@font-face { font-family: "Geist"; src: url("/vendor/geist-sans.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/vendor/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #09090b; --surface: #0f0f12; --surface-2: #16161b; --surface-3: #1d1d23;
  --line: #222229; --line-2: #2f2f38; --ink: #fafafa; --muted: #a1a1aa; --dim: #8b8b96;
  --accent: #8c8dff; --accent-ink: #0a0a1f; --accent-soft: #1b1b38;
  --ok: #4ade80; --bad: #ff6b5f; --warn: #fbbf24; --ok-soft: #10261a; --bad-soft: #2c1210; --warn-soft: #2a2010;
  --signal-on: #8c8dff; --signal-off: #2b2b35; --map-hit: #ff6b5f; --map-miss: #15151a;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 16px; --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); font-feature-settings: "ss01", "cv11"; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
[hidden] { display: none !important; }
a { color: var(--ink); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
code, pre, kbd { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 28px; }
h1, h2, h3 { letter-spacing: -.035em; font-weight: 640; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.05; }
section { position: relative; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 40; background: rgba(9, 9, 11, .72); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav-bar { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 680; font-size: 18px; letter-spacing: -.035em; text-decoration: none; color: var(--ink); }
/* Logo: a NAND gate, the TapeOut primitive, holding a check; the output bubble is the pin. */
.logo { width: 28px; height: 28px; flex: none; overflow: visible; }
.logo .bubble { fill: var(--accent); filter: drop-shadow(0 0 4px var(--accent)); animation: bubble 3.2s ease-in-out infinite; transform-origin: 28.6px 16px; }
.logo .tick { stroke-dasharray: 1; stroke-dashoffset: 0; }
a.brand:hover .logo .tick { animation: draw .6s var(--ease); }
@keyframes bubble { 50% { transform: scale(.8); } }
@keyframes draw { from { stroke-dashoffset: 1; } }
.nav nav { display: flex; gap: 4px; margin-left: auto; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; padding: 8px 12px; border-radius: 8px; transition: color .2s, background .2s; }
.nav nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav nav a[aria-current="page"] { color: var(--ink); }

/* ---------- buttons ---------- */
.button, button { font: inherit; font-weight: 560; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); text-decoration: none;
  transition: transform .2s var(--ease), background .2s, border-color .2s, color .2s; }
.button:hover, button:hover { border-color: var(--muted); }
.button:active, button:active { transform: translateY(1px) scale(.99); }
.button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.button.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.ghost { background: transparent; }
.button.small { min-height: 36px; padding: 6px 13px; font-size: 14px; border-radius: 9px; }
button:disabled { opacity: .45; cursor: progress; }
.icon-button { min-height: 32px; width: 32px; padding: 0; border-radius: 8px; background: transparent; border-color: transparent; color: var(--muted); }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.icon-button:hover { color: var(--ink); background: var(--surface-3); border-color: transparent; }
.icon-button.copied { color: var(--ok); }

/* ---------- hero ---------- */
.hero { padding: 56px 0 72px; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M48 0H0v48' fill='none' stroke='%23ffffff' stroke-opacity='.045'/%3E%3C/svg%3E"); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; min-height: min(760px, calc(100svh - 64px)); }
.hero h1 { font-size: clamp(2.6rem, 4.6vw, 4.25rem); line-height: 1; letter-spacing: -.05em; font-weight: 660; }
.split .word { display: inline-block; }
.js .split .word { opacity: 0; transform: translateY(.45em); filter: blur(6px); animation: rise .9s var(--ease) forwards; animation-delay: calc(var(--i) * 55ms + 80ms); }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }
.lede { color: var(--muted); font-size: clamp(1.05rem, 1.4vw, 1.2rem); max-width: 30em; margin: 24px 0 32px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.install-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 28px; padding: 4px 4px 4px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-width: 100%; }
.install-pill code { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stage { position: relative; margin: 0; height: min(620px, 72svh); min-height: 440px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); overflow: hidden; touch-action: pan-y; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; opacity: 0; transition: opacity 1.2s var(--ease); }
.stage[data-ready="true"] canvas { opacity: 1; }
.stage[data-dragging] canvas { cursor: grabbing; }
.pin, .out { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; display: inline-flex; align-items: center; gap: 8px; font: 500 13px var(--mono);
  padding: 6px 10px; min-height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(15, 15, 18, .86); color: var(--ink); white-space: nowrap; opacity: 0; transition: opacity .6s .3s, background .25s, border-color .25s, color .25s; }
.stage[data-ready="true"] .pin, .stage[data-ready="true"] .out { opacity: 1; }
.pin { cursor: pointer; transform: translate(-115%, -50%); }
.pin span, .out span { color: var(--dim); }
.pin b, .out b { font-weight: 600; }
.pin[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pin[aria-pressed="true"] span { color: var(--accent-ink); opacity: .7; }
.pin:hover { border-color: var(--accent); }
.pin:active { transform: translate(-115%, -50%) scale(.96); }  /* keep the positioning transform while pressed */
.out { transform: translate(18%, -50%); pointer-events: none; }
.stage[data-differs="true"] .out[data-out="1"] { border-color: var(--bad); color: var(--bad); box-shadow: 0 0 24px rgba(255, 107, 95, .25); }
.stage-bar { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 3; display: flex; align-items: center; gap: 16px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(9, 9, 11, .8); font: 13px var(--mono); color: var(--muted); }
.stage-bar a { color: var(--ink); text-decoration: none; }
.stage-bar b { color: var(--ink); font-weight: 600; }
.verdict { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--ok); }
.verdict i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; animation: pulse 1.6s infinite; }
.stage[data-differs="true"] .verdict { color: var(--bad); }
.stage[data-differs="true"] .when-match, .stage[data-differs="false"] .when-differ { display: none; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- proof ---------- */
.proof { padding-top: 120px; padding-bottom: 40px; }
.proof h2 { max-width: 14em; margin-bottom: 48px; }
.proof-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.pr, .terminal { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.pr header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.pr header a { font-weight: 600; text-decoration: none; }
.pr header .num { color: var(--dim); font-weight: 400; }
.pr-state { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 13px; font-weight: 600; }
.pr-state svg, .merge-blocked svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.diff { margin: 0; padding: 16px 20px; font-size: 13px; line-height: 1.75; border-bottom: 1px solid var(--line); overflow-x: auto; }
.diff .file { color: var(--dim); }
.del { color: var(--bad); } .add { color: var(--ok); }
.checks { list-style: none; margin: 0; padding: 8px 12px; }
.checks li { display: flex; align-items: center; gap: 10px; padding: 8px 8px; font-size: 14.5px; border-radius: 8px; }
.checks li a { margin-left: auto; font-size: 13.5px; color: var(--muted); }
.checks i { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.checks [data-status="pass"] i { background: var(--ok); }
.checks [data-status="pass"] i::after { content: ""; width: 6px; height: 3px; border: solid var(--bg); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.checks [data-status="fail"] i { background: var(--bad); }
.checks [data-status="fail"] i::after { content: "✕"; color: var(--bg); font-size: 9px; font-weight: 900; }
.req { font-size: 12px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 8px; }
.merge-blocked { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--bad); font-weight: 600; font-size: 14.5px; }

.terminal { background: #060608; display: flex; flex-direction: column; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--line); font: 12.5px var(--mono); color: var(--dim); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.term-bar span { margin-left: 10px; }
.term-lines { list-style: none; margin: 0; padding: 18px 20px 22px; font: 13.5px/1.9 var(--mono); color: var(--muted); counter-reset: line; }
.term-lines li { counter-increment: line; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-lines li::before { content: counter(line); display: inline-block; width: 2em; color: var(--line-2); }
.js .term-lines li { opacity: 0; transform: translateX(-6px); transition: opacity .35s, transform .35s var(--ease); }
.js .term-lines li.on { opacity: 1; transform: none; }
.term-lines .dim { color: var(--dim); }
.term-lines .hl { color: var(--ink); }
.term-lines .err { color: var(--bad); font-weight: 600; }

.evidence-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 20px 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.evidence-row > div { padding: 22px 24px; border-right: 1px solid var(--line); min-width: 0; }
.evidence-row > div:last-child { border-right: 0; }
.evidence-row dt { font-size: 13px; color: var(--dim); }
.evidence-row dd { margin: 6px 0 0; font: 600 clamp(1.5rem, 3vw, 2.3rem)/1.1 var(--mono); letter-spacing: -.03em; overflow-wrap: anywhere; }
.evidence-row dd.changed { color: var(--bad); }
.evidence-row dd.plain { color: var(--ok); }

/* ---------- facts ---------- */
.facts { padding-top: 100px; padding-bottom: 100px; }
.facts dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts dl > div { padding: 32px 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column-reverse; gap: 8px; }
.facts dl > div:last-child { border-right: 0; }
.facts dd { margin: 0; font: 600 clamp(2rem, 3.6vw, 3rem)/1 var(--mono); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.facts dt { color: var(--muted); font-size: 14.5px; }

/* ---------- story ---------- */
.story { padding-top: 40px; padding-bottom: 80px; }
.story h2 { margin-bottom: 24px; }
.story-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; }
.story-steps { list-style: none; margin: 0; padding: 0; }
.story-steps li { min-height: 52vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 0; cursor: pointer; color: var(--dim); transition: color .5s var(--ease); }
.story-steps .n { font: 13px var(--mono); color: var(--dim); transition: color .5s; }
.story-steps h3 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin: 6px 0 8px; transition: transform .6s var(--ease); transform-origin: left center; }
.story-steps p { margin: 0; font-size: 1.1rem; max-width: 22em; }
.story-steps li.active { color: var(--ink); }
.story-steps li.active .n { color: var(--accent); }
.story-steps li.active p { color: var(--muted); }
.story-steps li:not(.active) h3 { transform: scale(.94); }
.story-visual { position: sticky; top: calc(50vh - 220px); height: 440px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); overflow: hidden; }
.panel { position: absolute; inset: 0; display: grid; place-items: center; padding: 32px; opacity: 0; transform: scale(.97) translateY(10px); transition: opacity .6s var(--ease), transform .6s var(--ease); pointer-events: none; }
.panel.active { opacity: 1; transform: none; }
.code { margin: 0; font-size: 15px; line-height: 1.8; color: var(--muted); }
.code .k { color: var(--ink); } .code .s { color: var(--accent); } .code .n { color: var(--warn); } .code .t { color: var(--dim); }
.truth { border-collapse: collapse; font: 15px var(--mono); min-width: 300px; }
.truth th { color: var(--dim); font-weight: 500; text-align: left; padding: 10px 24px 10px 0; border-bottom: 1px solid var(--line); }
.truth td { padding: 12px 24px 12px 0; border-bottom: 1px solid var(--line); }
.truth tr.diff td:last-child { color: var(--bad); font-weight: 700; }
.truth tr.diff td:first-child::after { content: " ●"; color: var(--bad); font-size: 10px; vertical-align: middle; }
.panel.active .truth tbody tr { animation: rowin .5s var(--ease) both; animation-delay: calc(var(--i) * 120ms + 150ms); }
@keyframes rowin { from { opacity: 0; transform: translateX(-10px); } }
.replay { display: grid; gap: 14px; width: min(100%, 380px); }
.chip-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2); }
.chip-card span { color: var(--muted); font-size: 14px; }
.chip-card code { grid-column: 1; color: var(--dim); font-size: 13px; }
.chip-card b { grid-row: 1 / 3; grid-column: 2; font: 600 1.8rem var(--mono); color: var(--ok); }
.chip-card.bad b { color: var(--bad); }
.panel.active .chip-card { animation: rowin .6s var(--ease) both; }
.panel.active .chip-card.bad { animation-delay: .15s; }
.confirm { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; color: var(--ok); font-size: 14.5px; }
.confirm i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 1.6s infinite; }
.checks.big { width: min(100%, 380px); border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2); padding: 10px; }
.checks.big li { font-size: 16px; padding: 12px; }
.panel[data-panel="3"] { align-content: center; gap: 16px; }
.merge { display: block; width: min(100%, 380px); text-align: center; padding: 13px; border-radius: 12px; border: 1px solid var(--bad); color: var(--bad); font-weight: 600; }

/* ---------- input space ---------- */
.space { padding-top: 120px; padding-bottom: 120px; border-top: 1px solid var(--line); }
.space-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: 40px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 12.5px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; margin: 0; }
.tag.live { color: var(--accent); border-color: var(--accent); }
.space-grid { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.map { position: relative; border: 1px solid var(--line); border-radius: 18px; background: var(--map-miss); overflow: hidden; aspect-ratio: 1; }
.map canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: crosshair; }
.map canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.probe { position: absolute; left: var(--x); top: var(--y); transform: translate(12px, 12px); pointer-events: none; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(9, 9, 11, .92); font: 12.5px var(--mono); color: var(--muted); white-space: nowrap; }
.probe b { color: var(--ink); font-weight: 600; }
.probe[data-side="left"] { transform: translate(calc(-100% - 12px), 12px); }
.probe[data-vside="up"] { transform: translate(12px, calc(-100% - 12px)); }
.probe[data-side="left"][data-vside="up"] { transform: translate(calc(-100% - 12px), calc(-100% - 12px)); }
.probe[data-differs="true"] { border-color: var(--bad); }
.probe[data-differs="true"] span:last-child b { color: var(--bad); }
.space-stats { margin: 0; display: grid; grid-auto-rows: 1fr; gap: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.space-stats > div { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.space-stats > div:last-child { border-bottom: 0; }
.space-stats dt { font-size: 13px; color: var(--dim); }
.space-stats > div { display: flex; flex-direction: column; justify-content: center; }
.space-stats dd { margin: 4px 0 0; font: 600 clamp(1.4rem, 2.6vw, 2.1rem)/1.15 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.space-stats dd.bad { color: var(--bad); }
[data-space][data-verified="true"] [data-stat="verified"] { color: var(--ok); }
[data-space][data-engine="WebGPU"] [data-stat="engine"] { color: var(--accent); }

/* ---------- workbench ---------- */
.workbench { padding-top: 120px; padding-bottom: 120px; border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.chip { min-height: 36px; padding: 6px 14px; border-radius: 9px; font-size: 14px; border-color: transparent; background: transparent; color: var(--muted); }
.chip:hover { color: var(--ink); border-color: transparent; background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); border-color: var(--line-2); }

.command { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 150px auto; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 16px; }
.command .arrow { color: var(--dim); padding-bottom: 12px; font-size: 18px; }
.command .error { grid-column: 1 / -1; margin: 0; }
.field label { display: block; font-size: 12.5px; color: var(--dim); margin: 0 0 6px 2px; }
input:not([type=file]) { width: 100%; font: 14px var(--mono); padding: 11px 12px; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; transition: border-color .2s, box-shadow .2s; }
input:not([type=file])::placeholder { color: var(--dim); }
input:not([type=file]):focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid="true"] { border-color: var(--bad) !important; }
.error { color: var(--bad); font-size: 14px; font-weight: 500; margin: 6px 0 0; }

.notice { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; background: var(--surface); }
.notice.warn { border-color: var(--warn); background: var(--warn-soft); }
.notice p { margin: 4px 0; }
.loading-line { display: flex; align-items: center; gap: 12px; font: 14px var(--mono); color: var(--muted); }
.elapsed { margin-left: auto; color: var(--dim); }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dropzone { position: relative; border-radius: 20px; transition: outline-color .2s; outline: 2px dashed transparent; outline-offset: 6px; }
.dropzone.dragging { outline-color: var(--accent); }
.report { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; transition: opacity .3s; }
.report.loading { opacity: .55; }
.report.enter { animation: enter .55s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.report .empty { padding: 32px; margin: 0; color: var(--muted); }
.report-head { padding: 24px 28px 20px; }
.source { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 16px; font-size: 13.5px; color: var(--dim); }
.source a { color: var(--muted); }
.decision { display: flex; align-items: center; gap: 12px; font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -.04em; line-height: 1.1; }
.decision:focus { outline: none; }
.decision:focus-visible { outline: 2px solid var(--accent); }
.glyph { display: inline-grid; place-items: center; width: 1.15em; height: 1.15em; border-radius: 10px; font-size: .75em; font-weight: 800; }
.decision[data-status="compatible"] { color: var(--ok); } .decision[data-status="compatible"] .glyph { background: var(--ok-soft); }
.decision[data-status="behavior-changed"] { color: var(--bad); } .decision[data-status="behavior-changed"] .glyph { background: var(--bad-soft); }
.decision[data-status="interface-mismatch"] { color: var(--warn); } .decision[data-status="interface-mismatch"] .glyph { background: var(--warn-soft); }
.decision[data-status="inconclusive"] { color: var(--ink); } .decision[data-status="inconclusive"] .glyph { background: var(--surface-3); }
.headline { margin: 10px 0 0; font-size: 1.12rem; font-weight: 500; }
.pair { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 0; color: var(--dim); font-size: 13.5px; overflow-wrap: anywhere; }

.led-block { display: grid; gap: 12px; padding: 22px 28px; border-top: 1px solid var(--line); background: #0b0b0e; }
.led-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.led-name { font: 13px var(--mono); color: var(--dim); }
.leds { display: flex; flex-wrap: wrap; gap: 6px; }
.leds i { width: 14px; height: 14px; border-radius: 50%; background: var(--signal-off); transition: background .3s, box-shadow .3s; }
.leds i.on { background: var(--signal-on); box-shadow: 0 0 10px rgba(140, 141, 255, .7); }
.leds i.changed { outline: 2px solid var(--bad); outline-offset: 2px; }
.leds i.changed.on { background: var(--bad); box-shadow: 0 0 10px rgba(255, 107, 95, .7); }
.leds em { font: 12px var(--mono); color: var(--dim); font-style: normal; align-self: center; }
.report.enter .leds i { animation: led .5s var(--ease) both; }
.report.enter .led-row:nth-child(2) .leds i { animation-delay: .12s; }
.report.enter .led-row:nth-child(3) .leds i { animation-delay: .24s; }
@keyframes led { from { opacity: 0; transform: scale(.4); } }
.led-hex { font-size: 15px; font-weight: 600; }
.led-hex.changed { color: var(--bad); }
.iface { display: flex; flex-wrap: wrap; gap: 32px; padding: 22px 28px; border-top: 1px solid var(--line); background: #0b0b0e; }
.iface div { display: flex; align-items: baseline; gap: 10px; }
.iface span:first-child { color: var(--dim); font-size: 13.5px; margin-right: 6px; }
.iface b { font: 600 1.5rem var(--mono); }
.iface b.changed { color: var(--warn); }

.statuses { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 28px; border-top: 1px solid var(--line); }
.pill { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 12px; font-size: 14px; color: var(--muted); max-width: 100%; }
.pill .k { color: var(--dim); font: 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.pill strong { color: var(--ink); font-weight: 600; }
.pill.ok strong { color: var(--ok); } .pill.bad strong { color: var(--bad); }
.pill .d::before { content: "·"; margin-right: 10px; color: var(--line-2); }
.next { margin: 0; padding: 0 28px 4px; color: var(--muted); font-size: 15px; }
.next b { color: var(--ink); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 28px 22px; }
.details { border-top: 1px solid var(--line); }
.rtabs { display: flex; gap: 4px; padding: 10px 20px 0; border-bottom: 1px solid var(--line); }
.rtabs button { min-height: 40px; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--dim); padding: 8px 10px; font-size: 14px; }
.rtabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.rtabs button:hover { color: var(--ink); }
.rpanel { padding: 20px 28px 26px; }
.rpanel:focus-visible { outline-offset: -2px; }
dl.evidence { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 20px; margin: 0; font-size: 14px; }
dl.evidence dt { color: var(--dim); }
dl.evidence dd { margin: 0; overflow-wrap: anywhere; color: var(--muted); }
dl.evidence code { color: var(--ink); }
.json { margin: 0; max-height: 420px; overflow: auto; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.bit-tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
caption { text-align: left; font: 600 13.5px var(--mono); padding-bottom: 8px; }
th, td { text-align: left; padding: 5px 12px 5px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th { color: var(--dim); font-weight: 500; }
td { font-family: var(--mono); }
tr.changed td { color: var(--bad); font-weight: 700; }
.open-file { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 14px; cursor: pointer; min-height: 44px; }
.open-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.open-file span { border-bottom: 1px dashed var(--line-2); }
.open-file:hover span { color: var(--ink); border-color: var(--ink); }
.open-file:focus-within span { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* ---------- install ---------- */
.install { padding-top: 120px; padding-bottom: 120px; border-top: 1px solid var(--line); }
.install h2 { margin-bottom: 40px; }
.install-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); grid-template-rows: auto 1fr; gap: 0 40px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px; border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; background: var(--surface); }
.tabs button { flex: none; min-height: 36px; padding: 6px 12px; border-radius: 10px; border: 0; background: none; font: 13px var(--mono); color: var(--dim); }
.tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--ink); }
.files { grid-column: 1; border: 1px solid var(--line); border-radius: 0 0 16px 16px; background: #060608; min-height: 330px; }
.file-panel { position: relative; }
.file-panel pre { margin: 0; padding: 22px 24px; padding-right: 92px; overflow-x: auto; font-size: 13.5px; line-height: 1.75; color: var(--ink); }
.file-panel .button { position: absolute; top: 14px; right: 14px; }
.install-steps { grid-column: 2; grid-row: 1 / 3; list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 22px; align-content: start; }
.install-steps li { counter-increment: s; display: flex; align-items: flex-start; gap: 14px; color: var(--muted); font-size: 15.5px; }
.install-steps li::before { content: counter(s); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-2); font: 13px var(--mono); color: var(--ink); }
.install-steps b { color: var(--ink); font-weight: 600; }
.install-steps code { color: var(--ink); }

/* ---------- scope ---------- */
.scope { padding-top: 120px; padding-bottom: 120px; border-top: 1px solid var(--line); }
.scope h2 { margin-bottom: 40px; }
.scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.scope ul { list-style: none; margin: 0; padding: 12px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.scope li { display: flex; gap: 14px; align-items: baseline; padding: 16px 0; font-size: 1.08rem; border-bottom: 1px solid var(--line); }
.scope li:last-child { border-bottom: 0; }
.scope li::before { font: 700 14px var(--mono); flex: none; width: 18px; }
.scope .yes li::before { content: "✓"; color: var(--ok); }
.scope .no li { color: var(--muted); }
.scope .no li::before { content: "✕"; color: var(--dim); }

/* ---------- final + footer ---------- */
.final { padding-top: 140px; padding-bottom: 140px; border-top: 1px solid var(--line); text-align: center; }
.final h2 { font-size: clamp(2.4rem, 5.6vw, 4.6rem); max-width: 12em; margin: 0 auto 36px; letter-spacing: -.05em; }
.final .cta { justify-content: center; }
.footer { border-top: 1px solid var(--line); }
.footer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-top: 28px; padding-bottom: 40px; color: var(--dim); font-size: 14px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer nav a { color: var(--muted); text-decoration: none; }
.footer nav a:hover { color: var(--ink); }
.footer p { margin: 0 0 0 auto; }
.footer p a { color: var(--muted); }
.brand.small { font-size: 14px; color: var(--muted); font-weight: 500; }
.brand.small .logo { width: 20px; height: 20px; }
.brand.small .logo .bubble { animation: none; }

/* ---------- 404 ---------- */
.notfound { border-top: 0; min-height: 60svh; }
.notfound h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); letter-spacing: -.05em; margin-bottom: 16px; }
.notfound p { color: var(--muted); margin: 0 0 32px; }

/* ---------- docs ---------- */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 56px; padding-top: 56px; padding-bottom: 96px; }
.docs nav.toc { position: sticky; top: 88px; align-self: start; display: block; font-size: 14px; }
.docs nav.toc p { margin: 0 0 10px; color: var(--dim); font: 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.docs nav.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.docs nav.toc a { display: block; padding: 5px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); text-decoration: none; }
.docs nav.toc a:hover { color: var(--ink); border-left-color: var(--ink); }
.prose { max-width: 48em; min-width: 0; }
.prose h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); letter-spacing: -.045em; line-height: 1.02; margin-bottom: 20px; }
.prose > p:first-of-type { color: var(--muted); font-size: 1.15rem; }
.prose h2 { margin: 2.4em 0 .6em; padding-top: 1.2em; border-top: 1px solid var(--line); font-size: 1.7rem; letter-spacing: -.03em; }
.prose h3 { margin: 1.8em 0 .5em; font-size: 1.15rem; letter-spacing: -.02em; }
.prose p, .prose li { color: #d4d4d8; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--ink); text-decoration-color: var(--accent); }
.prose strong { color: var(--ink); }
.prose :not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; font-size: .86em; }
.code-block, .prose .code { position: relative; margin: 18px 0; }
.prose .code pre { margin: 0; padding: 18px 20px; padding-right: 84px; background: #060608; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; font-size: 13.5px; line-height: 1.65; color: var(--ink); }
.prose .code .copy { position: absolute; top: 10px; right: 10px; min-height: 30px; padding: 4px 11px; font-size: 13px; }
.prose .table { margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; }
.prose table { font-size: 14.5px; }
.prose th, .prose td { padding: 10px 14px; vertical-align: top; }
.prose td { font-family: var(--sans); color: #d4d4d8; }
.prose td code { font-family: var(--mono); }
.prose tr:last-child td { border-bottom: 0; }
aside.note { border: 1px solid var(--accent-soft); border-left: 3px solid var(--accent); background: var(--surface); padding: 14px 18px; margin: 20px 0; border-radius: 0 12px 12px 0; }
aside.note p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; gap: 36px; }
  .stage { height: 520px; }
  .proof-grid { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .space-grid { grid-template-columns: minmax(0, 1fr); }
  .space-stats { grid-auto-rows: auto; }
  .space-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .space-stats > div { border-bottom: 0; border-right: 1px solid var(--line); padding: 14px; }
  .space-stats > div:last-child { border-right: 0; }
  .space-stats dd { font-size: 1.1rem; }
  .install-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .install-steps { grid-column: 1; grid-row: auto; }
  .command { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .command .block-field { grid-column: 1 / 3; }
  .command button[type=submit] { grid-column: 3; }
  .docs { grid-template-columns: 1fr; gap: 20px; }
  .docs nav.toc { position: static; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .nav nav a:not([href="/docs"]) { display: none; }
  .nav nav { gap: 0; }
  .nav-cta { padding: 6px 12px; }
  .nav-bar { gap: 12px; }
  .hero { padding: 28px 0 48px; }
  .hero h1 { font-size: 2.45rem; }
  .lede { margin: 18px 0 24px; }
  .cta .button { flex: 1 1 auto; }
  .install-pill { margin-top: 20px; }
  .install-pill code { font-size: 12.5px; }
  .stage { height: 440px; min-height: 0; border-radius: 18px; }
  .pin, .out { font-size: 12px; padding: 5px 8px; min-height: 32px; }
  .stage-bar { font-size: 12px; gap: 10px; left: 10px; right: 10px; bottom: 10px; }
  .stage-bar > span:nth-child(2) { display: none; }
  .proof, .space, .workbench, .install, .scope { padding-top: 80px; padding-bottom: 80px; }
  .proof h2 { margin-bottom: 28px; }
  .term-lines { font-size: 12px; padding: 14px; }
  .evidence-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evidence-row > div { padding: 16px; }
  .evidence-row > div:nth-child(2) { border-right: 0; }
  .evidence-row > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .facts { padding-top: 56px; padding-bottom: 56px; }
  .facts dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts dl > div { padding: 22px 14px; }
  .facts dl > div:nth-child(2) { border-right: 0; }
  .facts dl > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .facts dd { font-size: 1.7rem; }
  .story-grid { grid-template-columns: 1fr; gap: 0; }
  .story-visual { top: 72px; height: 300px; z-index: 2; order: -1; border-radius: 16px; }
  .story-steps li { min-height: 46vh; }
  .story-steps h3 { font-size: 1.9rem; }
  .panel { padding: 18px; }
  .code { font-size: 12.5px; }
  .truth { font-size: 13.5px; min-width: 0; }
  .truth td, .truth th { padding: 8px 16px 8px 0; }
  .space-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .space-stats > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .space-stats > div:nth-child(odd) { border-right: 1px solid var(--line); }
  .space-stats > div:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .examples { width: 100%; }
  .chip { flex: 1 1 auto; padding: 6px 8px; font-size: 13px; }
  .command { grid-template-columns: 1fr; }
  .command .arrow { display: none; }
  .command .block-field, .command button[type=submit] { grid-column: 1; }
  .report-head, .led-block, .iface, .statuses, .actions, .rpanel { padding-left: 16px; padding-right: 16px; }
  .next { padding-left: 16px; padding-right: 16px; }
  .rtabs { padding: 8px 8px 0; }
  .led-row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .led-name { grid-column: 1 / -1; }
  .leds i { width: 12px; height: 12px; }
  .actions .button { flex: 1 1 auto; }
  dl.evidence { grid-template-columns: 1fr; gap: 2px; }
  dl.evidence dd { margin-bottom: 10px; }
  .bit-tables { grid-template-columns: 1fr; }
  .scope-grid { grid-template-columns: 1fr; }
  .scope ul { padding: 4px 18px; }
  .final { padding-top: 96px; padding-bottom: 96px; }
  .final h2 { font-size: 2.3rem; }
  .footer p { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 1ms !important; transition-delay: 0s !important; }
  .js .split .word, .js [data-reveal], .js .term-lines li { opacity: 1; transform: none; filter: none; }
}
