/* Zero-real Agent Policy (ZAP): site styles.
 * Editorial layout on one centered axis: a centered title block, the hero
 * film and figures at ~1160px, one ~680px reading column, a slim sticky
 * contents bar once the header scrolls away, hairlines only where they
 * separate meaning. One color, cobalt, marks ZAP (and the
 * primary action); comparisons are slate and gray; everything else is neutral. */

:root {
  --bg: #ffffff;
  --bg-2: #f4f5f8;          /* quiet tint for code and the tip */
  --ink: #11141d;
  --ink-2: #4f5464;
  --ink-3: #80869a;
  --rule: #e2e4ea;
  --accent: #244bff;        /* ZAP */
  --accent-ink: #1d3fe0;
  --accent-soft: #e9edff;
  --on-accent: #ffffff;
  --zap-2: #9db0ff;         /* ZAP variants (SFT only) */
  --frontier: #747c8c;      /* frontier models: fills only */
  --baseline: #b4b8c2;      /* other baselines: fills only */
  --neutral-1: #747c8c;
  --neutral-2: #b4b8c2;
  --neutral-3: #dcdee6;
  --media-bg: #0e0f14;
  --on-media: #f4f4f2;

  /* legacy names still read by the components and the inline SVG figures */
  --surface: var(--bg-2);
  --fg: var(--ink);
  --muted: var(--ink-2);
  --line: var(--rule);

  --f-sans: "Geist", ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-body: var(--f-sans);
  --font-mono: var(--f-mono);

  --col: 680px;
  --wide: 1160px;
  --gutter: 24px;
  --bar: 60px;             /* sticky contents bar height */
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131621; --bg-2: #1b1f2d; --ink: #f0f2fc; --ink-2: #adb5ca; --ink-3: #828aa0; --rule: #363d50;
    --accent: #93a8ff; --accent-ink: #a9baff; --accent-soft: #242e54; --on-accent: #131621;
    --zap-2: #5368c0; --frontier: #7a8398; --baseline: #4e5567;
    --neutral-1: #7a8398; --neutral-2: #4e5567; --neutral-3: #363d50;
    --media-bg: #0a0c12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131621; --bg-2: #1b1f2d; --ink: #f0f2fc; --ink-2: #adb5ca; --ink-3: #828aa0; --rule: #363d50;
  --accent: #93a8ff; --accent-ink: #a9baff; --accent-soft: #242e54; --on-accent: #131621;
  --zap-2: #5368c0; --frontier: #7a8398; --baseline: #4e5567;
  --neutral-1: #7a8398; --neutral-2: #4e5567; --neutral-3: #363d50;
  --media-bg: #0a0c12;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 24px); }
@media (max-width: 760px) { :root { --gutter: 16px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-sans); font-size: 18px; line-height: 1.65; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, svg { max-width: 100%; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--neutral-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; }
b, strong { font-weight: 600; }
code, .mono { font-family: var(--f-mono); font-size: .84em; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 12px; text-decoration: none; }
.skip:focus { top: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

/* ---------- layout ---------- */
.col, .wide { width: min(100% - 2 * var(--gutter), var(--col)); margin-inline: auto; }
.wide { width: min(100% - 2 * var(--gutter), var(--wide)); }
.stack { display: flex; flex-direction: column; gap: 20px; }
section.sec { padding-top: 168px; display: flex; flex-direction: column; gap: 36px; }
section.sec > .sub-sec { padding-top: 48px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.two > * { min-width: 0; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; gap: 36px; } section.sec { padding-top: 112px; } }

/* ---------- theme toggle (byline and footer) ---------- */
.theme-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; padding: 4px 0; font: inherit; }
.theme-btn:hover { color: var(--ink); }
.theme-btn svg { width: 14px; height: 14px; flex: none; }

/* ---------- contents bar (slides in once the header has scrolled away) ---------- */
.toc { position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: var(--bar); background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--rule); transition: transform .3s cubic-bezier(.2, .7, .2, 1), opacity .3s; }
.toc.hide { transform: translateY(-100%); opacity: 0; pointer-events: none; visibility: hidden; }
.toc-in { width: min(100% - 2 * var(--gutter), var(--wide)); height: 100%; margin-inline: auto; display: flex; align-items: center; gap: 16px; }
.toc ol { list-style: none; margin: 0 0 0 -11px; padding: 0 12px 0 0; display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.toc ol::-webkit-scrollbar { display: none; }
.toc a { display: block; padding: 7px 11px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 13.5px; line-height: 1.2; white-space: nowrap; transition: color .15s, background .15s; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); background: var(--bg-2); font-weight: 500; }
.toc-end { flex: none; display: flex; align-items: center; gap: 10px; }
.toc-end .theme-btn { width: 34px; height: 34px; justify-content: center; border-radius: 50%; }
.toc-end .theme-btn svg { width: 16px; height: 16px; }
@media (max-width: 760px) { .toc-end .btn { display: none; } }

/* ---------- hero ---------- */
.hero { width: min(100% - 2 * var(--gutter), 980px); margin-inline: auto; padding-top: clamp(72px, 12vh, 136px); display: flex; flex-direction: column; align-items: center; gap: 30px; text-align: center; }
.hero .meta { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; color: var(--ink-3); }
.hero .meta time::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; vertical-align: middle; margin-right: 12px; }
.hero .meta .theme-btn { margin-left: 6px; padding: 4px 10px; border: 1px solid var(--rule); border-radius: 999px; font-size: 13px; }
.hero h1 { font-size: clamp(46px, 8.2vw, 116px); line-height: .95; letter-spacing: -.05em; font-weight: 500; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero h1 .nw { white-space: nowrap; }
.hero h1 .acr { font-size: .3em; letter-spacing: 0; font-weight: 400; color: var(--ink-3); font-family: var(--f-mono); vertical-align: 1.1em; white-space: nowrap; }
.hero .sub { font-size: clamp(19px, 2.1vw, 24px); line-height: 1.45; letter-spacing: -.014em; color: var(--ink-2); max-width: 800px; text-wrap: balance; }
.hero .links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 4px; }
.hero .links .btn { padding: 13px 24px; font-size: 15px; }
.hero-media { margin: clamp(56px, 8vh, 88px) auto 0; }
.hero-media .vid { gap: 0; }
.hero-media .vid-frame, .hero-media [data-video]:empty { border-radius: 22px; box-shadow: 0 50px 100px -50px rgb(10 14 40 / .45), 0 0 0 1px rgb(0 0 0 / .04); }
@media (max-width: 760px) { .hero { gap: 22px; } .hero-media .vid-frame, .hero-media [data-video]:empty { border-radius: 14px; } }

/* ---------- headline numerals and byline ---------- */
#headline { padding-top: 72px; }
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; min-width: 0; padding: 36px 20px 34px; }
.stat + .stat { border-left: 1px solid var(--rule); }
.stat .num { font-size: clamp(48px, 5.8vw, 80px); line-height: .95; letter-spacing: -.055em; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat:first-child .num { color: var(--accent); }
.stat .lbl { font-size: 15px; line-height: 1.45; color: var(--ink-2); max-width: 22ch; }
@media (max-width: 760px) {
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 28px 12px; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
.byline { max-width: 860px; margin: 48px auto 0; text-align: center; font-size: 14.5px; line-height: 1.7; color: var(--ink-2); }
.byline .paper-title { font-size: 17px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); margin-bottom: 10px; line-height: 1.4; text-wrap: balance; }
.byline .authors { color: var(--ink-2); text-wrap: balance; }
.byline .author-note { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.byline sup { font-size: .7em; line-height: 0; }

/* ---------- section heads & prose ---------- */
/* A part's title is a small cobalt label over its lead heading; a part
   without a lead heading shows its title at lead size instead. */
.part-head { padding: 0; }
.part-title { display: flex; align-items: center; gap: 16px; font-family: var(--f-mono); font-size: 12.5px; font-weight: 500; line-height: 1.3; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); scroll-margin-top: calc(var(--bar) + 24px); }
.part-title::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
section.part > .part-head + * { margin-top: -14px; }
section.part:not(:has(.h-lead)) .part-title { display: block; font-family: var(--f-sans); font-size: clamp(34px, 4.4vw, 52px); line-height: 1.05; letter-spacing: -.045em; text-transform: none; color: var(--ink); }
section.part:not(:has(.h-lead)) .part-title::after { content: none; }
section.part:not(:has(.h-lead)) > .part-head + * { margin-top: 0; }
.h-lead { font-size: clamp(34px, 4.4vw, 52px); line-height: 1.05; letter-spacing: -.045em; }
.stack > .h-lead + p { margin-top: 8px; }
.h-sub { font-size: clamp(23px, 2.4vw, 28px); line-height: 1.2; letter-spacing: -.03em; }
.stack > .h-sub { margin-top: 20px; }

/* ---------- figures ---------- */
figure { margin: 0; display: flex; flex-direction: column; gap: 16px; min-width: 0; scroll-margin-top: calc(var(--bar) + 24px); }
section.sec > figure { margin-block: 24px; }
figcaption { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); max-width: var(--col); text-wrap: pretty; }
figure.wide > figcaption, .trials-more figcaption { margin-inline: auto; } /* line up with the text column */
.fig-num { font-weight: 600; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.fig-num:hover { color: var(--accent-ink); }
.fig-name { color: var(--ink); font-weight: 500; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.svg-fig { width: 100%; height: auto; display: block; }
svg text { font-family: var(--f-sans); }
/* chart panels sit on a soft card */
.bars { background: var(--bg-2); border-radius: 20px; padding: 32px 36px 28px; }
@media (max-width: 760px) { .bars { padding: 22px 18px 18px; border-radius: 16px; } }

/* reserve space for video slots before the script fills them */
[data-video]:empty { aspect-ratio: 16 / 3; background: var(--media-bg); border-radius: var(--radius); }
[data-video][data-race]:empty { aspect-ratio: 16 / 9; }
.hero-media [data-video]:empty { aspect-ratio: 16 / 9; }

/* ---------- video ---------- */
.vid { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 14px; min-width: 0; }
.vid-frame { position: relative; background: var(--media-bg); border-radius: var(--radius); overflow: hidden; max-width: 100%; aspect-ratio: 16 / 9; }
.vid-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.badge { position: absolute; top: 12px; right: 12px; font-family: var(--f-sans); font-size: 12px; font-weight: 500; line-height: 1; padding: 6px 10px; border-radius: 999px; background: rgb(10 12 18 / .55); color: var(--on-media); font-variant-numeric: tabular-nums; pointer-events: none; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.vid-toggle { position: absolute; left: 12px; bottom: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgb(10 12 18 / .5); color: var(--on-media); display: grid; place-items: center; cursor: pointer; opacity: .6; transition: opacity .2s; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.vid-frame:hover .vid-toggle, .vid-toggle:focus-visible { opacity: .95; }
.vid-toggle svg { width: 13px; height: 13px; fill: currentColor; }
.vid-zoom { position: absolute; right: 12px; bottom: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgb(10 12 18 / .5); color: var(--on-media); display: grid; place-items: center; cursor: zoom-in; opacity: .6; transition: opacity .2s; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.vid-frame:hover .vid-zoom, .vid-zoom:focus-visible { opacity: .95; }
.vid-zoom svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.vid-frame.zoomable video { cursor: zoom-in; }

/* ---------- lightbox (an enlarged clip; site.js moves the clip's node in and back) ----------
   The dialog scrolls when a tall node (the stacked race on a phone) cannot fit. */
html.lb-open { overflow: hidden; scrollbar-gutter: stable; overflow-anchor: none; }
.lb { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: auto; overscroll-behavior: contain; }
.lb::backdrop { background: rgb(8 8 8 / .84); }
.lb-stage { box-sizing: border-box; width: 100%; min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 60px var(--gutter) var(--gutter); }
.lb-stage > * { flex: none; box-sizing: border-box; max-width: 100%; background: var(--bg); padding: 14px; border-radius: 4px; box-shadow: 0 0 0 1px var(--rule); }
@media (max-width: 600px) { .lb-stage { padding: 60px 8px 8px; } .lb-stage > * { padding: 8px; } }
.lb .vid-zoom { display: none; }
.lb .vid-frame.zoomable video { cursor: auto; }
.lb-close { position: fixed; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .14); color: #f4f4f2; display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.lb-close:hover, .lb-close:focus-visible { background: rgb(255 255 255 / .28); }
.lb-close:focus-visible { outline: 2px solid #f4f4f2; outline-offset: 2px; }
.lb-close svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
@media (prefers-reduced-motion: no-preference) {
  .lb[open]::backdrop { animation: lb-fade .18s ease-out; }
  .lb[open] .lb-stage > * { animation: lb-zoom .2s ease-out; }
}
@keyframes lb-fade { from { opacity: 0; } }
@keyframes lb-zoom { from { opacity: 0; transform: scale(.96); } }
.vid-frame.missing { display: grid; place-items: center; padding: 16px; background: var(--bg-2); }
.vid-frame.missing .ph { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-3); text-align: center; max-width: 90%; }
.views { display: grid; grid-template-columns: repeat(3, 1fr); font-family: var(--f-sans); font-size: 12px; font-weight: 500; color: var(--ink-3); }
.views span { text-align: center; }
.vid > .vid-frame { grid-area: 1 / 1; }
.vid > .views { grid-area: 1 / 1; align-self: end; margin-bottom: 12px; position: relative; z-index: 1; pointer-events: none; color: var(--on-media); }
.vid > .views span { justify-self: center; padding: 5px 10px; border-radius: 999px; background: rgb(10 12 18 / .5); line-height: 1; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@media (max-width: 600px) {
  .vid > .views { grid-area: auto; align-self: auto; margin: -6px 0 0; color: var(--ink-3); font-size: 11.5px; }
  .vid > .views span { padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.prompt { font-family: var(--f-sans); font-size: 15.5px; line-height: 1.5; color: var(--ink); display: flex; gap: 14px; align-items: baseline; }
.prompt .k { flex: none; font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.prompt .t { min-width: 0; }
.prompt.unverified .t::after { content: " (placeholder caption)"; color: var(--ink-3); }

/* ---------- buttons, filters ---------- */
.btn { font: 500 14px/1 var(--f-sans); text-decoration: none; display: inline-flex; align-items: center; gap: 9px; padding: 11px 18px; white-space: nowrap; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--neutral-2); }
.btn.ghost:hover { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn svg { width: 11px; height: 11px; fill: currentColor; }
.btn.sm { padding: 9px 16px; font-size: 13.5px; }

/* ---------- bar chart ---------- */
.bars:not(.one) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; }
@media (max-width: 760px) { .bars:not(.one) { grid-template-columns: 1fr; gap: 36px; } }
@media (min-width: 761px) { .bars:not(.one) .bar-row, .bars:not(.one) .axis { grid-template-columns: minmax(0, 128px) minmax(0, 1fr) 52px; gap: 12px; } }
.bar-panel h4 { margin: 0 0 18px; font: 600 16px/1.3 var(--f-sans); letter-spacing: -.01em; }
.bar-panel h4 span { font-weight: 400; color: var(--ink-3); }
.bar-row { display: grid; grid-template-columns: minmax(0, 168px) minmax(0, 1fr) 60px; align-items: center; gap: 16px; padding-block: 6px; }
.bar-row .name { font-size: 15px; line-height: 1.25; color: var(--ink); }
.bar-row .name small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.bar-row.ours .name { color: var(--accent-ink); font-weight: 600; }
.bar-row.ours .name small { font-weight: 400; }
.track { position: relative; height: 30px; background: linear-gradient(to right, var(--rule) 1px, transparent 1px) 0 0 / 25% 100%; border-right: 1px solid var(--rule); }
.fill { position: absolute; inset: 0 auto 0 0; background: var(--baseline); border-radius: 0 6px 6px 0; }
.frontier .fill { background: var(--frontier); }
.variant .fill { background: var(--zap-2); }
.ours .fill { background: var(--accent); }
.bar-row .val { position: absolute; top: 50%; left: calc(var(--w) + 10px); transform: translateY(-50%); font-size: 14.5px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.ours .val { color: var(--accent-ink); font-weight: 600; }
.axis { display: grid; grid-template-columns: minmax(0, 168px) minmax(0, 1fr) 60px; gap: 16px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-3); padding-top: 8px; }
.axis .ticks { display: flex; justify-content: space-between; }
@media (max-width: 520px) { .bar-row, .axis { grid-template-columns: minmax(0, 112px) minmax(0, 1fr) 52px; gap: 10px; } .bar-row .name { font-size: 13.5px; } .bar-row .val { font-size: 13px; } .track { height: 24px; } }

/* ---------- dot matrix ---------- */
.dm { min-width: 560px; display: grid; grid-template-columns: minmax(150px, 1.6fr) repeat(5, minmax(70px, 1fr)); font-size: 14px; }
.dm .hd { font-size: 12.5px; line-height: 1.25; color: var(--ink-2); padding: 0 6px 12px; text-align: center; align-self: end; }
.dm .hd.ours { color: var(--ink); font-weight: 600; }
.dm .grp { grid-column: 1 / -1; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: 18px 0 8px; border-bottom: 1px solid var(--ink); }
.dm .task { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--rule); line-height: 1.3; color: var(--ink); min-width: 0; }
.dm .task small { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.dm .cell { display: flex; justify-content: center; align-items: center; gap: 5px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); padding: 9px 4px; }
.dm .cell.ours { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.dot { width: 11px; height: 11px; border-radius: 50%; border: 1.6px solid var(--neutral-1); background: transparent; padding: 0; cursor: pointer; }
.dot.s { background: var(--neutral-1); }
.cell.ours .dot { border-color: var(--accent); }
.cell.ours .dot.s { background: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--ink-2); align-items: center; }
.legend .dot { display: inline-block; cursor: default; vertical-align: -1px; margin-right: 4px; }
/* Collapsed per-task figure under Figure 1: a quiet one-line toggle, no box. */
details.trials-more, details.trials-more:last-of-type { border: 0; }
.trials-more { width: min(100%, var(--col)); margin-inline: auto; }
.trials-more > summary { justify-content: flex-start; gap: 7px; padding-block: 2px; font-weight: 400; font-size: 13px; color: var(--ink-3); width: fit-content; }
.trials-more > summary:hover, .trials-more > summary:focus-visible { color: var(--ink-2); }
.trials-more > summary::before { content: ""; width: 5px; height: 5px; border-right: 1.3px solid currentColor; border-bottom: 1.3px solid currentColor; transform: translateY(-1px) rotate(-45deg); transition: transform .15s; flex: none; }
.trials-more[open] > summary::before { transform: translateY(-2px) rotate(45deg); }
.trials-more > summary::after { content: none; }
.trials-more[open] > summary::after { content: none; }
.trials-more > figure { padding-top: 18px; }
@media (prefers-reduced-motion: reduce) { .trials-more > summary::before { transition: none; } }
.tip { position: fixed; z-index: 50; max-width: 280px; background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 4px; box-shadow: 0 8px 24px rgb(0 0 0 / .18); pointer-events: none; }
.tip .m { font-family: var(--f-mono); font-size: 11px; opacity: .7; display: block; margin-bottom: 3px; }

/* ---------- race ---------- */
.race { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .race { grid-template-columns: 1fr; } }
.lane { display: flex; flex-direction: column; gap: 16px; min-width: 0; background: var(--bg-2); border-radius: 20px; padding: 20px 20px 16px; }
.lane .vid-frame { border-radius: 12px; }
.lane-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.lane-name { font-weight: 600; font-size: 18px; letter-spacing: -.015em; display: flex; flex-direction: column; gap: 3px; }
.lane-name small { font-weight: 400; color: var(--ink-3); font-size: 13px; letter-spacing: 0; }
.lane.ours .lane-name { color: var(--accent-ink); }
.meters { display: flex; gap: 24px; font-variant-numeric: tabular-nums; }
.meter { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.meter .v { font-size: clamp(24px, 2.6vw, 34px); font-weight: 500; line-height: 1; color: var(--ink); letter-spacing: -.035em; }
.meter .l { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.lane.ours .meter .v { color: var(--accent-ink); }
.stamp { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: var(--f-sans); font-weight: 600; font-size: clamp(14px, 1.8vw, 19px); letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--on-media); padding: 10px 18px; border-radius: 999px; background: rgb(10 12 18 / .66); white-space: nowrap; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lane.ours .stamp { background: var(--accent); color: #fff; }
.race-ctl { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { text-align: left; padding: 13px 12px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-weight: 500; font-size: 13px; color: var(--ink-3); border-bottom-color: var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-right: 0; padding-left: 16px; }
td code { white-space: nowrap; }
tr.hl td { font-weight: 600; }
.col-ours { color: var(--accent-ink); }

/* ---------- episode loop diagram ---------- */
.loop { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }
.loop li { position: relative; border-top: 1px solid var(--ink); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.loop li.rep { border-top: 2px solid var(--ink); padding-top: 13px; }
.loop .n { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.loop li.rep .n { color: var(--ink-2); }
.loop .h { font-weight: 600; font-size: 15px; line-height: 1.25; }
.loop .d { font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.loop-note { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
@media (max-width: 760px) { .loop { grid-template-columns: 1fr 1fr; gap: 24px 20px; } .loop li:last-child { grid-column: 1 / -1; } }
.pipe { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: baseline; font-size: 13.5px; color: var(--ink); padding-top: 4px; }
.pipe span.end { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); flex-basis: 100%; padding-top: 4px; }
.pipe i { font-style: normal; color: var(--ink-3); }

/* ---------- training-task carousels (one per category) ---------- */
.cars { display: flex; flex-direction: column; gap: 44px; min-width: 0; }
.car-group { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.car-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.car-title { font-size: clamp(22px, 2.4vw, 27px); line-height: 1.2; letter-spacing: -.02em; font-weight: 500; }
.car-title .n { font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; font-weight: 400; color: var(--ink-3); margin-left: 10px; white-space: nowrap; }
.car-nav { display: flex; gap: 8px; flex: none; }
.car-nav[hidden] { display: none; }
.car-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--neutral-2); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; padding: 0; transition: border-color .15s, opacity .15s; }
.car-btn:hover:not(:disabled) { border-color: var(--ink); }
.car-btn:disabled { opacity: .3; cursor: default; }
.car-btn svg { width: 14px; height: 14px; }
.car { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-x pan-y; min-width: 0; }
.car::-webkit-scrollbar { display: none; }
.car:focus-visible { outline-offset: 4px; }
.car-track { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; }
/* Tile widths leave a slice of the next tile showing at the edge. */
.car-track > li { flex: 0 0 calc((100% - 3 * 16px) / 3.35); min-width: 0; scroll-snap-align: start; }
@media (max-width: 900px) { .car-track > li { flex-basis: calc((100% - 16px) / 2.3); } }
@media (max-width: 560px) { .car-track { gap: 12px; } .car-track > li { flex-basis: 76%; } }
.tile { gap: 8px; }
/* ---------- intro list, comparison table ---------- */
ol.kinds { margin: 0; padding: 0; list-style: none; counter-reset: kd; display: flex; flex-direction: column; }
ol.kinds li { counter-increment: kd; display: grid; grid-template-columns: 32px 1fr; gap: 8px; padding: 14px 0; border-top: 1px solid var(--rule); }
ol.kinds li:last-child { border-bottom: 1px solid var(--rule); }
ol.kinds li::before { content: counter(kd); font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); padding-top: 5px; }
ul.plain { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
table.cmp th[scope="row"] { font-weight: 400; color: var(--ink); }
table.cmp .m { text-align: center; width: 19%; padding-left: 8px; padding-right: 8px; }
table.cmp thead th.m { color: var(--ink-3); }
table.cmp td.m svg { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }
table.cmp td.yes { color: var(--ink); }
table.cmp td.no { color: var(--ink-3); }
table.cmp tr.ours th, table.cmp tr.ours td { background: var(--accent-soft); border-bottom-color: transparent; }
table.cmp tr.ours th { border-radius: 10px 0 0 10px; padding-left: 14px; }
table.cmp tr.ours td:last-child { border-radius: 0 10px 10px 0; }
table.cmp tr.ours th[scope="row"] { color: var(--accent-ink); font-weight: 600; }
table.cmp tr.ours td.yes { color: var(--accent); }
@media (max-width: 520px) { table.cmp { font-size: 14px; } table.cmp .m { width: auto; padding-left: 4px; padding-right: 4px; } table.cmp thead th.m { font-size: 11.5px; } }

.tile .prompt { font-size: 12px; gap: 0; color: var(--ink-2); }
.tile .badge { font-size: 10px; padding: 4px 5px; top: 6px; right: 6px; }
.tile .vid-toggle { width: 26px; height: 26px; left: 6px; bottom: 6px; }

/* ---------- reward staircase ---------- */
.stair .bar { transform-box: fill-box; transform-origin: 50% 100%; }
.stair.play .bar { animation: grow .9s cubic-bezier(.2, .7, .2, 1) backwards; }
.stair.play .bar.b2 { animation-delay: .25s; } .stair.play .bar.b3 { animation-delay: .5s; } .stair.play .bar.b4 { animation-delay: .8s; animation-duration: 1.3s; }
@keyframes grow { from { transform: scaleY(.12); } to { transform: scaleY(1); } }

/* ---------- lessons, steps, quote ---------- */
.lessons { list-style: none; margin: 0; padding: 0; counter-reset: ls; }
.lessons li { counter-increment: ls; display: grid; grid-template-columns: 40px 1fr; gap: 8px; padding: 18px 0; border-top: 1px solid var(--rule); }
.lessons li:last-child { border-bottom: 1px solid var(--rule); }
.lessons li::before { content: counter(ls, decimal-leading-zero); font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); padding-top: 5px; }
ul.steps { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; counter-reset: st; }
ul.steps li { counter-increment: st; display: grid; grid-template-columns: 32px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 16.5px; }
ul.steps li:first-child { border-top: 1px solid var(--rule); }
ul.steps li::before { content: counter(st); font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); padding-top: 4px; }
blockquote.take { margin: 0; padding-left: 24px; border-left: 2px solid var(--ink); font-family: var(--f-sans); font-style: normal; font-weight: 400; font-size: clamp(20px, 2.2vw, 24px); line-height: 1.5; letter-spacing: -.012em; color: var(--ink); text-wrap: pretty; }


/* ---------- citation ---------- */
.bib { margin: 0; padding: 22px 24px; border-radius: 16px; background: var(--bg-2); font-family: var(--f-mono); font-size: 12.5px; line-height: 1.6; white-space: pre; overflow-x: auto; color: var(--ink); }
.copy-row { display: flex; gap: 14px; align-items: center; }
.copied { font-size: 13px; color: var(--ink-3); }

/* ---------- details ---------- */
details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; padding-block: 16px; font-weight: 500; font-size: 16.5px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--f-mono); font-weight: 400; color: var(--ink-3); font-size: 18px; line-height: 1; }
details[open] > summary::after { content: "−"; }
details > div { padding-block: 0 20px; display: flex; flex-direction: column; gap: 12px; font-size: 16px; color: var(--ink-2); }
details ul, details ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
details b { color: var(--ink); }
.inline-details { border: 0; }
.inline-details:last-of-type { border: 0; }
.inline-details > summary { justify-content: flex-start; font-weight: 500; font-size: 14.5px; color: var(--ink); padding-block: 6px; }
.inline-details > summary::after { font-size: 14px; color: inherit; }
.full-prompt > summary { font-size: 12.5px; color: var(--ink-3); font-family: var(--f-mono); }
.full-prompt-text { margin: 6px 0 0; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--bg-2); border-radius: 12px; padding: 16px 18px; font-family: var(--f-mono); font-size: 12px; line-height: 1.6; color: var(--ink-2); }

/* ---------- interactive mounts ---------- */
.mount { min-height: 120px; display: grid; place-items: center; color: var(--ink-3); font-family: var(--f-mono); font-size: 12.5px; padding: 20px; text-align: center; background: var(--bg-2); }
.mount.live { display: block; padding: 0; min-height: 0; text-align: left; font-family: inherit; font-size: inherit; color: inherit; background: none; }
/* Components: drop their card chrome so they sit in the page like figures.
   The mount element itself receives the .epx / .ow class when the component starts. */
.mount.live.ow { display: grid; }
.mount.epx { border: 0; border-top: 1px solid var(--ink); border-radius: 0; padding: 20px 0 0; background: transparent; }
.mount.epx .epx-frame { border-radius: 2px; }
.mount.ow, .mount .ow { border-radius: 0; border-width: 1px 0; border-color: var(--rule); border-top-color: var(--ink); background: transparent; --ow-bg: var(--bg); }
.mount .ow-euler { border-radius: 0; }
.mount .ow-chip { border-radius: 3px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 128px; border-top: 1px solid var(--rule); padding-block: 40px 56px; font-size: 13.5px; color: var(--ink-3); }
.site-footer .wide { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; align-items: baseline; }
.site-footer .wordmark { color: var(--ink); font-size: 15px; font-weight: 600; }
.foot-end { display: inline-flex; gap: 24px; align-items: baseline; }
.site-footer .theme-btn { color: var(--ink-2); }
.site-footer a { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .stair.play .bar { animation: none; }
}

/* ---------- Figure 1: sim -> real animation (assets/js/sim2real.js) ---------- */
.s2r { width: 100%; margin-inline: auto; }
.s2r:empty { aspect-ratio: 1200 / 530; }
.s2r[data-layout="tall"] { max-width: 440px; }
.s2r svg { display: block; width: 100%; height: auto; overflow: visible; }
.s2r .fr { fill: none; stroke: var(--neutral-3); stroke-width: 1.5; }
.s2r .ln, .s2r .lnf, .s2r .tl { stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.s2r .ln, .s2r .tl { fill: none; }
.s2r .lnf { fill: var(--bg); }
.s2r .tl { stroke: var(--ink-2); stroke-width: 1.2; }
.s2r .tb { fill: var(--bg); stroke: var(--ink-2); stroke-width: 1.2; }
.s2r .grid { fill: none; stroke: var(--neutral-3); stroke-width: 1; }
.s2r .bk { fill: none; stroke: var(--neutral-2); stroke-width: 1; }
.s2r .co { fill: none; stroke: var(--ink); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.s2r .ci { fill: none; stroke: var(--bg); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.s2r .dotk { fill: var(--ink); }
.s2r .trk { stroke: var(--rule); stroke-width: 1.5; stroke-linecap: round; }
.s2r .pf { stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; }
.s2r .obs, .s2r .mk-n { fill: none; stroke: var(--neutral-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.s2r .act, .s2r .mk-a { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.s2r .adot { fill: var(--accent); }
.s2r .bnd { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 4 6; }
.s2r .hd { fill: var(--ink-3); letter-spacing: .12em; }
.s2r .lab { fill: var(--ink); font-weight: 500; }
.s2r .sm { fill: var(--ink-3); }
.s2r .tagb { fill: var(--bg); stroke: var(--ink); stroke-width: 1.2; }
.s2r .tagt { fill: var(--ink); font-weight: 500; }
.s2r .lapb { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.s2r .lapr { fill: none; stroke: var(--accent); stroke-width: 1; }
.s2r .lapt { fill: var(--accent); font-weight: 500; letter-spacing: -.02em; }
.s2r .chip rect { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.s2r .chip text { fill: var(--accent-ink); font-family: var(--f-mono); }
.s2r .holdt { fill: var(--ink); font-weight: 500; letter-spacing: -.01em; }
.s2r .holdt .b { font-weight: 600; }
.s2r .holdt .sep { fill: var(--ink-3); }

/* ---------- in-text citations and references ---------- */
.cites { font-size: .8em; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
a.cite { color: inherit; text-decoration: none; }
a.cite:hover, a.cite:focus-visible { color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--accent); }
ol.refs { font-size: 14.5px; line-height: 1.55; gap: 8px; }
ol.refs li { scroll-margin-top: 30vh; overflow-wrap: anywhere; }
ol.refs li.ref-hit { color: var(--ink); background: var(--accent-soft); transition: background .6s; }

.links a[aria-disabled="true"] { opacity: .55; cursor: default; }
.bars.one { width: 100%; }

/* ---------- three robots, one interface ---------- */
.iface { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .iface { grid-template-columns: 1fr; } }
.iface-h { font-size: 13.5px; font-weight: 600; padding-bottom: 6px; border-bottom: 2px solid currentColor; margin-bottom: 8px; }
.iface-h span { font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.iface-h.sim { color: #2f6aa6; }
.iface-h.real { color: #c4561a; }
.iface img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; }
.iface-d { font-size: 12.5px; color: var(--ink-2); text-align: center; margin-top: 6px; line-height: 1.4; }
.iface-box { margin-top: 16px; border: 0; background: var(--bg-2); border-radius: 16px; padding: 18px 20px; font-size: 13.5px; }
.iface-bh { margin-bottom: 8px; }
.iface-bh span, .iface-box dd > span { color: var(--ink-3); }
.iface-box dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.iface-box dt { font-weight: 600; }
.iface-box dd { margin: 0; overflow-wrap: anywhere; }
