/* PyRUA-Dex project page: Peking University red (#9A0000, the logo red) on white.
   System fonts only (no font CDN), one stylesheet, one small script. */

:root {
  --red: #9A0000;
  --red-dk: #730000;
  --rose: #D99A9A;        /* the program after exploration, in charts; with --red an ordinal pair (validated light->dark, one hue) */
  --red-50: #FCF6F6;
  --red-100: #F7EAEA;
  --red-200: #EDD2D2;
  --gold: #B8892C;
  --gold-l: #F4DE9C;
  --ink: #1C1B1F;
  --text: #36353C;
  --sub: #605F68;
  --mute: #8C8B94;
  --line: #EDE8E7;
  --line-2: #E2DAD9;
  --bar: #C9C8CF;
  --bg: #FFFFFF;
  --bg-2: #FBF8F7;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Songti SC", SimSun, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1140px;
  --r: 14px;
  --shadow: 0 1px 2px rgba(90, 20, 20, .05), 0 12px 30px -14px rgba(90, 20, 20, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 74px; color-scheme: light; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
b, strong { font-weight: 650; color: var(--ink); }
em { font-style: italic; }
code { font-family: var(--mono); font-size: .9em; color: var(--red-dk); background: var(--red-50); border: 1px solid var(--red-100); border-radius: 5px; padding: 0 5px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.ic { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 60; background: rgba(255, 255, 255, .88); border-top: 3px solid var(--red);
  border-bottom: 1px solid var(--line); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); }
.bar-in { max-width: 1240px; margin: 0 auto; padding: 8px 28px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 18px; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
/* the wordmark's "Dex" in the title's handwriting, on the same cap height, x-height and baseline */
.brand .wm-hand { display: inline-block; width: auto; height: .813em; vertical-align: -.046em; }
.wm-py { color: var(--red); }
.wm-dex { color: var(--ink); }
.nav { display: flex; gap: 2px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; color: var(--sub); font-size: 14.5px; font-weight: 560; padding: 7px 12px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { color: var(--red); background: var(--red-50); text-decoration: none; }
.nav a.on { color: var(--red); }
.nav a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 1px; height: 2px; border-radius: 2px; background: var(--red); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); font: 600 15px/1.2 var(--sans); white-space: nowrap; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--red-200); }
.btn .ic { font-size: 17px; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dk); border-color: var(--red-dk); }
.btn-soon { cursor: default; color: var(--sub); background: var(--bg-2); }
.btn-soon:hover { transform: none; box-shadow: none; border-color: var(--line-2); }
.btn .soon { font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--red); background: var(--red-100); padding: 4px 8px; border-radius: 999px; }
.btn-sm { padding: 7px 13px; font-size: 13.5px; }
.btn-sm .ic { font-size: 15px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 0 0 22px; text-align: center;
  background: radial-gradient(1000px 460px at 50% -140px, rgba(154, 0, 0, .10), transparent 70%); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image: radial-gradient(rgba(154, 0, 0, .16) 1px, transparent 1.3px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(75% 62% at 50% 0%, #000, transparent 78%); mask-image: radial-gradient(75% 62% at 50% 0%, #000, transparent 78%); }
.hero > * { position: relative; }
/* the hero's background film: on by default; switched off, the hero is the light page as before. No tint on the
   film: the title block sits on a frosted white card instead, so the page keeps its own colours. */
.hero-opening { isolation: isolate; padding-top: 44px; padding-bottom: 50px; }
.hero-backdrop { position: absolute; inset: 0 auto 0 50%; width: 100vw; transform: translateX(-50%); z-index: -1;
  overflow: hidden; pointer-events: none; background: #f4f2f2; transition: opacity .6s ease, visibility .6s; }
.hero-backdrop video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 58%; }
.hero-card { max-width: 1080px; margin: 0 auto; padding: 26px 30px 28px; border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 24px; background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(40, 12, 16, .16); transition: background .6s ease, box-shadow .6s ease, border-color .6s ease; }
.hero.vid-on::before { opacity: 0; }
.hero.vid-off .hero-backdrop { opacity: 0; visibility: hidden; }
.hero.vid-off .hero-card { background: transparent; border-color: transparent; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none; }
.hero-ctl { position: absolute; right: 0; bottom: 12px; display: flex; gap: 8px; }
.hero-sw, .hero-snd { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 13px 0 8px;
  border: 1px solid rgba(154, 0, 0, .22); border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink);
  font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; box-shadow: 0 4px 14px rgba(40, 12, 16, .12); }
.hero-snd { padding: 0 13px; }
.hero-snd[hidden] { display: none; }
.sw-track { position: relative; width: 30px; height: 18px; border-radius: 999px; background: #cfc5c6; transition: background .25s; }
.sw-knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .25s; }
.hero-sw[aria-pressed="true"] .sw-track { background: var(--red); }
.hero-sw[aria-pressed="true"] .sw-knob { transform: translateX(12px); }
.hero-sw:focus-visible, .hero-snd:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
@media (max-width: 640px) {
  .hero-card { padding: 18px 14px 20px; border-radius: 16px; }
  .hero-ctl { position: static; justify-content: center; margin-top: 14px; }
}
.org { display: inline-flex; align-items: center; gap: 12px; padding: 5px 18px 5px 5px; border: 1px solid var(--red-200); border-radius: 999px;
  background: rgba(255, 255, 255, .85); color: var(--red); font-weight: 650; font-size: 14px; letter-spacing: .02em; }
.org img { width: 36px; height: 36px; }
.title { margin: 22px 0 0; font-weight: 800; font-size: clamp(56px, 8.6vw, 108px); line-height: 1; letter-spacing: -.035em; color: var(--ink); }
/* the robot's own brush writing of "Dex" (SOURCES.md), set on the title's cap height, x-height and baseline */
.title .wm-hand { display: inline-block; width: auto; height: .813em; vertical-align: -.046em; }
.sub1 { margin: 16px 0 0; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(27px, 3.4vw, 42px); line-height: 1.15; color: var(--red); }
.sub2 { margin: 8px auto 0; max-width: 840px; font-size: clamp(18px, 2.1vw, 25px); font-weight: 650; line-height: 1.35; color: var(--ink); text-wrap: balance; }
/* the state of the art, said in the title block */
.hero-sota { display: inline-flex; align-items: center; gap: 10px; margin: 16px auto 0; font-size: clamp(15px, 1.55vw, 19px);
  line-height: 1.35; color: var(--ink); text-wrap: balance; }
.hero-sota b { color: var(--red); font-weight: 800; }
.hero-sota .ic { flex: none; color: var(--gold); font-size: 1.15em; }
.authors { max-width: 940px; margin: 24px auto 0; font-size: 17px; font-weight: 650; line-height: 1.7; color: var(--ink); text-wrap: balance; }
.authors span { white-space: nowrap; }
.authors a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(154, 0, 0, .28); }
.authors a:hover, .authors a:focus-visible { color: var(--red); border-bottom-color: var(--red); }
.authors sup, .affil sup { margin-left: 1px; font-size: .62em; font-weight: 650; color: var(--red); }
.affil { margin: 6px 0 0; font-size: 15px; color: var(--sub); }
.affil span { display: inline-block; margin: 0 9px; white-space: nowrap; }
.unis { margin: 20px 0 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 38px; }
.unis img { height: 46px; width: auto; }
.links { margin: 24px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tldr { max-width: 900px; margin: 30px auto 0; padding: 0 28px; font-family: var(--serif); font-size: clamp(18px, 2vw, 22px); line-height: 1.5; color: var(--text); text-wrap: balance; }
.tldr b { color: var(--red); font-weight: 600; }

/* ---------- teaser clips ---------- */
.teaser { max-width: 1240px; margin: 30px auto 0; padding: 0 28px; }
.clips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.clip { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; background: #ECE9E8; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.clip video { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.clip:hover video { transform: scale(1.03); }
.clip-tag { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 9px; text-align: left; color: rgba(255, 255, 255, .9);
  font-size: 12.5px; line-height: 1.3; background: linear-gradient(rgba(25, 6, 6, 0), rgba(25, 6, 6, .74)); }
.clip-tag b { display: block; color: #fff; font-size: 13.5px; font-weight: 650; }
/* the clip wall in groups: the real robot first and largest, then the two benchmarks in smaller tiles */
.clips-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 24px 2px 10px; font-size: 13px; color: var(--sub); }
.clips-h:first-child { margin-top: 0; }
.clips-h b { color: var(--ink); font-size: 15px; font-weight: 750; }
.clips-h .ic { color: var(--red); font-size: 18px; }
.clips-h .speed { margin: 0; }
.clips.clips-real { grid-template-columns: repeat(3, 1fr); gap: 12px; }
.clips.clips-sim { grid-template-columns: repeat(6, 1fr); gap: 8px; }
.clips-sim .clip { border-radius: 10px; }
.clips-sim .clip-tag { padding: 16px 8px 6px; font-size: 10.5px; }
.clips-sim .clip-tag b { font-size: 11.5px; }
.cap { margin: 12px 0 0; font-size: 14px; color: var(--sub); text-align: center; }
.speed { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px; background: var(--red-100); color: var(--red); font-weight: 750; font-size: 12.5px; }

/* ---------- headline numbers ---------- */
.stats { max-width: 1240px; margin: 30px auto 0; padding: 0 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; text-align: left; }
.stat { position: relative; padding: 18px 18px 16px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.badge { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--red-100); color: var(--red); font-size: 21px; }
.stat-v { margin-top: 12px; font-size: 40px; font-weight: 750; line-height: 1.05; letter-spacing: -.02em; color: var(--ink); }
.stat-v small { font-size: 19px; font-weight: 650; color: var(--sub); }
.stat-v .arrow { font-size: 22px; color: var(--mute); margin: 0 2px; }
.stat-k { margin-top: 6px; font-size: 14.5px; font-weight: 650; color: var(--ink); line-height: 1.35; }
.stat-t { margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--sub); }
.stat.hot { border-color: transparent; background: linear-gradient(155deg, #A80F0F 0%, #8A0000 55%, #6E0000 100%); }
.stat.hot .badge { background: rgba(255, 255, 255, .16); color: #fff; }
.stat.hot .stat-v, .stat.hot .stat-k { color: #fff; }
.stat.hot .stat-t, .stat.hot .stat-v small { color: rgba(255, 255, 255, .84); }
.sota { position: absolute; top: 16px; right: 16px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  background: var(--gold-l); color: #5E3F00; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.sota .ic { font-size: 13px; }
.stat-v.sm { font-size: 33px; }

/* ---------- sections ---------- */
.sec { padding: 92px 0; }
.sec.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { max-width: 880px; margin: 0 auto 42px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--red); font-size: 13px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow .ic { font-size: 16px; }
.sec-head h2 { margin: 10px 0 0; font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 3.7vw, 44px); line-height: 1.15; letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.sec-head h2::after { content: ""; display: block; width: 48px; height: 3px; margin: 18px auto 0; border-radius: 2px; background: var(--red); }
.lead { margin: 18px auto 0; font-size: 18px; line-height: 1.6; color: var(--sub); }
.h3 { display: flex; align-items: center; gap: 10px; margin: 72px 0 20px; font-size: 23px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.h3 .ic { font-size: 24px; color: var(--red); }
.h3-lead { margin: -8px 0 22px; max-width: 900px; color: var(--sub); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 24px 26px; box-shadow: var(--shadow); }

/* ---------- overview ---------- */
.abs-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 26px; align-items: start; }
.abstract { border-left: 4px solid var(--red); font-size: 16.5px; line-height: 1.78; }
.abstract h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; font-size: 14px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.abstract p { margin: 0; text-align: justify; hyphens: auto; }
.glance { display: grid; gap: 12px; }
.g-item { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s; }
.g-item:hover { border-color: var(--red-200); box-shadow: var(--shadow); }
.g-item b { display: block; font-size: 15.5px; line-height: 1.35; }
.g-item span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.5; color: var(--sub); }

/* ---------- figures ---------- */
.fig { margin: 0; padding: 18px 18px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.fig + .fig { margin-top: 22px; }
.zoom { display: block; overflow: hidden; border-radius: 8px; cursor: zoom-in; }
.fig img { width: 100%; height: auto; }
.fig figcaption { margin-top: 12px; font-size: 14px; line-height: 1.6; color: var(--sub); }
.fig figcaption b { color: var(--ink); }

/* ---------- method: stages ---------- */
.stages { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
.stage { position: relative; overflow: hidden; }
.stage::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--rose); }
.stage.s2::before { background: var(--red); }
.stage-top { display: flex; align-items: center; gap: 14px; }
.stage-num { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 13px; background: var(--red-100); color: var(--red); font-size: 23px; font-weight: 800; }
.stage.s2 .stage-num { background: var(--red); color: #fff; }
.stage h3 { margin: 0; font-size: 20px; line-height: 1.25; color: var(--ink); }
.stage-goal { margin: 2px 0 0; font-family: var(--serif); font-style: italic; font-size: 16.5px; color: var(--sub); }
.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 13px; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; font-size: 15px; line-height: 1.55; }
.steps li > .ic { margin-top: 1px; font-size: 21px; color: var(--red); }
.keep-rule { display: flex; align-items: center; gap: 18px; margin-top: 20px; padding: 18px 22px; border-radius: var(--r);
  border: 1px solid var(--red-200); background: linear-gradient(90deg, var(--red-100), var(--red-50) 45%, #fff); }
.keep-rule .badge { width: 48px; height: 48px; font-size: 25px; background: var(--red); color: #fff; }
.keep-rule b { display: block; font-size: 16.5px; }
.keep-rule span { display: block; font-size: 14.5px; line-height: 1.55; color: var(--text); }

/* ---------- method: chain of links ---------- */
.chain-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 22px; align-items: stretch; }
.k-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.formula { margin: 16px 0 6px; text-align: center; font-family: var(--serif); font-size: 27px; line-height: 1.4; color: var(--ink); }
.formula i { font-style: italic; }
.formula sub, .formula sup { font-size: .55em; }
.formula .big { font-size: 1.45em; vertical-align: -.1em; }
.formula .lim { display: inline-flex; flex-direction: column; align-items: flex-start; margin: 0 .25em 0 .05em; font-size: .5em; line-height: 1.2; vertical-align: middle; }
.formula-note { margin: 0; text-align: center; font-size: 14px; color: var(--sub); }
.chainviz { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 0; margin: 22px 0 8px; }
.lk { width: 58px; height: 34px; margin: 0 -5px; display: grid; place-items: center; border: 3px solid var(--red); border-radius: 18px;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; position: relative; }
.lk:nth-child(even) { border-color: var(--rose); z-index: 1; }
.lk-eq { margin-left: 16px; font-size: 20px; font-weight: 750; color: var(--red); white-space: nowrap; }
.chain-text { margin: 12px 0 0; font-size: 15px; line-height: 1.6; }
.chain-text + .chain-text { margin-top: 10px; }

/* ---------- method: program ---------- */
.prog-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; margin-top: 22px; }
.code-card { padding: 0; overflow: hidden; }
.code-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: #2A1A1D; color: #EAD9DA; font: 600 13px/1.2 var(--mono); }
.code-head .dots { display: inline-flex; gap: 6px; margin-right: 6px; }
.code-head .dots i { width: 10px; height: 10px; border-radius: 50%; background: #6B4A4E; }
.code-head .dots i:first-child { background: #C2453F; }
.code { margin: 0; padding: 16px 18px 18px; overflow-x: auto; background: #21151A; color: #F3EAEA; font: 12.6px/1.62 var(--mono); tab-size: 4; }
.code code { color: inherit; background: none; border: 0; border-radius: 0; padding: 0; font: inherit; }
.code .k { color: #FF8F80; }
.code .s { color: #F3CB86; }
.code .c { color: #A08E92; font-style: italic; }
.code .f { color: #FFFFFF; font-weight: 700; }
.code .b { color: #F7B4C2; font-weight: 600; }
.code .n { color: #F7B4C2; }
.code-cap { padding: 12px 16px 14px; font-size: 13.5px; line-height: 1.55; color: var(--sub); border-top: 1px solid var(--line); }
.task-card { padding: 0; overflow: hidden; }
.task-card video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #ECE9E8; }
.task-body { padding: 16px 18px 18px; }
.task-body h4 { margin: 0; font-size: 16.5px; color: var(--ink); }
.task-body p { margin: 4px 0 0; font-size: 14px; color: var(--sub); }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.mini div { padding: 10px 12px; border-radius: 10px; background: var(--red-50); border: 1px solid var(--red-100); }
.mini b { display: block; font-size: 20px; line-height: 1.2; color: var(--ink); }
.mini span { font-size: 12.5px; color: var(--sub); }

/* ---------- method: codebox ---------- */
.cb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cb { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); transition: transform .2s, box-shadow .2s, border-color .2s; }
.cb:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--red-200); }
.cb h4 { margin: 0; font-size: 16.5px; line-height: 1.3; color: var(--ink); }
.cb p { margin: 0; font-size: 14px; line-height: 1.58; color: var(--sub); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.chip { padding: 4px 7px; border-radius: 6px; background: var(--red-50); border: 1px solid var(--red-100); color: var(--red-dk); font: 12.3px/1.2 var(--mono); }
.cb-wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 20px; background: linear-gradient(90deg, var(--red-50), #fff 62%); }
.cb-wide .badge { width: 50px; height: 50px; font-size: 25px; }
.cb-wide .chips { margin: 0; padding: 0; flex-wrap: nowrap; }

/* ---------- results: leaderboard ---------- */
.lb-card { padding: 0; overflow: hidden; }
.lb-scroll { overflow-x: auto; }
.lb { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 14.5px; }
.lb th { padding: 13px 14px 10px; text-align: left; font-size: 11.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--mute);
  background: var(--bg-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.lb th.num, .lb td.num { text-align: right; }
.lb td { padding: 8px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lb td.num { font-variant-numeric: tabular-nums; }
.lb tbody tr:last-child td { border-bottom: 0; }
.lb tbody tr:hover td { background: #FDFBFB; }
.lb .m { font-weight: 600; color: var(--ink); }
.lb tr.ours td { background: var(--red-50); }
.lb tr.ours:hover td { background: var(--red-100); }
.lb tr.ours td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.lb tr.top td { background: var(--red-100); }
.lb tr.top .m { color: var(--red); }
.lb .crown { margin-left: 6px; font-size: 16px; color: var(--gold); vertical-align: -2px; }
.type { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--sub); }
.type .ic { font-size: 15px; color: var(--mute); }
tr.ours .type .ic { color: var(--red); }
.yes { color: var(--sub); }
.no-demo { color: var(--red); font-weight: 700; }
.score { display: flex; align-items: center; gap: 10px; min-width: 250px; }
.score .track { position: relative; flex: 1; height: 10px; }
.score .fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v) / 80 * 100%); border-radius: 0 4px 4px 0; background: var(--bar); }
tr.ours .score .fill { background: var(--red); }
tr.ours.s1 .score .fill { background: var(--rose); }
.score b { width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.lb-note { padding: 11px 16px 13px; font-size: 12.8px; line-height: 1.55; color: var(--mute); border-top: 1px solid var(--line); }
.ins-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.ins { display: flex; gap: 14px; align-items: flex-start; }
.ins b { display: block; font-size: 16px; line-height: 1.35; }
.ins span { display: block; margin-top: 3px; font-size: 14px; line-height: 1.55; color: var(--sub); }

/* ---------- results: refinement and online ---------- */
.num-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.nbox { padding: 16px 18px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); }
.nbox b { display: block; font-size: 28px; font-weight: 750; line-height: 1.1; letter-spacing: -.015em; color: var(--red); }
.nbox span { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--sub); }
.online-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 14px 0 6px; text-align: center; }
.vs-v { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--red); }
.vs-v.gray { color: var(--mute); }
.vs-k { margin-top: 8px; font-size: 13.5px; line-height: 1.45; color: var(--sub); }
.vs-x { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--mute); }
.ticks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.ticks li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; font-size: 14.5px; line-height: 1.55; }
.ticks li > .ic { margin-top: 3px; font-size: 18px; color: var(--red); }
.cost { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14.5px; }
.cost th, .cost td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.cost th:first-child, .cost td:first-child { text-align: left; }
.cost th { font-size: 11.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.cost tr:last-child td { border-bottom: 0; }
.cost-note { margin: 12px 0 0; font-size: 13.5px; color: var(--sub); }

/* ---------- real robot ---------- */
.platform { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: -14px 0 34px; }
.platform span { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; color: var(--text); }
.platform .ic { font-size: 17px; color: var(--red); }
.real-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: stretch; margin-top: 22px; }
.film { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.film video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #1A1416; }
.film-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 13px 16px 15px; font-size: 14px; color: var(--sub); }
.film-meta b { color: var(--ink); }
.stage-card { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 22px 24px; }
.stage-head { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 650; color: var(--ink); }
.stage-head .ic { color: var(--red); font-size: 18px; }
.stage-sub { margin: 0; font-size: 14px; color: var(--sub); }
.sbar { display: grid; grid-template-columns: 58px 1fr 76px; align-items: center; gap: 12px; font-size: 14px; color: var(--sub); }
.sbar .tr { position: relative; height: 10px; border-radius: 5px; background: #EEE8E8; overflow: hidden; }
.sbar .tr i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v) / 32 * 100%); border-radius: 5px; background: var(--rose); }
.sbar.s2 .tr i { background: var(--red); }
.sbar b { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.sbar.s2 b { color: var(--red); }
.stage-note { margin: 2px 0 0; font-size: 13px; line-height: 1.5; color: var(--mute); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--red-100); color: var(--red); font-size: 12.5px; font-weight: 700; }
.pill .ic { font-size: 14px; }

/* real-robot results: one row per task, exploration -> refinement (validation layouts of 32) */
.rs-card { padding: 22px 26px 18px; }
.rs-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--sub); }
.key { display: inline-flex; align-items: center; gap: 7px; }
.key i { width: 12px; height: 12px; border-radius: 50%; background: var(--rose); }
.key i.s2 { background: var(--red); }
.rs-total { font-size: 14.5px; color: var(--sub); }
.rs-total b { color: var(--ink); }
.skill-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 14px; font-size: 13.5px; line-height: 1.5; color: var(--sub); }
.dumb { position: relative; }
.dumb-group { padding: 12px 0 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.rs-table tr.grp td { padding-top: 10px; font-weight: 700; color: var(--red); }
.dumb-row { display: grid; grid-template-columns: minmax(180px, 1.05fr) 2fr 78px; grid-template-areas: "name track val"; gap: 16px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.dumb-name { grid-area: name; min-width: 0; }
.dumb-name b { display: block; font-size: 14.5px; font-weight: 650; line-height: 1.25; }
.dumb-name small { display: block; font-size: 12.5px; line-height: 1.35; color: var(--mute); }
.track2 { grid-area: track; position: relative; height: 26px; background-image: linear-gradient(90deg, #EEE8E8 1px, transparent 1px); background-size: 25% 100%; border-right: 1px solid #EEE8E8; }
.track2 .seg { position: absolute; top: 50%; height: 2px; margin-top: -1px; left: calc(var(--a) / 32 * 100%); width: calc((var(--b) - var(--a)) / 32 * 100%); background: var(--red-200); }
.track2 .pt { position: absolute; top: 50%; left: calc(var(--a) / 32 * 100%); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 2px #fff; outline: none; }
.track2 .pt.s2 { left: calc(var(--b) / 32 * 100%); background: var(--red); }
.track2 .pt::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
.track2 .pt:hover, .track2 .pt:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(154, 0, 0, .25); }
.dumb-v { grid-area: val; text-align: right; font-size: 14px; color: var(--sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dumb-v b { color: var(--ink); }
.dumb-axis { display: grid; grid-template-columns: minmax(180px, 1.05fr) 2fr 78px; grid-template-areas: "pad ticks val"; gap: 16px; padding-top: 6px; font-size: 12px; color: var(--mute); }
.axis-pad { grid-area: pad; }
.axis-ticks { grid-area: ticks; position: relative; height: 18px; }
.axis-ticks span { position: absolute; top: 0; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.axis-unit { grid-area: val; text-align: right; }
.table-toggle { margin-top: 12px; font-size: 13.5px; color: var(--sub); }
.table-toggle summary { cursor: pointer; color: var(--red); font-weight: 600; }
.rs-table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 13.5px; }
.rs-table th, .rs-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.rs-table td.num, .rs-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rs-table th { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.rs-table th.span { text-align: center; }   /* a header over several columns */

/* reserved slots: tasks on the real robot */
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.slot { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r); background: #fff; border: 1px solid var(--line); transition: transform .2s, box-shadow .2s, border-color .2s; }
.slot:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--red-200); }
.slot-media { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--red);
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .95) 0 22%, transparent 60%), radial-gradient(circle at 20% 0%, rgba(154, 0, 0, .08), transparent 60%),
  linear-gradient(135deg, var(--red-50), var(--red-100)); }
.slot-media video, .slot-media img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.slot-media::before { content: ""; position: absolute; inset: 0; opacity: .7; background-image: radial-gradient(rgba(154, 0, 0, .14) 1px, transparent 1.3px); background-size: 16px 16px; }
.slot-media .ic { position: relative; font-size: 46px; stroke-width: 1.35; }
.flag { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: #fff; border: 1px solid var(--red-200); color: var(--red); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.flag .ic { font-size: 13px; stroke-width: 2; }
.slot-body { padding: 14px 16px 16px; }
.slot-body b { font-size: 15.5px; }
.slot-body p { margin: 3px 0 0; font-size: 13.5px; color: var(--sub); }
.rs-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 3px 8px; border-radius: 6px; background: var(--red-50); border: 1px solid var(--red-100);
  color: var(--red-dk); font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); color: var(--sub); font-size: 11.5px; font-weight: 700; letter-spacing: .03em; }
.tag .ic { font-size: 12px; stroke-width: 2.2; }
.tag.bi { background: var(--red-50); border-color: var(--red-100); color: var(--red); }
.dj-sum { justify-content: center; background: linear-gradient(155deg, #A80F0F, #7A0000); border-color: transparent; color: #fff; }
.dj-sum:hover { border-color: transparent; }
.dj-sum .badge { background: rgba(255, 255, 255, .16); color: #fff; }
.dj-sum b { color: #fff; font-size: 17px; }
.dj-sum span { font-size: 13.5px; color: rgba(255, 255, 255, .85); }

/* ---------- BibTeX ---------- */
.bib { position: relative; max-width: 900px; margin: 0 auto; }
.bib pre { margin: 0; padding: 22px 24px; overflow-x: auto; border-radius: var(--r); background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--red);
  font: 13.5px/1.68 var(--mono); color: var(--ink); box-shadow: var(--shadow); }
.copy { position: absolute; top: 12px; right: 12px; }
.copy.done { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- footer ---------- */
.foot { padding: 30px 0 36px; background: #fff; border-top: 3px solid var(--red); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; }
.foot-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--ink); }
.foot-brand img { width: 34px; height: 34px; }
.foot-brand small { display: block; font-weight: 500; font-size: 13px; color: var(--sub); }
.foot p { margin: 0; font-size: 14px; color: var(--sub); }

/* ---------- tooltip, lightbox, reveal ---------- */
.tip { position: absolute; z-index: 90; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); padding: 6px 10px; border-radius: 8px; background: var(--ink);
  color: rgba(255, 255, 255, .78); font-size: 12.5px; line-height: 1.35; white-space: nowrap; box-shadow: 0 8px 22px rgba(0, 0, 0, .2); opacity: 0; transition: opacity .12s; }
.tip.on { opacity: 1; }
.tip strong { margin-right: 6px; font-size: 14px; color: #fff; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 3vw; background: rgba(24, 8, 8, .84); cursor: zoom-out; }
.lightbox.on { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; padding: 12px; border-radius: 10px; background: #fff; }
.js .rv { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.js .rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { opacity: 1; transform: none; transition: none; }
  .clip video, .btn, .cb, .slot, .dj-card { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .stats, .num-grid { grid-template-columns: repeat(2, 1fr); }
  .clips { grid-template-columns: repeat(3, 1fr); }
  .clips.clips-sim { grid-template-columns: repeat(4, 1fr); }
  .abs-grid, .chain-grid, .prog-grid, .real-grid, .online-grid { grid-template-columns: 1fr; }
  .cb-grid { grid-template-columns: repeat(2, 1fr); }
  .cb-wide { flex-direction: column; align-items: flex-start; }
  .cb-wide .chips { flex-wrap: wrap; }
  .slot-grid, .ins-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .wrap, .bar-in, .teaser, .stats, .tldr { padding-left: 18px; padding-right: 18px; }
  .bar-in { gap: 10px; }
  .brand .wm { display: none; }
  .bar .btn-sm span { display: none; }
  .sec { padding: 64px 0; }
  .clips { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .clips.clips-real { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .clips.clips-sim { grid-template-columns: repeat(2, 1fr); }
  .stats, .num-grid, .stages, .cb-grid, .slot-grid, .ins-grid { grid-template-columns: 1fr; }
  .abstract p { text-align: left; }
  .dumb-row { grid-template-columns: 1fr 64px; grid-template-areas: "name name" "track val"; gap: 4px 12px; }
  .dumb-axis { grid-template-columns: 1fr 64px; grid-template-areas: "ticks val"; gap: 12px; }
  .dumb-axis .axis-pad { display: none; }
  .vs-v { font-size: 38px; }
}

/* ---------- DexJoCo results and the two real-robot films (2026-11-20) ---------- */
.dj-clips { margin: 4px 0 22px; }
.dj-lb .score .fill { width: calc(var(--v) / 100 * 100%); }
.lb tr.later td { color: var(--sub); }
.dj-note { margin: 10px 0 0; font-size: 13px; color: var(--sub); }
.real-grid.two { grid-template-columns: 1fr 1fr; }
.slot-grid.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1060px) { .real-grid.two { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .slot-grid.two { grid-template-columns: 1fr; } }

/* ---------- real robot: one full-width theater, a tab for each task family (2026-11-23) ---------- */
#real { overflow: hidden; }
.theater { --w: min(980px, 84vw); --ease: cubic-bezier(.65, 0, .25, 1); position: relative; margin-top: 4px; }
.th-tabs { position: relative; display: flex; gap: 2px; width: max-content; max-width: 100%; margin: 0 auto 16px; padding: 5px;
  overflow-x: auto; scrollbar-width: none; background: #fff; border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.th-tabs::-webkit-scrollbar { display: none; }
.th-tab { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: 999px;
  background: none; color: var(--sub); font: 620 14.5px/1.1 var(--sans); white-space: nowrap; cursor: pointer; transition: color .4s var(--ease); }
.th-tab .ic { font-size: 17px; }
.th-tab em { min-width: 20px; padding: 3px 6px; border-radius: 999px; background: var(--red-100); color: var(--red); font-style: normal;
  font-size: 11.5px; font-weight: 750; text-align: center; transition: background .4s var(--ease), color .4s var(--ease); }
.th-tab:hover { color: var(--red); }
.th-tab.on, .th-tab.on:hover { color: #fff; }
.th-tab.on em { background: rgba(255, 255, 255, .2); color: #fff; }
.th-tab:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.th-ink { position: absolute; z-index: 0; top: 5px; bottom: 5px; left: 0; width: 0; border-radius: 999px;
  background: linear-gradient(135deg, #B01515, var(--red) 55%, var(--red-dk)); box-shadow: 0 6px 16px -6px rgba(154, 0, 0, .6);
  transition: transform .55s var(--ease), width .55s var(--ease); }
html:not(.js) .th-tab.on { background: var(--red); }

.th-fam[hidden] { display: none; }
.th-desc { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 18px; color: var(--sub); font-size: 15px; text-align: center; }
.th-desc .ic { flex: none; font-size: 17px; color: var(--red); }
.th-note { margin: -10px 0 16px; color: var(--mute); font-size: 13px; text-align: center; }

/* the track spans the whole window; the film in front is centred, its neighbours wait at the sides */
.th-track { position: relative; width: 100vw; margin-left: calc(50% - 50vw); height: calc(var(--w) * 9 / 16 + 58px); perspective: 1800px; }
.th-slide { position: absolute; top: 0; left: calc(50% - var(--w) / 2); width: var(--w); margin: 0; z-index: 1; opacity: 0; pointer-events: none;
  transform: scale(.6); transition: transform .8s var(--ease), opacity .8s var(--ease), filter .8s var(--ease); will-change: transform; }
.th-slide[data-pos="0"] { z-index: 3; opacity: 1; transform: none; pointer-events: auto; }
.th-slide[data-pos="-1"], .th-slide[data-pos="1"] { z-index: 2; opacity: .5; pointer-events: auto; cursor: pointer; filter: saturate(.55) brightness(.97); }
.th-slide[data-pos="-1"] { transform: translateX(-76%) scale(.78) rotateY(12deg); }
.th-slide[data-pos="1"] { transform: translateX(76%) scale(.78) rotateY(-12deg); }
.th-slide[data-pos="-2"] { transform: translateX(-140%) scale(.6) rotateY(18deg); }
.th-slide[data-pos="2"] { transform: translateX(140%) scale(.6) rotateY(-18deg); }
.th-slide[data-pos="-1"]:hover, .th-slide[data-pos="1"]:hover { opacity: .72; filter: none; }
.th-fam.fan .th-slide:not([data-pos="0"]) { transform: scale(.66); opacity: 0; transition: none; }

.th-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 18px; background: #161113;
  box-shadow: 0 34px 60px -34px rgba(70, 10, 10, .6), 0 0 0 1px rgba(28, 27, 31, .06); }
.th-media video { width: 100%; height: 100%; object-fit: cover; background: #161113; }
.th-slide:not([data-pos="0"]) .th-media video { pointer-events: none; }
.th-slide[data-pos="0"] .th-media { box-shadow: 0 40px 70px -36px rgba(110, 0, 0, .55), 0 0 0 1px rgba(154, 0, 0, .14); }
.th-speed { position: absolute; top: 14px; left: 14px; z-index: 2; padding: 3px 9px; border-radius: 6px; background: rgba(154, 0, 0, .92);
  color: #fff; font-size: 13px; font-weight: 750; letter-spacing: .02em; }
.th-play { position: absolute; top: 50%; left: 50%; z-index: 2; display: grid; place-items: center; width: 80px; height: 80px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(154, 0, 0, .93); color: #fff; cursor: pointer; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, .2), 0 14px 32px -10px rgba(0, 0, 0, .6); transition: transform .3s var(--ease), opacity .35s, background .3s; }
.th-play .ic { font-size: 32px; margin-left: 5px; }
.th-play::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); animation: thPulse 2.4s ease-out infinite; }
.th-play:hover { background: var(--red); transform: translate(-50%, -50%) scale(1.07); }
.th-slide:not([data-pos="0"]) .th-play, .th-slide.playing .th-play { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(.82); }
.th-slide.started:not(.playing) .th-play { opacity: 0; pointer-events: none; }
@keyframes thPulse { from { transform: scale(.92); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }

.th-slide figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 15px 4px 0; font-size: 15px; color: var(--sub);
  opacity: 0; transform: translateY(6px); transition: opacity .5s ease .25s, transform .5s ease .25s; }
.th-slide[data-pos="0"] figcaption { opacity: 1; transform: none; }
.th-slide figcaption b { font-size: 17px; color: var(--ink); }
.th-zh { color: var(--red); font-weight: 600; }
.th-dur { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--mute); font-size: 13.5px; font-variant-numeric: tabular-nums; }

.th-nav { position: absolute; top: calc(var(--w) * 9 / 32); z-index: 5; display: grid; place-items: center; width: 50px; height: 50px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--red); cursor: pointer;
  box-shadow: 0 10px 26px -12px rgba(90, 20, 20, .45); transform: translateY(-50%); transition: transform .3s var(--ease), background .3s, color .3s; }
.th-nav .ic { font-size: 24px; stroke-width: 2.2; }
.th-nav:hover { background: var(--red); color: #fff; border-color: var(--red); }
.th-nav.prev { left: max(8px, calc(50% - var(--w) / 2 - 25px)); }
.th-nav.next { right: max(8px, calc(50% - var(--w) / 2 - 25px)); }
.th-nav.prev:hover { transform: translateY(-50%) translateX(-3px); }
.th-nav.next:hover { transform: translateY(-50%) translateX(3px); }

.th-thumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.th-thumb { position: relative; display: flex; align-items: center; gap: 10px; overflow: hidden; padding: 6px 14px 6px 6px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .35s, box-shadow .35s, transform .35s var(--ease); }
.th-thumb img { width: 76px; height: 43px; object-fit: cover; border-radius: 7px; filter: saturate(.7); transition: filter .35s; }
.th-thumb b { display: block; font-size: 13.5px; line-height: 1.25; }
.th-thumb small { color: var(--mute); font-size: 12px; font-variant-numeric: tabular-nums; }
.th-thumb:hover { transform: translateY(-2px); border-color: var(--red-200); }
.th-thumb.on { border-color: var(--red); box-shadow: 0 10px 22px -14px rgba(154, 0, 0, .7); }
.th-thumb.on img { filter: none; }
.th-thumb.on b { color: var(--red); }
.th-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p, 0) * 100%); background: var(--red); transition: width .25s linear; }

/* switching families: the old one slips away, the new one slides in and fans its films out */
.th-fam.leave-r { animation: thOutL .2s ease-in forwards; }
.th-fam.leave-l { animation: thOutR .2s ease-in forwards; }
.th-fam.enter-r .th-desc, .th-fam.enter-r .th-thumbs { animation: thInR .6s var(--ease) both; }
.th-fam.enter-l .th-desc, .th-fam.enter-l .th-thumbs { animation: thInL .6s var(--ease) both; }
.th-fam.enter-r .th-slide[data-pos="0"] { animation: thSlideR .75s var(--ease) both; }
.th-fam.enter-l .th-slide[data-pos="0"] { animation: thSlideL .75s var(--ease) both; }
@keyframes thOutL { to { opacity: 0; transform: translateX(-48px) scale(.98); } }
@keyframes thOutR { to { opacity: 0; transform: translateX(48px) scale(.98); } }
@keyframes thInR { from { opacity: 0; transform: translateX(40px); } }
@keyframes thInL { from { opacity: 0; transform: translateX(-40px); } }
@keyframes thSlideR { from { opacity: 0; transform: translateX(14%) scale(.9) rotateY(-10deg); } }
@keyframes thSlideL { from { opacity: 0; transform: translateX(-14%) scale(.9) rotateY(10deg); } }

@media (max-width: 720px) {
  .theater { --w: 88vw; }
  .th-tabs { justify-content: flex-start; border-radius: 16px; }
  .th-tab { padding: 8px 12px; font-size: 13.5px; }
  .th-track { height: calc(var(--w) * 9 / 16 + 50px); }
  .th-desc { font-size: 14px; }
  .th-desc .ic { display: none; }
  .th-slide figcaption { flex-wrap: nowrap; padding-top: 12px; }
  .th-slide figcaption b { font-size: 15.5px; white-space: nowrap; }
  .th-sub { display: none; }
  .th-thumbs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 12px -18px 0; padding: 2px 18px 8px;
    scroll-snap-type: x mandatory; scrollbar-width: none; }
  .th-thumbs::-webkit-scrollbar { display: none; }
  .th-thumb { flex: none; scroll-snap-align: center; padding-right: 12px; }
  .th-thumb b { white-space: nowrap; }
  .th-nav { width: 40px; height: 40px; }
  .th-play { width: 62px; height: 62px; }
  .th-play .ic { font-size: 25px; }
  .th-thumb img { width: 60px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .th-slide, .th-ink, .th-slide figcaption, .th-thumb { transition: none; }
  .th-play::after { animation: none; }
  .th-fam.leave-r, .th-fam.leave-l, .th-fam.enter-r .th-desc, .th-fam.enter-l .th-desc, .th-fam.enter-r .th-thumbs,
  .th-fam.enter-l .th-thumbs, .th-fam.enter-r .th-slide[data-pos="0"], .th-fam.enter-l .th-slide[data-pos="0"] { animation: none; }
}

/* three number boxes in a row (the simulation's system identification); one column on phones */
.num-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .num-grid.three { grid-template-columns: 1fr; } }

/* ---------- layout pass (2026-11-25) ---------- */
/* Long prose is set justified with automatic hyphenation, as the abstract already was. A section's lead stays centred
   under its heading: its lines are justified and the last one is centred. Short labels and the narrow cards (under
   about 40 characters a line, where justified text opens gaps) keep a ragged right edge. Phones keep it everywhere. */
.nw { white-space: nowrap; }
.lead, .h3-lead, .fig figcaption, .code-cap, .lb-note, .cost-note, .dj-note, .chain-text, .keep-rule span, .steps li > span,
.ticks li > span, .cb p, .skill-note > span:not(.pill), .abstract p { text-align: justify; -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 7 3 3; }
.lead { text-align-last: center; }
.h3-lead { max-width: none; }                            /* as wide as the blocks under it (it stopped at 900px) */
/* the four primitive cards in two columns: in four, the longest ran to 18 short lines beside one of 6 */
.cb-grid { grid-template-columns: repeat(2, 1fr); }
/* a block after a figure keeps the figures' distance (the per-task table of DexJoCo touched the figure above it) */
.fig + .card { margin-top: 22px; }
/* the tasks' column of the real-robot chart: wide enough for its longest line */
.dumb-row, .dumb-axis { grid-template-columns: minmax(180px, 1.3fr) 2fr 78px; }
/* a number with an arrow stays on one line in its box */
.nbox b.sm { font-size: 24px; }
.nbox span .nw { display: inline; margin: 0; }           /* ".nbox span" sets spans as blocks: not the no-wrap ones inside */
.mini b { white-space: nowrap; }
/* the theatre's description: the icon runs with the centred text (it stood alone at the left edge of two lines) */
.th-desc { display: block; text-wrap: balance; }
.th-desc .ic { display: inline-block; margin-right: 8px; vertical-align: -3px; }
/* the theatre's thumbnails in one row (six piano films wrapped to a second row): on wide windows a film strip of equal
   cells under the film, as wide as the film; on narrower ones the row scrolls sideways, as it does on phones */
@media (min-width: 1061px) {
  .th-thumbs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; max-width: var(--w); margin: 16px auto 0; }
  .th-thumb { flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 6px 9px; text-align: center; }
  .th-thumb img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
  .th-thumb b { font-size: 12.5px; letter-spacing: -.01em; }
  .th-thumb > span { flex: 1; display: flex; flex-direction: column; }      /* a title on two lines: the durations stay level */
  .th-thumb small { margin-top: auto; padding-top: 2px; }
}
@media (min-width: 721px) and (max-width: 1060px) {
  .th-thumbs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .th-thumbs::-webkit-scrollbar { display: none; }
  .th-thumb { flex: none; scroll-snap-align: center; }
  .th-thumb b { white-space: nowrap; }
}
@media (max-width: 720px) {
  .h3-lead, .fig figcaption, .code-cap, .lb-note, .cost-note, .dj-note, .chain-text, .keep-rule span, .steps li > span,
  .ticks li > span, .cb p, .skill-note > span:not(.pill), .abstract p { text-align: left; }
  .lead { text-align: center; text-align-last: auto; }
  .cb-grid { grid-template-columns: 1fr; }
  .mini b { font-size: 17.5px; }
  .dumb-row { grid-template-columns: 1fr 64px; }
  .dumb-axis { grid-template-columns: 1fr 64px; }
  .th-desc .ic { display: none; }
}

/* ---------- footer (2026-11-25): project names never broken at their hyphen, lines of even length ---------- */
.foot p { text-wrap: balance; }
.foot p a { white-space: nowrap; }
