/* EmbodiWeave landing. Subject: a robotics test lab. Engineering paper, graphite ink, one safety-orange accent. */
:root {
  --paper: #f4f2ec; --surface: #fbfaf7; --alt: #eceae2; --line: #d6d2c6; --ink: #1b2026; --muted: #555b62;
  --accent: #b93d0b; --robot: #ea580c; --ped: #2b4c7e; --obs: #8b9097; --goal: #2f6b2f;
  --ok: #2f6b2f; --bad: #b42318;
  --ease: cubic-bezier(.2, 0, 0, 1); --t-quick: 120ms; --t-std: 240ms; --t-reveal: 320ms; --t-hero: 500ms;
  --display: "Space Grotesk", "IBM Plex Sans", sans-serif; --text: "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font: 400 16px/1.6 var(--text); background-color: var(--paper);
  /* engineering paper: the one depth device */
  background-image: linear-gradient(var(--alt) 1px, transparent 1px), linear-gradient(90deg, var(--alt) 1px, transparent 1px);
  background-size: 24px 24px; }
a { color: var(--accent); text-underline-offset: 3px; }
.mono, code, .code { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px clamp(16px, 4vw, 48px); background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none;
  font: 700 18px/1 var(--display); min-height: 40px; }
.nav nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 14px; padding: 10px 10px; border-radius: 8px;
  transition: color var(--t-quick) var(--ease), background var(--t-quick) var(--ease); }
.nav nav a:not(.btn):hover { color: var(--ink); background: var(--alt); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink); font: 600 15px/1.2 var(--text);
  text-decoration: none; cursor: pointer; transition: transform var(--t-quick) var(--ease), background var(--t-quick) var(--ease); }
.btn:hover { background: #2c333b; }
.btn:active { transform: scale(.98); }
.btn .arrow { transition: transform var(--t-quick) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

main { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* hero */
.hero { min-height: min(calc(100svh - 61px), 860px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(32px, 6vw, 72px) 0; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font: 600 13px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
h1 { font: 700 clamp(2.4rem, 6vw, 4.4rem)/1.02 var(--display); letter-spacing: -.035em; margin: 0 0 22px; text-wrap: balance; }
h1 .hl { color: var(--accent); }
.lede { font-size: clamp(16px, 1.6vw, 18px); color: var(--muted); max-width: 600px; margin: 0 0 26px; }
.ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.live { display: inline-flex; gap: 10px; align-items: center; margin: 0; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); font-size: 14px; color: var(--muted); }
.live b { color: var(--ink); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--obs); flex: none; }
.dot.up { background: var(--ok); }
.dot.down { background: var(--bad); }

/* signature: two recorded episodes on the same seed */
.replay { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(12px, 2vw, 20px); }
.arenas { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 1.5vw, 16px); }
.arena-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.arena-head { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); min-height: 38px; }
.arena-head b { color: var(--ink); font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.arena-card svg { width: 100%; aspect-ratio: 1; display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.arena-foot { font: 600 13px/1.3 var(--mono); min-height: 18px; }
.arena-foot.bad { color: var(--bad); }
.arena-foot.ok { color: var(--ok); }
.replay figcaption { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; font-size: 14px; color: var(--muted); }
.replay figcaption b { color: var(--ink); font-weight: 500; }
.legend { margin: 10px 0 0; font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.legend .k { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.k.robot { background: var(--robot); } .k.ped { background: var(--ped); } .k.obs { background: var(--obs); }
.k.goal { border: 2px solid var(--goal); background: transparent; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.stat .label { font: 600 12px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat .num { font: 700 clamp(28px, 3.6vw, 40px)/1.1 var(--display); font-variant-numeric: tabular-nums; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.stat .to { color: var(--obs); font-weight: 500; font-size: .7em; }
.stat .good { color: var(--ok); }
.stat .bad, .num.bad { color: var(--bad); }
.stat .cap { font-size: 13px; color: var(--muted); }

/* sections */
.band { padding: clamp(48px, 7vw, 80px) clamp(0px, 2vw, 24px); border-top: 1px solid var(--line); }
.band.alt { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 24px 0; padding-left: clamp(16px, 3vw, 40px); padding-right: clamp(16px, 3vw, 40px); }
h2 { font: 700 clamp(26px, 3.4vw, 38px)/1.12 var(--display); letter-spacing: -.02em; margin: 0 0 10px; text-wrap: balance; }
h3 { font: 600 18px/1.3 var(--display); margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 26px; max-width: 720px; }
.note { color: var(--muted); font-size: 14px; max-width: 780px; margin: 16px 0 0; }

.loop { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.loop li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color var(--t-std) var(--ease); }
.loop li:hover { border-color: var(--ink); }
.loop .n, .why .n { font: 600 13px/1 var(--mono); color: var(--accent); }
.loop b { font: 600 18px/1.3 var(--display); }
.loop li > span:last-child { color: var(--muted); font-size: 15px; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
td.mono, td .mono { white-space: nowrap; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: top; }
th { font: 600 12px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.n { font: 500 17px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
td small { display: block; color: var(--muted); font: 400 12px/1.4 var(--text); margin-top: 3px; }
td.win { color: var(--ok); font-weight: 600; }
td.state { color: var(--muted); text-align: center; padding: 28px; }
td.state.err { color: var(--bad); }
.pill { display: inline-block; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 1px 10px; font-size: 13px; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.step { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: baseline; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-size: 15px; }
.step .k { font: 600 12px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.step .v { overflow-wrap: anywhere; }
.step.k-decide .k, .step.k-gate .k { color: var(--accent); }
.step.k-train .k { color: var(--ped); }
.step.k-measure .k { color: var(--ok); }
.steps .more { justify-self: start; }
.verdict { margin-top: 16px; background: var(--surface); border: 1px solid var(--bad); border-radius: 12px; padding: 20px; }
.verdict.ok { border-color: var(--ok); }
.verdict h3 { color: var(--bad); }
.verdict.ok h3 { color: var(--ok); }
.verdict ul { margin: 10px 0 12px; padding-left: 20px; font: 400 14px/1.6 var(--mono); }
.verdict p { margin: 0; color: var(--muted); font-size: 15px; }

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.code { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; margin: 0;
  font-size: 13px; line-height: 1.65; }
.why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.why p { margin: 0; color: var(--muted); font-size: 15px; }
.why .n { display: block; margin-bottom: 10px; }

footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 28px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; background: var(--paper); }

/* graph schema */
.schema-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: clamp(8px, 2vw, 20px); margin-bottom: 32px; }
#schema { width: 100%; min-width: 560px; height: auto; display: block; font-family: var(--mono); }
#schema .edge path { stroke: var(--obs); stroke-width: 1.4; transition: stroke var(--t-std) var(--ease), opacity var(--t-std) var(--ease); }
#schema .edge text { font-size: 10px; fill: var(--muted); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; transition: opacity var(--t-std) var(--ease); }
#schema .node rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.2; transition: fill var(--t-quick) var(--ease); }
#schema .node text { font: 600 13px var(--text); fill: var(--ink); pointer-events: none; }
#schema .node { cursor: default; outline: none; }
#schema .node.hub rect { fill: var(--robot); stroke: var(--robot); }
#schema .node.hub text { fill: #fff; }
#schema .node:focus-visible rect, #schema .node.lit rect { stroke: var(--accent); stroke-width: 2; }
#schema.focus .edge { opacity: .18; }
#schema.focus .edge.lit { opacity: 1; }
#schema .edge.lit path { stroke: var(--accent); stroke-width: 2; }
#schema .edge.lit text { fill: var(--accent); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.facts li { padding-left: 16px; border-left: 2px solid var(--line); color: var(--muted); font-size: 15px; }
.facts b { color: var(--ink); font-weight: 600; }

/* the loop reads as a sequence: a rail joins the steps on wide screens */
.loop { position: relative; }
.loop li { position: relative; }
@media (min-width: 901px) {
  .loop li:not(:nth-child(3n))::after { content: ""; position: absolute; right: -13px; top: 30px; width: 14px; height: 2px; background: var(--accent); }
}
tbody tr { transition: background var(--t-quick) var(--ease); }
tbody tr:hover { background: var(--surface); }
.step { transition: border-color var(--t-quick) var(--ease); }
.step:hover { border-color: var(--obs); }

/* hero replay progress */
.progress { height: 3px; background: var(--alt); border-radius: 2px; overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; width: 0; background: var(--robot); }

/* motion: precise personality, only when allowed */
@keyframes rise { from { opacity: 0; transform: translateY(var(--rise, 16px)); } to { opacity: 1; transform: none; } }
.motion .e1, .motion .e2, .motion .e3, .motion .e4 { animation: rise var(--t-hero) var(--ease) both; }
.motion .e2 { animation-delay: 80ms; --rise: 22px; }
.motion .e3 { animation-delay: 180ms; }
.motion .e4 { animation-delay: 300ms; }
.motion .reveal.pending { opacity: 0; transform: translateY(16px); }
.motion .reveal { transition: opacity var(--t-reveal) var(--ease), transform var(--t-reveal) var(--ease); }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .loop, .why { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .nav nav a:not(.btn) { display: none; }
  .stats, .loop, .why { grid-template-columns: minmax(0, 1fr); }
  .step { grid-template-columns: 1fr; gap: 2px; }
  .motion .e2 { --rise: 12px; }
  .motion .e1, .motion .e2, .motion .e3, .motion .e4 { animation-delay: 0ms; }
}

/* honesty labels */
.tag { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; vertical-align: middle; }
.tag.rec { color: var(--ped); }
.tag.live-tag { color: var(--ok); }
.tag.live-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.motion .tag.live-tag i { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.replay-top { display: flex; align-items: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
a.live { text-decoration: none; transition: border-color var(--t-quick) var(--ease); }
a.live:hover { border-color: var(--ok); }
.lede b { color: var(--ink); font-weight: 600; }

/* 3D replay */
.viewtabs { margin-left: auto; display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.viewtabs button { font: 600 12px/1 var(--mono); padding: 8px 12px; min-height: 32px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer;
  transition: background var(--t-quick) var(--ease), color var(--t-quick) var(--ease); }
.viewtabs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.stage3d { position: relative; aspect-ratio: 16 / 11; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.stage3d canvas { display: block; width: 100%; height: 100%; }
.who { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.who p { width: fit-content; margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.who b { color: var(--ink); font-weight: 500; }
.who em { font: 600 12px/1 var(--mono); font-style: normal; }
.who em.bad { color: var(--bad); } .who em.ok { color: var(--ok); }
.stage3d .hint { position: absolute; right: 10px; bottom: 8px; margin: 0; font: 500 11px/1 var(--mono); color: var(--muted); pointer-events: none; }
.k.depl { background: #6b7480; }
.tag3d { position: absolute; left: 0; top: 0; pointer-events: none; font: 600 10px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--c); padding: 3px 6px; border-radius: 4px; white-space: nowrap; will-change: transform; }
.legend { display: block; }

/* hero: live query card under the replay */
.hero-right { display: grid; gap: 12px; min-width: 0; }
.heroq { display: grid; gap: 8px; text-decoration: none; color: var(--paper); background: var(--ink); border-radius: 12px; padding: 14px 16px;
  border: 1px solid var(--ink); transition: transform var(--t-quick) var(--ease), box-shadow var(--t-std) var(--ease); }
.heroq:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 35%, transparent); }
.heroq:active { transform: scale(.995); }
.hq-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: #c9ccd0; }
.hq-top .tag.live-tag { color: #7fd17f; } .hq-top .tag.live-tag i { background: #7fd17f; }
.hq-top .mono { margin-left: auto; color: #7fd17f; }
.hq-cy { font: 400 12px/1.6 var(--mono); color: #c9ccd0; overflow-wrap: anywhere; }
.hq-cy span { color: #ff9a5c; }
.hq-out { font-size: 15px; line-height: 1.5; }
.hq-out b { color: #ff9a5c; font-family: var(--mono); }
.hq-out .go { color: #c9ccd0; white-space: nowrap; }

/* live console */
.console-band { border-top: 0; padding-top: clamp(32px, 5vw, 56px); }
.band-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.band-head .sub { margin-bottom: 20px; }
.graphcount { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 26px; max-width: 460px; }
.graphcount b { color: var(--ink); font-weight: 500; }
.console { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.qlist { display: grid; gap: 8px; }
.q { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; min-height: 56px; padding: 12px 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font: inherit;
  transition: border-color var(--t-quick) var(--ease), background var(--t-quick) var(--ease), transform var(--t-quick) var(--ease); }
.q:hover { border-color: var(--obs); }
.q:active { transform: scale(.99); }
.q[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.q .qn { font: 600 13px/1.5 var(--mono); color: var(--accent); flex: none; }
.q[aria-selected="true"] .qn { color: var(--robot); }
.q b { display: block; font: 600 15px/1.35 var(--text); }
.q small { display: block; font: 400 12px/1.4 var(--mono); color: var(--muted); margin-top: 2px; }
.q[aria-selected="true"] small { color: #b9bdc2; }
.qpanel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(14px, 2vw, 20px); display: grid; gap: 14px; min-width: 0;
  transition: opacity var(--t-std) var(--ease); }
.qpanel.busy { opacity: .6; }
.qbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.qbar #qMeta { flex: 1 1 200px; }
.qread { margin: 0; font-size: 15px; color: var(--muted); border-left: 3px solid var(--robot); padding: 2px 0 2px 12px; min-height: 1.6em; }
.qread b { color: var(--ink); }
.cy { font-size: 12.5px; max-height: 260px; }
.cy .kw { color: var(--accent); font-weight: 500; }
.cy .lb, .cy .pr, .param .pr { color: var(--ped); }
.params { display: flex; flex-wrap: wrap; gap: 6px; }
.param { font: 400 12px/1.4 var(--mono); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; overflow-wrap: anywhere; }
.qtable { max-height: 340px; overflow: auto; }
.qtable table { min-width: 100%; width: max-content; }
.qtable th, .qtable td { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.qtable th { position: sticky; top: 0; background: var(--paper); }
.qtable td.wrap { white-space: normal; min-width: 280px; }
.qtable td.nul { color: var(--obs); font-family: var(--mono); }
.qtable td.yes { color: var(--ok); font-family: var(--mono); font-weight: 600; }
.qtable td.no { color: var(--bad); font-family: var(--mono); }
.qtable td.num { text-align: right; }

/* decision chain */
.chain { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.note.est { margin: -6px 0 14px; font-size: 13px; }
.chain h3 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bars, .checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; }
.bars li.win { border-color: var(--robot); box-shadow: inset 3px 0 0 var(--robot); }
.bl { display: flex; align-items: center; gap: 10px; }
.bl b { font-size: 14px; font-weight: 600; }
.bl .pv { margin-left: auto; font-weight: 600; }
.chosen { font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; background: var(--accent); color: #fff; padding: 4px 7px; border-radius: 999px; }
.track { height: 8px; background: var(--alt); border-radius: 4px; overflow: hidden; }
.track span { display: block; height: 100%; width: var(--w); background: var(--obs); border-radius: 4px; transition: width var(--t-hero) var(--ease); }
.win .track span { background: var(--robot); }
.bars small, .checks small { color: var(--muted); font-size: 12px; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.checks li small { display: block; }
.checks .ck { font-weight: 700; }
.checks .pass .ck { color: var(--ok); }
.checks .fail .ck { color: var(--bad); }
.bars .state, .checks .state { color: var(--muted); display: block; border: 0; background: none; }
.gatebox { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 15px; color: var(--muted); }
.gatebox b { font: 700 18px/1.2 var(--display); margin-right: 6px; }
.gatebox.bad { border-color: var(--bad); } .gatebox.bad b { color: var(--bad); }
.gatebox.ok { border-color: var(--ok); } .gatebox.ok b { color: var(--ok); }

@media (max-width: 900px) {
  .console, .chain { grid-template-columns: minmax(0, 1fr); }
  .qlist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* phones: the simulation sits right under the headline */
  .hero-copy { display: contents; }
  .hero-right { display: contents; }
  .hero .eyebrow { order: 1; } .hero h1 { order: 2; } .hero .replay { order: 3; } .hero .heroq { order: 4; } .hero .lede { order: 5; } .hero .ctas { order: 6; } .hero .live { order: 7; justify-self: start; }
  .hero { gap: 18px; }
  .hero .eyebrow, .hero h1, .hero .lede, .hero .ctas { margin-bottom: 0; }
}
@media (max-width: 640px) {
  .stage3d { aspect-ratio: 4 / 3.4; }
  .who p { font-size: 11px; padding: 4px 6px; }
  .who b, .stage3d .hint { display: none; }
  .qlist { grid-template-columns: minmax(0, 1fr); }
  .checks li { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); }
  .checks li > span:nth-child(2) { grid-column: 2 / -1; }
  .checks li > span:nth-child(3) { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; }
}

/* Judge route and field guide share the lab's visual grammar. */
.skip { position: fixed; top: -70px; left: 16px; z-index: 100; background: var(--ink); color: var(--paper); padding: 12px; }
.skip:focus { top: 12px; }
.hero-verdict { font-size: 14px; margin: -8px 0 24px; color: var(--muted); }
.hero-verdict .tag { margin-bottom: 8px; margin-right: 8px; }
.hero-verdict b { color: var(--ink); }
.judge-route { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; padding: 40px 0; border-block: 1px solid var(--line); }
.judge-route h2 { font-size: 26px; }
.judge-route ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.judge-route a { display: grid; gap: 8px; text-decoration: none; color: var(--ink); min-height: 100%; padding-left: 16px; border-left: 2px solid var(--line); transition: border-color 160ms var(--ease); }
.judge-route a:hover { border-color: var(--accent); }
.judge-route a span { color: var(--accent); font: 500 12px var(--mono); text-transform: uppercase; }
.judge-route small { color: var(--muted); font-size: 13px; }
.guide-intro { padding: 80px 0 40px; max-width: 880px; }
.guide-intro h1 { font-size: clamp(42px,6vw,76px); }
.guide-index { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 24px 0 40px; border-block: 1px solid var(--ink); }
.guide-index > div { padding: 24px; border-right: 1px solid var(--line); }
.guide-index > div:first-child { padding-left: 0; }
.guide-index > div:last-child { border: 0; }
.guide-index h3 { margin-top: 16px; }
.guide-index p { margin-bottom: 0; color: var(--muted); }
.walkthrough { list-style: none; margin: 32px 0 0; padding: 0; }
.walkthrough li { display: grid; grid-template-columns: 70px minmax(0,1fr); gap: 16px; padding: 28px 0; border-top: 1px solid var(--line); }
.walk-n { font: 500 28px var(--mono); color: var(--accent); }
.walkthrough p { max-width: 800px; color: var(--muted); }
.walkthrough a { display: inline-block; min-height: 40px; }
.graph-flow { display: grid; grid-template-columns: 1fr 28px 1.3fr 28px 1fr; gap: 12px; align-items: center; margin-bottom: 40px; }
.graph-flow > div:not(.flow-bottom) { border: 1px solid var(--ink); padding: 24px 16px; background: var(--paper); }
.graph-flow .flow-core { background: var(--ink)!important; color: var(--paper); border-top: 4px solid var(--robot)!important; }
.graph-flow small { display: block; font: 12px/1.6 var(--mono); margin-top: 8px; }
.flow-bottom { grid-column: 1/-1; text-align: center; font: 13px/1.6 var(--mono); padding: 16px; border-bottom: 1px solid var(--line); }
.demo-film { display: block; width: 100%; aspect-ratio: 4/3; background: var(--ink); border: 1px solid var(--line); border-radius: 12px; }
.guide-intro ~ section code, .walkthrough code { overflow-wrap: anywhere; }
.viewtabs button { min-height: 40px; }
#schema .node.hub rect { fill: var(--accent); stroke: var(--accent); }
@media(max-width:900px) { .judge-route { grid-template-columns: 1fr; } }
@media(max-width:640px) { .judge-route ol,.guide-index { grid-template-columns: 1fr; } .judge-route a { padding: 10px 0 10px 16px; } .guide-index > div { padding: 24px 0; border: 0; border-bottom: 1px solid var(--line); } .walkthrough li { grid-template-columns: 40px minmax(0,1fr); gap: 8px; } .graph-flow { grid-template-columns: 1fr; text-align: center; } .graph-flow > span { transform: rotate(90deg); } .guide-intro { padding-top: 48px; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } *,*::before,*::after { animation: none!important; transition: none!important; } }
.hero { align-items: start; padding-block: 48px; }
.hero-copy { padding-top: 48px; }
.hero h1 { font-size: clamp(38px,4.5vw,58px); }
@media(max-width:900px) { .hero-copy { padding-top: 0; } .hero { padding-block: 32px; } }

section[id] { scroll-margin-top: 84px; }

.tag3d { background: var(--ink, #1b2026); color: #fbfaf7; border-left: 3px solid var(--c); }

/* Reference study: Aceternity's framed hierarchy and tactile controls, adapted to the lab. */
.lab-home { background-size: 48px 48px; }
.lab-home > .nav { top: 12px; max-width: 1120px; width: calc(100% - 32px); margin: 16px auto 0; padding: 10px 14px 10px 20px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb,var(--surface) 94%,transparent); box-shadow: 0 2px 2px #1b202605,0 8px 24px #1b202606; }
.lab-home main { border-inline: 1px dashed var(--line); }
.lab-home .hero { padding-block: 48px 40px; }
.lab-home .hero-copy { padding-top: 30px; }
.lab-home .lede { max-width: 49ch; margin-bottom: 24px; }
.lab-home .replay { box-shadow: 0 1px 2px #1b202608,0 14px 40px #1b202605; }
.lab-home .btn { box-shadow: inset 0 1px 0 #ffffff25,0 1px 2px #1b202610; }
.lab-home .btn.ghost { box-shadow: inset 0 1px 0 #fff,0 1px 2px #1b202608; }
.release-proof { border-left: 2px solid var(--accent); padding: 2px 0 2px 18px; margin-bottom: 24px; }
.proof-label { font: 500 11px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.proof-value { display: flex; align-items: center; gap: 18px; margin-block: 7px; }
.proof-value > strong { font: 600 42px/1 var(--display); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.proof-value > strong span { font-size: 21px; color: var(--muted); letter-spacing: -.04em; }
.proof-value p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.proof-value b { font-weight: 500; color: var(--ink); }
.proof-note { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 8px 0 0; max-width: 46ch; }
.proof-note a { display: inline-block; padding-block: 6px; }
.archive-label { margin: 8px 0 12px; font: 500 11px/1.5 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.lab-home .judge-route { grid-template-columns: 1fr; gap: 28px; padding-block: 48px; }
.lab-home .judge-route > div { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
.lab-home .judge-route > div .eyebrow { grid-column: 1/-1; }
.lab-home .judge-route .note { margin: 0; max-width: 40ch; align-self: center; }
.lab-home .judge-route ol { gap: 12px; }
.lab-home .judge-route a { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 24px; gap: 12px; background: var(--surface); box-shadow: 0 1px 2px #1b202605; transition: border-color var(--t-std) var(--ease),background var(--t-std) var(--ease); }
.lab-home .judge-route a::after { content: '↗'; position: absolute; right: 22px; top: 19px; color: var(--muted); font-size: 20px; }
.lab-home .judge-route a:hover,.lab-home .judge-route a:focus-visible { border-color: var(--accent); background: #fffdf8; }
.lab-home .judge-route a b { font: 600 20px/1.3 var(--display); max-width: 18ch; }
@media(max-width:900px) { .lab-home .hero-copy { padding-top: 0; } .lab-home > .nav { top: 8px; margin-top: 8px; } }
@media(max-width:640px) { .lab-home > .nav { width: calc(100% - 24px); padding-inline: 12px; } .lab-home main { border: 0; } .lab-home .hero { padding-block: 32px; } .lab-home .judge-route > div { grid-template-columns: 1fr; gap: 12px; } .proof-value > strong { font-size: 38px; } .lab-home .judge-route a { padding: 22px; } }
@media(max-width:900px) { .lab-home .hero .lede { order:3; } .lab-home .hero .release-proof { order:4; } .lab-home .hero .ctas { order:5; } .lab-home .hero .replay { order:6; } .lab-home .hero .heroq { order:7; } .lab-home .hero .live { order:8; } .lab-home .hero h1,.lab-home .hero .lede,.lab-home .hero .release-proof,.lab-home .hero .ctas { margin-bottom:0; } }
