:root {
  --accent: #a20337;
  --accent-dark: #7d0229;
  --accent-soft: #f9eef1;
  --accent-line: #ead3da;
  --ink: #26282b;
  --muted: #6b7178;
  --faint: #9aa0a6;
  --rule: #ebe7e8;
  --bg: #ffffff;
  --panel: #fcfcfa;
  --sketch: #659e89;
  --sketch-dark: #41705e;
  --action: #b06a3c;
  --real-sketch-a: #d6e9df;
  --real-sketch-b: #173d2c;
  --real-action: #da9369;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --mono: "Source Code Pro", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { display: block; max-width: 100%; }
sup { line-height: 0; }

.container { max-width: 940px; margin: 0 auto; padding: 0 24px 60px; }

/* Table of contents */
.page-toc { position: fixed; top: 180px; left: 22px; width: 180px; z-index: 50; }
.page-toc-title {
  margin: 0 0 8px 12px; color: var(--faint); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.page-toc ul { list-style: none; margin: 0; padding: 0; }
.page-toc a {
  display: block; padding: 4px 12px; border-left: 2px solid var(--rule); color: var(--faint);
  font-size: 13.5px; line-height: 1.3; transition: color .15s, border-color .15s;
}
.page-toc a:hover { color: var(--accent); text-decoration: none; }
.page-toc a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.page-toc .toc-sub a { padding-left: 24px; font-size: 12.5px; }
@media (max-width: 1400px) { .page-toc { display: none; } }

/* Header */
.hero { text-align: center; padding-top: 48px; }
.title {
  margin: 0 0 22px; font-family: var(--serif); font-weight: 600; font-size: 40px; line-height: 1.2;
  color: var(--accent); letter-spacing: -0.005em;
}
.authors, .affiliations { list-style: none; padding: 0; margin: 0; }
.authors .break, .affiliations .break { flex-basis: 100%; height: 0; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; font-size: 19px; }
.authors a { color: var(--ink); border-bottom: 1px solid var(--accent-line); }
.authors a:hover { color: var(--accent); text-decoration: none; }
.authors sup, .affiliations sup { font-size: 0.7em; color: var(--muted); margin-left: 1px; }
.affiliations {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 22px;
  margin-top: 12px; color: var(--muted); font-size: 15.5px;
}
.corresponding { margin: 6px 0 0; color: var(--faint); font-size: 13.5px; }
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 16px; border: 1px solid var(--accent);
  border-radius: 999px; color: var(--accent); font-size: 15px; font-weight: 600; line-height: 1.2;
  transition: background .18s, color .18s;
}
.pill svg { width: 17px; height: 17px; }
a.pill:hover { background: var(--accent); color: #fff; text-decoration: none; }
.pill.is-disabled { border-color: #d7d9dc; color: var(--faint); cursor: default; }

/* TL;DR and hero video */
.tldr-block { margin-top: 34px; }
.tldr { text-align: center; margin: 0 auto 16px; max-width: 780px; font-size: 19px; }
.accent-label { color: var(--accent); font-weight: 700; }
.accent-strong { color: var(--accent); font-weight: 600; }
.figure figcaption {
  margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.45;
}

/* Sections */
.section { margin-top: 18px; }
.section-line { border: 0; border-top: 1px solid var(--rule); margin: 30px 0 26px; }
h2, h3, h4 { font-family: var(--serif); color: var(--accent); }
h2 { font-size: 30px; font-weight: 500; margin: 0 0 14px; line-height: 1.25; }
h3 { font-size: 22px; font-weight: 500; margin: 32px 0 10px; }
h4 { font-size: 19px; font-weight: 600; margin: 0; }
p { margin: 0 0 14px; }
.abstract { text-align: justify; hyphens: auto; }
.muted { color: var(--faint); font-weight: 400; }
.section-intro { color: var(--muted); font-size: 16.5px; }

.figure { margin: 22px 0; }
.figure img { width: 100%; height: auto; }
.figure-note { color: var(--muted); font-size: 15px; margin-top: -6px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.two-col .figure { margin: 10px 0; }
.inline-video, .main-video { width: 100%; border-radius: 8px; background: #111; }
.main-video { background: #000; }

/* Interactive demos */
.demo {
  margin: 24px 0; border: 1px solid var(--rule); border-radius: 12px; background: var(--panel);
  padding: 16px 18px 14px;
}
.demo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.demo-title { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); }
.demo-status { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.demo-body { display: grid; gap: 14px; margin-top: 10px; align-items: center; }
.sketch-demo-body { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.schedule-demo-body { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.demo-svg { width: 100%; height: auto; display: block; }
.path-view { background: #fff; border: 1px solid var(--rule); border-radius: 8px; }
.demo-plots .demo-svg { background: #fff; border: 1px solid var(--rule); border-radius: 8px; }
.plot-label { font-size: 13.5px; font-weight: 600; margin: 2px 0 4px; color: var(--ink); }
.demo-plots .plot-label:not(:first-child) { margin-top: 10px; }
.demo-controls {
  display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 10px 22px; align-items: end;
  margin-top: 14px;
}
#schedule-demo .demo-controls { grid-template-columns: 1fr 1fr auto; }
.control-group { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.control-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.control-label span { font-family: var(--mono); color: var(--ink); font-weight: 500; }
.segmented { display: inline-flex; border: 1px solid var(--accent); border-radius: 999px; overflow: hidden; }
.segmented button, .demo-btn, .tab-btn, .toggle-btn {
  appearance: none; border: 0; background: #fff; color: var(--accent); font: 600 13px var(--sans);
  padding: 6px 12px; cursor: pointer; line-height: 1.2;
}
.segmented button + button { border-left: 1px solid var(--accent-line); }
.segmented button.is-active, .tab-btn.is-active, .toggle-btn.is-active { background: var(--accent); color: #fff; }
.demo-btn { border: 1px solid var(--accent); border-radius: 999px; padding: 6px 18px; }
.demo-btn:hover, .segmented button:not(.is-active):hover, .tab-btn:not(.is-active):hover,
.toggle-btn:not(.is-active):hover { background: var(--accent-soft); }
input[type=range] { width: 100%; accent-color: var(--accent); margin: 4px 0; }
.demo-legend, .overlay-legend {
  display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; font-size: 13.5px; color: var(--muted);
}
.overlay-legend { margin: 4px 0 14px; }
.demo-legend span, .overlay-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg-line { display: inline-block; width: 24px; height: 4px; border-radius: 2px; }
.lg-demo { background: #d3d6da; }
.lg-sketch { background: linear-gradient(90deg, var(--sketch), var(--sketch-dark)); }
.lg-sketch-real { height: 7px; background: linear-gradient(90deg, var(--real-sketch-a), var(--real-sketch-b)); box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px #d8d8d8; }
.lg-square { width: 10px; height: 10px; background: var(--sketch-dark); border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--sketch-dark); display: inline-block; }
.lg-square-real { background: #52703a; box-shadow: 0 0 0 1px #c9c9c9; }
.lg-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.lg-action { background: var(--action); }
.lg-action-real { background: var(--real-action); box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px #d8d8d8; }
.lg-now { background: #fff; box-shadow: inset 0 0 0 3px #232323; }
.demo-caption { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.45; }

.token-panel { font-size: 14px; }
.token-row-label { font-weight: 600; margin-bottom: 5px; }
.token-row { display: flex; gap: 3px; flex-wrap: nowrap; }
.token {
  flex: 1 1 0; height: 26px; border-radius: 4px; position: relative; overflow: hidden;
  background: var(--c); transition: background-color .2s;
}
.token::after {
  content: ""; position: absolute; inset: 0; opacity: var(--noise, 1);
  background-image: radial-gradient(#8b8f95 0.9px, transparent 1.1px), radial-gradient(#b8bcc1 0.9px, transparent 1.1px);
  background-size: 5px 5px, 7px 7px; background-position: 0 0, 2px 3px; background-color: #e9eaec;
  transition: opacity .2s;
}
.token.is-updating { outline: 2px solid var(--accent); outline-offset: 1px; }
.token-arrow { color: var(--muted); font-size: 12.5px; margin: 6px 0; text-align: center; }
.token-stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 14px 0 0; font-size: 13.5px; }
.token-stats dt { color: var(--muted); }
.token-stats dd { margin: 0; font-family: var(--mono); font-size: 13px; }

/* Real-robot video players */
.task-videos { display: grid; gap: 22px; }
.task-video { border-top: 1px solid var(--rule); padding-top: 16px; }
.task-video:first-child { border-top: 0; padding-top: 0; }
.task-video-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.player-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-group { display: inline-flex; border: 1px solid var(--accent); border-radius: 999px; overflow: hidden; }
.btn-group button + button { border-left: 1px solid var(--accent-line); }
.task-desc { color: var(--faint); font: 400 15px var(--sans); margin-left: 8px; }

/* Canvas overlay players */
.overlay-stage { position: relative; border-radius: 10px; overflow: hidden; background: #111; outline: none; }
.overlay-stage:focus-visible { box-shadow: 0 0 0 3px var(--accent-line); }
.overlay-stage video { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.overlay-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.player-badge {
  position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 999px;
  background: rgba(20, 20, 22, .6); color: #fafafa; font: 500 12px var(--mono);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); pointer-events: none;
}
.player-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(255,255,255,.25); cursor: pointer; }
.player-progress > span { display: block; height: 100%; width: 0; background: var(--accent); }
.player-progress .tick {
  position: absolute; bottom: 8px; transform: translateX(-50%); padding: 1px 6px; border-radius: 999px;
  background: rgba(255,255,255,.9); color: var(--accent); font: 600 11px var(--mono); pointer-events: none;
}
.task-video-head h4 { display: flex; align-items: baseline; flex-wrap: wrap; }
.task-video .overlay-stage { margin-top: 10px; }
.player-tools { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; }
.chip-row, .step-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  appearance: none; border: 1px solid #d7d9dc; background: #fff; color: var(--faint); border-radius: 999px;
  padding: 4px 11px; font: 600 12.5px var(--sans); cursor: pointer;
}
.chip.is-on { border-color: var(--sketch-dark); color: var(--sketch-dark); background: #eef5f1; }
.demo-btn.small { padding: 4px 12px; font-size: 12.5px; }
.demo-btn[hidden] { display: none; }

/* Teaser */
.teaser { margin-top: 6px; }
.teaser-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; }
.teaser-bar .demo-btn { min-width: 76px; }
.mode-control { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.chapter-caption { min-height: 1.5em; margin: 8px 0 6px; font-size: 16px; }
.chapter-caption b { color: var(--accent); }
.noise-bands { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.band { display: flex; gap: 2px; height: 12px; }
.band-cell {
  flex: 1 1 0; border-radius: 2px; opacity: .35;
  background: color-mix(in srgb, #c9ccd0 calc(var(--noise) * 100%), var(--c) calc(100% - var(--noise) * 100%));
}
.band-sketch .band-cell { --c: var(--sketch-dark); }
.band-action .band-cell { --c: var(--real-action); }
.band-cell.is-done { opacity: 1; }
.band-cell.is-current { outline: 2px solid var(--ink); outline-offset: 1px; }
.band-lead { position: relative; height: 22px; }
.lead-mark { position: absolute; left: 0; bottom: 0; height: 7px; border: 1.5px solid var(--sketch-dark); border-bottom: 0; border-radius: 2px 2px 0 0; transition: background .2s; }
.lead-mark.is-active { background: rgba(65, 112, 94, .18); }
.lead-label { position: absolute; left: 0; bottom: 9px; white-space: nowrap; font: 600 11.5px var(--mono); color: var(--sketch-dark); }
.teaser-note { color: var(--muted); font-size: 14.5px; margin-top: 10px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--accent-line); border-radius: 10px; margin: 14px 0; }
.results-table, .mini-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.results-table caption, .mini-table caption {
  caption-side: top; text-align: left; padding: 10px 14px; background: #fbf7f8; color: var(--accent);
  font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--accent-line);
}
.results-table th, .results-table td { padding: 7px 10px; font-size: 14.5px; text-align: center; border-bottom: 1px solid #f0eced; white-space: nowrap; }
.results-table thead th { color: var(--muted); font-size: 13px; font-weight: 600; }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table .method-cell { text-align: left; font-weight: 600; }
.row-ours td { background: var(--accent-soft); }
.win { font-weight: 700; color: var(--accent-dark); }
.table-note { font-size: 13.5px; color: var(--muted); padding: 0 14px 10px; margin: 8px 0 0; }
.sim-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sim-grid .table-wrap { margin: 8px 0; }
.results-table.compact td, .results-table.compact th { font-size: 14px; }

/* Real-world success chart */
.sr-chart { margin: 10px 0 16px; display: grid; gap: 10px; }
.sr-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13.5px; color: var(--muted); margin-bottom: 2px; }
.sr-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sr-key { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.sr-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.sr-row.sr-overall { border-top: 1px solid var(--rule); padding-top: 10px; }
.sr-task { font-weight: 600; font-size: 15px; text-align: right; }
.sr-overall .sr-task { color: var(--accent); }
.sr-bars { display: grid; gap: 3px; }
.sr-bar { position: relative; height: 16px; background: #f4f2f3; border-radius: 3px; }
.sr-bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 100%); border-radius: 3px; background: var(--c); }
.sr-bar span { position: absolute; left: calc(var(--v) * 100% + 6px); top: 50%; transform: translateY(-50%); font: 500 12px var(--mono); color: var(--muted); }
.sr-key.sr-dp { background: #b9bdc3; }
.sr-key.sr-bsp { background: #dcc9ce; }
.sr-key.sr-pam { background: var(--accent); }
.sr-bar.sr-dp { --c: #b9bdc3; }
.sr-bar.sr-bsp { --c: #dcc9ce; }
.sr-bar.sr-pam { --c: var(--accent); }
.sr-bar.sr-pam span { color: var(--accent); font-weight: 700; }
.more { margin: 6px 0 18px; }
.more summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 15px; }
.more-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-top: 10px; align-items: start; }
.more .mini-table td, .more .mini-table th { white-space: nowrap; font-size: 13px; }

/* Findings */
.findings { list-style: none; padding: 0; margin: 8px 0 0; }
.findings > li { margin-bottom: 12px; }
.findings b { color: var(--accent); font-weight: 600; }
.mini-table { border: 1px solid var(--accent-line); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: 14px; }
.mini-table th, .mini-table td { padding: 5px 8px; text-align: center; border-bottom: 1px solid #f0eced; }
.mini-table td:first-child { text-align: left; }
.mini-table thead th { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.mini-table tbody tr:last-child td { border-bottom: 0; }

/* Citation */
.bibtex { position: relative; }
.bibtex pre {
  margin: 0; background: #faf6f7; border: 1px solid var(--accent-line); border-radius: 8px;
  padding: 16px 18px; font: 13.5px/1.55 var(--mono); overflow-x: auto; color: #333;
}
.copy-btn {
  position: absolute; top: 10px; right: 10px; border: 1px solid var(--accent); background: #fff; color: var(--accent);
  border-radius: 999px; padding: 3px 12px; font: 600 12.5px var(--sans); cursor: pointer;
}
.copy-btn:hover { background: var(--accent-soft); }
.footer { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--rule); color: var(--faint); font-size: 13.5px; text-align: center; }

@media (max-width: 820px) {
  body { font-size: 17px; }
  .title { font-size: 30px; }
  .title br { display: none; }
  .sketch-demo-body, .schedule-demo-body, .two-col, .sim-grid, .more-grid { grid-template-columns: 1fr; }
  .demo-controls, #schedule-demo .demo-controls { grid-template-columns: 1fr; }
  .mode-control { margin-left: 0; }
}
@media (max-width: 480px) {
  .container { padding: 0 14px 40px; }
  .authors { font-size: 17px; gap: 2px 14px; }
  .segmented button { padding: 6px 9px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
