:root {
  --bg: #f4efe6;
  --bg-alt: #ece5d8;
  --panel: #faf7f1;
  --paper: #fffdf8;
  --stage: #ebe4d6;
  --ink: #2b2520;
  --ink-soft: #5a5148;
  --ink-faint: #8b8176;
  --line: #ddd3c2;
  --accent: #2b2520;
  --accent-ink: #f4efe6;
  --oc: #c07428;
  --task: #637d93;
  --cov: #1a6b70;
  --good: #2f7a4a;
  --bad: #b3332d;
  --warn: #9a6b00;
  --shadow: none;
  --cta: #e8822c;
  --cta-hover: #f0913d;
  --cta-edge: #b8611a;
  --cta-ink: #2b2520;
  --radius: 8px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--accent); }

.wrap { max-width: 980px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap.wide { max-width: 1240px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: clamp(30px, 5vw, 50px); margin: 6px 0 10px; }
h2 { font-size: clamp(24px, 3.2vw, 32px); margin: 64px 0 14px; }
h3 { font-size: 20px; margin: 26px 0 8px; }
p { margin: 0 0 14px; }

/* hero ---------------------------------------------------------------------------- */
.hero { padding: 40px 0 4px; text-align: center; }
.hero .links { margin-bottom: 18px; }
.venue { color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; margin: 0; }
.authors { color: var(--ink-soft); font-size: 18px; margin: 0 0 18px; }
.links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 26px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: 600 14px/1.2 var(--sans);
  text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.teaser { margin: 0; }
.teaser video { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--stage); aspect-ratio: 1920 / 504; }
figcaption { color: var(--ink-soft); font-size: 14px; margin-top: 8px; }
.teaser figcaption { max-width: 760px; margin: 10px auto 0; }

/* abstract ------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat .num { font: 700 34px/1.1 var(--sans); font-variant-numeric: tabular-nums; }
.stat .num.oc { color: var(--oc); }
.stat .num.task { color: var(--task); }
.stat .num.cov { color: var(--cov); }
.stat .lbl { font-weight: 600; font-size: 14px; line-height: 1.35; }
.stat small { font-weight: 400; color: var(--ink-faint); }
.stats-note { color: var(--ink-faint); font-size: 13px; }

/* head to head --------------------------------------------------------------------- */
#head-to-head { margin-top: 8px; }
.h2h { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.h2h-bars { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.h2h > .h2h-bars:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
#head-to-head + .carousel { margin-top: 18px; }
.bar-row { display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 10px; }
.bar-label { font-weight: 600; font-size: 14px; }
.bar-label small { font-weight: 400; color: var(--ink-faint); }
.bar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; background: var(--bg-alt); }
.bar > * { display: flex; align-items: center; justify-content: center; min-width: 2px; border: 0; padding: 0; color: #fff; font: 700 12px var(--sans); transition: opacity 0.15s; }
.bar > .dim { opacity: 0.35; }
.seg-success { background: #9aa892; }
.seg-fell { background: #b3332d; }
.seg-never { background: #d9822b; }
.seg-holding { background: #c9a227; }
.seg-drop { background: #8e4b8a; }
.seg-other { background: #7a848d; }
.bar-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-soft); margin-left: 220px; }
.bar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.h2h-bars .hint { margin-left: 220px; }

/* demo ----------------------------------------------------------------------------- */
.demo-section { background: var(--bg-alt); padding: 4px 0 28px; margin-top: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.demo-section h2 { margin-top: 28px; }
.lede { color: var(--ink-soft); max-width: 820px; }
.demo { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: stretch; }
.demo-stage { position: relative; width: 100%; border-radius: var(--radius); overflow: hidden; background: var(--stage); border: 1px solid var(--line); min-height: 600px; }
.viewer { position: absolute; inset: 0; }
.viewer canvas { width: 100% !important; height: 100% !important; display: block; touch-action: none; }
.hud { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.hud span { background: rgba(43, 37, 32, 0.78); color: #f4efe6; padding: 5px 11px; border-radius: 999px; font: 600 13px/1.2 var(--sans); backdrop-filter: blur(4px); }
.hud .time { font-variant-numeric: tabular-nums; }
.hud .phase[data-state="good"] { background: rgba(47, 122, 74, 0.92); }
.hud .phase[data-state="bad"] { background: rgba(179, 51, 45, 0.9); }
.help { position: absolute; bottom: 10px; left: 12px; right: 12px; font-size: 12px; color: var(--ink-soft); pointer-events: none; }
#demo.is-setup .run-only { display: none; }
#demo:not(.is-setup) .setup-only { display: none; }
.loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(235, 228, 214, 0.94); color: var(--ink-soft); transition: opacity 0.4s; z-index: 2; }
.loading.hidden { opacity: 0; pointer-events: none; }
.loading .bar { width: min(320px, 70%); height: 6px; background: rgba(0, 0, 0, 0.1); border-radius: 3px; overflow: hidden; }
.loading .bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.2s; }
.loading p { margin: 0; font-size: 14px; text-align: center; padding: 0 16px; }
.loading.error .bar { display: none; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; box-shadow: var(--shadow); }
.ctl { display: flex; flex-direction: column; gap: 6px; }
.ctl[hidden] { display: none; }
.ctl.row { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ctl.buttons { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.ctl.buttons .btn { padding: 7px 12px; font-size: 13px; }
.ctl-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 700; }
.hint { color: var(--ink-faint); font-size: 12.5px; margin: 0; line-height: 1.4; }
.hint.warn { color: var(--warn); }
select { font: 14px var(--sans); padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: var(--bg); color: var(--ink-soft); padding: 7px 10px; font: 600 13px var(--sans); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg.small button { padding: 5px 9px; }
.chips { display: flex; flex-direction: column; gap: 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip-family { width: 100%; font-size: 11px; color: var(--ink-faint); }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 3px 9px; font: 500 12.5px var(--sans); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.slider { display: grid; grid-template-columns: 52px 1fr 58px; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.slider output { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.demo-note { color: var(--ink-faint); font-size: 12.5px; margin-top: 10px; }
#demo.task-pick-up .pp-only { display: none; }

/* figures, tables, galleries -------------------------------------------------------- */
.figure { margin: 18px 0; background: var(--paper); border-radius: var(--radius); padding: 12px; border: 1px solid var(--line); }
.figure img { width: 100%; height: auto; }
.figure figcaption { color: var(--ink-soft); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.cols.results { align-items: start; margin-top: 10px; }
.stage-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stage-step { padding: 12px 14px; background: var(--panel); display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.stage-step + .stage-step { border-left: 1px solid var(--line); }
.stage-step b { color: var(--cov); }
.stage-step span { color: var(--ink-soft); }
.caption-center { text-align: center; color: var(--ink-faint); font-size: 13px; margin-top: 8px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table caption { caption-side: bottom; text-align: left; color: var(--ink-faint); font-size: 12.5px; padding-top: 8px; }
.table th, .table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.table th:first-child, .table td:first-child { text-align: left; }
.table th { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; }
.table th.oc { color: var(--oc); }
.table th.task { color: var(--task); }
.table th.cov { color: var(--cov); }
.table tr.headline td { font-weight: 700; font-size: 15px; }
.table tr.indent td { color: var(--ink-soft); }
.table tr.indent td:first-child { padding-left: 22px; }
.table tbody tr:nth-child(4) td { border-top: 2px solid var(--line); }
.insight { background: var(--bg-alt); border-radius: var(--radius); padding: 4px 18px 8px; }
.insight h3 { margin-top: 14px; }

.gallery-title { margin-top: 36px; }
/* comparison clips: one row, scrolled left and right */
.carousel { position: relative; margin-top: 14px; }
.gallery { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-bottom: 10px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior-x: contain; }
.gallery > figure { flex: 0 0 100%; scroll-snap-align: start; }
.car-btn { position: absolute; top: calc(50% - 40px); z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: opacity 0.15s; }
.car-btn.prev { left: 10px; }
.car-btn.next { right: 10px; }
.car-btn:disabled { opacity: 0; pointer-events: none; }
.car-btn:hover { border-color: var(--ink); }
.gallery figure, .grid2 figure, .single { margin: 0; }
.gallery video, .grid2 video, .single video { width: 100%; border-radius: 8px; background: #20262b; box-shadow: var(--shadow); }
.gallery .clip-title { font-weight: 700; font-size: 15px; margin: 8px 0 2px; }
.gallery .outcomes { display: flex; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.gallery .ok { color: var(--good); font-weight: 600; }
.gallery .fail { color: var(--bad); font-weight: 600; }
.gallery .muted { color: var(--ink-faint); }
.tag { display: inline-block; font: 600 11px/1.6 var(--sans); padding: 0 7px; border-radius: 999px; background: var(--bg-alt); color: var(--task); border: 1px solid var(--line); vertical-align: 2px; margin-left: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px; }
.single { margin-top: 14px; }

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.card .big { font: 700 28px/1.1 var(--sans); color: var(--cov); }
.card p { margin: 0; font-size: 14px; color: var(--ink-soft); }

pre { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; font: 13px/1.5 var(--mono); }
.footer { color: var(--ink-faint); font-size: 13px; padding-top: 30px; padding-bottom: 40px; border-top: 1px solid var(--line); margin-top: 64px; }

@media (max-width: 900px) {
  .demo { grid-template-columns: 1fr; }
  .demo-stage { aspect-ratio: 4 / 3; min-height: 300px; height: auto; }
  .cols, .grid2 { grid-template-columns: 1fr; }
  .gallery > figure { flex-basis: 92%; }
  .car-btn { display: none; }
}
@media (max-width: 640px) {
  .stats, .cards3, .stage-strip { grid-template-columns: 1fr; }
  .stage-step + .stage-step { border-left: 0; border-top: 1px solid var(--line); }
  .bar-row { grid-template-columns: 1fr; gap: 4px; }
  .bar-legend, .h2h-bars .hint { margin-left: 0; }
    h2 { margin-top: 48px; }
  .hero { padding-top: 32px; }
}

/* minimal beige ---------------------------------------------------------------------- */
.tagline { max-width: 680px; margin: 4px auto 22px; color: var(--ink-soft); font: 400 18px/1.5 var(--serif); }
.venue { letter-spacing: 0.14em; }
.btn { background: transparent; border-color: var(--line); }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--accent-ink); }
.chip.on, .seg button.on { background: var(--ink); border-color: var(--ink); color: var(--accent-ink); }
.chip, select, .seg button { background: var(--paper); }
.panel, .stat, .card, .h2h { background: var(--panel); box-shadow: none; }
.demo-section { background: var(--bg-alt); }
.insight { background: transparent; border-left: 2px solid var(--line); border-radius: 0; padding: 0 0 0 18px; }
.stat .num { font-weight: 600; }
.card .big { font-weight: 600; }
.stage-step { background: var(--panel); }
.stage-step b { color: var(--ink); }
h2 { font-weight: 500; }
h3 { font-weight: 500; }
.gallery video, .grid2 video, .single video, .teaser video { box-shadow: none; }
input[type="range"] { accent-color: var(--ink); }
.loading .bar { background: rgba(43, 37, 32, 0.12); }
.single + p { margin-top: 22px; }
.card .big { color: var(--ink); }

/* wider media: up to 1200 px, centred on the page, whatever the text column is */
.bleed { margin-left: calc(50% - min(600px, 50vw - 16px)); margin-right: calc(50% - min(600px, 50vw - 16px)); }
.car-btn { top: calc(50% - 46px); background: rgba(250, 247, 241, 0.92); width: 44px; height: 44px; }
.car-count { text-align: center; color: var(--ink-faint); font-size: 13px; margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.gallery .clip-title { font-size: 16px; }

/* enlarge any video */
figure { position: relative; }
.vwrap { position: relative; line-height: 0; }
.expand { position: absolute; bottom: 10px; right: 10px; z-index: 3; width: 34px; height: 34px; border-radius: 8px; border: 0;
  background: rgba(43, 37, 32, 0.62); color: #f4efe6; font-size: 17px; line-height: 1; cursor: pointer; opacity: 0.85; }
.expand:hover { opacity: 1; background: rgba(43, 37, 32, 0.85); }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(24, 20, 16, 0.94); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.lightbox video { max-width: 96vw; max-height: 84vh; width: auto; height: auto; border-radius: 6px; background: #000; }
.lightbox p { color: #e9e2d6; font-size: 14px; max-width: 900px; text-align: center; margin: 0; }
.lightbox .close { position: absolute; top: 14px; right: 18px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3);
  background: transparent; color: #f4efe6; font-size: 22px; cursor: pointer; }

/* the invitation to play: same orange as the goal disc in the scene */
.btn-random { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 13px 14px;
  border: 0; border-radius: 10px; background: var(--cta); color: var(--cta-ink); font: 700 15.5px/1.2 var(--sans);
  cursor: pointer; box-shadow: 0 3px 0 var(--cta-edge); transition: background 0.15s, transform 0.08s, box-shadow 0.08s; }
.btn-random:hover { background: var(--cta-hover); }
.btn-random:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cta-edge); }
.btn-random:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn-random .dice { width: 24px; height: 24px; flex: none; transition: transform 0.2s; }
.btn-random:hover .dice { transform: rotate(-14deg); }
.btn-random.rolling .dice { animation: roll 0.55s ease-out; }
.btn-random.nudge { animation: nudge 0.9s ease-in-out 2; }
@keyframes roll { from { transform: rotate(0deg) scale(1); } 50% { transform: rotate(200deg) scale(1.15); } to { transform: rotate(360deg) scale(1); } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-3px); } 60% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .btn-random.rolling .dice, .btn-random.nudge { animation: none; } }

#real-robot .grid2 video { aspect-ratio: 8 / 7; object-fit: cover; }
.figure.narrow img { max-width: 760px; display: block; margin: 0 auto; }

/* clean light theme: white cards on light grey, geometric headings ---------------------- */
:root {
  --bg: #f7f7f8;
  --bg-alt: #f0f1f3;
  --panel: #ffffff;
  --paper: #ffffff;
  --stage: #eceef1;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-faint: #7a7a7a;
  --line: #e5e6e8;
  --accent: #1a1a1a;
  --accent-ink: #ffffff;
  --hl: #176c73;
  --radius: 16px;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Fira Code", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
body { font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); letter-spacing: -0.02em; }
h2 { font-weight: 600; font-size: clamp(24px, 3vw, 30px); }
h2::after { content: ""; display: block; height: 3px; margin-top: 14px; border-radius: 2px;
  background: linear-gradient(90deg, var(--hl) 0%, rgba(23, 108, 115, 0.25) 45%, rgba(23, 108, 115, 0) 85%); }
h3 { font-weight: 600; font-size: 18px; }
p b, li b, td b { color: var(--ink); }

/* hero card */
.hero { padding: 28px 0 8px; }
.hero .wrap { width: calc(100% - 32px); background: var(--paper); border-radius: 24px; box-shadow: var(--card-shadow); padding: 48px 40px 36px; }
.hero h1 { font-weight: 600; font-size: clamp(30px, 4.6vw, 50px); line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 18px; }
.authors { font-size: 15.5px; color: var(--ink-soft); }
.tagline { font: 400 18px/1.55 var(--serif); color: var(--ink-soft); letter-spacing: -0.005em; }
.links { gap: 12px; margin-bottom: 18px; }
.links .btn { border-radius: 10px; padding: 12px 22px; border: 0; background: var(--ink); color: #fff; font: 600 14.5px/1.2 var(--sans); }
.links .btn:first-child { background: var(--cta); color: var(--cta-ink); }
.links .btn:hover { opacity: 0.88; border: 0; }
.venue-pill { display: inline-block; margin: 0; padding: 6px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-alt); color: var(--hl); font: 600 13px/1.4 var(--mono); letter-spacing: 0.02em; }

/* demo: no band, the stage and panel become cards */
.demo-section { background: transparent; border: 0; margin-top: 0; }
.demo-stage { border: 0; border-radius: var(--radius); box-shadow: var(--card-shadow); }
.loading { background: rgba(236, 238, 241, 0.94); }
.hud span { background: rgba(26, 26, 26, 0.72); color: #fff; }
.panel { border: 0; border-radius: var(--radius); box-shadow: var(--card-shadow); background: var(--paper); }
.ctl-label { font: 500 11px/1.4 var(--mono); letter-spacing: 0.08em; color: var(--hl); }
.chip, select, .seg button { background: var(--bg); }
.chip.on, .seg button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
input[type="range"] { accent-color: var(--hl); }
.loading .bar { background: rgba(0, 0, 0, 0.08); }

/* cards: figures, stats, comparison, tables */
.figure, .stat, .card, .h2h { background: var(--paper); border: 0; border-radius: var(--radius); box-shadow: var(--card-shadow); }
.figure { padding: 20px; }
.stat { padding: 18px 20px; }
.stat .num, .card .big { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; }
.stats-note, .caption-center, .car-count, .demo-note { color: var(--ink-faint); }
.stage-strip { border: 0; border-radius: var(--radius); box-shadow: var(--card-shadow); }
.stage-step { background: var(--paper); }
.stage-step + .stage-step { border-left: 1px solid var(--line); }
.stage-step b { color: var(--hl); font-family: var(--serif); }
.insight { border-left: 3px solid var(--hl); }
input[type="checkbox"] { accent-color: var(--hl); }
.table td { color: var(--ink); }
.gallery video, .grid2 video, .single video, .teaser video { border-radius: 14px; }
.gallery .clip-title { font-family: var(--serif); font-weight: 600; color: var(--ink); }
figcaption { font-size: 13.5px; color: var(--ink-faint); text-align: center; }
.figure figcaption { text-align: left; }
.car-btn { background: rgba(255, 255, 255, 0.94); border: 0; box-shadow: var(--card-shadow); }
.expand { background: rgba(26, 26, 26, 0.6); color: #fff; }
.tag { background: var(--bg-alt); color: var(--hl); border-color: var(--line); }
pre { background: var(--paper); border: 0; box-shadow: var(--card-shadow); }
.footer { text-align: center; border-top: 0; }
@media (max-width: 640px) { .hero .wrap { padding: 32px 18px 26px; border-radius: 18px; } }

/* affiliations: General Robotics and NUS ------------------------------------------------- */
.authors { margin-bottom: 16px; }
.authors sup { font-size: 0.66em; line-height: 0; color: var(--ink-faint); margin-left: 1px; }
.affils { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 40px; margin: 0 0 8px; }
.affil { display: inline-flex; align-items: flex-start; gap: 4px; color: var(--ink-faint); text-decoration: none; transition: opacity 0.15s; }
.affil:hover { opacity: 0.75; }
.affil sup { font: 600 12px/1 var(--sans); }
.affils img { width: auto; }
.affils .logo-gr { height: 19px; }
.affils .logo-nus { height: 44px; }
.affil-note { font-size: 13px; color: var(--ink-faint); margin: 0 0 20px; }

/* a small, quiet badge in the demo viewer, so anyone playing sees where the work is from;
   it never takes pointer events, so dragging and orbiting underneath it still work */
.stage-brand { position: absolute; right: 12px; bottom: 12px; z-index: 3; display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 14px rgba(0, 0, 0, 0.06);
  pointer-events: none; -webkit-user-select: none; user-select: none; }
.stage-brand img { width: auto; opacity: 0.92; }
.stage-brand .logo-gr { height: 12px; }
.stage-brand .logo-nus { height: 30px; }
.stage-brand .sep { width: 1px; align-self: stretch; background: rgba(0, 0, 0, 0.14); }
.demo-stage .help { right: 280px; }

.footer-logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 36px; margin-bottom: 14px; }
.footer-logos a { display: block; opacity: 0.8; transition: opacity 0.15s; }
.footer-logos a:hover { opacity: 1; }
.footer-logos img { width: auto; }
.footer-logos .logo-gr { height: 15px; }
.footer-logos .logo-nus { height: 34px; }

@media (max-width: 640px) {
  .affils { gap: 12px 28px; }
  .affils .logo-gr { height: 16px; }
  .affils .logo-nus { height: 38px; }
  /* phones: the help text needs the full width at the bottom, so the badge sits under the timer */
  .stage-brand { top: 46px; bottom: auto; padding: 5px 9px; gap: 8px; border-radius: 8px; }
  .stage-brand .logo-gr { height: 9px; }
  .stage-brand .logo-nus { height: 23px; }
  .demo-stage .help { right: 12px; }
}

/* full screen demo ------------------------------------------------------------------------ */
.hud-r { display: flex; align-items: center; gap: 8px; }
.fs-btn { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 6px 12px 6px 10px;
  background: rgba(26, 26, 26, 0.72); color: #fff; font: 600 13px/1.2 var(--sans); cursor: pointer;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: background 0.15s; touch-action: manipulation; }
.fs-btn:hover { background: rgba(26, 26, 26, 0.88); }
.fs-btn:focus-visible { outline: 2px solid var(--hl); outline-offset: 2px; }
.fs-btn svg { width: 15px; height: 15px; flex: none; }
.hud .fs-btn span { background: none; padding: 0; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none; font: inherit; color: inherit; }
.fs-btn .fs-close, .fs-btn.on .fs-open { display: none; }
.fs-btn.on .fs-close { display: block; }

/* the stage and controls fill the screen: side by side in landscape, stacked in portrait */
.demo.is-fullscreen { position: fixed; inset: 0; z-index: 1000; margin: 0; width: 100%; height: 100%; max-width: none; box-sizing: border-box;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: var(--bg); grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); gap: 12px; overflow: hidden; }
.demo.is-fullscreen .demo-stage { height: 100%; min-height: 0; aspect-ratio: auto; }
.demo.is-fullscreen .panel { min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.demo:fullscreen::backdrop { background: #f7f7f8; }
.demo-fs-lock, .demo-fs-lock body { overflow: hidden; }
@media (orientation: portrait) {
  .demo.is-fullscreen { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .demo.is-fullscreen .panel { max-height: 42vh; max-height: 42dvh; }
}
/* tablets in portrait: the controls flow into balanced columns under the stage */
@media (orientation: portrait) and (min-width: 700px) {
  .demo.is-fullscreen .panel { display: block; max-height: none; column-width: 230px; column-gap: 20px; }
  .demo.is-fullscreen .panel > * { break-inside: avoid; margin: 0 0 12px; }
}
@media (max-width: 640px) {
  .fs-btn { padding: 6px 8px; }
  .fs-btn .fs-label { display: none; }
}
