/* ============================================================
   SIGNAL FROM THE DEEP — design tokens
   Do not add color, easing, or duration values outside this file.
   ============================================================ */

:root {
  /* Palette */
  --abyss:        #04070E;
  --abyss-2:      #071022;
  --abyss-3:      #0a1730;
  --biolume:      #5EEAD4;
  --biolume-deep: #22D3EE;
  --biolume-dim:  #14b8a6;
  --signal:       #F59E0B;
  --signal-hot:   #FBBF24;
  --foam:         #F1F5F9;
  --mist:         #94A3B8;
  --mist-dim:     #64748B;

  /* Glass */
  --glass-bg:      rgb(255 255 255 / 0.04);
  --glass-bg-2:    rgb(255 255 255 / 0.06);
  --glass-edge:    rgb(255 255 255 / 0.08);
  --glass-edge-2:  rgb(255 255 255 / 0.14);
  --glass-blur:    blur(20px) saturate(180%);
  --glass-blur-lt: blur(12px) saturate(160%);

  /* Motion — §4 */
  --ease-out:     cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out:  cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer:  cubic-bezier(0.32, 0.72, 0, 1);
  --dur-ui:       200ms;
  --dur-enter:    280ms;
  --dur-scene:    700ms;

  /* Type scale (fluid) */
  --t-12: clamp(11px, 0.72vw, 12px);
  --t-14: clamp(13px, 0.85vw, 14px);
  --t-16: clamp(14px, 1vw, 16px);
  --t-20: clamp(17px, 1.25vw, 20px);
  --t-28: clamp(22px, 1.8vw, 28px);
  --t-40: clamp(30px, 2.6vw, 40px);
  --t-56: clamp(38px, 3.6vw, 56px);
  --t-76: clamp(52px, 5vw, 76px);
  --t-110: clamp(64px, 7.6vw, 110px);
  --t-mega: clamp(80px, 12vw, 200px);

  /* Scroll depth — updated by JS 0→1 */
  --scroll-depth: 0;
  --scroll-vel:   0; /* -1..1 */
  --hue-shift:    calc(var(--scroll-depth) * 24deg);

  /* Layout */
  --nav-h: 64px;
  --gutter: clamp(20px, 4vw, 56px);

  color-scheme: dark;
}

/* Reduced motion — kill scene animations, keep UI feedback */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-scene: 0ms;
    --dur-enter: 120ms;
  }
}

/* Reduced transparency — solids replace glass */
@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-bg: rgb(7 16 34 / 0.92);
    --glass-bg-2: rgb(7 16 34 / 0.96);
    --glass-blur: none;
    --glass-blur-lt: none;
  }
}

/* ============================================================
   Reset + base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--abyss);
  color: var(--foam);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: auto; /* Lenis owns scrolling */
}
body {
  min-height: 100vh;
  overflow-x: clip;
  background: var(--abyss);
}

/* Locale-scoped fonts */
html[lang="en"] .display,
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3 {
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
html[lang="fa"] {
  font-family: 'Vazirmatn', ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: 'ss01', 'ss02';
}
html[lang="fa"] .display,
html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3 {
  font-family: 'Vazirmatn', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
  line-height: 1.15;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-feature-settings: 'tnum';
  letter-spacing: 0.02em;
}

/* Selection */
::selection { background: var(--biolume); color: var(--abyss); }

/* Focus visible — biolume ring */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--biolume);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Utility */
.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--t-12);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mist);
}
.mist { color: var(--mist); }
.signal { color: var(--signal); }
.biolume { color: var(--biolume); }
.tnum { font-variant-numeric: tabular-nums; }

/* Skip link */
.skip-link {
  position: fixed;
  top: 8px;
  inset-inline-start: 8px;
  padding: 8px 14px;
  background: var(--biolume);
  color: var(--abyss);
  font-weight: 600;
  border-radius: 8px;
  transform: translateY(-200%);
  transition: transform var(--dur-ui) var(--ease-out);
  z-index: 10000;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }
