/* Contrastive Direction Steering, project page.
   Layout: full-width colour bands, content in a 1120 px column. Night-blue bands (opening, real robot, citation) carry the
   recordings; light bands carry reading, clips and charts. Motion: a steering field behind the title, sections that rise
   into view, bars that grow. Colours tell the story of the paper: coral = the policy alone going wrong, amber = the target,
   emerald to cyan = steered with CDS, violet = the learned directions. */
@font-face { font-family: "Google Sans"; src: url("../fonts/GoogleSans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Google Sans"; src: url("../fonts/GoogleSans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Google Sans"; src: url("../fonts/GoogleSans-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "LM Mono"; src: url("../fonts/LMMono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "LM Mono"; src: url("../fonts/LMMono-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --night: #fff;        /* dark bands */
  --night-2: #fff;
  --paper: #fff;
  --mist: #fff;         /* tinted light bands */
  --mint: #fff;
  --ink: #15161a;          /* text on light */
  --mute: #676a73;
  --snow: #15161a;         /* text on dark */
  --haze: #676a73;         /* secondary text on dark */
  --line: #dcd8cc;
  --edge: #bdb8a9;
  --violet: #15161a;       /* learned directions, links */
  --violet-deep: #15161a;
  --cyan: #22cfff;
  --emerald: #2146d0;      /* CDS */
  --emerald-deep: #2146d0;
  --coral: #ff5a6e;        /* the policy alone going wrong */
  --amber: #ffc23d;        /* the target */
  --bar: #b7b3a6;
  --bar-light: #d8d4c8;
  --track: #e9e6dc;
  --best: #c9d5fb;
  --second: #e6ebfd;
  --grad-cds: #2146d0;
  --grad-dir: #15161a;
  --sans: "Google Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "LM Mono", "Latin Modern Mono", "Courier New", monospace;
  --col: 1120px;
  --measure: 68ch;
  --gut-l: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17.5px; line-height: 1.55; overflow-x: hidden; }
body.locked { overflow: hidden; }
em, i, cite, dfn, var, address { font-style: normal; }
b, strong { font-weight: 700; }
a { color: var(--violet-deep); }
img, canvas, svg, video { display: block; max-width: 100%; }
p { margin: 10px 0; max-width: var(--measure); }
h1, h2, h3 { text-wrap: balance; }
sub, sup { font-size: .68em; line-height: 0; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }

/* ---- motion: things rise into view once (js/fx.js adds the classes; without it everything is simply there) */
.js .rv { opacity: 0; transform: translateY(28px) scale(.985); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .rv.in { opacity: 1; transform: none; }

/* ---- bar on top */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--night); }
nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--night); padding-left: var(--gut-l); padding-right: var(--gut-r); }

.navin { max-width: var(--col); margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 54px; }
#prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--grad-cds); transform-origin: 0 50%; transform: scaleX(0); }
.brand { font-family: var(--mono); font-weight: 700; font-size: 17px; color: var(--emerald); text-decoration: none; flex: none; }
.links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-left: auto; min-width: 0; }
.links::-webkit-scrollbar { display: none; }
.links a { color: var(--haze); text-decoration: none; padding: 5px 10px; border-radius: 999px; font-size: 15px; white-space: nowrap; transition: color .2s, background .2s; }
.links a:hover { color: var(--snow); }
.links a.on { color: var(--snow); }
.watch { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 500; border-radius: 8px; padding: 5px 13px 5px 8px; background: var(--snow); color: var(--night); border: 0; }
.watch:hover { background: #fff; }
.watch svg { width: 17px; height: 17px; }

/* ---- bands: every section is a full-width band with its content in the column */
main { margin: 0; padding: 0; }
main > section, main > header { margin: 0; padding: 92px max(var(--gut-r), calc((100% - var(--col)) / 2)) 92px max(var(--gut-l), calc((100% - var(--col)) / 2)); position: relative; }
#method { background: var(--mist); }
#ablations { background: var(--mint); }
#try { background: var(--mist); }
#limits { background: var(--mist); }
.hero, .stats, #real, #cite, footer { background: var(--night); color: var(--snow); }

h2 { font-size: clamp(28px, 4vw, 46px); line-height: 1.06; letter-spacing: -.03em; margin: 14px 0 18px; font-weight: 700; max-width: 24ch; }
h3 { font-size: 19px; line-height: 1.3; margin: 22px 0 6px; font-weight: 700; }
h3.sub { font-size: 25px; margin: 64px 0 8px; letter-spacing: -.012em; }
.lead { font-size: 19.5px; line-height: 1.5; }
.note { color: var(--mute); font-size: 15.5px; }
.m { white-space: nowrap; }
.eq { display: block; width: fit-content; font-size: 23px; font-weight: 500; margin: 10px 0 14px; padding: 10px 22px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.kicker { display: block; font-family: var(--mono); font-size: 14.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--emerald-deep); margin: 0; }
#real .kicker, #cite .kicker { display: block; font-family: var(--mono); font-size: 14.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--emerald-deep); margin: 0; }
#real .kicker::before, #cite #real .note, #cite .note, #real figcaption, .hero .note { color: var(--haze); }
#real figcaption b { color: var(--snow); }

/* ---- opening */
.hero { padding-top: 56px; padding-bottom: 40px; overflow: hidden; }
#flow { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; opacity: .45; }
.hero > :not(canvas) { position: relative; z-index: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; max-width: none; }
.tag { font-family: var(--mono); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--haze); } .tag + .tag::before { content: "/"; margin-right: 8px; opacity: .6; }
.herotop { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px 56px; align-items: start; }
h1 { font-size: clamp(33px, 4.5vw, 56px); line-height: 1.04; letter-spacing: -.028em; font-weight: 700; margin: 0; color: #fff; }
h1 .hl { color: var(--emerald); }
.tldr { font-size: clamp(17.5px, 1.5vw, 19.5px); line-height: 1.5; max-width: 60ch; margin: 4px 0 18px; color: #d9defa; }
.tldr b { color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 4px; max-width: none; }
.btn { display: inline-flex; align-items: center; gap: 7px; font-family: inherit; font-size: 16px; font-weight: 500; line-height: 1; color: var(--snow); text-decoration: none; background: none; border: 1px solid rgba(163, 165, 173, .45); border-radius: 8px; padding: 11px 18px 11px 13px; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn:hover { border-color: var(--snow); }
button.btn[data-video] { background: var(--grad-cds); color: var(--night); border-color: transparent; }
.btn.soon, .btn.soon:hover { background: none; color: var(--haze); border-style: dashed; cursor: default; font-weight: 400; transform: none; }

/* ---- headline numbers */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-top: 8px; padding-bottom: 76px; }
.stat { border-radius: 12px; padding: 22px 22px 20px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(163, 165, 173, .25); }
.stat p { margin: 0; max-width: none; }
.stat .num { font-size: clamp(36px, 4.4vw, 56px); font-weight: 700; line-height: 1.02; letter-spacing: -.03em; color: var(--emerald); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .num .to { color: inherit; }
.stat .what { font-size: 17px; line-height: 1.4; margin-top: 10px; color: var(--snow); }
.stat .where { font-family: var(--mono); font-size: 14px; color: var(--haze); margin-top: 6px; }

/* ---- panels for recordings and live demos */
.panel { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 20px; }
.panel.labelled { margin-top: 38px; padding-top: 30px; }
.plabel { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); max-width: calc(100% - 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--night); color: var(--snow); border-radius: 999px; padding: 4px 18px; font-family: var(--mono); font-size: 16px; line-height: 1.35; }
.plabel .w1 { color: #8fb3ff; }
.plabel .w2 { color: var(--amber); }
.panel > .note { max-width: 100ch; margin-bottom: 0; }
.hero .panel, #real .panel { background: rgba(255, 255, 255, .055); border-color: rgba(163, 165, 173, .28); }
@supports (backdrop-filter: blur(6px)) { .hero .panel { backdrop-filter: blur(6px); } }
.hero .plabel, #real .plabel { background: var(--snow); color: var(--night); }
.hero .plabel .w1, #real .plabel .w1 { color: var(--violet-deep); }
.hero .plabel .w2, #real .plabel .w2 { color: #c26a00; }
.row { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.row.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col { flex: 1 1 300px; min-width: 0; }
canvas.view { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
canvas.view.wide { touch-action: auto; }
.scrollx { overflow-x: auto; }
.scrollnote { font-family: var(--mono); font-size: 13.5px; color: var(--mute); margin: 4px 0 0; }

/* ---- controls */
.controls { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; margin: 10px 0 4px; font-size: 15.5px; }
button, select { font: inherit; font-size: 15.5px; color: var(--ink); background: var(--paper); border: 1px solid var(--edge); border-radius: 8px; padding: 5px 14px; cursor: pointer; transition: background .18s, color .18s, border-color .18s, transform .18s; }
button:hover, select:hover { border-color: var(--violet); background: rgba(11, 12, 16, .08); }
button.on { background: var(--violet-deep); border-color: var(--violet-deep); color: #fff; }
button.go { background: var(--grad-cds); border-color: transparent; color: var(--night); font-weight: 700; }
button.go:hover { background: var(--grad-cds); transform: translateY(-1px); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg.small button { font-size: 14.5px; padding: 3px 11px; }
label.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 12px; user-select: none; }
label.chk input { accent-color: var(--violet); margin: 0; }
input[type=range] { accent-color: var(--violet); flex: 1 1 200px; min-width: 120px; }
.pill { display: inline-block; background: var(--mist); border: 1px solid var(--line); border-radius: 999px; padding: 1px 11px; font-size: 15px; font-variant-numeric: tabular-nums; }
.pill.instr { font-family: var(--mono); padding: 2px 13px; }
.pill:empty { display: none; }
.key { display: inline-block; width: 11px; height: 11px; border-radius: 6px; margin-right: 5px; vertical-align: -1px; border: 1px solid #555; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14.5px; color: var(--mute); margin-top: 12px; }
.algrid { display: grid; grid-template-columns: minmax(0, 1fr); }
.algrid .controls { flex-wrap: nowrap; }
.algrid .controls > span:nth-child(2) { white-space: nowrap; }
.hero :is(button, select, label.chk, .pill):not(.btn), #real :is(button, select, label.chk, .pill) { background: rgba(255, 255, 255, .07); color: var(--snow); border-color: rgba(163, 165, 173, .4); }
.hero button:not(.btn):hover, #real button:hover { background: rgba(255, 255, 255, .16); }
#real button.on { background: var(--grad-cds); color: var(--night); border-color: transparent; font-weight: 700; }
.hero input[type=range], #real input[type=range] { accent-color: var(--emerald); }
#real label.chk input { accent-color: var(--emerald); }

/* ---- recordings with overlays (players are built by js/real.js when they come near the screen) */
.players { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.players.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.players.four, .players.many { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.players.many .player .head { font-size: 14.5px; }
.players.one { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.players:empty { display: block; border-radius: 10px; background: rgba(11, 12, 16, .07); aspect-ratio: 3.5 / 1; }
.players.two:empty { aspect-ratio: 2.35 / 1; }
.players.one:empty { aspect-ratio: 2.1 / 1; }
.players.four:empty { aspect-ratio: 1.85 / 1; }
.player { background: var(--mist); border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-width: 0; transition: transform .25s, box-shadow .25s; }

.player .head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 6px; font-weight: 700; }
.player .head span.out { font-family: var(--mono); font-weight: 700; font-size: 14.5px; border-radius: 999px; padding: 1px 10px; background: #fff; border: 0; visibility: hidden; white-space: nowrap; }
.player .head span.out.show { visibility: visible; }
.stage { position: relative; border-radius: 12px; overflow: hidden; background: #14162c; aspect-ratio: 648 / 486; max-width: 100%; }
.stage video.ext, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage video.wrist { position: absolute; left: 8px; top: 8px; width: 30%; border-radius: 8px; border: 2px solid #fff; }
.readout { font-size: 14.5px; color: var(--mute); min-height: 42px; margin-top: 6px; }
.readout:empty { min-height: 0; margin: 0; }
.tlwrap { margin-top: 10px; }
.tlwrap canvas { border-radius: 10px; }
.vlmside { font-size: 15.5px; display: flex; flex-direction: column; gap: 10px; }
.vlmside .white { background: rgba(255, 255, 255, .07); border: 1px solid rgba(163, 165, 173, .28); border-radius: 10px; padding: 10px 12px; }
.vlmside h4 { margin: 0 0 4px; font-size: 14.5px; color: var(--haze); font-weight: 400; }
.vlmside .step { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; color: var(--haze); }
.vlmside .step.now { color: var(--amber); }
.vlmside .step.done { color: #5fe6b4; }
.vlmside pre { margin: 0; font: inherit; font-size: 13px; white-space: pre-wrap; word-break: break-word; max-height: 190px; overflow: auto; }
.hero .player, #real .player { background: rgba(255, 255, 255, .06); border-color: rgba(163, 165, 173, .25); }
.hero .player .head, #real .player .head { color: var(--snow); }
.hero .readout, #real .readout { color: var(--haze); }
#heroPanel .player .head { font-size: 17px; }


/* ---- figures of the paper and short clips */
figure { margin: 0; }
figure.fig, figure.clip { margin-top: 30px; }
figure.mid { max-width: 940px; }
figure.fig img { width: 100%; height: auto; cursor: zoom-in; background: #fff; border-radius: 12px; padding: 10px; border: 1px solid var(--line); transition: transform .3s, box-shadow .3s; }

figure.clip video { width: 100%; height: auto; aspect-ratio: 16 / 9; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
#real figure.clip video { border-color: transparent; }
figcaption { color: var(--mute); font-size: 15.5px; line-height: 1.5; margin-top: 12px; max-width: 100ch; }
figcaption b { color: var(--ink); }
figcaption .meta { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; border-radius: 999px; padding: 1px 9px; margin-left: 4px; background: rgba(11, 12, 16, .12); color: var(--violet-deep); }
#real figcaption .meta { background: rgba(255, 255, 255, .1); color: var(--snow); }
.cliprow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; }
.cliprow figure.clip { margin-top: 24px; }

/* ---- popups */
.vmodal, .zoom { position: fixed; inset: 0; z-index: 60; background: rgba(11, 12, 16, .88); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) var(--gut-r) max(16px, env(safe-area-inset-bottom, 0px)) var(--gut-l); }
@supports (backdrop-filter: blur(8px)) { .vmodal, .zoom { backdrop-filter: blur(8px); } }
.vbox { width: min(1180px, 100%, calc((100vh - 110px) * 16 / 9)); background: var(--paper); border-radius: 12px; padding: 10px; }
.vhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px 8px 8px; font-size: 15.5px; color: var(--mute); }
.vbox video { width: 100%; height: auto; aspect-ratio: 16 / 9; background: #fff; border-radius: 12px; }
.zoom { overflow: auto; cursor: zoom-out; }
.zoom img { background: #fff; max-width: none; width: min(2400px, max(100%, 1400px)); height: auto; border-radius: 8px; }

/* ---- abstract */
.abstract { margin-top: 8px; }
.abstract p { max-width: none; columns: 2 340px; column-gap: 44px; margin: 0; font-size: 18px; }

/* ---- method */
.phase { margin-top: 68px; }
.phead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.phead .n { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--grad-dir); color: #fff; font-weight: 700; font-size: 22px; display: grid; place-items: center; }
.phase + .phase .phead .n { background: var(--grad-cds); color: #fff; }
.phead h3 { margin: 0; font-size: 27px; letter-spacing: -.015em; }
.phead .when { font-family: var(--mono); font-size: 14.5px; color: var(--violet-deep); background: rgba(11, 12, 16, .1); border-radius: 999px; padding: 3px 13px; }
.phase figure.clip { margin-top: 18px; }
.twocol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 40px; margin-top: 16px; max-width: 940px; }
.twocol p { max-width: none; }
.twocol > div > :first-child, .twocol > p { margin-top: 0; }
.sources { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sources li { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 12px; padding: 8px 13px; }
.why { margin-top: 68px; }
.why h3 { font-size: 25px; letter-spacing: -.012em; }

/* ---- simulation: what the other methods do */
.baselines { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 24px 0 0; }
.baselines div { min-width: 0; background: var(--mist); border-radius: 10px; padding: 12px 14px; }
.baselines dt { font-family: var(--mono); font-weight: 700; font-size: 16px; color: var(--violet-deep); }
.baselines dd { margin: 2px 0 0; color: var(--mute); font-size: 15.5px; line-height: 1.45; }

/* ---- results: bars next to the table behind them */
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); gap: 22px; align-items: start; margin-top: 22px; }
.duo > * { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; }
.duo .controls:first-child { margin-top: 0; }
#real .duo > * { background: rgba(255, 255, 255, .055); border-color: rgba(163, 165, 173, .28); }
.findings p { max-width: none; margin: 0 0 14px; }
.findings p:last-child { margin-bottom: 0; }
.hbars { margin-top: 12px; display: grid; gap: 5px; font-variant-numeric: tabular-nums; }
.hlegend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--mute); }
.hlegend i { display: inline-block; width: 14px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--bar); }
.hlegend i.light { background: var(--bar-light); }
.hlegend i.cds { background: var(--grad-cds); }
.haxis, .hrow { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 10px; align-items: center; }
.haxis { font-family: var(--mono); font-size: 13px; color: var(--mute); }
.hscale { display: flex; justify-content: space-between; margin-right: 62px; }
.hrow { padding: 3px 0; }
.hname { text-align: right; font-size: 15px; line-height: 1.2; }
.hrow.ours .hname { font-weight: 700; color: var(--emerald-deep); }
.htracks { display: grid; gap: 3px; margin-right: 62px; }
.htrack { position: relative; height: 14px; background: var(--track); border-radius: 999px; }
.hbar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--bar); transition: width .8s cubic-bezier(.2, .7, .2, 1); }
.hbar.light { background: var(--bar-light); }
.hrow.ours .hbar { background: var(--grad-cds); }
.hrow.ours .hbar.light { background: #9fe8cf; }
.hval { position: absolute; top: 50%; transform: translateY(-50%); padding-left: 8px; font-size: 13.5px; line-height: 1; font-weight: 500; white-space: nowrap; transition: left .8s cubic-bezier(.2, .7, .2, 1); }
.hrow.ours .hval { font-weight: 700; }
#real .hlegend, #real .haxis { color: var(--haze); }
#real .htrack { background: rgba(255, 255, 255, .1); }
#real .hbar { background: #6d74a8; }
#real .hrow.ours .hbar { background: var(--grad-cds); }
#real .hrow.ours .hname { color: #5fe6b4; }
table.res { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.35; font-variant-numeric: tabular-nums; }
table.res th, table.res td { padding: 6px 9px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 400; }
table.res th:first-child { text-align: left; }
table.res thead th { font-weight: 700; vertical-align: bottom; border-bottom: 2px solid var(--ink); }
table.res thead tr:first-child th { border-bottom: 0; padding-bottom: 0; }
table.res thead tr:first-child:last-child th { border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
table.res thead th.span { text-align: center; color: var(--violet-deep); }
table.res thead th.span::after { content: ""; display: block; border-bottom: 2px solid rgba(11, 12, 16, .35); margin: 3px 4px 0; }
table.res tbody tr { transition: background .15s; }
table.res tbody tr:hover { background: rgba(11, 12, 16, .06); }
table.res tr.ours th { font-weight: 700; color: var(--emerald-deep); }
table.res tr.in th { padding-left: 24px; }
table.res tr.sum th, table.res tr.sum td { font-weight: 700; border-top: 2px solid var(--ink); }
table.res tr.grouprow th { text-align: left; color: var(--violet-deep); padding-top: 12px; }
table.res td.mid { text-align: center; }
table.res td.best { background: var(--best); font-weight: 700; }
table.res td.second { background: var(--second); }
#real table.res th, #real table.res td { border-bottom-color: rgba(163, 165, 173, .22); }
#real table.res thead th, #real table.res tr.sum th, #real table.res tr.sum td { border-color: var(--haze); }
#real table.res td.best { background: rgba(18, 201, 138, .32); color: #fff; }
#real table.res tbody tr:hover { background: rgba(255, 255, 255, .05); }

/* ---- limitations, BibTeX, references */
.limits { list-style: none; margin: 18px 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.limits li { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--coral); border-radius: 10px; padding: 14px 16px; font-size: 16.5px; line-height: 1.45; }
.limits li:nth-child(2) { border-top-color: var(--amber); }
.limits li:nth-child(3) { border-top-color: var(--violet); }
.limits li b { display: block; margin-bottom: 2px; font-size: 18px; }
.bib { position: relative; margin-top: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(163, 165, 173, .3); border-radius: 12px; max-width: 820px; }
.bib pre { margin: 0; padding: 18px; font-family: var(--mono); font-size: 15.5px; line-height: 1.45; overflow-x: auto; color: var(--snow); }
.bib .copy { position: absolute; top: 10px; right: 10px; background: var(--grad-cds); color: var(--night); border: 0; font-weight: 700; }
details.more { margin-top: 26px; border-top: 1px solid var(--line); max-width: 100ch; }
details.more summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
details.more p { max-width: 100ch; color: var(--mute); font-size: 16px; }
details.refs ol { margin: 4px 0 0; padding-left: 26px; font-size: 15.5px; line-height: 1.5; }
details.refs li { margin: 3px 0; }
#cite details.more { border-top-color: rgba(163, 165, 173, .3); }
#cite details.refs ol { color: var(--haze); }
#cite h2 { color: #fff; }

footer { padding: 6px var(--gut-r) calc(34px + env(safe-area-inset-bottom, 0px)) var(--gut-l); }
.footin { max-width: var(--col); margin: 0 auto; color: var(--haze); font-size: 14.5px; border-top: 1px solid rgba(163, 165, 173, .25); padding-top: 18px; }
.footin p { margin: 2px 0; max-width: none; }

/* ---- narrow screens */
@media (max-width: 980px) {
  .herotop, .twocol, .duo { grid-template-columns: minmax(0, 1fr); }
  .limits { grid-template-columns: minmax(0, 1fr); }
  .players, .players.one { grid-template-columns: minmax(0, 1fr); }
  .players.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .players.four, .players.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .players:empty, .players.one:empty { aspect-ratio: 1.1 / 1; }
  .row.three { grid-template-columns: minmax(0, 1fr); }
  canvas.view.wide { width: 860px; max-width: none; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  main > section, main > header { padding-top: 64px; padding-bottom: 64px; }
  .hero { padding-top: 34px; padding-bottom: 28px; }
  .stats { grid-template-columns: minmax(0, 1fr); padding-top: 4px; padding-bottom: 56px; gap: 12px; }
  .stat { padding: 16px 18px; }
  .players.two, .cliprow { grid-template-columns: minmax(0, 1fr); }
  .players.two:empty { aspect-ratio: .62 / 1; }
  .panel { padding: 10px; border-radius: 12px; }
  .panel.labelled { padding-top: 26px; }
  .plabel { font-size: 14.5px; padding: 4px 12px; }
  .lead { font-size: 18px; }
  .abstract p { font-size: 17px; }
  .btn { padding: 10px 15px 10px 11px; font-size: 15.5px; }
  .eq { font-size: 19px; padding: 9px 14px; }
  .duo > * { padding: 12px; border-radius: 10px; }
  .haxis, .hrow { grid-template-columns: 98px minmax(0, 1fr); gap: 8px; }
  .hname { font-size: 13.5px; }
  .htracks, .hscale { margin-right: 56px; }
  .watch { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 500; border-radius: 8px; padding: 5px 13px 5px 8px; background: var(--snow); color: var(--night); border: 0; }
  .links a { padding: 5px 8px; font-size: 14.5px; }
  .phead h3 { font-size: 23px; }
  figure.fig img { padding: 6px; border-radius: 12px; }
  figure.clip video { border-radius: 12px; }
  .hero::before, .hero::after { filter: blur(50px); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; } .hbar, .hval { transition: none; } }
@media print { nav, .zoom, .vmodal, .controls, .actions, #flow { display: none; } main > section { padding-block: 24px; } }

/* ---- no player chrome: clips and recordings run by themselves while on screen; a click holds or resumes them */
#heroCtl, #realCtl, #vlmCtl, #simCtl { display: none; }
figure.clip video, .stage canvas { cursor: pointer; }
figure.chart.solo { max-width: 620px; margin-top: 30px; }

/* ---- instruction label: plain text on the band, object words in the colours of the objects */
.plabel, .hero .plabel, #real .plabel { position: static; transform: none; display: block; max-width: none; background: none; color: inherit; padding: 0; margin: 0 0 12px; border-radius: 0; font-size: 18px; white-space: normal; }
.plabel .w1, .hero .plabel .w1, #real .plabel .w1 { color: #ff8a3d; }   /* carrot */
.plabel .w2, .hero .plabel .w2, #real .plabel .w2 { color: #19c37d; }   /* green plate */
.panel.labelled { margin-top: 20px; padding-top: 16px; }

/* ---- less decoration: no boxes around text, charts and tables; no particle field */
#flow { display: none; }
.hero .panel, #real .panel { background: none; border: 0; padding: 0; }
.hero .panel.labelled, #real .panel.labelled { margin-top: 36px; padding-top: 0; }
.hero .player, #real .player { background: none; border: 0; padding: 0; }
.stat { background: none; border: 0; border-top: 1px solid rgba(163, 165, 173, .35); border-radius: 0; padding: 16px 0 0; }
.duo > *, #real .duo > * { background: none; border: 0; padding: 0; border-radius: 0; }
.baselines div { background: none; padding: 0; border-radius: 0; }
.limits li { border: 0; border-top: 1px solid var(--ink); border-radius: 0; padding: 12px 0 0; background: none; }
.limits li:nth-child(2), .limits li:nth-child(3) { border-top-color: var(--ink); }
.sources li { border: 0; border-left: 2px solid var(--ink); border-radius: 0; background: none; padding: 2px 0 2px 12px; }
.eq { border: 0; padding: 0; background: none; }
.phead .n { background: none; color: var(--ink); width: auto; height: auto; font-size: 27px; }
.phead .n::after { content: "."; }
.phead .when { background: none; padding: 0; color: var(--mute); }
figure.fig img { border: 0; padding: 0; border-radius: 0; background: none; }

/* ---- one warm-paper ground for the whole page, ink text, one cobalt accent (CDS). No dark bands. */
body { background: #f6f4ee; }
main > section, main > header { background: none !important; }
main > section + section { border-top: 1px solid var(--line); }
nav { border-bottom: 1px solid var(--line); }
h1, #cite h2 { color: var(--ink); }
h1 .hl { color: inherit; }
.tldr { color: var(--ink); } .tldr b { color: var(--ink); }
.brand, .kicker, #real .kicker, #cite .kicker { color: #2146d0; }
.links a.on { color: var(--ink); font-weight: 700; }
.watch, .watch:hover { background: var(--ink); color: #f6f4ee; }
button.btn[data-video], button.go, .bib .copy { background: #2146d0; color: #fff; border-color: #2146d0; }
.hero :is(button, select, label.chk, .pill):not(.btn), #real :is(button, select, label.chk, .pill) { background: #fdfcf9; color: var(--ink); border-color: var(--edge); }
#real button.on, button.on { background: var(--ink); color: #f6f4ee; border-color: var(--ink); font-weight: 400; }
.stat { border-top-color: var(--ink); }
.stat .num { color: var(--ink); }
#real .hbar { background: var(--bar); } #real .htrack { background: var(--track); }
#real .hrow.ours .hbar, .hrow.ours .hbar { background: #2146d0; } .hrow.ours .hbar.light { background: #9db0ef; }
#real .hrow.ours .hname, .hrow.ours .hname, table.res tr.ours th { color: #2146d0; }
#real table.res td.best { background: var(--best); color: var(--ink); }
.vlmside .white { background: #fdfcf9; border-color: var(--line); } .vlmside .step.done { color: #2146d0; } .vlmside .step.now { color: #b4530a; }
.plabel .w1, .hero .plabel .w1, #real .plabel .w1 { color: #c8590a; }
.plabel .w2, .hero .plabel .w2, #real .plabel .w2 { color: #1c7c3c; }
.bib { background: #fdfcf9; border-color: var(--line); }
.panel { background: #fdfcf9; }
.hlegend i.cds { background: #2146d0; }
input[type=range], label.chk input, .hero input[type=range], #real input[type=range], #real label.chk input { accent-color: #2146d0; }
#prog { background: #2146d0; }
.btn.soon, .btn.soon:hover { color: var(--mute); }
footer { background: none; } .footin { border-top-color: var(--line); }

/* ---- type: Google Sans everywhere; LM Mono only for the instruction strings (as in the paper figures) and BibTeX */
.brand, .kicker, .tag, .stat .where, .scrollnote, .player .head span.out, figcaption .meta, .phead .when, .baselines dt, .haxis { font-family: var(--sans); letter-spacing: 0; text-transform: none; }
.plabel, .pill.instr, .bib pre { font-family: var(--mono); }
.brand { color: var(--ink); font-weight: 700; font-size: 18px; }
h1 { font-weight: 500; letter-spacing: -.02em; font-size: clamp(30px, 3.9vw, 48px); line-height: 1.1; }
h2 { font-weight: 500; font-size: clamp(25px, 2.7vw, 32px); letter-spacing: -.01em; line-height: 1.2; margin: 0 0 16px; max-width: none; }
h3 { font-weight: 500; }
.byline { margin: 16px 0 0; color: var(--mute); font-size: 16.5px; }
.baselines dt { color: var(--ink); font-weight: 700; }
.phead .n { font-weight: 500; }
.hrow.ours .hname { font-weight: 500; }
.herotop { display: block; }
.herotop h1 { max-width: 22ch; }
.herotop .tldr { max-width: 62ch; margin-top: 18px; }
.plabel { font-family: var(--sans); }
#heroPanel .plabel { font-family: var(--mono); }

/* ---- white page: the clips and paper figures (white ground) sit in the page without a frame; no cards */
body, nav { background: #fff; }
figure.clip video { border: 0; border-radius: 0; background: #fff; }
.panel, .panel.labelled { background: none; border: 0; border-radius: 0; padding: 0; }
.player, .hero .player, #real .player { background: none; border: 0; padding: 0; transform: none !important; box-shadow: none !important; }
.bib, .vlmside .white { background: #f6f6f4; border: 0; }
.phead { align-items: baseline; }
.phead h3 { font-size: 22px; letter-spacing: 0; }
.watch, .watch:hover, #real button.on, button.on { color: #fff; }
.hero :is(button, select, label.chk, .pill):not(.btn), #real :is(button, select, label.chk, .pill) { background: #fff; }

.hero button.on:not(.btn), #real button.on, button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- no blue: interface in ink, CDS in the green of the "with CDS" labels of the clips */
button.btn[data-video], button.go, .bib .copy { background: var(--ink); color: #fff; border-color: var(--ink); }
#prog { background: var(--ink); }
#real .hrow.ours .hbar, .hrow.ours .hbar, .hlegend i.cds { background: #1c7c3c; }
#real .hrow.ours .hname, .hrow.ours .hname { color: #1c7c3c; }
.vlmside .step.done { color: #1c7c3c; }
input[type=range], label.chk input, .hero input[type=range], #real input[type=range], #real label.chk input { accent-color: var(--ink); }
a { color: inherit; }
figure.fig.narrow { max-width: 620px; }

/* ---- method diagrams drawn in the page */
.dg { display: grid; gap: 18px 28px; margin-top: 20px; align-items: center; }
.dg canvas { display: block; width: 100%; height: auto; }
.dg-a { grid-template-columns: minmax(0, 1.69fr) minmax(0, 1fr); max-width: 980px; }
.dg-b { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); max-width: 820px; }
.dg-c { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 980px; align-items: start; gap: 26px 48px; }
.dg-c figure { margin: 0; }
.dg-c figure p { margin: 8px 0 0; font-size: 16px; color: var(--mute); max-width: 44ch; }
.dgt { font-size: 18px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.dgt.cds { color: #1c7c3c; }
.dgcap { margin-top: 14px; max-width: 68ch; color: var(--mute); font-size: 16.5px; min-height: 2.9em; }
.dgbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 16px; }
.dgsrc { font-size: 16px; color: var(--mute); }
.dgsrc b { color: var(--ink); font-weight: 500; }
.modesw { display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; }
.modesw button { font: inherit; font-size: 15px; font-weight: 500; padding: 5px 16px; border: 0; border-radius: 0; background: #fff; color: var(--ink); cursor: pointer; }
.modesw button.on { background: var(--ink); color: #fff; }
.brand { font-size: 16px; font-weight: 500; white-space: nowrap; }
@media (max-width: 760px) {
  .dg-a, .dg-b, .dg-c { grid-template-columns: minmax(0, 1fr); }
  .dg-a canvas[data-dg="effects"], .dg-b canvas[data-dg="steerpick"] { max-width: 340px; margin: 0 auto; }
  .brand { font-size: 14.5px; }
}
@media (max-width: 760px) {
  .navin { flex-wrap: wrap; row-gap: 0; }
  .brand { flex: 1 0 100%; padding-top: 8px; font-size: 15.5px; }
  .links { margin-left: -8px; width: calc(100% + 8px); }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .actions .btn { justify-content: center; white-space: nowrap; padding-inline: 8px; }
  .dg { margin-top: 14px; }
  .dg-c figure p { max-width: none; }
}
@media (max-width: 760px) {
  .actions [data-video], .actions [data-link="bibtex"] { grid-column: 1 / -1; }
  .actions [data-video] { order: -1; }
}
@media (max-width: 760px) {
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 100%; }
  .actions .btn { min-width: 0; font-size: 14.5px; white-space: normal; }
}
.dirpick { display: inline-flex; gap: 6px; }
.dirpick button { font: inherit; font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer; }
.dirpick button i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.dirpick button.on { border-color: var(--ink); background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.dgplay { font: inherit; font-size: 15px; color: var(--mute); background: none; border: 0; padding: 4px 2px; text-decoration: underline; cursor: pointer; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 36px; align-items: start; margin-top: 26px; }
.trio figure { margin: 0; min-width: 0; }
.trio .haxis, .trio .hrow { grid-template-columns: 92px minmax(0, 1fr); gap: 8px; }
.trio .hname { font-size: 14px; }
.trio .htracks, .trio .hscale { margin-right: 58px; }
@media (max-width: 1000px) { .trio { grid-template-columns: minmax(0, 1fr); max-width: 560px; } }

/* method: the three steps in words, and the line that says what each drawing shows */
.steps3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 22px 0 26px; }
.steps3 > div { background: #f6f6f4; border-radius: 14px; padding: 16px 18px 14px; }
.steps3 .sn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; }
.steps3 h4 { display: inline; margin: 0 0 0 8px; font-size: 18px; font-weight: 700; color: var(--ink); }
.steps3 p { margin: 10px 0 0; font-size: 16px; line-height: 1.45; max-width: none; color: var(--ink); }
.dgintro { margin: 4px 0 14px; max-width: 78ch; font-size: 16.5px; line-height: 1.5; color: var(--mute); }
@media (max-width: 760px) { .steps3 { grid-template-columns: 1fr; } }

/* recordings: a slim slider to jump forward and backward; play and pause stay a click on the picture */
#realCtl, #vlmCtl, #simCtl { display: flex; flex-wrap: nowrap; margin: 10px 0 2px; }
#realCtl > button, #vlmCtl > button, #simCtl > button { display: none; }
#realCtl input[type=range], #vlmCtl input[type=range], #simCtl input[type=range] { flex: 1 1 auto; min-width: 0; height: 22px; cursor: pointer; }
#realCtl .pill, #vlmCtl .pill, #simCtl .pill { flex: none; white-space: nowrap; font-size: 14px; background: none; border: 0; padding: 0; color: var(--mute); }

/* no early line breaks: title and text run the width of the column */
.herotop h1, .herotop .tldr, h2, main > section > p, .lead, .dgcap, .dgintro, .dg-c figure p, figcaption, .note, .panel > .note { max-width: none; }
.dgcap { min-height: 0; }
/* method page: the six-stage overview */
.pipe { margin: 26px 0 8px; }
.pipe .steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pipe .steps button { border-radius: 999px; padding: 5px 14px; font-size: 15px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.pipe .steps button b { font-weight: 500; }
.pipe .steps button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pipe canvas.view { border: 0; border-radius: 14px; display: block; }
#pipeText { margin: 12px 0 6px; min-height: 3em; color: var(--ink); font-size: 17px; }
.pipe p, .phase p { max-width: none; }

/* ---- academic header of the named page: title, authors, affiliation and links centred; the TL;DR under them */
.herotop.acad { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0; padding-top: 14px; }
.herotop.acad h1 { max-width: none; font-size: clamp(28px, 3.3vw, 42px); line-height: 1.16; }
.herotop.acad h1 span { display: block; }
.authors { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 28px; max-width: 920px; font-size: clamp(17px, 1.45vw, 19.5px); line-height: 1.45; color: var(--ink); }
.authors a { color: inherit; text-decoration: none; }
.authors a[href] { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.authors a[href]:hover { text-decoration-color: currentColor; }
.affil { margin: 8px 0 0; color: var(--mute); font-size: clamp(16px, 1.3vw, 17.5px); max-width: none; }
.herotop.acad .actions { justify-content: center; margin: 30px 0 0; }
.herotop.acad .tldr { text-align: left; max-width: 64ch; margin: 38px auto 0; }
.btn svg.logo { width: 16px; height: 16px; }
@media (max-width: 760px) {
  .herotop.acad h1 span { display: inline; }
  .authors { gap: 4px 18px; }
  .herotop.acad .actions { width: 100%; margin-top: 24px; }
  .herotop.acad .tldr { margin-top: 26px; }
}

/* ---- abstract of the paper, first thing under the buttons: centred heading, text in a reading column */
.herotop.acad .abstract { max-width: 72ch; margin: 46px auto 0; text-align: left; }
.abstract h2 { text-align: center; margin: 0 0 14px; }
.abstract p { columns: auto; font-size: clamp(16.5px, 1.35vw, 18px); line-height: 1.62; max-width: none; margin: 0; color: var(--ink); }
.abstract p { text-align: justify; }   /* aligned to both sides */
@media (max-width: 640px) { .abstract p { hyphens: auto; -webkit-hyphens: auto; } }   /* narrow column: hyphenation keeps the gaps small */

/* ---- method on the main page: lead, equation and animated overview always shown; the three detailed parts open on demand */
details.mdetail { margin-top: 30px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
details.mdetail > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 16px 0; }
details.mdetail > summary::-webkit-details-marker { display: none; }
details.mdetail > summary .t { font-size: 20px; font-weight: 500; color: var(--ink); }
details.mdetail > summary .t::before { content: "+"; display: inline-block; width: 1.05em; font-weight: 400; }
details.mdetail[open] > summary .t::before { content: "−"; }
details.mdetail > summary .s { color: var(--mute); font-size: 16px; }
details.mdetail > summary:hover .t { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
details.mdetail > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
details.mdetail[open] { padding-bottom: 44px; }
details.mdetail > .phase:first-of-type { margin-top: 18px; }

/* ---- opening row: three real runs side by side, one per way of giving the target (js/hero.js) */
.players.teaser { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.players.teaser:empty { aspect-ratio: 3.3 / 1; }
.players.teaser .tile { min-width: 0; }
#heroPanel .tile .player .head { font-size: 16px; }
.ttask { margin: 8px 0 0; font-family: var(--mono); font-size: 15px; line-height: 1.4; color: var(--ink); max-width: none; }
@media (max-width: 700px) {
  .players.teaser { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .players.teaser:empty { aspect-ratio: .34 / 1; }
}
