/* ═══════════════════════════════════════════════════════════
   APGRP — Interactive Research Explainer
   Design language: "Observatory" — deep-space glass, luminous
   data, editorial type. Three.js scenes sit inside quiet frames.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #05060d;
  --bg-2: #090c1a;
  --ink: #eef2ff;
  --ink-dim: #aab4d0;
  --ink-faint: #6c7898;
  --line: rgba(150, 170, 255, .13);
  --line-strong: rgba(150, 170, 255, .26);

  --cyan: #4df2ff;
  --violet: #8b7bff;
  --green: #3dffa2;
  --red: #ff4d5e;
  --orange: #ff8a3d;
  --amber: #ffc24d;

  --glass: linear-gradient(160deg, rgba(255,255,255,.065), rgba(255,255,255,.018));
  --radius: 24px;
  --maxw: 1180px;

  --f-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --f-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; letter-spacing: -.02em; line-height: 1.08; }
p { margin: 0; }
sub { font-size: .72em; }
::selection { background: rgba(77,242,255,.28); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.container { width: min(var(--maxw), 100% - 40px); margin-inline: auto; }
.mono { font-family: var(--f-mono); }

/* ─────────── Atmosphere ─────────── */
.bg-stage { position: fixed; inset: 0; z-index: -3; pointer-events: none; }
.bg-stage canvas { width: 100%; height: 100%; display: block; }
.bg-aurora {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 50% at 12% 8%, rgba(139,123,255,.20), transparent 70%),
    radial-gradient(50% 45% at 92% 28%, rgba(77,242,255,.12), transparent 70%),
    radial-gradient(55% 50% at 50% 105%, rgba(255,77,94,.10), transparent 70%);
}
.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ─────────── Gradient text helpers ─────────── */
em.grad, em.grad-red {
  font-family: var(--f-serif); font-style: italic; font-weight: 400;
  letter-spacing: -.01em; padding-right: .06em;
  background: linear-gradient(95deg, var(--cyan), var(--violet) 55%, #d28bff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
em.grad-red { background-image: linear-gradient(95deg, var(--orange), var(--red) 60%, #ff7aa8); }

/* ─────────── Navigation ─────────── */
.nav {
  position: fixed; z-index: 50; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 28px;
  padding: 8px 10px 8px 18px; border-radius: 999px;
  background: rgba(10,13,28,.55); backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  transition: background .3s, border-color .3s;
  overflow: hidden;
}
.nav.scrolled { background: rgba(8,10,22,.8); border-color: var(--line-strong); }
.nav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 700; letter-spacing: .14em; font-size: 13px; }
.orb {
  width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block;
  background: radial-gradient(circle at 35% 30%, #fff, var(--cyan) 40%, #1b6dff 100%);
  box-shadow: 0 0 14px 2px rgba(77,242,255,.65);
  animation: orb 3.2s ease-in-out infinite;
}
@keyframes orb { 50% { box-shadow: 0 0 22px 5px rgba(77,242,255,.9); transform: scale(1.12); } }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-dim);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.nav-links a.active { color: var(--bg); background: var(--ink); }
.nav-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.nav-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--violet)); box-shadow: 0 0 10px var(--cyan); }

/* ─────────── Buttons ─────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 14px 26px; border-radius: 999px; font-family: var(--f-display); font-weight: 600; font-size: 14.5px; letter-spacing: .01em;
  border: 1px solid transparent; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, background .25s, border-color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #04121a; background: linear-gradient(120deg, var(--cyan), #9ab6ff);
  box-shadow: 0 8px 30px rgba(77,242,255,.28), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn-primary:hover { box-shadow: 0 12px 44px rgba(77,242,255,.45), inset 0 1px 0 rgba(255,255,255,.6); }
.btn-ghost { color: var(--ink); background: rgba(255,255,255,.04); border-color: var(--line-strong); backdrop-filter: blur(10px); }
.btn-ghost:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.3); }

/* ─────────── Glass primitive ─────────── */
.glass {
  position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(20px) saturate(130%); -webkit-backdrop-filter: blur(20px) saturate(130%);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.06);
}
/* cursor-follow spotlight (driven by --mx/--my from JS) */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(120,150,255,.14), transparent 60%);
}
.glass:hover::before { opacity: 1; }

/* ─────────── Reveal ─────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.7,.2,1) var(--d, 0s), transform .9s cubic-bezier(.2,.7,.2,1) var(--d, 0s); }
.reveal.visible { opacity: 1; transform: none; }

/* ═════════════════ HERO ═════════════════ */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 110px 0 90px; overflow: hidden; isolation: isolate; }
.hero-stage { position: absolute; inset: 0; z-index: -2; cursor: grab; touch-action: pan-y; }
.hero-stage.dragging { cursor: grabbing; }
.hero-stage canvas { width: 100%; height: 100%; display: block; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5,6,13,.92) 0%, rgba(5,6,13,.66) 34%, rgba(5,6,13,0) 62%),
    linear-gradient(0deg, var(--bg) 0%, rgba(5,6,13,0) 22%),
    linear-gradient(180deg, rgba(5,6,13,.7) 0%, rgba(5,6,13,0) 16%);
}
.hero-content { pointer-events: none; }
.hero-content a, .hero-content .btn { pointer-events: auto; }
.hero-copy { max-width: 620px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim);
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 0 rgba(255,138,61,.7); animation: ping 2s infinite; display: inline-block; }
.pulse-dot.green { background: var(--green); box-shadow: 0 0 0 0 rgba(61,255,162,.7); animation-name: ping-g; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(255,138,61,0); } 100% { box-shadow: 0 0 0 0 rgba(255,138,61,0); } }
@keyframes ping-g { 70% { box-shadow: 0 0 0 9px rgba(61,255,162,0); } 100% { box-shadow: 0 0 0 0 rgba(61,255,162,0); } }

.hero-title { margin-top: 26px; font-size: clamp(3.2rem, 8.2vw, 6.6rem); font-weight: 700; line-height: .95; letter-spacing: -.045em; }
.hero-title em.grad { font-size: 1.08em; letter-spacing: -.02em; }
.hero-title-sub {
  display: block; margin-top: 18px; font-family: var(--f-display); font-weight: 500; letter-spacing: .02em;
  font-size: clamp(1rem, 1.9vw, 1.35rem); color: var(--ink-dim);
}
.hero-sub { margin-top: 22px; max-width: 540px; font-size: 1.08rem; color: var(--ink-dim); }
.hero-sub strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 34px 0 0; padding: 0; font-size: 13px; color: var(--ink-dim); }
.legend li { display: inline-flex; align-items: center; gap: 9px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-agent { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.dot-obstacle { background: var(--red); box-shadow: 0 0 10px var(--red); }
.dot-goal { background: var(--green); box-shadow: 0 0 10px var(--green); }

/* HUD */
.hud {
  position: absolute; z-index: 2; right: max(20px, calc((100vw - var(--maxw)) / 2)); bottom: 74px; width: 290px;
  padding: 18px 20px 14px; border-radius: 20px; font-size: 13px;
}
.hud-head { display: flex; align-items: center; gap: 9px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.hud-head em { font-style: normal; margin-left: auto; color: var(--ink-faint); }
.hud-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--ink-dim); }
.hud-row > span:first-child { flex: 0 0 auto; }
.hud-row b { margin-left: auto; font-family: var(--f-mono); font-weight: 500; font-size: 12.5px; color: var(--ink); }
.hud-row .hud-meter { flex: 1; margin-left: 4px; }
.hud-row .hud-meter + b { margin-left: 0; min-width: 34px; text-align: right; }
.hud-meter { height: 5px; border-radius: 9px; background: rgba(255,255,255,.08); overflow: hidden; }
.hud-meter i { display: block; height: 100%; width: 90%; border-radius: 9px; background: linear-gradient(90deg, var(--green), var(--cyan)); transition: width .25s; }
#hud-mode { padding: 2px 10px; border-radius: 999px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.mode-plan { color: var(--cyan) !important; background: rgba(77,242,255,.12); }
.mode-reflex { color: var(--green) !important; background: rgba(61,255,162,.14); }

.hero-hint {
  position: absolute; z-index: 2; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint);
  white-space: nowrap; pointer-events: none;
}
.hero-hint i { width: 1px; height: 22px; background: linear-gradient(var(--cyan), transparent); animation: drip 2s infinite; }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ═════════════════ SECTIONS ═════════════════ */
.section { position: relative; padding: clamp(70px, 9vw, 120px) 0; }
.section::before { content: ""; position: absolute; left: 50%; top: 0; width: min(var(--maxw), 100% - 40px); height: 1px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.section-header { max-width: 760px; margin-bottom: clamp(40px, 6vw, 70px); }
.section-tag { display: inline-flex; align-items: center; gap: 12px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-dim); }
.section-tag b { font-weight: 500; color: var(--cyan); padding: 3px 9px; border-radius: 7px; border: 1px solid rgba(77,242,255,.3); background: rgba(77,242,255,.07); letter-spacing: .08em; }
.section-header h2 { margin-top: 18px; font-size: clamp(2.3rem, 5.4vw, 4.2rem); font-weight: 600; letter-spacing: -.035em; }
.section-header h2 em { font-size: 1.1em; }
.section-desc { margin-top: 20px; font-size: 1.12rem; color: var(--ink-dim); max-width: 640px; }

/* ─────────── Cards & viewports ─────────── */
.comparison-grid, .two-col-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.card { padding: 22px; transition: transform .45s cubic-bezier(.2,.8,.2,1), border-color .3s; }
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.card-label { display: flex; align-items: center; gap: 11px; margin: 2px 4px 18px; font-family: var(--f-display); font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.card-label i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.card-label.danger { color: #ff9aa5; } .card-label.danger i { background: var(--red); box-shadow: 0 0 12px var(--red); }
.card-label.success { color: #9dffd2; } .card-label.success i { background: var(--green); box-shadow: 0 0 12px var(--green); }

.viewport {
  position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden;
  background: radial-gradient(90% 80% at 50% 38%, #0e1430 0%, #070a17 70%);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 60px rgba(0,0,0,.55);
}
.viewport-wide { aspect-ratio: 16 / 10; }
.stage { position: absolute; inset: 0; touch-action: pan-y; cursor: grab; }
.stage.dragging { cursor: grabbing; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage.no-webgl::after { content: "WebGL is unavailable in this browser."; position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--ink-faint); }
.viewport::after { /* glass sheen */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.06), transparent 28%, transparent 72%, rgba(255,255,255,.025));
}
.vp-chip {
  position: absolute; z-index: 2; padding: 5px 11px; border-radius: 999px; pointer-events: none;
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim);
  background: rgba(6,8,18,.62); backdrop-filter: blur(8px); border: 1px solid var(--line);
}
.vp-tl { top: 12px; left: 12px; } .vp-tr { top: 12px; right: 12px; }
.vp-chip.state { color: var(--amber); transition: color .2s, background .2s, border-color .2s; }
.vp-chip.state.bad { color: #ffd3d8; background: rgba(255,77,94,.28); border-color: rgba(255,77,94,.6); }
.vp-legend { position: absolute; z-index: 2; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 12px; border-radius: 12px; pointer-events: none; font-size: 11px; color: var(--ink-dim); background: rgba(6,8,18,.62); backdrop-filter: blur(8px); border: 1px solid var(--line); }
.vp-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-risk { background: linear-gradient(135deg, #5a3cff, #ff3b5c); } .sw-path { background: var(--cyan); }
.sw-ghost { background: transparent; border: 1.5px solid var(--orange); border-radius: 50%; }
.sw-plan { background: var(--cyan); } .sw-reflex { background: var(--green); } .sw-blend { background: #e8dcff; }

.card-desc, .card-desc-small { margin: 20px 4px 0; color: var(--ink-dim); font-size: .98rem; }
.card-desc-small { font-size: .93rem; }
.card-desc strong { color: #ffb3bb; font-weight: 600; }
.two-col-grid > .card { display: flex; flex-direction: column; }
.params { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: auto 0 0; padding-top: 22px; }
.params div { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.params dt { font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.params dd { margin: 4px 0 0; font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; color: var(--ink); }
.failure-badge {
  display: inline-block; margin: 18px 4px 4px; padding: 6px 14px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #ffb3bb;
  background: rgba(255,77,94,.1); border: 1px solid rgba(255,77,94,.35);
}

.insight { display: flex; gap: 18px; align-items: flex-start; margin-top: 30px; padding: 26px 30px; border-radius: 20px; background: linear-gradient(110deg, rgba(139,123,255,.13), rgba(77,242,255,.05)); border: 1px solid rgba(139,123,255,.28); }
.insight svg { flex: none; color: var(--amber); margin-top: 3px; }
.insight p { font-size: 1.05rem; color: var(--ink-dim); }
.insight strong { color: var(--ink); font-weight: 600; }

/* ─────────── Solution ─────────── */
.analogy-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0; align-items: stretch; margin-bottom: 26px; }
.analogy-card { padding: 30px 30px 32px; }
.analogy-card h3 { font-size: 1.7rem; margin-top: 18px; font-weight: 600; }
.analogy-sub { margin: 6px 0 14px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; }
.analogy-card p:last-child { color: var(--ink-dim); }
.analogy-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; }
.analogy-icon svg { width: 34px; height: 34px; }
.brain .analogy-icon { color: var(--cyan); background: rgba(77,242,255,.09); border: 1px solid rgba(77,242,255,.3); box-shadow: 0 0 40px rgba(77,242,255,.18); }
.brain .analogy-sub { color: var(--cyan); }
.reflex .analogy-icon { color: var(--green); background: rgba(61,255,162,.09); border: 1px solid rgba(61,255,162,.3); box-shadow: 0 0 40px rgba(61,255,162,.16); }
.reflex .analogy-sub { color: var(--green); }
.analogy-link { position: relative; width: 120px; display: flex; align-items: center; justify-content: center; }
.pipe { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: linear-gradient(90deg, var(--cyan), var(--green)); opacity: .4; border-radius: 2px; }
.pipe-pulse { position: absolute; top: calc(50% - 4px); width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 16px 4px rgba(120,255,220,.8); animation: pulse-travel 2.6s cubic-bezier(.6,0,.4,1) infinite; }
@keyframes pulse-travel { 0% { left: 0; background: var(--cyan); } 100% { left: calc(100% - 10px); background: var(--green); } }
.pipe-label { position: relative; top: -22px; font-family: var(--f-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); background: var(--bg); padding: 0 8px; }

/* Arbitration */
.slider-area { margin: 20px 4px 4px; }
.slider-label-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-dim); margin-bottom: 8px; font-weight: 500; }
.slider-label-row span:last-child { color: #ff9aa5; }
#danger-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px; outline-offset: 8px; cursor: pointer;
  background: linear-gradient(90deg, var(--cyan), var(--amber) 55%, var(--red)); box-shadow: 0 0 24px rgba(139,123,255,.25); }
#danger-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #dfe6ff 60%, #9fb0ff); border: 3px solid var(--bg); box-shadow: 0 0 0 1px rgba(255,255,255,.5), 0 4px 16px rgba(0,0,0,.5); transition: transform .15s; }
#danger-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
#danger-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--bg); box-shadow: 0 0 0 1px rgba(255,255,255,.5); }
.arb-label { margin-top: 20px; font-size: .92rem; color: var(--ink-dim); }
.arb-label span { font-weight: 600; color: var(--cyan); transition: color .2s; }
.arb-bar { display: flex; height: 12px; margin-top: 10px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.06); }
.arb-fill-brain { background: linear-gradient(90deg, #1ea7ff, var(--cyan)); transition: width .25s; }
.arb-fill-reflex { background: linear-gradient(90deg, var(--green), #8dffd0); transition: width .25s; }
.arb-legend { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; }
.leg-brain { color: var(--cyan); } .leg-reflex { color: var(--green); }
.alpha-display { font-family: var(--f-mono); color: var(--ink); font-size: 13px; }
.alpha-display b { font-weight: 500; color: var(--amber); }
.alpha-display em { font-style: normal; color: var(--ink-faint); margin-left: 4px; font-size: 11.5px; }

/* Algorithm */
.algo { margin-top: 26px; padding: 36px clamp(24px, 4vw, 46px) 34px; }
.algo-title { font-family: var(--f-display); font-weight: 600; font-size: 1.35rem; margin-bottom: 30px; }
.algo-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; position: relative; counter-reset: s; }
.algo-steps::before { content: ""; position: absolute; left: 22px; right: 22px; top: 22px; height: 1px; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--green)); opacity: .35; }
.algo-step { position: relative; display: flex; flex-direction: column; gap: 16px; font-size: .93rem; color: var(--ink-dim); }
.step-num {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; position: relative; z-index: 1;
  font-family: var(--f-mono); font-weight: 500; color: var(--cyan); background: var(--bg-2); border: 1px solid rgba(77,242,255,.4); box-shadow: 0 0 22px rgba(77,242,255,.14);
}
.highlight-step { color: var(--ink); }
.highlight-step .step-num { color: #04170f; background: var(--green); border-color: var(--green); box-shadow: 0 0 28px rgba(61,255,162,.5); }
.formula { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 30px; padding: 16px 22px; border-radius: 14px; font-family: var(--f-mono); font-size: 14px; color: #d4dbff; background: rgba(0,0,0,.28); border: 1px dashed var(--line-strong); }
.formula-sep { color: var(--ink-faint); }

/* ─────────── Results ─────────── */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.stat-card { padding: 32px 30px; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(139,123,255,.22), transparent 70%); pointer-events: none; }
.stat-icon { width: 44px; height: 44px; color: var(--cyan); border-radius: 13px; display: grid; place-items: center; background: rgba(77,242,255,.08); border: 1px solid rgba(77,242,255,.25); }
.stat-icon svg { width: 22px; height: 22px; }
.stat-num { margin-top: 26px; font-family: var(--f-display); font-weight: 700; font-size: clamp(3rem, 5.4vw, 4.4rem); letter-spacing: -.04em; line-height: 1; background: linear-gradient(170deg, #fff, #a8b8ff); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 14px; font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; }
.stat-sub { margin-top: 6px; font-size: .9rem; color: var(--ink-faint); }

.chart-section, .ablation-card { margin-top: 26px; padding: clamp(26px, 4vw, 44px); }
.chart-title, .ablation-card h3 { font-size: 1.5rem; font-weight: 600; }
.chart-title span { color: var(--ink-faint); font-weight: 400; }
.bar-chart { margin-top: 30px; display: flex; flex-direction: column; gap: 16px; }
.bar-row { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; }
.bar-name { font-size: .93rem; color: var(--ink-dim); }
.bar-name.apgrp-name { color: var(--cyan); font-weight: 600; }
.bar-name.control-name { color: var(--amber); font-weight: 600; }
.bar-track, .ablation-bar-track { position: relative; height: 34px; border-radius: 11px; background: rgba(255,255,255,.045); border: 1px solid var(--line); }
.bar, .ablation-bar { position: relative; height: 100%; border-radius: 10px; transition: width 1.6s cubic-bezier(.2,.8,.2,1); min-width: 3px; }
.bar-pct, .ablation-bar span { position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); font-family: var(--f-mono); font-size: 13px; color: var(--ink); white-space: nowrap; }
.apgrp-bar { background: linear-gradient(90deg, #1b6dff, var(--cyan)); box-shadow: 0 0 28px rgba(77,242,255,.45); }
.control-bar { background: linear-gradient(90deg, #ff8a3d, var(--amber)); box-shadow: 0 0 28px rgba(255,194,77,.38); }
.baseline-bar { background: linear-gradient(90deg, #5b3b9e, var(--violet)); }
.baseline-bar.zero-bar { background: var(--red); box-shadow: 0 0 14px rgba(255,77,94,.7); }
.chart-note { margin-top: 30px; padding: 18px 22px; border-radius: 14px; font-size: .97rem; color: var(--ink-dim); background: rgba(255,194,77,.06); border-left: 3px solid var(--amber); }
.chart-note strong { color: var(--amber); }

.ablation-items { margin-top: 28px; display: flex; flex-direction: column; gap: 20px; }
.ablation-label { display: block; margin-bottom: 9px; font-size: .94rem; color: var(--ink); }
.ablation-bar-track { height: 18px; border-radius: 9px; }
.ablation-bar { border-radius: 8px; }
.ab-full .ablation-bar { background: linear-gradient(90deg, #14b98a, var(--green)); box-shadow: 0 0 22px rgba(61,255,162,.35); }
.ab-partial .ablation-bar { background: linear-gradient(90deg, #ff8a3d, var(--amber)); box-shadow: 0 0 22px rgba(255,194,77,.3); }
.ab-fail .ablation-bar { background: var(--red); box-shadow: 0 0 14px rgba(255,77,94,.7); }
.ablation-verdict { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink-dim); font-size: .98rem; }
.ablation-verdict strong { color: var(--cyan); font-weight: 600; }
.ablation-card .card-desc-small { margin: 10px 0 0; }

.apgrp-live { margin-top: 26px; padding: clamp(22px, 3vw, 32px); }
.live-sim-inner { display: grid; grid-template-columns: 1.7fr 1fr; gap: 28px; align-items: stretch; }
.live-stats { display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.live-stat { padding: 18px 20px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.ls-label { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.live-stat strong { font-family: var(--f-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; }
#encounter-count { color: var(--amber); font-variant-numeric: tabular-nums; }
.live-note { font-size: .8rem; color: var(--ink-faint); margin-top: 2px; }

/* ─────────── Footer ─────────── */
.footer { position: relative; padding: 110px 0 0; border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, rgba(5,6,13,.85) 40%); }
.footer-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; }
.footer-logo { display: inline-flex; align-items: center; gap: 12px; font-family: var(--f-display); font-weight: 700; letter-spacing: .18em; font-size: 1.1rem; }
.footer-desc { margin-top: 22px; font-family: var(--f-serif); font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.2; color: var(--ink); max-width: 560px; }
.author-line { margin-top: 18px; color: var(--ink-dim); }
.author-line strong { color: var(--ink); font-weight: 600; }
.footer-card { padding: 34px; }
.footer-card h4 { font-size: 1.4rem; font-weight: 600; }
.footer-card p { margin-top: 10px; color: var(--ink-dim); }
.footer-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.footer-bottom { margin-top: 90px; padding: 26px 20px; border-top: 1px solid var(--line); text-align: center; font-size: 12.5px; color: var(--ink-faint); font-family: var(--f-mono); letter-spacing: .06em; }

/* ─────────── Responsive ─────────── */
@media (max-width: 980px) {
  .hud { position: relative; right: auto; bottom: auto; width: min(var(--maxw), 100% - 40px); margin: 40px auto 0; }
  .hero { flex-direction: column; justify-content: center; padding-bottom: 70px; }
  .hero-shade { background: linear-gradient(180deg, rgba(5,6,13,.8) 0%, rgba(5,6,13,.62) 55%, rgba(5,6,13,.9) 100%); }
  .hero-hint { display: none; }
  .comparison-grid, .two-col-grid, .live-sim-inner, .footer-inner { grid-template-columns: 1fr; }
  .analogy-row { grid-template-columns: 1fr; gap: 0; }
  .analogy-link { width: 2px; height: 70px; margin: 0 auto; }
  .pipe { left: 0; right: 0; top: 0; bottom: 0; width: 2px; height: auto; background: linear-gradient(var(--cyan), var(--green)); }
  .pipe-pulse { left: -4px !important; top: 0; animation: pulse-down 2.4s cubic-bezier(.6,0,.4,1) infinite; }
  @keyframes pulse-down { from { top: 0; } to { top: calc(100% - 10px); } }
  .pipe-label { display: none; }
  .stats-row { grid-template-columns: 1fr; }
  .algo-steps { grid-template-columns: 1fr; gap: 22px; }
  .algo-steps::before { left: 21px; right: auto; top: 22px; bottom: 22px; width: 1px; height: auto; background: linear-gradient(var(--cyan), var(--green)); }
  .algo-step { flex-direction: row; align-items: center; }
  .bar-row { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 640px) {
  .nav { gap: 6px; padding-left: 14px; width: calc(100% - 20px); justify-content: space-between; }
  .logo-text { display: none; }
  .nav-links a { padding: 7px 10px; font-size: 12.5px; }
  .hero-title { font-size: clamp(2.9rem, 15vw, 4rem); }
  .card { padding: 16px; }
  .insight { padding: 20px; flex-direction: column; }
  .bar-pct, .ablation-bar span { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .orb, .pulse-dot, .pipe-pulse, .hero-hint i { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   ADDED IN THE ACCURACY PASS
   Styles for the benchmark spec strip, the measured-range marker on the
   arbitration slider, data tables, the diagnosis cards, the survivorship
   caution, the limitations list and the closing takeaway.
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────── Benchmark spec strip ─────────── */
.section-tight { padding: clamp(34px, 4vw, 54px) 0; }
.section-tight::before { display: none; }
.spec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.spec { padding: 20px 22px; border-radius: 18px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.spec dt { font-family: var(--f-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.spec dd { margin: 8px 0 0; font-family: var(--f-display); font-weight: 600; font-size: 1.18rem; letter-spacing: -.01em; color: var(--ink); }
.spec dd.spec-sub { margin-top: 5px; font-family: var(--f-body); font-weight: 400; font-size: .84rem; color: var(--ink-faint); letter-spacing: 0; }

/* ─────────── Hero HUD disclaimer ─────────── */
.hud-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .74rem; line-height: 1.45; color: var(--ink-faint); }

/* ─────────── Component verdict chips ─────────── */
.analogy-verdict { margin-top: 16px; padding: 9px 13px; border-radius: 11px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .02em; }
.analogy-verdict.good { color: #9dffd2; background: rgba(61,255,162,.09); border: 1px solid rgba(61,255,162,.3); }
.analogy-verdict.bad { color: #ff9aa5; background: rgba(255,77,94,.09); border: 1px solid rgba(255,77,94,.3); }
.analogy-verdict em { font-style: italic; }

.card-label.warn { color: #ffd88f; }
.card-label.warn i { background: var(--amber); box-shadow: 0 0 12px var(--amber); }

/* ─────────── Caveat notes under params / formulas ─────────── */
.params-note, .formula-note, .slider-note {
  margin-top: 16px; font-size: .86rem; line-height: 1.55; color: var(--ink-faint);
}
.params-note strong, .formula-note strong { color: var(--amber); font-weight: 600; }
.slider-note .mono, .card-desc .mono, .card-desc-small .mono, .chart-note .mono {
  font-family: var(--f-mono); font-size: .92em; color: var(--ink-dim);
}
.formula-note { padding-top: 16px; border-top: 1px solid var(--line); }

/* ─────────── Measured-range marker on the arbitration slider ─────────── */
.measured-band { position: relative; height: 26px; margin-top: 6px; }
.measured-band .band-fill {
  position: absolute; left: 0; top: 0; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,194,77,.85), rgba(255,194,77,.12));
  box-shadow: 0 0 12px rgba(255,194,77,.4);
}
.measured-band .band-label {
  position: absolute; left: 0; top: 10px; font-family: var(--f-mono);
  font-size: 10px; letter-spacing: .04em; color: var(--amber); opacity: .85; white-space: nowrap;
}

/* ─────────── Extra bar colours + label gutter ─────────── */
.bar-chart { padding-right: 104px; }
.untrained-bar { background: linear-gradient(90deg, #6f4bd8, var(--violet)); box-shadow: 0 0 24px rgba(139,123,255,.35); }
.plain-bar { background: linear-gradient(90deg, #8a5a2a, #c9823f); }

/* ─────────── Data tables ─────────── */
.table-wrap { margin-top: 28px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .93rem; }
.data-table th, .data-table td { padding: 13px 16px; text-align: right; border-bottom: 1px solid var(--line); }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 500; border-bottom: 1px solid var(--line-strong); vertical-align: bottom;
}
.data-table thead th em { display: block; margin-top: 4px; font-style: normal; font-size: 9.5px; letter-spacing: .1em; opacity: .7; text-transform: none; }
.data-table tbody td { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .row-apgrp td { color: var(--ink); background: rgba(77,242,255,.05); }
.data-table .row-apgrp td:first-child { color: var(--cyan); font-weight: 600; box-shadow: inset 2px 0 0 var(--cyan); }
.data-table .row-ctrl td { background: rgba(255,255,255,.02); }
.data-table .row-best td { color: var(--ink); background: rgba(255,194,77,.07); }
.data-table .row-best td:first-child { color: var(--amber); font-weight: 600; box-shadow: inset 2px 0 0 var(--amber); }
.data-table .row-best strong { color: var(--amber); }

/* ─────────── Survivorship-bias caution block ─────────── */
.caution { margin-top: 26px; padding: clamp(24px, 3.4vw, 34px); border-left: 3px solid var(--red); }
.caution-head {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: #ff9aa5; margin-bottom: 14px;
}
.caution p { color: var(--ink-dim); font-size: 1rem; line-height: 1.65; }
.caution strong { color: var(--ink); font-weight: 600; }

/* ─────────── Diagnosis cards ─────────── */
.diag-card { display: flex; flex-direction: column; }
.diag-card .card-desc { margin-bottom: 4px; }
.metric-list { margin: 20px 0 18px; display: flex; flex-direction: column; gap: 1px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.metric-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 11px 16px; background: rgba(255,255,255,.035); }
.metric-list dt { font-size: .88rem; color: var(--ink-dim); }
.metric-list dd { margin: 0; font-family: var(--f-mono); font-size: 1rem; font-weight: 500; color: var(--amber); font-variant-numeric: tabular-nums; }

.code-block {
  margin: 18px 0; padding: 16px 18px; border-radius: 14px; overflow-x: auto;
  background: rgba(0,0,0,.4); border: 1px solid var(--line);
  font-family: var(--f-mono); font-size: 12px; line-height: 1.7; color: var(--ink-dim);
}
.code-block b { color: var(--red); font-weight: 500; }

/* ─────────── Limitations ─────────── */
.limits { margin-top: 26px; padding: clamp(26px, 4vw, 44px); }
.limits h3 { font-size: 1.5rem; font-weight: 600; }
.limit-list { margin: 24px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.limit-list li {
  padding: 18px 20px; border-radius: 16px; background: rgba(255,255,255,.035);
  border: 1px solid var(--line); font-size: .92rem; line-height: 1.6; color: var(--ink-faint);
}
.limit-list li b { display: block; margin-bottom: 6px; font-family: var(--f-display); font-weight: 600; font-size: .98rem; color: var(--ink-dim); }
.limit-list li em { color: var(--ink-dim); font-style: italic; }

/* ─────────── Closing takeaway ─────────── */
.takeaway {
  position: relative; margin-top: 26px; padding: clamp(34px, 5vw, 56px) clamp(28px, 5vw, 64px);
  background: linear-gradient(120deg, rgba(77,242,255,.08), rgba(139,123,255,.05));
  border: 1px solid rgba(77,242,255,.22);
}
.takeaway-mark {
  position: absolute; top: clamp(4px, 1vw, 12px); left: clamp(18px, 3vw, 32px);
  font-family: var(--f-serif); font-size: 7rem; line-height: 1; color: rgba(77,242,255,.16); pointer-events: none;
}
.takeaway p { position: relative; font-family: var(--f-serif); font-size: clamp(1.3rem, 2.6vw, 2rem); line-height: 1.35; color: var(--ink); }
.takeaway strong { color: var(--cyan); font-weight: inherit; }

/* ─────────── Footer addition ─────────── */
.footer-sub { margin-top: 16px; font-size: .9rem; line-height: 1.6; color: var(--ink-faint); max-width: 520px; }
.footer-desc em { font-style: italic; }

/* ─────────── Responsive ─────────── */
@media (max-width: 1024px) {
  .spec-grid { grid-template-columns: repeat(2, 1fr); }
  .limit-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .spec-grid { grid-template-columns: 1fr; }
  .bar-chart { padding-right: 0; }
  .bar-row { grid-template-columns: 1fr; gap: 8px; }
  .bar-track { height: 28px; }
  .bar-pct, .ablation-bar span { left: auto; right: 10px; transform: translateY(-50%); }
  .bar .bar-pct { color: #04060f; font-weight: 600; }
  .zero-bar .bar-pct, .baseline-bar .bar-pct { left: calc(100% + 10px); right: auto; color: var(--ink); font-weight: 400; }
  .takeaway-mark { font-size: 4.5rem; }
  .data-table { font-size: .86rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   FRAMING PASS — "how to read this" box, headline delta strip,
   and risk-field-vs-no-risk-field bar groups.
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────── "How to read these charts" ─────────── */
.readbox {
  margin-bottom: 26px; padding: clamp(24px, 3.4vw, 34px);
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(61,255,162,.09), rgba(77,242,255,.04));
  border: 1px solid rgba(61,255,162,.26);
}
.readbox-head {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: #9dffd2; margin-bottom: 14px;
}
.readbox p { color: var(--ink-dim); font-size: 1.02rem; line-height: 1.68; }
.readbox p + p { margin-top: 12px; }
.readbox strong { color: var(--ink); font-weight: 600; }

/* ─────────── Headline delta strip ─────────── */
.headline-chart { margin-bottom: 4px; }
.delta-strip {
  margin-top: 26px; padding: 16px 22px; border-radius: 14px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 18px;
  background: rgba(61,255,162,.07); border: 1px solid rgba(61,255,162,.26);
}
.delta-val { font-family: var(--f-display); font-weight: 700; font-size: 1.55rem; letter-spacing: -.02em; color: var(--green); }
.delta-meta { font-family: var(--f-mono); font-size: 12px; color: var(--ink-dim); }
.delta-tag {
  margin-left: auto; padding: 5px 12px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: #04120b; background: var(--green); font-weight: 600;
}
.chart-note-good { background: rgba(61,255,162,.06); border-left-color: var(--green); }
.chart-note-good strong { color: var(--green); }

/* ─────────── Bar groups ─────────── */
.bar-group + .bar-group { margin-top: 38px; padding-top: 34px; border-top: 1px solid var(--line); }
.bar-group { margin-top: 26px; }
.group-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .15em; text-transform: uppercase;
}
.group-head .group-rule { width: 26px; height: 2px; border-radius: 2px; flex: none; }
.group-head.good { color: #9dffd2; }
.group-head.good .group-rule { background: var(--green); box-shadow: 0 0 10px var(--green); }
.group-head.bad { color: #ff9aa5; }
.group-head.bad .group-rule { background: var(--red); box-shadow: 0 0 10px var(--red); }
.group-note {
  margin-top: 20px; padding-left: 16px; border-left: 2px solid var(--line-strong);
  font-size: .92rem; line-height: 1.62; color: var(--ink-faint);
}
.group-note strong { color: var(--ink-dim); font-weight: 600; }

@media (max-width: 760px) {
  .delta-strip { flex-direction: column; align-items: flex-start; }
  .delta-tag { margin-left: 0; }
}

/* Neutral measurement chip (replaces the former pass/fail verdict on the
   arbitration card after the diagnosis section was removed). */
.analogy-verdict.neutral {
  color: var(--ink-dim); background: rgba(255,255,255,.05);
  border: 1px solid var(--line-strong);
}

/* ═══════════════════════════════════════════════════════════════════
   REDESIGN PASS — risk-field-first narrative.
   Hero result card, problem grid, method pipeline + equations,
   soft-vs-hard panel, and the live side-by-side grid comparison.
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────── Hero result card (replaces the old fake telemetry HUD) ─────────── */
.hero-result {
  position: absolute; right: clamp(16px, 4vw, 54px); bottom: clamp(90px, 12vh, 150px);
  width: min(380px, calc(100vw - 32px)); padding: 22px 24px; border-radius: 20px; z-index: 3;
}
.hr-head {
  display: flex; align-items: center; gap: 9px; padding-bottom: 14px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint);
}
.hr-rows { display: flex; flex-direction: column; gap: 12px; }
.hr-row { display: grid; grid-template-columns: 94px 1fr 44px; align-items: center; gap: 11px; }
.hr-label { font-size: .8rem; color: var(--ink-faint); }
.hr-row.is-win .hr-label { color: var(--ink); font-weight: 600; }
.hr-track { height: 9px; border-radius: 5px; background: rgba(255,255,255,.07); overflow: hidden; }
.hr-fill { display: block; height: 100%; border-radius: 5px; }
.hr-fill.hr-plain { background: linear-gradient(90deg, #6b4a2a, #b87a3c); }
.hr-fill.hr-pred { background: linear-gradient(90deg, #14b98a, var(--green)); box-shadow: 0 0 16px rgba(61,255,162,.5); }
.hr-val { font-family: var(--f-mono); font-size: .92rem; text-align: right; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.hr-row.is-win .hr-val { color: var(--green); font-weight: 500; }
.hr-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.hr-delta { font-family: var(--f-display); font-weight: 700; font-size: 1.32rem; letter-spacing: -.02em; color: var(--green); }
.hr-meta { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-faint); }
.hr-note { margin-top: 12px; font-size: .74rem; line-height: 1.5; color: var(--ink-faint); }

@media (max-width: 1100px) {
  .hero-result { position: static; width: auto; margin: 34px auto 0; max-width: 560px; }
}

/* ─────────── Shared canvas frame for the grid scenes ─────────── */
.grid-frame {
  position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden;
  background: #070912; border: 1px solid var(--line);
}
.grid-frame canvas { display: block; width: 100%; height: 100%; }

/* ─────────── 01 Problem ─────────── */
.problem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.problem-viz { display: flex; flex-direction: column; }
.mini-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 14px; padding: 11px 15px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.mini-state { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--ink-dim); }
.mini-state.bad { color: #ff9aa5; }
.mini-state.good { color: #9dffd2; }
.mini-stat { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-faint); }
.mini-stat b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

.problem-copy { display: flex; flex-direction: column; gap: 4px; }
.why-item { display: flex; gap: 18px; padding: 20px 4px; border-bottom: 1px solid var(--line); }
.why-item:last-child { border-bottom: none; }
.why-num {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 11px; color: var(--ink-faint);
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.why-item h3 { font-family: var(--f-display); font-size: 1.08rem; font-weight: 600; letter-spacing: -.01em; }
.why-item p { margin-top: 7px; font-size: .95rem; line-height: 1.62; color: var(--ink-faint); }
.why-item strong { color: var(--ink-dim); font-weight: 600; }

/* ─────────── 02 Method pipeline ─────────── */
.pipeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pipe-step { position: relative; padding: 28px 26px; border-radius: 20px; }
.pipe-num {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 16px;
  font-family: var(--f-mono); font-size: 12px; color: var(--cyan);
  background: rgba(77,242,255,.09); border: 1px solid rgba(77,242,255,.3);
}
.pipe-step h3 { font-family: var(--f-display); font-size: 1.2rem; font-weight: 600; letter-spacing: -.015em; }
.pipe-step p { margin-top: 10px; font-size: .94rem; line-height: 1.62; color: var(--ink-faint); }
.pipe-step strong { color: var(--cyan); font-weight: 600; }

.eq-block { margin-top: 24px; padding: clamp(26px, 4vw, 40px); border-radius: var(--radius); }
.eq-row { display: flex; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.eq-row:last-of-type { border-bottom: none; }
.eq-tag {
  flex: none; padding: 4px 10px; border-radius: 7px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); background: rgba(255,255,255,.05); border: 1px solid var(--line);
}
.eq { font-family: var(--f-mono); font-size: clamp(.82rem, 1.5vw, 1rem); color: var(--ink-dim); line-height: 1.7; }
.eq-row.eq-key .eq { color: var(--cyan); }
.eq-row.eq-key .eq-tag { color: var(--cyan); border-color: rgba(77,242,255,.3); background: rgba(77,242,255,.08); }
.eq-block .params { margin-top: 24px; padding-top: 0; }

/* ─────────── Soft vs hard constraint panel ─────────── */
.soft-hard { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 4px 0 18px; }
.sh-case { padding: 20px 20px 18px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.sh-head { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 12px; }
.sh-case p { font-size: .9rem; line-height: 1.58; color: var(--ink-faint); }
.sh-out { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .86rem; color: var(--ink-dim); }
.sh-out b { font-family: var(--f-mono); font-size: .9em; }
.sh-bad { border-color: rgba(255,77,94,.26); } .sh-bad .sh-head { color: #ff9aa5; } .sh-bad .sh-out b { color: var(--red); }
.sh-good { border-color: rgba(61,255,162,.26); background: rgba(61,255,162,.05); }
.sh-good .sh-head { color: #9dffd2; } .sh-good .sh-out b { color: var(--green); }

/* ─────────── 03 Side-by-side comparison ─────────── */
.cmp-wrap { padding: clamp(22px, 3.4vw, 38px); border-radius: var(--radius); }
.cmp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px; }
.cmp-btn {
  padding: 9px 18px; border-radius: 10px; cursor: pointer;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .06em;
  color: var(--ink-dim); background: rgba(255,255,255,.05); border: 1px solid var(--line-strong);
  transition: color .2s, background .2s, border-color .2s;
}
.cmp-btn:hover { color: var(--ink); background: rgba(255,255,255,.09); border-color: var(--cyan); }
.cmp-btn.is-off { color: var(--amber); border-color: rgba(255,194,77,.45); background: rgba(255,194,77,.08); }
.cmp-hint { margin-left: auto; font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-faint); }

.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.cmp-panel { padding: 18px; border-radius: 18px; background: rgba(255,255,255,.028); border: 1px solid var(--line); }
.cmp-panel.is-win { border-color: rgba(61,255,162,.3); background: rgba(61,255,162,.04); }
.cmp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cmp-title { font-family: var(--f-display); font-weight: 600; font-size: 1.02rem; letter-spacing: -.01em; }
.cmp-title.plain { color: #d9a46a; }
.cmp-title.pred { color: var(--green); }
.cmp-state {
  padding: 4px 11px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); background: rgba(255,255,255,.05); border: 1px solid var(--line);
}
.cmp-state.bad { color: #ff9aa5; border-color: rgba(255,77,94,.4); background: rgba(255,77,94,.1); }
.cmp-state.good { color: #9dffd2; border-color: rgba(61,255,162,.4); background: rgba(61,255,162,.1); }
.cmp-metrics { display: flex; gap: 10px; margin-top: 14px; }
.cmp-metric {
  flex: 1; padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px;
}
.cmp-metric span { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.cmp-metric b { font-family: var(--f-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cmp-panel .cmp-metric b { color: #e3b887; }
.cmp-panel.is-win .cmp-metric b { color: var(--green); }
.cmp-bar { height: 5px; border-radius: 3px; margin-top: 12px; background: rgba(255,255,255,.06); overflow: hidden; }
.cmp-fill { display: block; height: 100%; border-radius: 3px; transition: width .4s ease; }
.cmp-fill.plain { background: linear-gradient(90deg, #6b4a2a, #c9823f); }
.cmp-fill.pred { background: linear-gradient(90deg, #14b98a, var(--green)); }
.cmp-leg { margin-top: 12px; font-size: .78rem; line-height: 1.5; color: var(--ink-faint); }
.cmp-disclaimer {
  margin-top: 24px; padding: 18px 22px; border-radius: 14px;
  font-size: .9rem; line-height: 1.65; color: var(--ink-faint);
  background: rgba(139,123,255,.07); border-left: 3px solid var(--violet);
}
.cmp-disclaimer b, .cmp-disclaimer strong { color: var(--ink-dim); font-weight: 600; }

/* ─────────── Results metric table ─────────── */
.metric-table td.good { color: var(--green); font-weight: 600; }
.metric-table td.flat { color: var(--ink-faint); }
.data-table .cell-sub { display: block; margin-top: 3px; font-size: .8em; font-style: normal; color: var(--ink-faint); }
.data-table td.good { color: var(--green); }
.data-table td.flat { color: var(--ink-faint); }

/* ─────────── Responsive ─────────── */
@media (max-width: 1024px) {
  .problem-grid, .cmp-grid, .soft-hard { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: 1fr; }
  .cmp-hint { margin-left: 0; width: 100%; }
}
@media (max-width: 760px) {
  .hr-row { grid-template-columns: 78px 1fr 40px; gap: 8px; }
  .eq-row { gap: 10px; }
  .eq { font-size: .76rem; }
  .why-item { gap: 13px; padding: 16px 0; }
  .cmp-metric b { font-size: 1.25rem; }
}
