/* ==========================================================================
   Fitted — marketing site
   Tokens first; every color in the file comes from these.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f4f2ec;
  --surface: #fbfaf7;
  --surface-2: #efece4;
  --ink: #15140f;
  --ink-2: #4b4840;
  --muted: #6c685f;
  --line: #e0dcd2;
  --line-strong: #c9c4b8;
  --grid: rgba(21, 20, 15, 0.045);
  --grid-major: rgba(21, 20, 15, 0.07);

  --accent: #3446e0;
  --accent-hover: #2636c7;
  --accent-ink: #ffffff;
  --accent-wash: rgba(52, 70, 224, 0.08);
  --accent-ring: rgba(52, 70, 224, 0.18);

  --critical: #d03b3b;
  --critical-wash: rgba(208, 59, 59, 0.07);
  --good: #0ca30c;
  --std: #aaa498;

  --code-bg: #16150f;
  --code-ink: #ece9e1;
  --code-dim: #8d897f;
  --code-key: #b9b5ab;
  --code-accent: #9ba5ff;

  --shadow-sm: 0 1px 2px rgba(21, 20, 15, 0.05);
  --shadow: 0 1px 0 rgba(21, 20, 15, 0.03), 0 18px 40px -18px rgba(21, 20, 15, 0.16);

  --radius: 16px;
  --radius-sm: 10px;

  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-sans: "Geist", "Segoe UI", "Geeza Pro", "Noto Sans Arabic", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: 24px;
  --max: 1200px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e0e0c;
    --surface: #171714;
    --surface-2: #12120f;
    --ink: #f1eee6;
    --ink-2: #bebab0;
    --muted: #8f8b82;
    --line: #2a2925;
    --line-strong: #3b3a35;
    --grid: rgba(241, 238, 230, 0.035);
    --grid-major: rgba(241, 238, 230, 0.06);
    --accent: #7683f5;
    --accent-hover: #8e99ff;
    --accent-ink: #0e0e0c;
    --accent-wash: rgba(118, 131, 245, 0.12);
    --accent-ring: rgba(118, 131, 245, 0.24);
    --critical-wash: rgba(208, 59, 59, 0.08);
    --std: #5f5c55;
    --code-bg: #0a0a08;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e0c;
  --surface: #171714;
  --surface-2: #12120f;
  --ink: #f1eee6;
  --ink-2: #bebab0;
  --muted: #8f8b82;
  --line: #2a2925;
  --line-strong: #3b3a35;
  --grid: rgba(241, 238, 230, 0.035);
  --grid-major: rgba(241, 238, 230, 0.06);
  --accent: #7683f5;
  --accent-hover: #8e99ff;
  --accent-ink: #0e0e0c;
  --accent-wash: rgba(118, 131, 245, 0.12);
  --accent-ring: rgba(118, 131, 245, 0.24);
  --critical-wash: rgba(208, 59, 59, 0.08);
  --std: #5f5c55;
  --code-bg: #0a0a08;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
.lede, .section-lede { text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre { font-family: var(--font-mono); }
::selection { background: var(--accent-ring); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; background: var(--ink); color: var(--bg); border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 500; font-size: 15px; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink-2); }
.btn-light { background: #f4f2ec; color: #15140f; }
.btn-light:hover { background: #ffffff; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: transparent; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.brand-mark { width: 28px; height: 28px; color: var(--ink); }
.brand-dot { fill: var(--accent); }
.nav-links { display: flex; gap: 26px; margin-right: auto; }
.nav-links a { text-decoration: none; font-size: 14.5px; color: var(--ink-2); transition: color .15s; }
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.menu-btn { display: none; }
.nav-links .nav-menu-cta { display: none; }
.i-moon { display: none !important; }
:root[data-theme="dark"] .i-sun { display: none !important; }
:root[data-theme="dark"] .i-moon { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none !important; }
  :root:not([data-theme="light"]) .i-moon { display: block !important; }
}

/* ---------- Shared type ---------- */

.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.kicker-num { color: var(--accent); }
.kicker-num::after { content: ""; display: inline-block; width: 28px; height: 1px; margin-left: 10px; vertical-align: middle; background: var(--line-strong); }

.section { padding: clamp(72px, 8vw, 112px) 0; }
.section-alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.section-head { max-width: 760px; }
.section-head h2, .contact-copy h2 {
  margin-top: 18px;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.1rem, 3.8vw, 3.4rem); line-height: 1.06; letter-spacing: -0.022em;
}
.section-lede { margin-top: 18px; font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 62ch; }

/* ---------- Hero ---------- */

.hero {
  position: relative; display: flex; align-items: center; overflow: hidden;
  min-height: calc(100vh - 64px); min-height: calc(100svh - 64px);
  padding: clamp(32px, 5vw, 64px) 0;
}
.hero > .container { width: 100%; }
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  background-position: -1px -1px;
  /* Faded at the top and sides only: at the bottom it continues into How it works, where the
     3D scene picks it up as the wall behind the model (scene3d.js). */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 30%);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 30%);
          mask-composite: intersect;
}
.hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px 36px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
}
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.hero h1 {
  margin-top: 26px;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.9rem, 4.7vw, 4.4rem); line-height: 1.0; letter-spacing: -0.03em;
}
.bar-mark { position: relative; display: inline-block; white-space: nowrap; }
.bar-mark svg {
  position: absolute; left: 0; right: 0; bottom: -0.05em; width: 100%; height: 0.17em; overflow: visible;
  fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round;
}
.bar-mark svg path { vector-effect: non-scaling-stroke; }
.lede { margin-top: 24px; max-width: 48ch; font-size: clamp(17px, 1.4vw, 18.5px); line-height: 1.6; color: var(--ink-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.proof-row { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 30px; font-size: 14px; color: var(--muted); }
.proof-row li { display: inline-flex; align-items: center; gap: 8px; }
.proof-row li::before { content: ""; width: 10px; height: 1px; background: var(--line-strong); box-shadow: 0 -3px 0 -0px transparent; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: none; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: color .15s;
}
.scroll-cue:hover { color: var(--ink); }
.scroll-cue i { position: relative; width: 1px; height: 32px; background: var(--line-strong); overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: -1px; top: 0; width: 3px; height: 10px; border-radius: 2px; background: var(--accent); animation: cueDrop 1.8s ease-in-out infinite; }
@keyframes cueDrop { 0% { transform: translateY(-10px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(32px); opacity: 0; } }
@media (min-width: 1081px) and (min-height: 760px) { .scroll-cue { display: flex; } }
@media (prefers-reduced-motion: reduce) { .scroll-cue i::after { animation: none; top: 11px; } }

/* ---------- Hero descent ---------- */

.hero-visual { margin: 0; position: relative; min-width: 0; }
.descent { width: 100%; height: auto; overflow: visible; }
.descent .dv-zone-a { stop-color: var(--critical); stop-opacity: 0; }
.descent .dv-zone-b { stop-color: var(--critical); stop-opacity: 0.07; }
.descent .dv-cap { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--muted); }
.descent .dv-tick { font-family: var(--font-mono); font-size: 10.5px; fill: var(--muted); }
.descent .dv-bar-line { stroke: var(--ink); stroke-width: 1.5; }
.descent .dv-bar-ticks { fill: none; stroke: var(--ink); stroke-width: 1; }
.descent .dv-bar-label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; fill: var(--ink); }
.descent .dv-seg { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; }
.descent .dv-cross { fill: var(--accent); opacity: 0; }
.descent .dv-pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.descent .dv-pt-hi { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.descent .dv-t { font-family: var(--font-sans); font-size: 13.5px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.descent .dv-n { font-family: var(--font-mono); font-size: 11px; font-weight: 500; fill: var(--accent); }
.descent .dv-s { font-family: var(--font-mono); font-size: 11.5px; fill: var(--muted); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.descent .dv-frame { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1; }
.descent .dv-card-hi .dv-frame { stroke: var(--accent); stroke-width: 1.5; }
.descent .dv-card-hi { filter: drop-shadow(0 0 12px var(--accent-ring)); }
.descent .dv-result { filter: drop-shadow(0 10px 24px rgba(21, 20, 15, 0.10)); }
.descent .dv-dot, .descent .dv-gray { fill: var(--line-strong); }
.descent .dv-bad { fill: var(--critical); }
.descent .dv-acc { fill: var(--accent); }
.descent .dv-line { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.descent .dv-base { stroke: var(--line); stroke-width: 1; }
.descent .dv-check { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.descent .dv-card-v { font-family: var(--font-mono); font-size: 11px; font-weight: 500; fill: var(--ink); }
.descent .dv-card-l { font-family: var(--font-mono); font-size: 10px; fill: var(--muted); }
.descent .dv-card-k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--ink-2); }
.descent .dv-big { font-family: var(--font-sans); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; fill: var(--ink); }
.descent .dv-small { font-family: var(--font-sans); font-size: 10px; fill: var(--muted); }
.descent .dv-leader { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 2 3; }
.descent .dv-halo { fill: var(--accent-ring); }
.descent .dv-pulse { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0; }
.descent .dv-end { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }
.descent .dv-cost .dv-seg { stroke: var(--ink-2); stroke-width: 1.5; }
.descent .dv-cost .dv-cost-drop { stroke: var(--ink); stroke-width: 2; }
.descent .dv-cost-pt { fill: var(--bg); stroke: var(--ink-2); stroke-width: 1.5; }
.descent .dv-cost-end { fill: var(--ink); stroke: var(--bg); stroke-width: 2; }
.descent .dv-cost-v { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; fill: var(--ink); }
.descent .dv-cost-cut { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; fill: var(--accent); }
.descent .dv-cost-note { font-family: var(--font-mono); font-size: 10px; fill: var(--muted); }
.descent .dv-play { transition: opacity .5s ease; }
.descent .dv-play.is-out { opacity: 0; }
.dv-caption { margin-top: 4px; font-size: 12px; color: var(--muted); text-align: right; }

@media (prefers-reduced-motion: no-preference) {
  .descent .dv-seg, .descent .dv-bar-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: dvDraw var(--t, .8s) cubic-bezier(.45, 0, .25, 1) var(--d, 0s) forwards; }
  .descent .dv-in { opacity: 0; animation: dvIn .55s ease-out var(--d, 0s) forwards; }
  .descent .dv-cross { transform-box: fill-box; transform-origin: center; animation: dvCross 1.1s ease-out var(--d, 0s) forwards; }
  .descent .dv-pulse { transform-box: fill-box; transform-origin: center; animation: dvPulse 2.6s ease-out var(--d, 0s) infinite; }
}
@keyframes dvDraw { to { stroke-dashoffset: 0; } }
@keyframes dvIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes dvCross { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(2.8); } }
@keyframes dvPulse { 0% { opacity: .7; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(2.2); } }

.descent-list { display: none; margin-top: 8px; border-top: 1px solid var(--line); }
.descent-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 8px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dl-n { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--accent); }
.dl-name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.dl-name small { display: block; margin-top: 1px; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.dl-val { font-family: var(--font-mono); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dl-meter { grid-column: 2 / -1; position: relative; height: 4px; border-radius: 2px; background: var(--line); }
.dl-meter::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v) / 8 * 100%); border-radius: 2px; background: var(--std); }
.dl-ok .dl-meter::before { background: var(--accent); }
.dl-meter::after { content: ""; position: absolute; left: 25%; top: -4px; bottom: -4px; width: 1.5px; background: var(--ink); }

/* ---------- Demo videos ---------- */

.section-demo { border-top: 1px solid var(--line); }
.demo-video { margin: 48px 0 0; }
.demo-video + .demo-video { margin-top: 56px; }
.demo-label {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.demo-label span:first-child { color: var(--accent); }
.demo-frame {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong);
  background: #0e0e0c; box-shadow: var(--shadow);
}
.demo-frame video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #0e0e0c; }
.btn .i-play { width: 18px; height: 18px; }
.btn .i-play path { fill: currentColor; stroke: none; }

/* ---------- Explorer ---------- */

.section-explorer .explorer { margin-top: 48px; }
.explorer {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 24px 26px 18px;
}
.ex-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ex-title { margin-top: 8px; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; text-wrap: initial; }

.tabs { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.tab {
  height: 32px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

.ex-controls {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.35fr); gap: 28px;
  margin: 20px 0 0; padding: 18px 0 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.ctrl { display: grid; grid-template-columns: 1fr auto; align-items: baseline; row-gap: 6px; }
.ctrl label { font-size: 13px; color: var(--ink-2); }
.ctrl output { font-family: var(--font-mono); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ctrl input[type="range"] { grid-column: 1 / -1; }
.ctrl-toggles { display: flex; flex-direction: column; justify-content: center; gap: 12px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer;
  --pct: 50%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) 0 var(--pct), var(--line-strong) var(--pct) 100%);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .12s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); transition: background-color .2s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.seg-label { font-size: 13px; color: var(--ink-2); margin-right: 6px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label span { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--ink-2); transition: all .15s; }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.ex-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; padding-top: 18px; }
.ex-main { min-width: 0; }

.chart { position: relative; width: 100%; min-height: 300px; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis line.base { stroke: var(--line-strong); }
.chart .tick-label { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .axis-title { font-family: var(--font-sans); font-size: 12px; fill: var(--ink-2); }
.chart .zone { fill: var(--critical-wash); transition: y .2s ease, height .2s ease; }
.chart .zone-label { font-family: var(--font-sans); font-size: 11.5px; fill: var(--muted); }
.chart .bar-line { stroke: var(--ink); stroke-width: 1.5; }
.chart .bar-label-bg { fill: var(--surface); }
.chart .bar-label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; fill: var(--ink); }
.chart .hint { font-family: var(--font-sans); font-size: 11.5px; fill: var(--muted); }
.chart .pt { cursor: pointer; outline: none; }
.chart .pt .hit { fill: transparent; }
.chart .pt .halo { fill: var(--accent-ring); r: 0; transition: r .25s ease; }
.chart .pt .mark { stroke: var(--surface); stroke-width: 2; transition: r .2s ease, fill .2s ease, stroke .2s ease; }
.chart .pt.is-out .mark { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; r: 4.5px; }
.chart .pt.is-fit .mark { fill: var(--ink); r: 5.5px; }
.chart .pt.is-rec .mark { fill: var(--accent); r: 7.5px; }
.chart .pt.is-rec .halo { r: 15px; }
.chart .pt .sel { fill: none; stroke: var(--ink); stroke-width: 1.5; r: 0; transition: r .2s ease; }
.chart .pt.is-sel .sel { r: 11px; }
.chart .pt:hover .mark, .chart .pt:focus-visible .mark { stroke: var(--accent); stroke-width: 2; }
.chart .pt:focus-visible .sel { r: 11px; stroke: var(--accent); }
.chart .pt-label { font-family: var(--font-sans); font-size: 12px; font-weight: 500; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.chart .pt-label.muted { fill: var(--ink-2); font-weight: 400; }

.chart-tip {
  position: absolute; z-index: 5; min-width: 200px; max-width: 260px; pointer-events: none;
  padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); font-size: 12.5px;
}
.chart-tip .tt-name { font-weight: 600; font-size: 13px; }
.chart-tip .tt-spec { color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; margin: 2px 0 8px; }
.chart-tip .tt-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.chart-tip .tt-row span { color: var(--ink-2); }
.chart-tip .tt-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip .tt-status { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink-2); }

.chart-foot { display: grid; gap: 8px; margin-top: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.lg { display: inline-block; flex: none; }
.lg-rec { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.lg-fit { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.lg-out { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--muted); }
.ex-summary { font-size: 12.5px; color: var(--muted); }

.ex-panel { border-left: 1px solid var(--line); padding-left: 26px; min-width: 0; }
.pn-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--bg);
}
.pill svg { width: 12px; height: 12px; }
.pill-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill-crit { background: var(--critical-wash); border-color: transparent; color: var(--ink); }
.pill-crit svg { fill: var(--critical); }
.pn-name { margin-top: 14px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.pn-spec { margin-top: 4px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.pn-metrics { margin: 16px 0 0; }
.pn-metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.pn-metrics dt { color: var(--ink-2); }
.pn-metrics dd { margin: 0; display: inline-flex; align-items: baseline; gap: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pn-metrics .lim { font-family: var(--font-mono); font-size: 11.5px; font-weight: 400; color: var(--muted); }
.pn-metrics .chk { width: 14px; height: 14px; align-self: center; }
.pn-metrics .chk.ok { fill: var(--good); }
.pn-metrics .chk.no { fill: var(--critical); }
.pn-gain { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.pn-gain > div { padding: 12px; border-radius: 10px; background: var(--accent-wash); }
.pn-gain b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.pn-gain span { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.pn-sub { margin-top: 18px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pn-alts { margin-top: 8px; counter-reset: alt; }
.pn-alts li { counter-increment: alt; }
.pn-alts button {
  display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: baseline; width: 100%;
  padding: 7px 0; border: 0; border-bottom: 1px dashed var(--line); background: none; text-align: left; font-size: 13px; cursor: pointer; color: var(--ink);
}
.pn-alts button::before { content: counter(alt); font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.pn-alts button:hover .alt-name { text-decoration: underline; text-underline-offset: 3px; }
.pn-alts .alt-val { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pn-text { margin-top: 12px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.pn-reasons { margin-top: 12px; display: grid; gap: 6px; }
.pn-reasons li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.pn-reasons svg { width: 12px; height: 12px; flex: none; fill: var(--critical); transform: translateY(1px); }
.pn-run { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 12.5px; }
.pn-run dt { color: var(--muted); }
.pn-run dd { margin: 0; color: var(--ink); }
.pn-back { margin-top: 18px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 500; cursor: pointer; }
.pn-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.pn-near { margin-top: 10px; display: grid; gap: 10px; }
.pn-near li button { width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.pn-near li button:hover { border-color: var(--line-strong); }
.pn-near b { display: block; font-size: 13px; }
.pn-near span { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-2); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.cmp th, .cmp td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cmp thead th { position: sticky; top: 0; background: var(--bg); font-weight: 500; }
.cmp th button {
  padding: 0; border: 0; background: none; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 4px;
}
.cmp th button::after { content: "↕"; font-size: 10px; color: var(--line-strong); }
.cmp th[aria-sort="ascending"] button::after { content: "↑"; color: var(--ink); }
.cmp th[aria-sort="descending"] button::after { content: "↓"; color: var(--ink); }
.cmp .num { text-align: right; font-variant-numeric: tabular-nums; }
.cmp th.num button { flex-direction: row-reverse; }
.cmp tbody tr { cursor: pointer; transition: background-color .12s; }
.cmp tbody tr:hover { background: var(--bg); }
.cmp tbody tr:last-child td { border-bottom: 0; }
.cmp tr.is-out td { color: var(--muted); }
.cmp tr.is-out td:first-child { color: var(--ink-2); }
.cmp tr.is-rec { background: var(--accent-wash); }
.cmp .cfg-name { font-weight: 500; }
.cmp .cfg-hw { display: block; margin-top: 1px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.cmp td:last-child { white-space: normal; min-width: 150px; }
.cmp .st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.cmp .st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.cmp .st-rec::before { background: var(--accent); }
.cmp .st-fit::before { background: var(--ink); }
.cmp .st-out::before { border: 1.5px solid var(--muted); width: 6px; height: 6px; }
.table-note { margin-top: 10px; font-size: 12px; color: var(--muted); }

.ex-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }

/* ---------- How it works ---------- */

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin-top: 56px; counter-reset: s; }
.step { display: flex; flex-direction: column; padding-top: 22px; border-top: 1px solid var(--ink); position: relative; }
.step::before { content: ""; position: absolute; top: -4px; left: 0; width: 1px; height: 8px; background: var(--ink); }
.step-top { display: flex; align-items: baseline; gap: 12px; }
.step-n { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.step h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.step-badge {
  margin-left: auto; align-self: center; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
}
.step-badge.auto { background: var(--accent-wash); border-color: transparent; color: var(--accent); }
.step > p { margin-top: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.mini { margin-top: auto; padding-top: 20px; }
.mini { display: grid; }
.mini-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line-strong); font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.mini-row b { font-weight: 500; color: var(--ink); text-align: right; }
.mini-row b.ok { color: var(--ink); }
.mini-row b.ok::before { content: "✓ "; color: var(--good); }
.mini-row b.no { color: var(--muted); }
.mini-row b.no::before { content: "✕ "; color: var(--critical); }

.repro {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; align-items: center;
  margin-top: 72px; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.repro h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.12; letter-spacing: -0.015em; }
.repro p { margin-top: 12px; color: var(--ink-2); }
.spec {
  margin: 0; padding: 20px 22px; overflow-x: auto; border-radius: 12px;
  background: var(--code-bg); color: var(--code-ink); font-size: 12.5px; line-height: 1.75;
}
.spec .k { color: var(--code-key); }
.spec .c { color: var(--code-dim); }
.spec .a { color: var(--code-accent); }

/* ---------- Critical errors ---------- */

.errors-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: start; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; max-width: 520px; }
.stat { padding: 16px 0 0; border-top: 1px solid var(--line-strong); }
.stat-label { font-size: 13px; color: var(--ink-2); }
.stat-value { margin-top: 6px; font-size: 48px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.stat-value .arrow { font-weight: 400; color: var(--muted); font-size: 0.6em; vertical-align: 0.15em; margin: 0 2px; }
.stat-value-quiet { font-size: 28px; color: var(--ink-2); padding-top: 12px; }
.stat-sub { margin-top: 6px; font-size: 12.5px; color: var(--muted); }

.errfig { margin: 0; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.errfig-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.errfig-title { font-size: 14px; font-weight: 600; }
.legend-bars .lg { width: 14px; height: 10px; border-radius: 0 3px 3px 0; }
.lg-bar-std { background: var(--std); }
.lg-bar-fit { background: var(--accent); }
.errbars { margin-top: 22px; display: grid; gap: 20px; }
.err-row { display: grid; gap: 8px; }
.err-label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink); }
.err-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; }
.err-tag svg { width: 11px; height: 11px; }
.err-tag.crit { background: var(--critical-wash); color: var(--ink); }
.err-tag.crit svg { fill: var(--critical); }
.err-tag.minor { background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.err-bars { display: grid; gap: 2px; }
.err-line { display: flex; align-items: center; gap: 8px; height: 14px; }
.err-line i {
  display: block; height: 12px; min-width: 2px; border-radius: 0 4px 4px 0;
  width: calc(var(--v) / var(--max) * 86%);
  transform-origin: left center; transition: transform .8s cubic-bezier(.2,.7,.2,1);
}
.err-line.std i { background: var(--std); }
.err-line.fit i { background: var(--accent); }
.err-line b { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
html.js .errfig:not(.in) .err-line i { transform: scaleX(0); }
.errfig figcaption { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ---------- Synthetic data ---------- */

.syn-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 56px; align-items: start; }
.syn-funnel, .syn-example { margin: 0; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.syn-fig-title { font-size: 14px; font-weight: 600; }
.funnel { margin-top: 20px; display: grid; gap: 14px; }
.funnel li { display: grid; gap: 6px; }
.fn-label { font-size: 13.5px; color: var(--ink-2); }
.fn-bar { display: flex; align-items: center; gap: 10px; height: 16px; }
.fn-bar i {
  display: block; height: 14px; border-radius: 0 4px 4px 0; background: var(--std);
  width: calc(var(--n) / 5000 * 82%);
  transform-origin: left center; transition: transform .9s cubic-bezier(.2, .7, .2, 1);
}
.fn-kept .fn-bar i { background: var(--accent); }
.fn-kept .fn-label { color: var(--ink); font-weight: 500; }
.fn-bar b { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fn-kept .fn-bar b { color: var(--ink); }
html.js .syn-funnel:not(.in) .fn-bar i { transform: scaleX(0); }
.syn-result { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 22px; padding: 14px 16px; border-radius: 10px; background: var(--accent-wash); }
.syn-result span { font-size: 13px; color: var(--ink-2); }
.syn-result b { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.syn-result .arrow { font-weight: 400; color: var(--muted); font-size: 0.75em; }
.syn-funnel figcaption { margin-top: 16px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.syn-seed { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-strong); }
.syn-tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.syn-text { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.syn-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.syn-labels code { padding: 3px 8px; border-radius: 6px; background: var(--accent-wash); font-size: 11.5px; color: var(--ink); }
.syn-variants { margin-top: 10px; display: grid; }
.syn-variants li { position: relative; padding: 12px 0 12px 22px; border-bottom: 1px solid var(--line); }
.syn-variants li:last-child { border-bottom: 0; padding-bottom: 0; }
.syn-variants li::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.syn-variants li::after { content: ""; position: absolute; left: 6px; top: 24px; width: 10px; height: 1px; background: var(--line-strong); }
.syn-variants .syn-text { margin-top: 0; font-size: 14.5px; }
.syn-variants li.no .syn-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.syn-variants [dir="auto"] { text-align: start; }
.syn-status { margin-top: 6px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-ok, .st-no { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; border-radius: 999px; font-size: 11.5px; font-weight: 500; color: var(--ink); }
.st-ok { background: rgba(12, 163, 12, 0.14); }
.st-no { background: var(--critical-wash); }
.st-ok::before, .st-no::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.st-ok::before { background: var(--good); }
.st-no::before { background: var(--critical); }

.syn-points { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin-top: 56px; }
.syn-point { padding-top: 20px; border-top: 1px solid var(--line-strong); }
.syn-point h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.syn-point p { margin-top: 10px; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.syn-private { display: flex; align-items: center; gap: 12px; margin-top: 40px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; font-size: 14.5px; color: var(--ink-2); }
.syn-private svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Pilot ---------- */

.phases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 56px; }
.phase { position: relative; padding: 30px 24px 0 0; }
.phase::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px;
  background:
    linear-gradient(var(--ink), var(--ink)) left bottom / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 25%) left bottom / 100% 7px no-repeat;
}
.phase::after {
  content: ""; position: absolute; left: -4px; top: 7px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
}
.phase:last-child::after { box-shadow: none; }
.phase-when { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--accent); }
.phase h3 { margin-top: 8px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.phase p:last-child { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }

.pilot-grid { display: grid; grid-template-columns: 1.15fr 1fr 0.9fr; gap: 20px; margin-top: 64px; }
.card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.card-ink { background: var(--code-bg); color: var(--code-ink); border-color: var(--line); display: flex; flex-direction: column; }
.card-ink p { margin-top: 12px; color: #bdb9af; font-size: 15px; }
.card-ink .btn { margin-top: auto; align-self: flex-start; }
.card-ink p + .btn { margin-top: 28px; }

.checks { margin-top: 16px; display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 28px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-wash);
}
.checks li::after {
  content: ""; position: absolute; left: 5px; top: 7px; width: 8px; height: 5px;
  border-left: 1.8px solid var(--accent); border-bottom: 1.8px solid var(--accent); transform: rotate(-45deg);
}
.checks-neutral li::before { background: var(--bg); border: 1px solid var(--line-strong); }
.checks-neutral li::after { left: 6px; top: 11px; width: 6px; height: 0; border-left: 0; border-bottom: 1.6px solid var(--ink-2); transform: none; }

/* ---------- Deployment ---------- */

.deploy-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; margin-top: 56px; align-items: start; }
.deploy-targets { display: grid; gap: 12px; }
.target { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.target svg { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.target h3 { font-size: 16px; font-weight: 600; }
.target p { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.deploy-targets .checks { margin-top: 16px; padding: 0 4px; }

.bilingual { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.bi-head h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 2.2vw, 1.9rem); line-height: 1.15; letter-spacing: -0.015em; }
.bi-head p { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.bi-io { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr); gap: 14px; align-items: stretch; margin-top: 22px; }
.bi-label { display: block; margin-bottom: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: left; }
.bi-in { padding: 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 15px; line-height: 1.8; }
.bi-in p { text-align: right; }
.bi-in .bi-mixed { text-align: left; font-size: 14px; color: var(--ink-2); }
.bi-in .bi-label { text-align: left; }
.bi-arrow { display: grid; place-items: center; color: var(--muted); }
.bi-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bi-out { margin: 0; padding: 16px; border-radius: 12px; background: var(--code-bg); color: var(--code-ink); font-size: 11.5px; line-height: 1.65; overflow-x: auto; white-space: pre; }
.bi-out .k { color: var(--code-accent); }
.bi-out .bi-label { color: var(--code-dim); }

/* ---------- Use cases ---------- */

.cases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 56px; }
.case { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .2s, transform .2s; }
.case:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.case h3 { font-size: 16px; font-weight: 600; }
.case-in { margin-top: 14px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; flex: 1; }
.case-out { margin-top: 18px; }
.case-out code { display: inline-block; padding: 6px 9px; border-radius: 8px; background: var(--accent-wash); font-size: 11.5px; line-height: 1.5; color: var(--ink); }

/* ---------- Team ---------- */

.team-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 56px; align-items: start; }
.caps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.caps li { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); background: var(--surface); }
.people { display: grid; gap: 12px; }
.person { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.avatar { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-strong); font-family: var(--font-display); font-size: 20px; color: var(--ink-2); }
.person h3 { font-size: 16px; font-weight: 600; }
.person .role { margin-top: 2px; font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.person p:last-child { margin-top: 6px; font-size: 14px; color: var(--ink-2); }

/* ---------- FAQ ---------- */

.faq-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
.faq-grid .section-head { position: sticky; top: 96px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 0; cursor: pointer; list-style: none; font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px;
  background: linear-gradient(var(--ink-2), var(--ink-2)) center / 12px 1.5px no-repeat, linear-gradient(var(--ink-2), var(--ink-2)) center / 1.5px 12px no-repeat;
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 40px 22px 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.65; }

/* ---------- Contact ---------- */


.contact-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 56px; align-items: start; }
.contact-alt { margin-top: 24px; font-size: 14.5px; color: var(--muted); }
.contact-alt a { color: var(--accent); text-underline-offset: 3px; }
.contact-form { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field label, .field legend { font-size: 13.5px; font-weight: 500; color: var(--ink); padding: 0; }
.field legend { margin-bottom: 9px; }
.opt { font-weight: 400; color: var(--muted); margin-left: 4px; }
.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg);
  font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 104px; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.8; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.field input[aria-invalid="true"] { border-color: var(--critical); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13.5px; color: var(--ink-2); transition: all .15s; user-select: none; }
.chips input:checked + span { background: var(--accent-wash); border-color: var(--accent); color: var(--ink); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.form-status { font-size: 14px; color: var(--ink-2); }
.form-status.is-error { color: var(--critical); }

/* ---------- Footer ---------- */

.footer { padding: 48px 0 40px; border-top: 1px solid var(--line); }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; align-items: start; }
.footer-brand p { margin-top: 10px; font-size: 14px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.footer-links a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.footer-legal { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ---------- Reveal ---------- */

html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
html.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .syn-funnel:not(.in) .fn-bar i { transform: none; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html.js .errfig:not(.in) .err-line i { transform: none; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero h1 { max-width: 15ch; font-size: clamp(2.9rem, 7vw, 5rem); }
  .lede { max-width: 58ch; }
  .hero-visual { max-width: 680px; margin-top: 8px; }
}

@media (max-width: 720px) {
  .descent { display: none; }
  .descent-list { display: block; }
  .dv-caption { margin-top: 10px; text-align: left; }
}

@media (max-width: 1120px) {
  .nav-links { gap: 20px; }
  .ex-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ctrl-toggles { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
  .cases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .syn-points { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .pilot-grid { grid-template-columns: 1fr 1fr; }
  .card-ink { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .menu-btn { display: inline-grid; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; margin: 0;
    padding: 8px var(--gutter) 16px; background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 0; font-size: 16px; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links .nav-menu-cta { display: block; color: var(--accent); font-weight: 500; }
  .ex-body { grid-template-columns: 1fr; }
  .ex-panel { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  .errors-grid, .team-grid, .faq-grid, .contact-grid, .deploy-grid, .repro, .syn-grid { grid-template-columns: 1fr; }
  .faq-grid .section-head { position: static; }
  .errors-grid, .team-grid, .faq-grid, .contact-grid { gap: 40px; }
  .phases { grid-template-columns: 1fr 1fr; row-gap: 36px; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .nav-cta { display: none; }
  .hero h1 { max-width: none; }
  .explorer { padding: 18px 16px 14px; border-radius: 16px; }
  .ex-controls { grid-template-columns: 1fr; gap: 18px; }
  .ctrl-toggles { flex-direction: column; align-items: flex-start; }
  .steps, .cases, .pilot-grid, .phases, .syn-points { grid-template-columns: 1fr; }
  .syn-funnel, .syn-example { padding: 20px; }
  .stat-value { font-size: 40px; }
  .field-row { grid-template-columns: 1fr; }
  .bi-io { grid-template-columns: 1fr; }
  .bi-arrow svg { transform: rotate(90deg); }
  .repro, .card, .bilingual, .errfig, .contact-form { padding: 20px; }
  .footer-inner { grid-template-columns: 1fr; }
  .faq details p { padding-right: 0; }
}

/* ==========================================================================
   How it works — scroll-driven 3D story ("the gauge", scene3d.js)
   Everything here is gated on html.journey-on, which scene3d.js sets only when
   WebGL is available and reduced motion is off. Otherwise the steps render as
   the four cards above.
   ========================================================================== */

.section-how { position: relative; }
/* The hero grid, continued through the heading down to the 3D stage (height and phase set by scene3d.js) */
html.journey-on .section-how::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--j-grid-h, 0px); pointer-events: none;
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  background-position: -1px calc(-1px - var(--j-grid-phase, 0px));
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%);
}
html.journey-on .section-how > .container:first-child { position: relative; }
.step-intro, .journey-visual { display: none; }
.journey > .journey-stage > .container { width: 100%; }

html.journey-on .step-intro { display: flex; }
html.journey-on .journey { position: relative; height: calc(var(--j-scroll, 4.6) * 86vh + 100vh - 64px); margin-top: 12px; }
html.journey-on .journey-stage {
  position: sticky; top: 64px; display: flex; align-items: center; overflow: hidden;
  height: calc(100vh - 64px); height: calc(100svh - 64px);
}
html.journey-on .journey-inner { display: grid; grid-template-columns: minmax(0, 0.76fr) minmax(0, 1.24fr); gap: 24px 48px; align-items: center; }

html.journey-on .journey-steps { display: block; position: relative; height: 440px; margin: 0; }
html.journey-on .journey-steps .step {
  position: absolute; left: 0; right: 0; top: 0; padding-top: 26px;
  opacity: 0; visibility: hidden; transform: translateY(22px);
  transition: opacity .4s ease, transform .55s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .4s;
}
html.journey-on .journey-steps .step.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: .1s, .1s, 0s; }
html.journey-on .journey-steps .step-top { flex-wrap: wrap; row-gap: 10px; }
html.journey-on .journey-steps .step h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 3.3vw, 3rem); line-height: 1; letter-spacing: -0.025em; }
html.journey-on .journey-steps .step-n { font-size: 13px; }
html.journey-on .journey-steps .step > p { margin-top: 18px; max-width: 46ch; font-size: 17px; line-height: 1.6; }
html.journey-on .journey-steps .mini { margin-top: 26px; padding-top: 0; max-width: 430px; }
html.journey-on .journey-steps .mini-row { font-size: 12.5px; padding: 8px 0; }

html.journey-on .journey-visual { display: block; position: relative; height: min(78vh, 700px); min-height: 400px; }
/* The scene fills the whole pinned stage, so units and their residues can travel anywhere on screen.
   scene3d.js offsets the camera so the model itself sits in the right column, as before. */
.journey-canvas, .journey-labels { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
html.journey-on .journey-inner { position: relative; z-index: 1; }
@media (min-width: 901px) {
  html.journey-on .journey-stage::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: var(--j-scrim, 1);
    background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 90%, transparent) 0%, color-mix(in srgb, var(--bg) 72%, transparent) 30%, transparent 48%);
  }
}
.journey-canvas { display: block; opacity: 0; transition: opacity .8s ease; }
.journey.is-ready .journey-canvas { opacity: 1; }
.journey-labels { pointer-events: none; overflow: hidden; }

.j-label {
  position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; will-change: transform, opacity;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.03em; line-height: 1.35; color: var(--ink-2);
  text-shadow: 0 0 8px var(--bg), 0 0 2px var(--bg);
}
.j-label b { font-weight: 500; color: var(--ink); }
.j-label i { font-style: normal; }
.j-label.is-bar { margin: -8px 0 0 8px; color: var(--ink); }
.j-label.is-top { translate: -50% -100%; }
.j-label.is-cand { margin: 6px 0 0 0; translate: -50% 0; text-align: center; display: grid; justify-items: center; gap: 1px; }
.j-label.is-cand span { font-size: 10.5px; }
.j-label.is-cand span.no { color: var(--critical); }
.j-label.is-cand span.ok { color: var(--muted); }
.j-label.is-accent { translate: -50% 0; padding: 4px 10px; border-radius: 999px; background: var(--accent-wash); color: var(--ink); text-shadow: none; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.j-label.is-accent b { color: var(--accent); }

.journey-hud {
  position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 12px; padding: 14px 18px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: border-color .4s ease, box-shadow .4s ease;
}
.journey-hud.is-clear { border-color: var(--accent); box-shadow: 0 0 36px -14px var(--accent-ring); }
.jh-name { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.jh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); transition: background-color .3s, box-shadow .3s; }
.journey-hud.is-clear .jh-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.journey-hud dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0; }
.journey-hud dt { font-size: 12.5px; color: var(--muted); }
.journey-hud dd { margin: 3px 0 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.journey-hud dd b { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; transition: color .25s; }
.journey-hud dd span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); opacity: 0; transition: opacity .4s; }
.journey-hud.has-bar dd span { opacity: 1; }
.journey-hud .is-over dd b { color: var(--critical); }
.journey-hud .is-over dd span { color: var(--critical); }

/* Colour key for the Compare and Fit chapters */
.journey-legend { position: absolute; left: 0; top: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; opacity: 0; pointer-events: none; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ink-2); }
.journey-legend li { display: inline-flex; align-items: center; gap: 7px; }
.journey-legend i { width: 9px; height: 9px; border-radius: 2px; }
.jl-over { background: var(--critical); }
.jl-pass { background: linear-gradient(to top, #3446e0, #8e99ff); }
.jl-fail { background: var(--muted); }

@media (max-height: 700px) {
  html.journey-on .journey-steps { height: 300px; }
  html.journey-on .journey-steps .mini { display: none; }
  html.journey-on .journey-visual { min-height: 320px; }
}

@media (max-width: 900px) {
  html.journey-on .journey-inner { grid-template-columns: 1fr; gap: 10px; align-content: center; }
  html.journey-on .journey-visual { order: -1; height: 47vh; height: 47svh; min-height: 300px; }
  html.journey-on .journey-steps { height: 236px; }
  html.journey-on .journey-steps .step { padding-top: 16px; }
  html.journey-on .journey-steps .step h3 { font-size: 2rem; }
  html.journey-on .journey-steps .step > p { margin-top: 10px; font-size: 15px; line-height: 1.5; }
  html.journey-on .journey-steps .mini { display: none; }
  .journey-hud { right: 0; padding: 10px 12px; gap: 6px; }
  .journey-hud dl { gap: 10px; }
  .journey-hud dd b { font-size: 17px; }
  .journey-hud dd span { display: none; }
  .journey-hud dt { font-size: 11.5px; }
  .jh-name { font-size: 10px; }
  .j-label { font-size: 10.5px; }
  .j-label.is-cand span, .j-label.is-cand i { display: none; }
  .j-label.is-bar { margin-left: -58px; margin-top: -22px; }
}
