/* MemJev project page. Layout language: a product page — large captions, one idea per screen, a day part (method, numbers)
   and a night part (the real robot). The blue → teal → green gradient marks the key words; blue is the paper's method colour. */
/* fonts are part of the page (assets/fonts, SIL Open Font License): no request leaves the folder */
@font-face { font-family: "Inter"; src: url("fonts/Inter-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-latin.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2,.75,.25,1);
  --ok: #1f9d55; --bad: #d93025;
}
:root, .chapter, .hero {
  --bg: #f5f5f7; --card: #ffffff; --ink: #1d1d1f; --ink2: #515154; --ink3: #86868b;
  --glass: rgba(255,255,255,.7); --line: rgba(0,0,0,.09); --soft: rgba(0,0,0,.05);
  --on: #1d1d1f; --on-ink: #ffffff; --accent: #0071e3; --base: #c3c6cf;
  --grad: linear-gradient(90deg, #0a6cff 0%, #17a9c9 55%, #25b97f 100%);
  /* capsule colour words in the shell game questions: a gradient like --grad, in the tones of the capsule (not its exact colour) */
  --grad-navy: linear-gradient(90deg, #14205c 0%, #2a45b8 55%, #4a6cf0 100%); --grad-bronze: linear-gradient(90deg, #8a4f16 0%, #b06a28 55%, #cf9440 100%);
}
html.night, .chapter.dark, .credits {
  --bg: #000000; --card: #131316; --ink: #f5f5f7; --ink2: #c7c7cc; --ink3: #8e8e93;
  --glass: rgba(22,22,26,.68); --line: rgba(255,255,255,.14); --soft: rgba(255,255,255,.07);
  --on: #f5f5f7; --on-ink: #101012; --accent: #4da3ff; --base: #4a4a52;
  --grad: linear-gradient(90deg, #5fb0ff 0%, #5fe0d2 55%, #8ff0a6 100%);
  --ok: #30d158; --bad: #ff453a;
  /* on black a true navy (#1b2a6b) has contrast 1.6, so the navy tones start at a lighter navy and get lighter still */
  --grad-navy: linear-gradient(90deg, #3d5df0 0%, #7391ff 55%, #b4c6ff 100%); --grad-bronze: linear-gradient(90deg, #b8642a 0%, #e0994a 55%, #f8d594 100%);
}

* { box-sizing: border-box; }
html { background: #f5f5f7; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; transition: background-color .7s; }
html.night { background: #000; }
body { margin: 0; min-width: 320px; font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: #b9dcff; color: #0b2545; }
a { color: inherit; }
em { font-style: normal; }
h1, h2, h3, p { margin: 0; }
.nw { white-space: nowrap; }
img { max-width: 100%; height: auto; }

/* ───────────────────────────── captions */
.cap { font-size: clamp(23px, 2.55vw, 40px); line-height: 1.12; font-weight: 600; letter-spacing: -.03em; color: var(--ink); text-wrap: balance; }
.cap em, .ln-brand em { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cap .mute { color: var(--ink3); }
.lede { max-width: 50em; margin: 30px auto 0; font-size: clamp(16px, 1.3vw, 20px); line-height: 1.5; font-weight: 450; letter-spacing: -.012em; color: var(--ink2); text-wrap: balance; }
.lede strong { color: var(--ink); font-weight: 650; }
.lede .tl { margin-right: .5em; font-size: .66em; font-weight: 650; letter-spacing: .18em; color: var(--accent); vertical-align: .1em; }
.eyebrow { margin: 0 0 16px; font-size: 12px; font-weight: 650; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.foot { max-width: 720px; margin: 30px auto 0; font-size: 13.5px; line-height: 1.6; color: var(--ink3); text-wrap: pretty; }

/* ───────────────────────────── opening: the paper title block; the method film follows on the same screen */
.hero { position: relative; text-align: center; padding: max(9vh, 64px) 5vw 3vh; }
.paper-title { max-width: 1120px; margin: 0 auto; font-size: clamp(27px, 3.3vw, 52px); line-height: 1.1; font-weight: 650; letter-spacing: -.034em; color: var(--ink); text-wrap: balance; }
.paper-title em { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.authors { margin-top: 1.1em; font-size: clamp(15px, 1.2vw, 19px); font-weight: 500; line-height: 1.5; color: var(--ink); }
.links { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 19px 0 15px; border-radius: 999px; background: var(--on); color: var(--on-ink);
  font-size: 15px; font-weight: 550; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .2s; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -14px rgba(0,60,140,.5); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.btn:focus-visible, .copy-btn:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* the opening copy arrives in steps */
html.js .paper-title, html.js .hero .authors, html.js .hero .links, html.js .hero .lede { opacity: 0; transform: translateY(16px); filter: blur(6px); }
.paper-title, .hero .authors, .hero .links, .hero .lede { transition: opacity .9s var(--ease), transform 1.1s var(--ease), filter .9s; }
.hero .authors { transition-delay: .12s; } .hero .links { transition-delay: .22s; } .hero .lede { transition-delay: .32s; }
html.in .paper-title, html.in .hero .authors, html.in .hero .links, html.in .hero .lede { opacity: 1; transform: none; filter: none; }

/* ───────────────────────────── the films (method, training): one screen each; a film plays by itself while it is on the screen */
.film { position: relative; }
.stage { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; }
.stage-box { position: absolute; left: 50%; top: 22vh; width: min(94vw, 1360px); height: 65vh; transform: translateX(-50%); }
.motion { display: block; width: 100%; height: 100%; overflow: visible; font-family: var(--font); }
/* scene captions: one at a time, at the top of the stage */
.caps { --eye: 42px; position: absolute; z-index: 2; left: 0; right: 0; top: max(6.6vh, 66px); padding: 0 6vw; text-align: center; pointer-events: none; }
.fc { position: absolute; left: 6vw; right: 6vw; top: 0; font-size: clamp(21px, 2.3vw, 36px); opacity: 0; will-change: opacity, transform; }
/* which film this is ("How does it work?" = inference, "How is it trained?" = training): one line above the captions.
   It comes in when the film starts playing (page.js adds .in then, so it arrives with the first caption and the drawing, never alone
   on an empty stage) and then stays; --eye = the room it takes */
.film-eye { margin: 0; height: var(--eye); font-size: clamp(20px, 1.8vw, 28px); line-height: 1.2; font-weight: 650; letter-spacing: -.012em; color: var(--accent); }
html.js .film-eye { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
html.js .film-eye.in { opacity: 1; transform: none; }
/* the label sits on its own line above the centred captions and starts at the same x as the INSTRUCTION / DEMONSTRATION label of the drawing:
   page.js sets `left` on every frame (the camera moves that label); the value here is only where it is before the script runs */
.film-eye { position: absolute; top: 0; left: max(3vw, calc((100vw - 1360px) / 2)); text-align: left; white-space: nowrap; }
.caps .fc { top: var(--eye); }
@media (max-height: 780px) { .caps { --eye: 31px; top: 58px; } .film-eye { font-size: 20px; } .stage-box { top: calc(22vh + 12px); height: calc(65vh - 12px); } }
/* play / pause and the six scenes */
.film-bar { position: absolute; z-index: 3; left: 50%; bottom: max(2.8vh, 16px); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; }
.film-ctl { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%); box-shadow: inset 0 0 0 1px var(--line); }
.film-play { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--on); color: var(--on-ink); cursor: pointer; transition: transform .25s var(--ease); }
.film-play:hover { transform: scale(1.08); }
.film-play svg { width: 16px; height: 16px; display: none; }
.film-ctl[data-state="playing"] .i-pause, .film-ctl[data-state="paused"] .i-play, .film-ctl[data-state="ended"] .i-replay { display: block; }
.film-steps { margin: 0; padding: 0; list-style: none; display: flex; gap: 5px; }
.film-steps button { display: block; width: 34px; height: 24px; padding: 10px 0; border: 0; background: none; cursor: pointer; }
.film-steps button::before { content: ""; display: block; height: 4px; border-radius: 2px; background: linear-gradient(var(--ink), var(--ink)) 0 0 / calc(var(--p, 0) * 100%) 100% no-repeat, rgba(127,127,135,.28); }
.film-play:focus-visible, .film-steps button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
/* speed of the film: three round buttons to the right of the controls (0.5x, 1x, 2x of the film's own speed; one setting for both films) */
.film-speed { display: flex; gap: 6px; }
.film-speed button { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; font: inherit; font-size: 12px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ink2);
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%); box-shadow: inset 0 0 0 1px var(--line); transition: transform .25s var(--ease), background-color .2s, color .2s; }
.film-speed button:hover { transform: scale(1.08); color: var(--ink); }
.film-speed button[aria-pressed="true"] { background: var(--on); color: var(--on-ink); box-shadow: none; }
.film-speed button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the drawing */
.motion text { fill: var(--ink); }
.motion .t-eye { font-size: 11.5px; font-weight: 650; letter-spacing: .2em; fill: var(--accent); }
.motion .t-instr { font-size: 17px; font-style: italic; font-weight: 450; fill: var(--ink2); letter-spacing: -.01em; }
.motion .t-lab { font-size: 14px; font-weight: 500; fill: var(--ink3); }
.motion .t-key { font-size: 14px; font-weight: 600; fill: var(--accent); }
.motion .t-sub { font-size: 13.5px; font-weight: 450; fill: var(--ink3); }
.motion .t-title { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.motion .t-title.sm { font-size: 17.5px; }
.motion .t-pick { font-size: 15px; font-weight: 600; fill: var(--accent); letter-spacing: -.01em; }
.motion .t-chip { font-size: 12px; font-weight: 600; fill: var(--accent); }
.motion .chip { fill: rgba(0,113,227,.1); }
.motion .card { fill: #fff; stroke: rgba(0,0,0,.07); stroke-width: 1; }
.motion .wire { fill: none; stroke: #a1a1a6; stroke-width: 1.6; stroke-linecap: round; }
.motion .wire.key { stroke: var(--accent); stroke-width: 2; }
.motion .wire.dash { stroke-dasharray: 5 6; }
.motion .brk { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.motion .fr { opacity: 0; }
.motion .fr-b { fill: none; stroke: rgba(0,0,0,.14); stroke-width: 1; }
.motion .fr.new .fr-b { stroke: var(--accent); stroke-width: 2.5; }
.motion .dot { fill: url(#gk); opacity: 0; }
.motion .bars rect { fill: #e7e9ef; }
.motion .bars.lit rect { fill: url(#gk); opacity: 0; }
.motion .ob { fill: #fff; stroke: #c7c7cc; stroke-width: 1.2; }
.motion .ol { font-size: 14px; font-weight: 650; fill: var(--ink2); }
.motion .ol.sm { font-size: 12.5px; }
.motion .ot { font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.motion .sbar { fill: #d4d7df; }
.motion .sbar.win { fill: url(#gk); }
.motion .ob.win.on { fill: #0a6cff; stroke: #0a6cff; }
.motion .winl.on { fill: #fff; }
.motion .ring { fill: none; stroke: #0a6cff; stroke-width: 3; }
.motion .hl { fill: rgba(10,108,255,.11); opacity: 0; }
.motion .ot.on { fill: #0a6cff; font-weight: 650; }
#m-held rect#m-held-r { fill: #f5f5f7; stroke: #0a6cff; stroke-width: 1.6; }      /* outline only: the fill is the page colour, so nothing shows through while it moves */
.motion #m-held text { fill: #1d1d1f; font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.motion #m-held .at { fill: #86868b; font-weight: 500; }
#m-held .eb, #m-efly rect { fill: #0a6cff; }
.motion #m-held .el, .motion #m-efly text { fill: #fff; font-size: 13px; font-weight: 650; }
#m-held, #m-efly, #m-heldlab text { opacity: 0; }
/* scene 6 of the first film: the whole episode on one line */
#m-all, #a-call, #a-note, #a-done, .motion .a-chip, .motion .a-sc, .motion .a-w, .motion .a-r { opacity: 0; }
.motion .a-track { fill: none; stroke: #b4b7c0; stroke-width: 2; stroke-dasharray: .1 8; stroke-linecap: round; }
.motion .a-lab { font-size: 12.5px; font-weight: 500; fill: var(--ink3); } .motion .a-lab.key { font-weight: 600; fill: var(--accent); }
.motion .a-s1 { fill: #fff; stroke: #0a6cff; stroke-width: 1.8; } .motion .a-s3 { fill: #f6faff; stroke: #c9defc; stroke-width: 1.2; }
.motion .a-sg { fill: none; stroke: #0a6cff; stroke-opacity: .2; stroke-width: .8; }
.motion #a-tile text { font-size: 28px; font-weight: 650; font-style: italic; fill: url(#gk); }
.motion .a-ring { fill: none; stroke: #0a6cff; stroke-width: 2.4; }
.motion .a-call, .motion .a-note { font-size: 12.5px; font-weight: 600; fill: var(--accent); }
.motion .a-chip rect.b { fill: #fff; stroke: rgba(0,0,0,.12); stroke-width: 1; }
.motion .a-chip.new rect.b { stroke: #0a6cff; stroke-width: 1.8; }
.motion .a-chip text { font-size: 13px; font-weight: 600; fill: #6e6e73; letter-spacing: -.005em; }
.motion .a-chip.new text { fill: #1d1d1f; }
.motion .a-chip text.l2 { font-size: 11px; } .motion .a-chip text.at { fill: #86868b; font-weight: 500; }
.motion .a-chip .eb { fill: #0a6cff; } .motion .a-chip text.el { fill: #fff; font-size: 10px; font-weight: 650; }
#a-done circle { fill: #1f9d55; } #a-done path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.motion #a-done text { font-size: 15px; font-weight: 600; fill: #1f9d55; }
.motion #af5.ok .fr-b { stroke: #1f9d55; stroke-width: 2.5; }
.motion .a-sc rect.b { fill: #fff; stroke: rgba(0,0,0,.07); stroke-width: 1; }
.motion .a-ob { fill: #fff; stroke: #c7c7cc; stroke-width: 1; } .motion .a-ob.win { fill: #0a6cff; stroke: #0a6cff; }
.motion text.a-ol { font-size: 8px; font-weight: 650; fill: var(--ink2); } .motion text.a-ol.win { fill: #fff; }
.motion .a-bar { fill: #d4d7df; } .motion .a-bar.win { fill: url(#gk); }
#m-pill rect { fill: #111114; } .motion #m-pill text { fill: #fff; font-size: 15px; font-weight: 650; }
#m-ghost rect { fill: rgba(255,255,255,.92); stroke: url(#gk); stroke-width: 2; stroke-dasharray: 5 4; }
.motion #m-ghost text:first-of-type { font-size: 40px; font-weight: 650; font-style: italic; fill: url(#gk); }
#m-tile .st1 { fill: #fff; stroke: #0a6cff; stroke-width: 2; }
#m-tile .st2 { fill: #eef5ff; stroke: #9cc4ff; stroke-width: 1.5; }
#m-tile .st3 { fill: #f6faff; stroke: #c9defc; stroke-width: 1.5; }
#m-tile .stg { fill: none; stroke: #0a6cff; stroke-opacity: .2; stroke-width: 1; }
.motion #m-tile text { font-size: 62px; font-weight: 650; font-style: italic; fill: url(#gk); }
/* training film */
.motion .an.a { fill: #c7dcff; } .motion .an.b { fill: #bdead6; }
.motion .cur { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.motion .curh { fill: var(--ink); }
.motion .ring.g { stroke: #16a36a; opacity: 0; }
.motion .wire.grn { stroke: #16a36a; stroke-width: 2; }
.motion .t-grn { font-size: 14px; font-weight: 600; fill: #16a36a; }
.motion .t-eye.grn { fill: #16a36a; }
.motion .t-warm { font-size: 14px; font-weight: 600; fill: #f0642c; }
.motion .grad { fill: none; stroke: url(#gw); stroke-width: 3; stroke-linecap: round; }
#t-grad { color: #ffab2e; }
.motion .chip.warm { fill: rgba(240,100,44,.13); } .motion .t-chip.warm { fill: #e0541f; }
.motion .t-mini { font-size: 11.5px; font-weight: 600; fill: var(--ink3); }
.motion .t-mini.warm { fill: #e0541f; }
.motion .ada rect { fill: #ffb58a; transition: fill .2s; }
.motion .ada rect.hot { fill: #ff5a36; }
.motion .flame { fill: #ff7a3d; }
.motion .t-lab.ink { fill: var(--ink); font-weight: 600; }
.motion .stt rect { fill: #fff; stroke: #0a6cff; stroke-width: 1.6; }
.motion .stt text { font-size: 19px; font-weight: 650; font-style: italic; fill: #0a6cff; }
.motion .stt.hot rect { stroke: #f0642c; stroke-width: 2.6; } .motion .stt.hot text { fill: #f0642c; }
#t-ok circle { fill: #16a36a; } #t-ok path, .motion .okp { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.motion .t-eye.warm { fill: #e0541f; }
#t-loss .eq { fill: var(--ink); }                 /* the loss, typeset with LaTeX and inlined as outlines (build/make_eq.py) */
#t-qp rect { fill: #111114; } .motion #t-qp text { font-size: 13px; font-weight: 600; fill: #fff; }
.motion .t-q { font-size: 16.5px; font-weight: 600; letter-spacing: -.015em; }
.motion .t-ans { font-size: 15px; font-weight: 600; fill: var(--accent); letter-spacing: -.01em; }
.motion .t-ans.grn { fill: #16a36a; }
.motion .okc { fill: #0a6cff; } .motion .okc.grn { fill: #16a36a; }
.motion .card.on { stroke: #0a6cff; stroke-width: 2; } .motion .card.on.grn { stroke: #16a36a; }
.motion .card.hot { stroke: #f0642c; stroke-width: 2; }
#m-vlm-r { transition: stroke .25s, stroke-width .25s; }
/* the low-level policy block: a grey outline that shows on the page colour before the block lights up (.on turns it blue) */
#m-pol-r { transition: stroke .25s, stroke-width .25s; }
#m-pol-r:not(.on) { stroke: rgba(0,0,0,.26); stroke-width: 1.5; }

/* ───────────────────────────── chapters */
.chapter { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 15vh 6vw; }
.chapter.task { padding-top: 12vh; padding-bottom: 12vh; }
.card { background: var(--card); border-radius: clamp(18px, 2vw, 30px); box-shadow: 0 1px 0 var(--line), 0 40px 80px -50px rgba(0,0,0,.35); }
.figure { width: 100%; max-width: 1180px; margin: 52px auto 0; padding: clamp(16px, 2.6vw, 40px); }
.figure img { display: block; width: 100%; }
/* scroll reveal */
html.js .rv { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
html.js .rv.in { opacity: 1; transform: none; }

/* ───────────────────────────── charts */
.chart { width: 100%; margin: 56px auto 0; }
/* comparison tables (the numbers of the paper's tables) */
.tbl-wrap { width: 100%; max-width: 1180px; margin: 48px auto 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 20px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.tbl-wrap.narrow { max-width: 640px; }
.tbl-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.25; font-variant-numeric: tabular-nums; color: var(--ink2); }
.tbl th, .tbl td { padding: 9px 7px; text-align: center; white-space: nowrap; font-weight: 450; }
.tbl thead th { padding-top: 12px; padding-bottom: 10px; font-size: 11.5px; font-weight: 600; color: var(--ink2); vertical-align: bottom; }
.tbl thead tr.grp th { padding-bottom: 2px; font-size: 10.5px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.tbl thead th span { font-weight: 450; color: var(--ink3); }
.tbl th.m, .tbl tbody th { text-align: left; padding-left: 20px; padding-right: 14px; }
.tbl tbody th { position: sticky; left: 0; z-index: 1; background: var(--card); font-weight: 500; color: var(--ink); }
.tbl tbody tr > * { border-top: 1px solid var(--line); }
.tbl tr.sec th { position: static; padding-top: 7px; padding-bottom: 7px; font-size: 11.5px; font-style: italic; font-weight: 450; color: var(--ink3); background: var(--soft); }
.tbl .g { border-left: 1px solid var(--line); } .tbl .avg { border-left: 1px solid var(--line); padding-right: 18px; color: var(--ink); }
.tbl td b { font-weight: 700; color: var(--ink); } .tbl td u { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.tbl tr.ours > * { background: linear-gradient(rgba(10,108,255,.1), rgba(10,108,255,.1)), var(--card); color: var(--ink); }      /* weights stay as in the other rows, so bold still means the highest score */
.tbl tr.ours th { font-weight: 650; }
.tbl-real { font-size: 15px; } .tbl-real th, .tbl-real td { padding: 14px 16px; } .tbl-real thead th { font-size: 13.5px; }
.tbl sup { font-size: .7em; }
@media (max-width: 600px) { .tbl-real { font-size: 13.5px; } .tbl-real th, .tbl-real td { padding: 12px 8px; } .tbl-real thead th { font-size: 12px; } .tbl th.m, .tbl tbody th { padding-left: 14px; padding-right: 8px; } }
.bars { max-width: 760px; height: min(46vh, 400px); display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 4vw, 56px); align-items: end; }
.bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar i { display: block; width: 100%; max-width: 150px; height: calc(var(--v) / 60 * (100% - 74px)); border-radius: 16px 16px 6px 6px; background: var(--base); transform-origin: bottom; transform: scaleY(0); transition: transform 1.3s var(--ease) .15s; }
.bar b { margin-bottom: 10px; font-size: clamp(22px, 2.4vw, 34px); font-weight: 600; letter-spacing: -.03em; color: var(--ink3); opacity: 0; transition: opacity .6s .9s; }
.bar span { margin-top: 12px; font-size: clamp(13px, 1.05vw, 16px); font-weight: 550; color: var(--ink2); }
.bar.ours i, .hbar.ours i { background: var(--grad); }
.bar.ours b, .hbar.ours b { color: var(--ink); }
.bar.ours span, .hbar.ours span { color: var(--ink); font-weight: 650; }
.in .bar i { transform: none; } .in .bar b { opacity: 1; }
.hbars { max-width: 860px; display: grid; gap: 22px; text-align: left; }
.hbar { display: grid; grid-template-columns: minmax(118px, 170px) minmax(0, 1fr) 96px; align-items: center; gap: 16px; }
.hbar span { font-size: clamp(13px, 1.05vw, 16px); font-weight: 550; color: var(--ink2); }
.hbar i { display: block; height: 34px; width: max(8px, calc(var(--v) / 1797 * 100%)); border-radius: 6px 17px 17px 6px; background: var(--base); transform-origin: left; transform: scaleX(0); transition: transform 1.3s var(--ease) .15s; }
.hbar b { font-size: clamp(15px, 1.3vw, 20px); font-weight: 600; letter-spacing: -.02em; color: var(--ink3); white-space: nowrap; }
.in .hbar i { transform: none; }
.slope { max-width: 760px; }
.slope svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font); }
.slope .grid line { stroke: var(--line); stroke-width: 1; }
.slope .ln line { stroke: var(--base); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 360; stroke-dashoffset: 360; transition: stroke-dashoffset 1.4s var(--ease) .2s; }
.slope .ln circle { fill: var(--base); }
.slope .ln text { font-size: 15px; font-weight: 600; fill: var(--ink3); letter-spacing: -.01em; }
.slope .ln text.nm { font-size: 12.5px; font-weight: 500; }
.slope .ln.ours line { stroke: #17a9c9; stroke-width: 4; } .slope .ln.ours circle { fill: #17a9c9; }
.slope .ln.ours text { fill: var(--ink); } .slope .ln.ours text.nm { font-weight: 650; }
.slope .ax text { font-size: 12.5px; fill: var(--ink3); }
.in .slope .ln line, .slope.in .ln line { stroke-dashoffset: 0; }

/* ───────────────────────────── the real robot */
.steps { list-style: none; width: 100%; max-width: 980px; margin: 54px auto 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; text-align: left; }
.steps li { background: var(--card); border-radius: 24px; padding: 24px 24px 26px; box-shadow: inset 0 0 0 1px var(--line); }
.steps span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--soft); font: 500 13px/1 var(--mono); color: var(--accent); }
.steps h3 { margin-top: 16px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.steps p { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--ink2); }

.viewer { width: 100%; max-width: 1280px; margin: 44px auto 0; }
.viewer[data-task="robomme"] { max-width: 1140px; }
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { font: inherit; font-size: 14px; font-weight: 550; letter-spacing: -.01em; color: var(--ink2); background: transparent; border: 0; border-radius: 999px; padding: 8px 18px; cursor: pointer; transition: background-color .25s, color .25s; }
.seg button[aria-selected="true"] { background: var(--on); color: var(--on-ink); }
/* second row of the RoboMME viewer: the tasks of the chosen suite */
.seg2 { margin: 14px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; min-height: 34px; }
.seg2 button { font: inherit; font-size: 13.5px; font-weight: 550; letter-spacing: -.005em; color: var(--ink3); background: transparent; border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer; box-shadow: inset 0 0 0 1px transparent; transition: color .25s, box-shadow .25s, background-color .25s; }
.seg2 button[hidden] { display: none; }
.seg2 button:hover { color: var(--ink); }
.seg2 button[aria-selected="true"] { color: var(--ink); background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.seg2 button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ask { margin: 26px auto 0; max-width: 900px; font-size: clamp(18px, 1.8vw, 28px); line-height: 1.2; font-weight: 600; letter-spacing: -.025em; color: var(--ink); text-wrap: balance; }
.ask b { font-weight: 600; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ask b.navy { background-image: var(--grad-navy); } .ask b.bronze { background-image: var(--grad-bronze); }
/* video controls: play / pause · the two phases as one scrubber · speed */
.vctl { margin: 20px auto 0; width: min(100%, 700px); display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: start; gap: 14px; }
.vbtn { height: 32px; padding: 0; border: 0; cursor: pointer; font: inherit; transition: transform .25s var(--ease), background-color .2s; }
.vbtn:hover { transform: scale(1.06); }
.vplay { width: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--on); color: var(--on-ink); }
.vplay svg { width: 16px; height: 16px; display: none; }
.viewer:not(.paused) .vplay .i-pause, .viewer.paused .vplay .i-play { display: block; }
.vspeed { min-width: 50px; padding: 0 12px; border-radius: 999px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vbtn:focus-visible, .phases:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.phases { display: grid; grid-template-columns: var(--cut, 50%) 1fr; gap: 6px; padding: 12px 0 0; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.phases div { text-align: left; }
.phases i { display: block; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; box-shadow: inset 0 0 0 .5px var(--line); transition: height .2s, margin .2s; }
.phases:hover i { height: 10px; margin-top: -1px; margin-bottom: -1px; }
.phases i::after { content: ""; display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--ink); border-radius: 4px; }
.phases span { display: block; margin-top: 8px; font-size: 12px; font-weight: 550; letter-spacing: .02em; color: var(--ink3); transition: color .3s; white-space: nowrap; }
.phases .on span { color: var(--ink); }
.trio { margin-top: 26px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.3vw, 20px); }
.col { margin: 0; min-width: 0; position: relative; text-align: left; }
.col canvas { display: block; width: 100%; height: auto; aspect-ratio: 640 / 400; border-radius: clamp(12px, 1.5vw, 22px); background: #2a2622; }
.col canvas { box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .4s; }
.col .model { position: absolute; left: 12px; top: 12px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: -.005em; color: #fff;
  background: rgba(20,20,24,.58); -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%); }
.col.ours .model { background: linear-gradient(90deg, #0a6cff, #17a9c9); }
.col figcaption { margin-top: 12px; min-height: 52px; display: flex; flex-direction: column; gap: 5px; padding: 0 4px; }
.col .ans { font-size: clamp(14px, 1.15vw, 17px); font-weight: 550; letter-spacing: -.012em; color: var(--ink3); transition: color .35s; }
.col .ans b { font-weight: 650; color: var(--ink); }
.col .verdict { display: inline-flex; align-items: center; gap: 7px; font-size: clamp(13px, 1.02vw, 15px); font-weight: 600; opacity: 0; transform: translateY(4px); transition: opacity .45s, transform .45s var(--ease); }
.col .verdict::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; background: currentColor;
  -webkit-mask: var(--icon) center / 18px 18px no-repeat; mask: var(--icon) center / 18px 18px no-repeat; }
.col .verdict.ok { color: var(--ok); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M9 0a9 9 0 1 0 0 18A9 9 0 0 0 9 0zm4.3 6.6-4.9 5.6a.9.9 0 0 1-1.3.1L4.6 9.9l1.2-1.3 1.8 1.7 4.3-4.9z'/%3E%3C/svg%3E"); }
.col .verdict.bad { color: var(--bad); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M9 0a9 9 0 1 0 0 18A9 9 0 0 0 9 0zm3.9 11.6-1.3 1.3L9 10.3l-2.6 2.6-1.3-1.3L7.7 9 5.1 6.4l1.3-1.3L9 7.7l2.6-2.6 1.3 1.3L10.3 9z'/%3E%3C/svg%3E"); }
.col .verdict.na { color: var(--ink3); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M9 0a9 9 0 1 0 0 18A9 9 0 0 0 9 0zm4 9.9H5V8.1h8z'/%3E%3C/svg%3E"); }
.viewer.show-verdict .col .verdict { opacity: 1; transform: none; }
.col .note { font-size: 12.5px; line-height: 1.35; color: var(--ink3); opacity: 0; transition: opacity .45s; }
.col .note:empty { display: none; }
.viewer.show-verdict .col .note { opacity: 1; }
.viewer.show-verdict .col.win canvas { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 2px var(--ok); }
.viewer.show-verdict .col.lose canvas { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 2px var(--bad); }

/* ───────────────────────────── chrome: local nav and chapter dots */
.localnav { position: fixed; z-index: 10; top: 0; left: 0; right: 0; height: 50px; padding: 0 max(20px, 2.6vw); display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); border-bottom: 1px solid var(--line);
  transform: translateY(-101%); visibility: hidden; transition: transform .55s var(--ease), background-color .6s, border-color .6s, visibility 0s .55s; }
.localnav.on { transform: none; visibility: visible; transition: transform .55s var(--ease), background-color .6s, border-color .6s, visibility 0s; }
.ln-brand { font-size: 20px; font-weight: 650; letter-spacing: -.03em; color: var(--ink); text-decoration: none; }
.ln-links { display: flex; align-items: center; gap: 26px; }
.ln-links a { font-size: 13px; color: var(--ink2); text-decoration: none; transition: color .2s; }
.ln-links a:hover, .ln-links a:focus-visible { color: var(--ink); }
.dots { position: fixed; z-index: 8; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; }
.dots.on { opacity: 1; visibility: visible; }
.dots a { position: relative; display: block; padding: 7px 9px; }
.dots a::before { content: ""; display: block; width: 8px; height: 8px; border-radius: 4px; background: var(--ink); opacity: .2; transition: height .4s var(--ease), opacity .4s; }
.dots a::after { content: ""; position: absolute; left: 9px; top: 7px; width: 8px; height: 8px; border-radius: 4px; background: var(--ink); opacity: 0; transition: opacity .4s; }
.dots a.done::before { opacity: .45; }
.dots a.on::before { height: 28px; }
.dots a.on::after { height: calc(8px + var(--p, 0) * 20px); opacity: .85; }
.dots a span { position: absolute; right: 28px; top: 50%; transform: translate(6px, -50%); font-size: 12.5px; font-weight: 500; color: var(--ink2); white-space: nowrap; opacity: 0; transition: opacity .25s, transform .25s var(--ease); pointer-events: none; }
.dots a:hover span, .dots a:focus-visible span { opacity: 1; transform: translate(0, -50%); }
.dots a:focus-visible { outline: none; } .dots a:focus-visible::before { opacity: .9; }

/* ───────────────────────────── closing */
.credits { position: relative; padding: 22vh 6vw 8vh; }
.credits-in { max-width: 860px; margin: 0 auto; text-align: center; }
.bibtex { margin: 10vh auto 0; text-align: left; border-radius: 22px; padding: 20px 24px 22px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.bib-head { display: flex; justify-content: space-between; align-items: center; }
.bib-head .eyebrow { margin: 0; }
.bibtex pre { margin: 14px 0 0; overflow-x: auto; font: 13.5px/1.62 var(--mono); color: var(--ink2); tab-size: 2; }
.copy-btn { font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink); background: transparent; border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: background .2s; }
.copy-btn:hover { background: var(--soft); }
.page-foot { margin-top: 9vh; font-size: 12px; color: var(--ink3); }
.credits.end { padding: 5vh 6vw 6vh; text-align: center; } .credits.end .page-foot { margin: 0; }
.to-top { color: var(--ink3); text-decoration: none; } .to-top:hover { color: var(--ink); }

/* ───────────────────────────── smaller screens */
@media (max-width: 900px) {
  .dots { display: none; }
  .ln-links { gap: 16px; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { padding: max(8vh, 62px) 18px 2vh; }
  .stage-box { top: 25vh; height: 62vh; width: 96vw; }
  .caps { --eye: 32px; top: max(7vh, 62px); } .film-eye { font-size: 19px; left: 16px; }
  .film-steps button { width: 26px; }
  .film-bar { gap: 6px; } .film-speed { gap: 4px; } .film-speed button { width: 32px; height: 32px; font-size: 10.5px; }
  .fc { left: 16px; right: 16px; }
  .links { gap: 8px; }
  .chapter { padding: 12vh 16px; }
  .credits { padding-left: 16px; padding-right: 16px; }
  .btn { height: 38px; padding: 0 15px 0 12px; font-size: 14px; }
  .ln-more { display: none; }
  .trio { grid-template-columns: 1fr; gap: 22px; }
  .col figcaption { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
  .hbar { grid-template-columns: 1fr; gap: 6px; }
  .hbar b { order: 3; }
  .seg button { padding: 8px 13px; font-size: 13px; }
  .seg2 { min-height: 68px; align-content: flex-start; } .seg2 button { padding: 7px 11px; font-size: 12.5px; }
  .phases div:not(.on) span { visibility: hidden; }      /* narrow screens: only the running phase is named, so the two names never overlap */
  .bibtex { padding: 16px 16px 18px; border-radius: 18px; }
  .bibtex pre { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .rv, html.js .film-eye, html.js .paper-title, html.js .hero .authors, html.js .hero .links, html.js .hero .lede { opacity: 1; transform: none; filter: none; transition: none; }
  .bar i, .hbar i { transform: none; transition: none; } .bar b { opacity: 1; }
  .slope .ln line { stroke-dashoffset: 0; transition: none; }
}

/* ?p= preview: the film alone, held at one point */
html.still *, html.still *::after, html.still *::before { transition: none !important; animation: none !important; }
html.still:not(.withhero) .hero { display: none; }
html.still .film:not(.solo) { height: 0; overflow: hidden; visibility: hidden; }
@media (max-width: 400px) { .film-steps button { width: 21px; } .film-ctl { padding-right: 12px; } }

/* author block of the named page: names on one line (wrapping on narrow screens), affiliations below */
.authors.named { display: flex; flex-wrap: wrap; justify-content: center; gap: .15em 2.4em; }
.authors .au { white-space: nowrap; }
.authors sup, .affil sup { font-size: .7em; line-height: 0; vertical-align: super; font-weight: 500; }
.authors sup { margin-left: .1em; } .affil sup { margin-right: .12em; }
.affil { margin-top: .45em; display: flex; flex-wrap: wrap; justify-content: center; gap: .15em 2.2em; font-size: clamp(14px, 1.1vw, 17.5px); font-weight: 450; line-height: 1.5; color: var(--ink2); }
.affil.legend { margin-top: .3em; font-size: clamp(12.5px, .95vw, 15px); color: var(--ink3); }
html.js .hero .affil { opacity: 0; transform: translateY(16px); filter: blur(6px); }
.hero .affil { transition: opacity .9s var(--ease), transform 1.1s var(--ease), filter .9s; transition-delay: .17s; }
html.in .hero .affil { opacity: 1; transform: none; filter: none; }
.authors .au a { text-decoration: none; transition: color .2s; }
.authors .au a:hover, .authors .au a:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.btn[aria-disabled="true"] { cursor: default; }
@media (max-width: 760px) { .authors.named { gap: .1em 1.4em; } .affil { gap: .1em 1.4em; } }
@media (prefers-reduced-motion: reduce) { html.js .hero .affil { opacity: 1; transform: none; filter: none; transition: none; } }
