/* =========================================================
   EBX Media — shared visual system
   Edit brand colors and fonts in the :root tokens below.
   ========================================================= */

:root {
  color-scheme: dark;

  /* Color */
  --bg: #0A0C11;          /* near-black, cool bias */
  --bg-2: #0F121A;        /* alternate section ground */
  --surface: #151925;     /* cards, panels */
  --surface-2: #1B2030;
  --line: #242A3A;        /* hairlines, borders */
  --line-2: #323A50;
  --text: #EEEAE2;        /* warm off-white */
  --text-2: #A7AAB5;      /* secondary text */
  --text-3: #80859A;      /* captions */
  --accent: #0057FF;      /* logo blue — buttons (white text passes AA) */
  --accent-hi: #6EA0FF;   /* accent for text/links on dark */
  --signal: #5CE1E6;      /* cyan — used sparingly for "conversion" */
  --danger: #FF7A7A;
  --success: #6FE3B0;

  /* Type */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  --fs-2xl: clamp(2rem, 1.3rem + 3vw, 3.4rem);
  --fs-hero: clamp(2.5rem, 1.4rem + 5.2vw, 5.4rem);

  /* Layout */
  --max: 1200px;
  --gutter: clamp(16px, 5vw, 48px);
  --section: clamp(72px, 10vw, 136px);
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
figure { margin: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Subtle film grain over everything (very light, no perf cost) */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg, video, canvas { max-width: 100%; display: block; }
a { color: var(--accent-hi); text-underline-offset: 3px; }
a:hover { color: var(--text); }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 800; line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; font-stretch: 112%; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); letter-spacing: -0.01em; line-height: 1.2; font-stretch: 105%; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: var(--section); position: relative; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section--tight { padding-block: clamp(48px, 7vw, 88px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-hi);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }

.section-head { display: grid; gap: 18px; max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head p { color: var(--text-2); font-size: var(--fs-lg); max-width: 60ch; }

.lede { color: var(--text-2); font-size: var(--fs-lg); max-width: 58ch; }
.muted { color: var(--text-2); }
.fine { color: var(--text-3); font-size: var(--fs-sm); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem/1 var(--font-body); letter-spacing: 0.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 0 0 0 rgba(42,99,245,.0), 0 10px 30px -10px rgba(0,87,255,.7); }
.btn--primary:hover { background: #1A68FF; color: #fff; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--text-2); color: var(--text); }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: 0.9375rem; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.text-link { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; text-decoration: none; color: var(--accent-hi); }
.text-link:hover { color: var(--text); }

/* ---------- Logo ---------- */
.wordmark { display: inline-flex; align-items: center; text-decoration: none; }
.wordmark img { height: 40px; width: auto; }
@media (min-width: 900px) { .wordmark img { height: 46px; } }
.footer-brand .wordmark img { height: 64px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  min-height: var(--header-h);
  background: rgba(10,12,17,.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(10,12,17,.9); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); }
.nav-links { display: none; align-items: center; gap: 30px; }
.nav-links a { color: var(--text-2); text-decoration: none; font-size: 0.9375rem; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-actions .btn { display: none; }

.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 14px; border-radius: 999px;
  background: transparent; color: var(--text); border: 1px solid var(--line-2);
  font: 600 .875rem var(--font-body); cursor: pointer;
}
.menu-toggle .bars { width: 16px; height: 10px; position: relative; }
.menu-toggle .bars::before, .menu-toggle .bars::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform .25s, top .25s; }
.menu-toggle .bars::before { top: 1px; }
.menu-toggle .bars::after { top: 7px; }
.menu-toggle[aria-expanded="true"] .bars::before { top: 4px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars::after { top: 4px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: calc(var(--header-h) + env(safe-area-inset-top, 0px)) 0 0 0; z-index: 49;
  background: var(--bg);
  padding: 28px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 28px; overflow-y: auto;
}
.mobile-menu ul { display: grid; gap: 4px; }
.mobile-menu li a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; font-stretch: 110%; letter-spacing: -0.01em; }
.mobile-menu .btn { width: 100%; }

@media (min-width: 900px) {
  .nav-links { display: flex; }
  .nav-actions .btn { display: inline-flex; }
  .menu-toggle, .mobile-menu { display: none !important; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(48px, 8vw, 104px) clamp(56px, 8vw, 96px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, rgba(42,99,245,.22), rgba(42,99,245,0) 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; display: grid; gap: clamp(40px, 6vw, 64px); }
.hero-copy { display: grid; gap: 26px; }
.hero h1 { font-size: var(--fs-hero); font-stretch: 118%; line-height: 0.98; letter-spacing: -0.03em; }
.hero h1 .l1 { display: block; text-transform: uppercase; }
.hero h1 .l2 { display: block; margin-top: .18em; font-weight: 500; font-stretch: 100%; color: var(--text-2); font-size: max(1.3rem, .4em); letter-spacing: -0.015em; line-height: 1.2; max-width: 24ch; margin-top: .35em; }
.hero .lede { font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); }
.hero-notes { display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.hero-notes li { display: inline-flex; align-items: center; gap: 8px; }
.hero-notes li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--signal); }

.signal-panel {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21,25,37,.8), rgba(15,18,26,.6));
  padding: 18px 18px 16px;
}
.signal-panel__top { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.signal-panel__top .live { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.signal-panel__top .live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 10px var(--signal); }
.signal-canvas-box { position: relative; aspect-ratio: 16 / 9; max-width: 100%; }
.signal-canvas-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.signal-labels { position: relative; height: 36px; margin-top: 10px; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: .1em; text-transform: uppercase; }
.signal-labels span { position: absolute; top: 0; display: grid; gap: 2px; color: var(--text-2); }
.signal-labels span small { font-size: .625rem; color: var(--text-3); letter-spacing: .06em; text-transform: none; }
.signal-labels span:nth-child(1) { left: 0; }
.signal-labels span:nth-child(2) { left: 44%; }
@media (max-width: 599px) { .signal-labels span small { display: none; } .signal-labels { height: 20px; } }
.signal-labels span:nth-child(3) { right: 0; text-align: right; color: var(--signal); }
.signal-caption { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--text-2); font-size: var(--fs-sm); }

@media (min-width: 1000px) {
  .hero .wrap { grid-template-columns: 1.15fr .85fr; align-items: center; }
}

/* ---------- Principles strip ---------- */
.strip { border-block: 1px solid var(--line); background: var(--bg-2); }
.strip .wrap { display: grid; gap: 28px; padding-block: 40px; }
.strip-statement { font-family: var(--font-display); font-stretch: 108%; font-weight: 600; font-size: clamp(1.25rem, 1rem + 1vw, 1.7rem); line-height: 1.25; letter-spacing: -0.01em; max-width: 34ch; text-wrap: balance; }
.strip-list { display: grid; gap: 14px; }
.strip-list li { display: grid; gap: 2px; padding-left: 18px; border-left: 1px solid var(--line-2); }
.strip-list strong { font-weight: 600; }
.strip-list span { color: var(--text-2); font-size: var(--fs-sm); }
@media (min-width: 900px) {
  .strip .wrap { grid-template-columns: 1fr 1.2fr; align-items: center; }
  .strip-list { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- System diagram ---------- */
.system { display: grid; gap: 0; position: relative; counter-reset: step; }
.system-step { position: relative; display: grid; align-content: start; grid-template-columns: 44px 1fr; gap: 0 18px; padding-bottom: 30px; }
.system-step:last-child { padding-bottom: 0; }
.system-step .node {
  grid-row: span 4; position: relative; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); background: var(--bg);
  font-family: var(--font-mono); font-size: .8125rem; color: var(--text-2);
  z-index: 1;
}
.system-step:last-child .node { border-color: var(--signal); color: var(--signal); box-shadow: 0 0 24px -4px rgba(92,225,230,.5); }
.system-step::before { content: ""; position: absolute; left: 21.5px; top: 44px; bottom: 0; width: 1px; background: linear-gradient(var(--line-2), var(--line)); }
.system-step:last-child::before { display: none; }
.system-step h3 { font-size: 1.35rem; margin-top: 8px; }
.system-step p { color: var(--text-2); margin-top: 8px; font-size: .98rem; }
.system-step .metric { margin-top: 12px; display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-hi); border: 1px solid rgba(110,160,255,.28); border-radius: 999px; padding: 4px 10px; background: rgba(42,99,245,.08); }

.system-track { display: none; }

@media (min-width: 1000px) {
  .system { grid-template-columns: repeat(5, 1fr); gap: 24px; padding-top: 0; }
  .system-step { grid-template-columns: 1fr; padding-bottom: 0; }
  .system-step .node { grid-row: auto; margin-bottom: 18px; }
  .system-step::before { display: none; }
  .system-track { display: block; position: absolute; left: 22px; right: 22px; top: 22px; height: 1px; background: var(--line-2); overflow: hidden; }
  .system-track::after {
    content: ""; position: absolute; top: -1px; left: 0; width: 80px; height: 3px;
    background: linear-gradient(90deg, transparent, var(--signal));
    border-radius: 2px;
    animation: travel 4.8s cubic-bezier(.5,0,.5,1) infinite;
  }
}
@keyframes travel { from { transform: translateX(-80px); } to { transform: translateX(1200px); } }

.example-math {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid; gap: 22px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: clamp(20px, 4vw, 36px);
}
.example-math header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; }
.example-math h3 { font-size: 1.2rem; }
.math-rows { display: grid; gap: 10px; overflow-x: auto; }
.math-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 14px 0; border-top: 1px dashed var(--line-2); font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .9rem; }
.math-row .eq { color: var(--text-2); }
.math-row .eq b { color: var(--text); font-weight: 500; }
.math-row .res { color: var(--signal); }
.math-row .why { font-family: var(--font-body); color: var(--text-3); font-size: .875rem; }
@media (min-width: 760px) {
  .math-row { grid-template-columns: 1.3fr .6fr 1.3fr; align-items: baseline; gap: 16px; }
}

/* ---------- Problem cards ---------- */
.grid-2 { display: grid; gap: 16px; }
.grid-3 { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 26px; display: grid; gap: 10px; align-content: start; }
.card .tag { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.card p { color: var(--text-2); }

.problem-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.problem-grid > div { background: var(--bg-2); padding: 28px; display: grid; gap: 10px; align-content: start; }
.problem-grid .x { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--danger); letter-spacing: .12em; text-transform: uppercase; }
.problem-grid p { color: var(--text-2); }
@media (min-width: 720px) { .problem-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .problem-grid { grid-template-columns: repeat(4, 1fr); } }

.pullquote { margin-top: clamp(36px, 5vw, 56px); font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: var(--fs-xl); letter-spacing: -0.02em; line-height: 1.15; max-width: 28ch; text-wrap: balance; }
.pullquote em { font-style: normal; color: var(--accent-hi); }

/* ---------- Outcomes ---------- */
.outcomes { display: grid; gap: 0; border-top: 1px solid var(--line); }
.outcomes li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.outcomes li svg { width: 20px; height: 20px; margin-top: 3px; color: var(--signal); }
@media (min-width: 900px) { .outcomes { grid-template-columns: 1fr 1fr; column-gap: 48px; } }

/* ---------- Curriculum ---------- */
.curriculum-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.curriculum { display: grid; gap: 28px; }
.module-group h3 { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); font-stretch: 100%; margin-bottom: 10px; }
.modules { display: grid; gap: 10px; }
.module {
  display: grid; grid-template-columns: 52px 1fr; gap: 4px 16px; align-items: baseline;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .2s, background-color .2s;
}
.module:hover { border-color: var(--line-2); background: var(--surface-2); }
.module .num { font-family: var(--font-mono); color: var(--accent-hi); font-size: .875rem; grid-row: span 2; }
.module h4 { font-family: var(--font-display); font-weight: 700; font-stretch: 105%; font-size: 1.08rem; letter-spacing: -0.005em; line-height: 1.25; }
.module p { color: var(--text-2); font-size: .9375rem; }
@media (min-width: 1000px) {
  .curriculum { grid-template-columns: repeat(2, 1fr); column-gap: 32px; }
}

/* ---------- Audience ---------- */
.audience li { display: grid; gap: 6px; padding: 22px 0; border-top: 1px solid var(--line); }
.audience li strong { font-family: var(--font-display); font-weight: 700; font-stretch: 105%; font-size: 1.15rem; }
.audience li span { color: var(--text-2); }
.audience-layout { display: grid; gap: 40px; }
.not-for { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: grid; gap: 14px; align-content: start; background: var(--bg-2); }
.not-for ul { display: grid; gap: 10px; }
.not-for li { color: var(--text-2); padding-left: 22px; position: relative; }
.not-for li::before { content: "×"; position: absolute; left: 0; color: var(--danger); font-family: var(--font-mono); }
@media (min-width: 1000px) {
  .audience-layout { grid-template-columns: 1.5fr 1fr; gap: 56px; align-items: start; }
}

/* ---------- Philosophy ---------- */
.philosophy { display: grid; gap: 48px; }
.big-quote { font-family: var(--font-display); font-weight: 800; font-stretch: 118%; font-size: var(--fs-2xl); line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance; }
.big-quote span { color: var(--text-3); }
.principles { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.principles li { background: var(--bg-2); padding: 24px 0; display: grid; gap: 6px; align-content: start; }
.principles strong { font-weight: 600; font-size: 1.05rem; }
.principles span { color: var(--text-2); }
@media (min-width: 900px) {
  .principles { grid-template-columns: repeat(2, 1fr); border: 0; gap: 1px; }
  .principles li { padding: 28px 28px 28px 0; }
  .principles li:nth-child(even) { padding-left: 28px; }
}

/* ---------- Signup ---------- */
.signup {
  position: relative; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(600px 300px at 90% 0%, rgba(42,99,245,.25), transparent 70%),
    radial-gradient(400px 240px at 0% 100%, rgba(92,225,230,.08), transparent 70%),
    var(--surface);
  padding: clamp(24px, 5vw, 56px);
  display: grid; gap: 32px;
}
.signup h2 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); }
.signup-copy { display: grid; gap: 16px; align-content: start; }
.signup-copy ul { display: grid; gap: 8px; margin-top: 6px; }
.signup-copy li { display: flex; gap: 10px; color: var(--text-2); }
.signup-copy li::before { content: "→"; color: var(--signal); font-family: var(--font-mono); }
@media (min-width: 960px) { .signup { grid-template-columns: 1fr 1fr; align-items: center; gap: 56px; } }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 52px; padding: 14px 16px;
  font: 400 1rem var(--font-body); color: var(--text);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:hover, .field textarea:hover { border-color: #43506e; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent-hi); box-shadow: 0 0 0 3px rgba(110,160,255,.22); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: var(--fs-sm); min-height: 0; }
.field-error:empty { display: none; }
.form-row { display: grid; gap: 16px; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form .btn { width: 100%; }
.consent { color: var(--text-3); font-size: .8125rem; line-height: 1.5; }
.consent a { color: var(--text-2); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.btn .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn[aria-busy="true"] { cursor: progress; opacity: .9; }

.form-alert { display: flex; gap: 10px; align-items: start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: var(--fs-sm); }
.form-alert--error { background: rgba(255,122,122,.08); border: 1px solid rgba(255,122,122,.35); color: #ffc4c4; }
.form-alert--preview { background: rgba(110,160,255,.07); border: 1px dashed rgba(110,160,255,.4); color: var(--text-2); }

.form-success { display: grid; gap: 14px; padding: 28px; border-radius: var(--radius); border: 1px solid rgba(111,227,176,.35); background: rgba(111,227,176,.06); }
.form-success .check { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(111,227,176,.14); color: var(--success); }
.form-success h3 { font-size: 1.4rem; }
.form-success p { color: var(--text-2); }
.form-success:focus { outline: none; }

/* ---------- FAQ ---------- */
.faq-layout { display: grid; gap: 40px; }
@media (min-width: 1000px) { .faq-layout { grid-template-columns: .8fr 1.2fr; gap: 64px; } }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 22px 0; font-weight: 600; font-size: 1.0625rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); font-size: 1.3rem; color: var(--accent-hi); transition: transform .25s; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent-hi); }
.faq .answer { padding: 0 0 24px; color: var(--text-2); max-width: 64ch; display: grid; gap: 10px; }

/* ---------- Testimonials (hidden until real ones exist) ---------- */
.testimonials blockquote { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: var(--surface); display: grid; gap: 16px; }
.testimonials blockquote p { font-size: 1.05rem; }
.testimonials cite { font-style: normal; color: var(--text-3); font-size: var(--fs-sm); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding-block: clamp(56px, 9vw, 112px) clamp(40px, 6vw, 72px); position: relative; overflow: hidden; }
.page-hero::before { content: ""; position: absolute; right: -10%; top: -40%; width: 60vw; height: 60vw; max-width: 760px; max-height: 760px; background: radial-gradient(closest-side, rgba(42,99,245,.18), transparent 70%); pointer-events: none; }
.page-hero .wrap { position: relative; display: grid; gap: 22px; }
.page-hero h1 { font-size: clamp(2.3rem, 1.4rem + 4vw, 4.4rem); font-stretch: 116%; letter-spacing: -0.03em; max-width: 18ch; }

/* ---------- Prose (legal / about) ---------- */
.prose { max-width: 70ch; display: grid; gap: 18px; }
.prose h2 { font-size: 1.6rem; margin-top: 24px; }
.prose h3 { margin-top: 10px; }
.prose p, .prose li { color: var(--text-2); }
.prose ul { list-style: disc; padding-left: 22px; display: grid; gap: 8px; }
.notice {
  border: 1px dashed rgba(255,196,110,.5); background: rgba(255,196,110,.06); color: #F2D3A3;
  border-radius: var(--radius-sm); padding: 16px 18px; font-size: var(--fs-sm); display: grid; gap: 6px;
}
.notice strong { color: #FFE2B3; }
.placeholder {
  border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 24px; color: var(--text-3);
  background: repeating-linear-gradient(135deg, transparent 0 12px, rgba(255,255,255,.015) 12px 24px);
  display: grid; gap: 8px;
}
.placeholder strong { color: var(--text-2); font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }

/* ---------- Resources ---------- */
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 28px; scrollbar-width: thin; }
.filter-row button {
  flex: none; height: 38px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text-2); border: 1px solid var(--line-2);
  font: 500 .875rem var(--font-body);
}
.filter-row button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.topic-card { position: relative; min-height: 210px; }
.topic-card .soon { position: absolute; top: 22px; right: 22px; }
.topic-card h3 { font-size: 1.3rem; margin-top: 18px; }
.topic-card ul { display: grid; gap: 6px; margin-top: 6px; }
.topic-card li { color: var(--text-3); font-size: .9rem; }
.topic-card li::before { content: "— "; }
.pill-soon { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 9px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg); padding-top: clamp(56px, 8vw, 96px); overflow: hidden; }
.footer-grid { display: grid; gap: 40px; }
.footer-brand { display: grid; gap: 18px; align-content: start; max-width: 38ch; }
.footer-brand p { color: var(--text-2); font-size: .95rem; }
.footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
.footer-cols h2 { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); font-stretch: 100%; margin-bottom: 14px; }
.footer-cols ul { display: grid; gap: 10px; }
.footer-cols a { color: var(--text-2); text-decoration: none; font-size: .95rem; }
.footer-cols a:hover { color: var(--text); }
.footer-cols a[aria-disabled="true"] { color: var(--text-3); cursor: default; }
.footer-cols small { color: var(--text-3); font-size: .75rem; }
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1.6fr; }
  .footer-cols { grid-template-columns: repeat(4, 1fr); }
}
.footer-disclaimer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; color: var(--text-3); font-size: .8125rem; }
.footer-disclaimer p { max-width: 72ch; }
.footer-mark { margin-top: 40px; margin-bottom: -3vw; opacity: .1; pointer-events: none; }
.footer-mark img { width: 100%; height: auto; }

/* ---------- Reveal (content is visible at rest; motion is additive) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
  .reveal-2 { animation-delay: .08s; }
  .reveal-3 { animation-delay: .16s; }
  .reveal-4 { animation-delay: .24s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .system-track::after { display: none; }
}

/* =========================================================
   Interactive layer
   ========================================================= */

/* Scroll progress (top edge of header) */
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--accent), var(--signal)); pointer-events: none; }

/* Typewriter headline — ghosts reserve the height of the longest phrase */
.typer { display: grid !important; }
.typer > span { grid-area: 1 / 1; }
.typer-ghost { visibility: hidden; }
.typer-live::after {
  content: ""; display: inline-block; width: .08em; height: .82em; margin-left: .06em;
  background: var(--signal); vertical-align: -0.04em; animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Intro video */
.intro-layout { display: grid; gap: 32px; align-items: center; }
@media (min-width: 1000px) { .intro-layout { grid-template-columns: .8fr 1.2fr; gap: 56px; } }
.video-frame {
  position: relative; aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line-2);
  background: radial-gradient(500px 260px at 70% 20%, rgba(0,87,255,.25), transparent 70%), var(--surface);
  box-shadow: 0 30px 80px -40px rgba(0,87,255,.55);
}
.video-frame video, .video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; background: #000; }
.video-placeholder, .video-poster { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--text-2); font-size: var(--fs-sm); letter-spacing: .08em; text-transform: uppercase; }
.video-poster { cursor: pointer; border: 0; padding: 0; background: #000 center / cover no-repeat; color: var(--text); font: inherit; }
.video-poster::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.55)); }
.play { position: relative; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 0 0 10px rgba(0,87,255,.18), 0 12px 40px -8px rgba(0,87,255,.8); transition: transform .2s; }
.play svg { margin-left: 3px; }
.video-poster:hover .play, .video-poster:focus-visible .play { transform: scale(1.08); }

/* Step explorer */
.explorer { margin-top: clamp(36px, 5vw, 56px); border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); padding: clamp(18px, 3vw, 28px); display: grid; gap: 18px; }
.explorer-head { display: grid; gap: 12px; }
.explorer-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.explorer-tabs button {
  flex: none; height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text-2); border: 1px solid var(--line-2); font: 600 .9rem var(--font-body);
  transition: background-color .2s, color .2s, border-color .2s;
}
.explorer-tabs button:hover { color: var(--text); border-color: var(--text-3); }
.explorer-tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.explorer-panel { min-height: 4.4em; }
.explorer-text { font-family: var(--font-display); font-stretch: 105%; font-weight: 600; font-size: clamp(1.1rem, 1rem + .6vw, 1.45rem); line-height: 1.35; letter-spacing: -0.01em; max-width: 48ch; }
.explorer-text.swap { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.explorer-bar { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.explorer-bar span { display: block; height: 100%; width: 100%; background: var(--signal); transform-origin: 0 50%; transform: scaleX(0); }
.explorer-bar span.run { animation: fill 5s linear forwards; }
@keyframes fill { to { transform: scaleX(1); } }
.system-step.is-active .node { border-color: var(--accent-hi); color: var(--text); box-shadow: 0 0 0 4px rgba(0,87,255,.2); }
.system-step.is-active h3 { color: var(--accent-hi); }
.system-step .node, .system-step h3 { transition: color .25s, border-color .25s, box-shadow .25s; }

/* Calculator */
.calc { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: clamp(20px, 4vw, 36px); display: grid; gap: 24px; }
.calc header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.calc h3 { font-size: 1.3rem; }
.calc-grid { display: grid; gap: 28px; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; } }
.calc-inputs { display: grid; gap: 22px; }
.range { display: grid; gap: 10px; }
.range label { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); font-weight: 600; }
.range output { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--accent-hi); font-weight: 500; }
.range input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0; }
.range input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--fill, 50%), var(--line-2) var(--fill, 50%)); }
.range input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line-2); }
.range input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
.range input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--text); border: 3px solid var(--accent); }
.range input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 3px solid var(--accent); }
.range input[type="range"]:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.calc-out { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.calc-out div { background: var(--surface); padding: 18px; display: grid; gap: 6px; }
.calc-out dt { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.calc-out dd { margin: 0; font-family: var(--font-display); font-weight: 800; font-stretch: 110%; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.calc-out dd.hi { color: var(--signal); }
.calc-tip { color: var(--text-2); font-size: var(--fs-sm); padding-top: 16px; border-top: 1px dashed var(--line-2); }

/* Cursor spotlight on cards */
.spot { position: relative; isolation: isolate; }
.spot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: 0; transition: opacity .3s;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(0,87,255,.14), transparent 60%);
}
.spot:hover::before { opacity: 1; }
.problem-grid > div, .module, .card { transition: transform .25s, border-color .25s, background-color .25s; }
@media (hover: hover) { .problem-grid > div:hover { background: #121726; } .module:hover { transform: translateX(4px); } }

/* Sticky mobile CTA */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(10,12,17,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  transform: translateY(0); transition: transform .3s;
}
.sticky-cta .btn { width: 100%; }
.sticky-cta.is-off { transform: translateY(110%); }
@media (min-width: 900px) { .sticky-cta { display: none !important; } }

@media (prefers-reduced-motion: reduce) { .typer-live::after { animation: none; } .explorer-bar { display: none; } }
@media (max-width: 899px) { body[data-page="home"] { padding-bottom: 84px; } }
.calc-out dd.neg { color: var(--danger); }
