:root {
  --bg: #fff8e7;
  --surface: #fffcf4;
  --plate: #ffffff;
  --ink: #17161a;
  --ink-2: #47463f;
  --muted: #6e6a5e;
  --rule: #ebe1c8;
  --accent: #2c47d0;
  --accent-soft: #e7ebfc;
  --highlight: #f97316;
    --native: #8f8a7c;
  --none: #d9cfb5;
    --mini: #b3502d;
  --mini-soft: #f5e2cf;

  --f-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --f-terminal: "Ubuntu Mono", ui-monospace, "DejaVu Sans Mono", Menlo, monospace;

  --rail: 11.5rem;
  --gap: 2.5rem;
  --measure: 45rem;
  --frame: 64rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014;
    --surface: #161920;
    --plate: #f1f2f4;
    --ink: #e9ebf0;
    --ink-2: #b6bcc8;
    --muted: #8a919e;
    --rule: #272b34;
    --accent: #97a7ff;
    --accent-soft: #1d2447;
    --highlight: #ff8c42;
    --native: #7d8494;
    --none: #363b47;
    --mini: #ed986e;
    --mini-soft: #322622;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1014;
  --surface: #161920;
  --plate: #f1f2f4;
  --ink: #e9ebf0;
  --ink-2: #b6bcc8;
  --muted: #8a919e;
  --rule: #272b34;
  --accent: #97a7ff;
  --accent-soft: #1d2447;
  --highlight: #ff8c42;
  --native: #7d8494;
  --none: #363b47;
  --mini: #ed986e;
  --mini-soft: #322622;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; scroll-padding-top: var(--top-h, 4.4rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
sup { font-size: 0.68em; line-height: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.frame { max-width: var(--frame); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); padding-block: 0 2rem; }

.top { position: sticky; top: 0; z-index: 2; background: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.1rem; border-bottom: 1px solid var(--rule); }
.top nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem clamp(0.9rem, 2.5vw, 1.75rem); font-size: 0.9rem; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--accent); }
.theme-btn { position: relative; width: 2rem; height: 2rem; padding: 0; overflow: hidden; border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn svg { position: absolute; inset: 0; width: 1rem; height: 1rem; margin: auto; transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.35s ease; }
.theme-btn .sun { opacity: 0; transform: translateY(110%) rotate(-90deg) scale(0.5); }
.theme-btn[data-mode="dark"] .sun { opacity: 1; transform: none; }
.theme-btn[data-mode="dark"] .moon { opacity: 0; transform: translateY(-110%) rotate(90deg) scale(0.5); }

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
@property --reveal { syntax: "<length>"; inherits: false; initial-value: 0px; }
html[data-theme-anim="reveal"]::view-transition-new(root) {
  -webkit-mask-image: radial-gradient(circle at var(--reveal-x) var(--reveal-y), #000 calc(var(--reveal) - 220px), transparent var(--reveal));
  mask-image: radial-gradient(circle at var(--reveal-x) var(--reveal-y), #000 calc(var(--reveal) - 220px), transparent var(--reveal));
}
html[data-theme-anim="dusk"]::view-transition-new(root) {
  -webkit-mask: linear-gradient(to bottom, #000 40%, transparent 60%) 0 100% / 100% 250% no-repeat;
  mask: linear-gradient(to bottom, #000 40%, transparent 60%) 0 100% / 100% 250% no-repeat;
  animation: theme-dusk 1.6s cubic-bezier(0.45, 0, 0.2, 1) both;
}
html[data-theme-anim="dawn"]::view-transition-new(root) {
  -webkit-mask: linear-gradient(to top, #000 40%, transparent 60%) 0 0 / 100% 250% no-repeat;
  mask: linear-gradient(to top, #000 40%, transparent 60%) 0 0 / 100% 250% no-repeat;
  animation: theme-dawn 1.6s cubic-bezier(0.45, 0, 0.2, 1) both;
}
@keyframes theme-dusk { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@keyframes theme-dawn { to { -webkit-mask-position: 0 100%; mask-position: 0 100%; } }
html.theme-fade, html.theme-fade *:not(svg) { transition: background-color 0.6s ease, color 0.6s ease, border-color 0.6s ease, text-decoration-color 0.6s ease !important; }

.hero, .section {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  column-gap: var(--gap);
}
.section { padding-block: clamp(2.5rem, 6vw, 4rem); border-top: 1px solid var(--rule); }
.rail {
  position: sticky;
  top: calc(var(--top-h, 4.4rem) + 1.5rem);
  align-self: start;
  margin: 0;
  padding-top: 0.35rem;
  font: 500 0.72rem/1.4 var(--f-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.body { min-width: 0; }
.prose { max-width: var(--measure); font-size: 1.06rem; color: var(--ink-2); }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 600; }
.lead { max-width: var(--measure); margin: 0 0 1rem; font: 450 clamp(1.4rem, 2.6vw, 1.7rem)/1.25 var(--f-display); letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.lead.later { margin-top: 3.5rem; }
.note { margin: 0; font: 500 0.72rem/1.4 var(--f-mono); letter-spacing: 0.04em; color: var(--muted); }

.hero { padding-block: clamp(2.5rem, 6vw, 3.75rem) 2rem; }
.hero .rail { position: static; padding-top: 0.9rem; }
.tag { display: inline-block; padding: 0.22rem 0.45rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 3px; background: var(--accent-soft); color: var(--accent); font: 500 0.7rem/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.hero-text { max-width: 48rem; }
.title { margin: 0; font: 450 clamp(2.6rem, 6vw, 3.6rem)/1.05 var(--f-display); font-optical-sizing: auto; letter-spacing: -0.02em; text-wrap: balance; }
.subtitle { margin: 0.7rem 0 0; font: 400 clamp(1.15rem, 2.2vw, 1.35rem)/1.35 "Times New Roman", Times, "Nimbus Roman", "Nimbus Roman No9 L", "TeX Gyre Termes", "Liberation Serif", Tinos, serif; font-variant-caps: small-caps; color: var(--ink-2); text-wrap: balance; }
.authors, .affils, .links { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.authors { gap: 0.15rem 1.1rem; margin-top: 1.4rem; font-size: 0.98rem; }
.authors a { text-decoration: underline; text-decoration-color: var(--rule); }
.authors a:hover { text-decoration-color: currentColor; }
.authors sup, .affils sup { margin-left: 0.1em; color: var(--muted); font-family: var(--f-mono); }
.authors sup { color: var(--accent); }
.affils { gap: 0.1rem 1.2rem; margin-top: 0.45rem; font-size: 0.88rem; color: var(--muted); }
.affils sup { margin: 0 0.25em 0 0; }
.links { gap: 0.5rem 1.4rem; align-items: center; margin-top: 1.3rem; }
.links a { padding: 0.2rem 0; color: var(--ink-2); font: 500 0.82rem/1.2 var(--f-mono); letter-spacing: 0.02em; text-decoration: none; }
.links a::after { content: " \2197"; color: var(--muted); }
.links a[href^="#"]::after { content: " \2193"; }
.links a:hover { color: var(--accent); }
.links a.primary { display: inline-block; padding: 0.3rem 0.6rem; border: 1.5px solid var(--highlight); border-radius: 3px; color: var(--ink); transition: background-color 0.2s ease; }
.links a.primary::after { color: var(--highlight); }
.links a.primary:hover { background: color-mix(in srgb, var(--highlight) 14%, transparent); }

.panel { position: relative; margin-top: 1.4rem; padding: 1rem 1.1rem 1rem calc(1.1rem + 3px); background: var(--surface); border: 1px solid var(--rule); border-left-width: 0; border-radius: 0 6px 6px 0; color: var(--ink-2); }
.panel::before { content: ""; position: absolute; top: -1px; bottom: -1px; left: 0; width: 3px; background: var(--accent); }
.panel p { margin: 0; }
.tldr p { font: 400 1.02rem/1.55 var(--f-terminal); color: var(--ink); }
.tldr-label { margin-right: 0.4em; color: var(--accent); font-weight: 700; }
.panel pre { margin: 0; overflow-x: auto; font: 400 0.88rem/1.5 var(--f-terminal); color: var(--ink); white-space: pre; }
.panel .copy { position: absolute; top: 0.55rem; right: 0.6rem; padding: 0.25rem 0.55rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--bg); color: var(--ink-2); font: 500 0.7rem/1 var(--f-mono); cursor: pointer; }
.panel .copy:hover { color: var(--accent); border-color: var(--accent); }
.bib { margin-top: 0; }

.plate { display: block; width: 100%; margin: 0; padding: 0; overflow: hidden; background: var(--plate); border: 1px solid var(--rule); border-radius: 6px; }
.plate video, .plate img { display: block; width: 100%; height: auto; }
button.plate { font: inherit; cursor: zoom-in; transition: border-color 0.2s ease; }
button.plate img { padding: clamp(0.5rem, 2vw, 1.1rem); }
button.plate:hover { border-color: var(--accent); }
figure { margin: 0; }
figcaption { margin-top: 0.7rem; max-width: var(--measure); font-size: 0.9rem; line-height: 1.55; color: var(--muted); }
figcaption p { margin: 0; }
figcaption p + p { margin-top: 0.5rem; }
figcaption em { font-family: var(--f-display); }
.figure { margin-top: 1.8rem; }
.teaser { padding-left: calc(var(--rail) + var(--gap)); padding-bottom: clamp(2.5rem, 6vw, 3.5rem); }
.teaser .cap-lead { font: italic 400 1.02rem/1.45 var(--f-display); color: var(--ink-2); }

.prism-def { display: flex; align-items: center; gap: 1rem; max-width: var(--measure); margin-top: 1.3rem; }
.prism-def img { flex: none; width: 2.75rem; height: 2.75rem; }
.prism-def p { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--ink-2); }
.prism-def strong { color: var(--ink); font-weight: 600; }

.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 2rem; max-width: 48rem; margin: 1.6rem 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps li { display: flex; flex-direction: column; counter-increment: step; padding-top: 0.75rem; border-top: 1px solid var(--rule); }
.steps h3 { display: flex; align-items: baseline; gap: 0.6rem; margin: 0; font: 600 1rem/1.35 var(--f-body); }
.steps h3::before { content: counter(step, decimal-leading-zero); font: 500 0.72rem/1 var(--f-mono); color: var(--accent); }
.steps p { margin: 0.35rem 0 0; font-size: 0.95rem; color: var(--ink-2); }
.steps .stage-tag { margin-top: auto; padding-top: 0.7rem; font: 500 0.7rem/1.4 var(--f-mono); letter-spacing: 0.03em; color: var(--muted); }

.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.6rem; max-width: 48rem; margin: 1.8rem 0 0; }
.figures div { padding-top: 0.7rem; border-top: 1px solid var(--rule); }
.figures dt { font: 450 1.9rem/1.1 var(--f-display); letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.figures dt small { font-size: 0.55em; color: var(--muted); }
.figures dt .unit { font-size: 0.6em; margin-left: 0.04em; }
.figures dt .unit, .figures dt .times, .figures.scores dt { color: var(--mini); }
.figures dd { margin: 0.3rem 0 0; font-size: 0.86rem; line-height: 1.45; color: var(--muted); }
.figures dd b { font-weight: 600; color: var(--ink-2); }
.figures sup { font-family: var(--f-mono); }
.footnotes { max-width: var(--measure); margin: 1rem 0 0; padding: 0; list-style: none; font-size: 0.8rem; line-height: 1.5; color: var(--muted); }
.footnotes li + li { margin-top: 0.2rem; }
.footnotes sup { margin-right: 0.3em; font-family: var(--f-mono); }

.table-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.7rem; margin: 2.8rem 0 0.8rem; font: 600 1rem/1.35 var(--f-body); }
.table-title span { font: italic 400 0.95rem/1.35 var(--f-display); color: var(--muted); }
.table-wrap { position: relative; overflow-x: auto; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
table.results { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.results th, .results td { padding: 0.5rem 0.55rem; text-align: left; font-weight: 400; white-space: nowrap; }
.results thead th { white-space: normal; padding-block: 0.7rem 0.55rem; border-bottom: 1px solid var(--rule); font: 500 0.68rem/1.3 var(--f-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); vertical-align: bottom; }
.results tbody tr + tr > * { border-top: 1px solid color-mix(in srgb, var(--rule) 70%, transparent); }
.results th[scope="row"] { font-weight: 500; color: var(--ink); }
.results th[scope="row"] sup { color: var(--muted); }
.results .group th { padding-block: 0.9rem 0.3rem; font: italic 400 0.92rem/1.3 var(--f-display); color: var(--muted); }
.results .group th span { margin-left: 0.5em; font: 500 0.66rem/1 var(--f-mono); font-style: normal; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.results .n { text-align: right; }
.results .c { text-align: center; }
.results .no, .results .na { color: var(--muted); }
.results tr.ours > * { background: var(--mini-soft); }
.results tr.ours th { box-shadow: inset 3px 0 0 var(--mini); }
.results tr.ours th, .results tr.ours .n { font-weight: 650; }
.size { display: inline-flex; align-items: center; gap: 0.55rem; }
.size-v { min-width: 3.1rem; text-align: right; }
.size-bar { position: relative; display: block; width: 5rem; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--rule) 70%, transparent); }
.size-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: max(var(--w), 2px); border-radius: 2px; background: var(--muted); }
tr.ours .size-bar::after { background: var(--mini); }
.table-note { max-width: var(--measure); margin: 0.6rem 0 0; font-size: 0.82rem; line-height: 1.5; color: var(--muted); }
.nn-table td.task { white-space: normal; min-width: 15rem; }
.nn-table tr.prism th[scope="row"] { color: var(--mini); }
.table-wrap.narrow { max-width: 34rem; }
table.results.agg-table { min-width: 26rem; }
.agg-table b { font-weight: 650; color: var(--ink); }
.nn-table .tag { margin-left: 0.45em; padding: 0.1em 0.35em; border: 1px solid var(--rule); border-radius: 3px; font: 500 0.6rem/1 var(--f-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); vertical-align: 0.1em; }

.toggle-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 1.4rem; }
.seg, .tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg button, .tabs button { padding: 0.35rem 0.7rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--surface); color: var(--ink-2); font: 500 0.76rem/1.2 var(--f-mono); cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease; }
.seg button:hover, .tabs button:hover { color: var(--accent); border-color: var(--accent); }
.seg button[aria-pressed="true"], .tabs button[aria-selected="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }

.bars { max-width: 48rem; margin: 1.1rem 0 0; }
.bar-row { display: grid; grid-template-columns: 12.5rem minmax(0, 1fr) 3.4rem; align-items: center; gap: 0.9rem; padding-block: 0.45rem; }
.bar-row + .bar-row { border-top: 1px solid color-mix(in srgb, var(--rule) 70%, transparent); }
.bar-row dt { font-size: 0.92rem; color: var(--ink-2); }
.bar-row.prism dt { color: var(--ink); font-weight: 600; }
.bar-row dd { display: contents; }
.bar-track { position: relative; height: 0.7rem; background: repeating-linear-gradient(to right, transparent 0 calc(25% - 1px), color-mix(in srgb, var(--rule) 80%, transparent) calc(25% - 1px) 25%); }
.bar { position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: 0 4px 4px 0; transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.bar-row.none .bar { background: var(--none); }
.bar-row.native .bar { background: var(--native); }
.bar-row.prism .bar { background: var(--mini); }
.bar-value { font: 500 0.85rem/1 var(--f-mono); text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.bar-row.prism .bar-value { color: var(--ink); font-weight: 600; }
.bar-axis { display: grid; grid-template-columns: 12.5rem minmax(0, 1fr) 3.4rem; gap: 0.9rem; max-width: 48rem; margin-top: 0.25rem; font: 500 0.66rem/1 var(--f-mono); color: var(--muted); }
.bar-axis span { position: relative; grid-column: 2; height: 1em; }
.bar-axis i { position: absolute; left: var(--x); font-style: normal; transform: translateX(-50%); }

.demos { display: grid; gap: 2rem; margin-top: 2rem; }
.demo-group h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.7rem; margin: 0 0 0.7rem; font: 600 1rem/1.35 var(--f-body); }
.demo-group h3 span { font: italic 400 0.95rem/1.35 var(--f-display); color: var(--muted); }
.demo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
.demo video { display: block; width: 100%; height: auto; border-radius: 5px; background: var(--surface); }
.demo figcaption { margin-top: 0.5rem; font: 400 0.98rem/1.4 var(--f-terminal); color: var(--ink); }
.demo figcaption small { display: block; margin-top: 0.25rem; font: 500 0.68rem/1.3 var(--f-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }

.neighbors { margin-top: 0.9rem; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; margin-top: 0.9rem; }
.trio video { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 5px; background: var(--surface); }
.trio .who { display: block; margin-bottom: 0.4rem; font: 500 0.68rem/1.3 var(--f-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink); }
.trio .who small { display: block; font-size: 1em; color: var(--muted); letter-spacing: 0.05em; text-transform: none; }
.trio .native .who { color: var(--ink-2); }
.trio .native video { box-shadow: 0 0 0 1.5px var(--native); }
.trio .prism .who { color: var(--mini); }
.trio .prism video { box-shadow: 0 0 0 1.5px var(--mini); }
.trio figcaption { margin-top: 0.45rem; font: 400 0.95rem/1.4 var(--f-terminal); color: var(--ink); }
.player { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; margin-top: 0.9rem; }
.play { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; padding: 0; border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.play:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.play:disabled { opacity: 0.5; cursor: progress; }
.play svg { width: 0.7rem; height: 0.7rem; }
.play .i-play, .play.paused .i-pause { display: none; }
.play.paused .i-play { display: block; }
.scrub { flex: 1 1 10rem; min-width: 0; accent-color: var(--accent); cursor: pointer; }
.step { min-width: 6.5rem; font: 500 0.72rem/1.3 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.load-error { margin: 1rem 0 0; color: var(--ink-2); }

details.protocol { max-width: var(--measure); margin-top: 1.6rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
details.protocol summary { display: flex; align-items: center; gap: 0.6rem; padding-block: 0.75rem; font: 600 0.95rem/1.35 var(--f-body); cursor: pointer; list-style: none; }
details.protocol summary::-webkit-details-marker { display: none; }
details.protocol summary::before { content: "+"; display: grid; place-items: center; width: 1.2rem; height: 1.2rem; border: 1px solid var(--rule); border-radius: 50%; font: 500 0.8rem/1 var(--f-mono); color: var(--accent); }
details.protocol[open] summary::before { content: "\2212"; }
details.protocol summary:hover { color: var(--accent); }
details.protocol .prose { padding-bottom: 1rem; font-size: 0.95rem; }

.bottom { display: grid; justify-items: center; gap: 0.35rem; padding-block: 1.6rem 0; border-top: 1px solid var(--rule); }
.to-top { display: grid; place-items: center; width: 2rem; height: 2rem; margin-bottom: 0.6rem; border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); color: var(--ink-2); }
.to-top:hover { color: var(--accent); border-color: var(--accent); }
.to-top svg { width: 1rem; height: 1rem; }
.bottom .credits { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem 1.2rem; }
.bottom p { margin: 0; font: 500 0.72rem/1.4 var(--f-mono); letter-spacing: 0.04em; color: var(--muted); text-align: center; }

html.lightbox-open { overflow: hidden; }
.lightbox { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden; background: rgb(8 10 14 / 0.84); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #e9ebf0; cursor: zoom-out; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { display: grid; justify-items: center; gap: 0.9rem; margin: 0; padding: 3.5rem 1rem 1.5rem; }
.lightbox img { display: block; width: auto; max-width: none; height: auto; padding: 1rem; border-radius: 6px; background: #fff; transform-origin: 0 0; }
.lightbox figcaption { max-width: 60ch; margin: 0; font: 500 0.88rem/1.4 var(--f-body); color: #c9ced8; text-align: center; text-wrap: balance; }
.lightbox-close { position: fixed; top: calc(1rem + env(safe-area-inset-top, 0px)); right: 1rem; width: 2.5rem; height: 2.5rem; padding: 0; border: 1px solid rgb(255 255 255 / 0.25); border-radius: 50%; background: rgb(255 255 255 / 0.08); color: #fff; font: 400 1.5rem/1 var(--f-body); cursor: pointer; }
.lightbox-close:hover { background: rgb(255 255 255 / 0.18); }

@media (max-width: 760px) {
  .hero, .section { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; margin-bottom: 1.2rem; padding-top: 0; }
  .hero .rail { margin-bottom: 1rem; padding-top: 0; }
  .teaser { padding-left: 0; }
  .steps, .steps.three { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .top nav a[href="#in-action"], .top nav a[href="#bottleneck"] { display: none; }
  .figures { grid-template-columns: minmax(0, 1fr); }
  .bar-row, .bar-axis { grid-template-columns: minmax(0, 1fr) 3.4rem; row-gap: 0.35rem; }
  .bar-row dt { grid-column: 1 / -1; }
  .bar-axis span { grid-column: 1; }
    .demo-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
  .demo-row::-webkit-scrollbar { display: none; }
  .demo { scroll-snap-align: start; }
  .trio { gap: 0.5rem; }
  .trio .who small { display: none; }
  .trio figcaption { font-size: 0.82rem; }
}

.top-name { color: var(--ink); font: 500 0.9rem/1 var(--f-mono); letter-spacing: 0.04em; text-decoration: none; }
.top-name:hover { color: var(--accent); }
.anon { margin: 1.1rem 0 0; color: var(--muted); font-size: 0.95rem; }

.top nav a[aria-current="true"] { color: var(--accent); }
.nav-ref { margin-right: 0.45em; font: 500 0.7rem/1 var(--f-mono); letter-spacing: 0.04em; color: var(--accent); }
@media (max-width: 820px) { .nav-ref { display: none; } }
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; margin: 1.8rem 0 0; padding: 0; list-style: none; }
.cat { display: block; height: 100%; padding: 0.75rem 0.9rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--ink); font: 600 0.98rem/1.3 var(--f-body); text-decoration: none; transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease; }
.cat small { display: block; margin-top: 0.3rem; font: 500 0.68rem/1.3 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cat:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.rail small { display: block; margin-top: 0.25rem; color: var(--muted); opacity: 0.8; letter-spacing: 0.05em; }
.intro { max-width: var(--measure); margin: 0; font-size: 1.04rem; line-height: 1.55; color: var(--ink-2); }
.intro strong { color: var(--ink); font-weight: 600; }
.intro + .intro { margin-top: 0.8em; }
/* Prediction clips: 2x2 video (recorded/predicted x agent/wrist) with labels beside its rows and above its columns. */
.pred-frame { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr 1fr; column-gap: 0.45rem; }
.pred-frame video { grid-column: 2 / 4; grid-row: 2 / 4; }
.pred-label { font: 500 0.64rem/1.2 var(--f-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.pred-col { grid-row: 1; margin-bottom: 0.3rem; text-align: center; }
.pred-col.c1 { grid-column: 2; }
.pred-col.c2 { grid-column: 3; }
.pred-row { grid-column: 1; display: flex; align-items: center; justify-content: center; margin: 3px 0; padding-left: 0.3rem; border-left: 2px solid var(--rule); writing-mode: vertical-rl; transform: rotate(180deg); }
.pred-row.r1 { grid-row: 2; }
.pred-row.r2 { grid-row: 3; border-left-color: var(--accent); color: var(--accent); }
.pred-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 1.2rem; margin-top: 0.9rem; }
@media (max-width: 900px) { .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .cats { grid-template-columns: minmax(0, 1fr); }
  .pred-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) { .hero .rail:empty { display: none; } }
.ref { color: var(--accent); }
.rail .ref, .cat .ref { display: block; margin-bottom: 0.3rem; font: 600 0.68rem/1.3 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.table-title .ref { font: inherit; font-style: normal; color: var(--accent); }
.intro strong.ref { color: var(--accent); }

/* Figure S4: real-robot rollouts. Paired trials sit in a one-slide carousel. */
.carousel-track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: 1.2rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline-offset: 4px; }
.rr-slide { scroll-snap-align: start; min-width: 0; }
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-top: 0.8rem; }
.carousel-btn { display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); color: var(--ink-2); cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease; }
.carousel-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.carousel-btn:disabled { opacity: 0.35; cursor: default; }
.carousel-btn svg { width: 1rem; height: 1rem; }
.carousel-count { min-width: 3.5rem; text-align: center; font: 500 0.72rem/1 var(--f-mono); letter-spacing: 0.06em; color: var(--muted); }
.rr-labels { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 0.4rem; }
.rr-labels.one { grid-template-columns: 1fr; }
.rr-who { font: 500 0.68rem/1.3 var(--f-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-2); }
.rr-who.mini { color: var(--mini); }
.rr-who b { margin-left: 0.6em; padding: 0.1em 0.4em; border: 1px solid var(--rule); border-radius: 3px; font-weight: 500; font-size: 0.92em; color: var(--muted); }
.rr-who b.ok { border-color: color-mix(in srgb, var(--mini) 40%, transparent); background: var(--mini-soft); color: var(--mini); }
.demo-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .demo-row.two { grid-auto-columns: 84%; }
  .rr-who b { display: inline-block; margin: 0.2rem 0 0 0.45em; }
}
