/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #1C1917; /* text-primary */
  background-color: #FAFAF9;
}

.paper-texture {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
}

/* Glass Panel Utility */
.glass-panel {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #E7E5E4; /* stone-200 */
  transition: all 0.3s ease;
}

.dark .glass-panel {
  background-color: rgba(0, 0, 0, 0.8);
  border-color: #292524; /* stone-800 */
}

/* Header Default & Shrinking Logic */
#nav-container {
  border: 1px solid transparent;
  box-shadow: none;
  transition: all 0.5s ease-in-out;

  /* Premium Frosted Glass */
  background-color: rgba(255, 255, 255, 0.65) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

.header-shrunk {
  padding: 0.5rem !important;
}

.header-shrunk #nav-container {
  max-width: 64rem !important; /* max-w-5xl */
  border-radius: 0 !important;
  border: 1px solid #E7E5E4 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  margin-top: 0.5rem !important;
  background-color: rgba(255, 255, 255, 0.65) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}


/* --- BUTTONS (Design System 4.5 - Primary Financial) --- */
@keyframes shimmerLinear {
    0% { background-position: 100% 0; }
    100% { background-position: -50% 0; }
}

.btn-wrapper {
    position: relative; padding: 1px; border-radius: 0 !important;
    background: #1C1917; overflow: hidden; cursor: pointer;
    display: inline-flex; transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: none; border: none;
}

/* Green Variant (Primary Financial - Exact Match) */
.btn-wrapper.green:hover { transform: translateY(-2px); box-shadow: 3px 3px 0px rgba(6, 78, 59, 0.3); }
.btn-wrapper.green:hover .btn-content { background-color: #064E3B; }
.btn-wrapper.green:hover .btn-shimmer { 
    opacity: 1; 
    animation: shimmerLinear 2s infinite linear;
    background: linear-gradient(90deg, #1C1917 0%, #1C1917 40%, rgba(255,255,255,0.7) 50%, #1C1917 60%, #1C1917 100%);
    background-size: 300% 100%;
}
.btn-wrapper.green:active .btn-content { background-color: #022C22; }

/* Blue Variant (Primary Financial style adapted for Blue) */
.btn-wrapper.blue:hover { transform: translateY(-2px); box-shadow: 3px 3px 0px rgba(30, 58, 138, 0.3); }
.btn-wrapper.blue:hover .btn-content { background-color: #172554; }
.btn-wrapper.blue:hover .btn-shimmer { 
    opacity: 1; 
    animation: shimmerLinear 2s infinite linear;
    background: linear-gradient(90deg, #1C1917 0%, #1C1917 40%, rgba(255,255,255,0.7) 50%, #1C1917 60%, #1C1917 100%);
    background-size: 300% 100%;
}
.btn-wrapper.blue:active .btn-content { background-color: #0F172A; }

.btn-wrapper:active { transform: translateY(0px) !important; box-shadow: none !important; }

.btn-shimmer {
    position: absolute; inset: 0;
    opacity: 0; transition: opacity 0.2s ease; z-index: 0;
    pointer-events: none;
}

.btn-content {
    position: relative; z-index: 1; background: #1C1917; color: #FAFAF9;
    padding: 0.75rem 2rem; border-radius: 0 !important;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
    width: 100%; text-align: center; transition: background-color 0.2s ease;
    display: flex; align-items: center; justify-content: center;
}

/* Animations */
@keyframes scroll-up {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

@keyframes scroll-down {
  0% { transform: translateY(-50%); }
  100% { transform: translateY(0); }
}

.animate-scroll-up {
  animation: scroll-up 60s linear infinite;
}

.animate-scroll-down {
  animation: scroll-down 60s linear infinite;
}

/* Utility for vertical mask gradient */
.mask-gradient-vertical {
  mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
}

/* Background Grid */
.bg-grid {
  background-size: 40px 40px;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

.dark .bg-grid {
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

/* --- 4. DATA ROWS (Design System 4.5) --- */
.data-row {
    background: white; border-bottom: 1px solid #E7E5E4;
    transition: all 0.3s ease; position: relative; overflow: hidden;
}
.data-row::before {
    content: ''; position: absolute; top: 50%; left: 50%; width: 120%; height: 200px;
    transform: translate(-50%, -50%) scale(0.8); opacity: 0;
    filter: blur(40px); pointer-events: none; transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); z-index: 0;
}
.data-row:hover::before {
    background: radial-gradient(circle, rgba(3, 100, 246, 0.15) 0%, rgba(255,255,255,0) 70%);
    opacity: 1; transform: translate(-50%, -50%) scale(1);
}
.data-row:hover { border-color: transparent; }
.data-row > * { position: relative; z-index: 1; }

/* --- HIGH CONTRAST (INK) SECTIONS --- */
.section-ink {
    background-color: #1C1917;
    color: #FAFAF9;
    position: relative;
    overflow: hidden;
}
.section-ink .paper-texture {
    opacity: 0.1;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.glass-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.label-caps {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* White Button Variant (for dark sections) */
.btn-wrapper.white .btn-content { background-color: #FAFAF9; color: #1C1917; }
.btn-wrapper.white:hover { transform: translateY(-2px); box-shadow: 3px 3px 0px rgba(96, 165, 250, 0.3); }
.btn-wrapper.white:hover .btn-content { background-color: #DBEAFE; }
.btn-wrapper.white:hover .btn-shimmer {
    opacity: 1;
    animation: shimmerLinear 2s infinite linear;
    background: linear-gradient(90deg, #DBEAFE 0%, #DBEAFE 40%, rgba(255,255,255,0.8) 50%, #DBEAFE 60%, #DBEAFE 100%);
    background-size: 300% 100%;
}
.btn-wrapper.white:active .btn-content { background-color: #D6D3D1; }