/* DPP project page, v3: styled after the paper figures (Calibri-style type, navy chips, tinted panels,
   Figure 2 plan colors, Figure 3/4 method colors). Loaded after the shared component styles. */
:root {
  --navy: #16293d;
  --ink: #16293d;
  --text: #2b3a4d;
  --muted: #5f6c7c;
  --line: #dfe4ec;
  --line-strong: #c5cdd8;
  --panel: #f6f8fb;
  --panel-line: #dde3ec;

  --tint-orange: #fff6ec;
  --tint-orange-line: #f3d9bf;
  --tint-purple: #f6f2fc;
  --tint-purple-line: #ddd0ef;
  --tint-green: #eff8f3;
  --tint-green-line: #cde7d9;
  --tint-cyan: #e9f6fb;
  --tint-cyan-line: #b9e1ef;

  /* Method colors from Figures 3-4, nudged to pass CVD separation (validated). */
  --m-r: #e9963a;
  --m-f: #cf6fa3;
  --m-dw: #3a8a62;
  --m-dpp: #0aa5d6;
  --m-dpp2: #1f5f99;
  --m-puma: #9aa3ae;
  --m-pi: #b7bec7;
  --m-aha: #cfd4da;
  --m-r-soft: #fcecd5;
  --m-f-soft: #f9e6ef;
  --m-dw-soft: #e3f2ea;
  --m-dpp-soft: #dff2f9;

  /* Plan colors from Figure 2. */
  --p-init: #ec7434;
  --p-can: #7c54b4;
  --p-cur: #248c64;
  --p-tau: #0aa5d6;
  --b1: #c45c24;
  --b2: #7c54b4;
  --b3: #248c64;
  --b4: #0b86b3;

  --ok: #14745c;
  --fail: #ac3c34;
  --x-red: #e5322d;

  /* Tokens used by the shared component styles. */
  --accent: #0b86b3;
  --accent-ink: #0a6d93;
  --accent-soft: #dff2f9;
  --accent-line: #9fd6ea;
  --track: #edf0f4;
  --bar: #c5cdd8;
  --max: 1200px;
  --measure: 700px;
  --sans: "Carlito", "Calibri", "Lato", system-ui, sans-serif;
  --mono: "Carlito", "Calibri", "Lato", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: #fff; scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 400 18.5px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--m-dpp); outline-offset: 3px; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
strong { color: var(--navy); font-weight: 700; }
h1, h2, h3, h4 { margin: 0; color: var(--navy); font-weight: 700; }
sup { line-height: 0; }
code { font: 0.95em ui-monospace, SFMono-Regular, Menlo, monospace; }
.wrap { width: min(var(--max), 100% - 64px); margin-inline: auto; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Figure vocabulary ---------- */
/* Navy-bordered white chip, as in "(a) Real-world evaluation". */
.fchip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px 7px;
  border: 3.5px solid var(--navy);
  border-radius: 16px;
  background: #fff;
  color: var(--navy);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  line-height: 1.15;
}

.fchip.sm { padding: 4px 14px 5px; border-width: 2.5px; border-radius: 12px; font-size: 19px; }
.fchip.task { border-width: 2px; border-color: #1f4658; border-radius: 10px; font-size: 20px; padding: 4px 14px; }

/* Rounded tinted panel with its chip on the top edge. */
.fpanel {
  position: relative;
  margin-top: 30px;
  padding: 56px 40px 40px;
  border: 1.5px solid var(--panel-line);
  border-radius: 22px;
  background: var(--panel);
}

.fpanel > .fchip:first-child { position: absolute; top: -26px; left: 26px; margin: 0; }
.fpanel.orange { background: var(--tint-orange); border-color: var(--tint-orange-line); }
.fpanel.purple { background: var(--tint-purple); border-color: var(--tint-purple-line); }
.fpanel.green { background: var(--tint-green); border-color: var(--tint-green-line); }
.fpanel.cyan { background: var(--tint-cyan); border-color: var(--tint-cyan-line); }
.fpanel.navy { background: #fff; border: 3px solid var(--navy); }

.sub {
  padding: 22px 24px;
  border: 1.5px solid var(--panel-line);
  border-radius: 16px;
  background: #fff;
}

/* Method chips (Figure 3): colored border, tinted fill. */
.mchip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 3px 12px;
  border: 2px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.3;
}

.mchip.r { border-color: var(--m-r); background: var(--m-r-soft); }
.mchip.f { border-color: var(--m-f); background: var(--m-f-soft); }
.mchip.dw { border-color: var(--m-dw); background: var(--m-dw-soft); }
.mchip.dpp { border-color: #3494b4; background: var(--m-dpp-soft); }

/* Numbered step badges (Figure 3b). */
.nbadge {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--b1);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
}

.nbadge.b2 { background: var(--b2); }
.nbadge.b3 { background: var(--b3); }
.nbadge.b4 { background: var(--b4); }

.outcome { font-weight: 700; }
.outcome.ok { color: var(--ok); }
.outcome.fail { color: var(--fail); }
.ours-box { display: inline-block; padding: 0 8px; border: 2.5px solid var(--navy); border-radius: 8px; line-height: 1.25; }

/* ---------- Navigation ---------- */
.progress { position: fixed; inset: 0 0 auto; z-index: 60; height: 3px; background: var(--m-dpp); transform: scaleX(0); transform-origin: 0 50%; }

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.nav .wrap { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--navy); font-size: 21px; font-weight: 700; text-decoration: none; }
.brand svg { width: 24px; height: 24px; }
.brand:hover { color: var(--navy); }
.nav-links { display: flex; flex: 1; justify-content: flex-end; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { flex-shrink: 0; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 16.5px; font-weight: 700; text-decoration: none; }
.nav-links a:hover { color: var(--navy); background: var(--panel); }
.nav-links a.active { color: var(--navy); box-shadow: inset 0 -3px 0 var(--m-dpp); border-radius: 0; }
.nav-cta { flex-shrink: 0; padding: 6px 16px; border: 2.5px solid var(--navy); border-radius: 10px; background: var(--navy); color: #fff; font-size: 16.5px; font-weight: 700; text-decoration: none; }
.nav-cta:hover { background: #fff; color: var(--navy); }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 24px; text-align: center; }
.hero-tag { display: inline-block; margin-bottom: 20px; }
.hero h1 { max-width: 24ch; margin-inline: auto; font-size: clamp(36px, 5.2vw, 64px); line-height: 1.04; letter-spacing: -0.01em; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--navy); font-size: 21px; font-weight: 700; }
.authors li { white-space: nowrap; }
.authors sup, .author-notes sup { color: var(--m-dpp); margin-left: 1px; }
.affiliation { margin: 6px 0 0; font-size: 19px; }
.author-notes { margin: 0; color: var(--muted); font-size: 16px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 2.5px solid var(--navy);
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.btn svg { width: 18px; height: 18px; }
.btn:hover { background: var(--panel); color: var(--navy); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: #22405d; color: #fff; }
.btn[aria-disabled="true"] { border-style: dashed; border-color: var(--line-strong); color: var(--muted); cursor: default; }
.btn[aria-disabled="true"]:hover { background: #fff; }
.btn .soon { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }

/* Figure 1 style comparison with looping real-robot clips. */
.fig1 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 64px; text-align: left; }
.fig1-panel { position: relative; padding: 48px 18px 16px; border: 2px solid var(--tint-orange-line); border-radius: 22px; background: #fff; }
.fig1-panel.dpp { border: 2.5px solid var(--navy); }

.fig1-chip {
  position: absolute;
  top: -24px;
  left: 20px;
  padding: 3px 16px 4px;
  border: 3.5px solid var(--p-init);
  border-radius: 14px;
  background: #fff;
  color: var(--p-init);
  font-size: clamp(21px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.2;
}

.fig1-panel.dpp .fig1-chip { border-color: var(--navy); color: var(--navy); }
.fig1-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: start; gap: 6px; margin: 0 4px 12px; text-align: center; }
.fig1-flow figcaption { min-height: 2.3em; }
.fig1-flow figure { margin: 0; }
.fig1-flow svg { display: block; height: 52px; margin: 0 auto; }
.fig1-flow figcaption { margin-top: 4px; font-size: 17px; font-weight: 700; line-height: 1.15; }
.fig1-flow .arrow { width: 26px; height: 20px; margin-top: 16px; }
.fig1-media { position: relative; overflow: hidden; border-radius: 12px; background: #000; }
.fig1-media video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.fig1-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 14px; color: var(--muted); font-size: 16px; text-align: left; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 2px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font: 700 16px var(--sans);
  cursor: pointer;
}

.icon-btn:hover { border-color: var(--navy); }
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn[aria-pressed="true"] { border-color: var(--navy); background: var(--panel); }

/* ---------- Sections ---------- */
.slide { position: relative; padding: 56px 0 24px; }
.slide-head { margin-bottom: 20px; }
.slide-head .lede { margin: 0; color: var(--navy); font-size: 20px; line-height: 1.45; }
.slide-head .aside { margin: 8px 0 0; color: var(--muted); font-size: 16px; line-height: 1.45; }
.note { max-width: 900px; margin: 12px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.note strong { color: var(--text); }

figure { margin: 0; }
.fig { margin-top: 20px; }
.fig-frame { overflow: hidden; border: 1.5px solid var(--panel-line); border-radius: 16px; background: #fff; }
.fig-frame.pad { padding: 16px; }
.fig-frame a { display: block; cursor: zoom-in; }
.fig figcaption { max-width: 900px; margin-top: 10px; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.fig figcaption strong { color: var(--navy); }


.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 2px solid var(--line-strong); border-radius: 12px; background: #fff; }
.seg button { padding: 4px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 700 16px var(--sans); cursor: pointer; }
.seg button:hover { color: var(--navy); }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* ---------- (1) Problem ---------- */
.schematic { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.schematic svg { display: block; width: 100%; height: auto; }
.schematic figcaption { margin-top: 8px; color: var(--muted); font-size: 16px; line-height: 1.45; }
.schematic figcaption strong { display: block; color: var(--navy); font-size: 18px; }
.sk text { font: 700 14px var(--sans); fill: var(--muted); }
.sk .lbl-ink { fill: var(--navy); }
.sk .lbl-bad { fill: var(--fail); }
.sk .halo { paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }

.explorer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.explorer-media { position: relative; aspect-ratio: 900 / 708; overflow: hidden; border: 1.5px solid var(--panel-line); border-radius: 12px; background: #fff; }
.explorer-media img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 450ms ease; }
.explorer-media img.on { opacity: 1; }
.explorer-badge { position: absolute; right: 10px; bottom: 10px; padding: 2px 12px; border: 2.5px solid var(--navy); border-radius: 10px; background: #fff; color: var(--navy); font-weight: 700; font-size: 16px; }
.explorer-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.explorer-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.explorer-controls .label { color: var(--navy); font-weight: 700; }
.readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.readout { padding: 10px 14px 12px; border: 1.5px solid var(--panel-line); border-radius: 12px; background: var(--panel); min-width: 0; }
.readout .k { color: var(--muted); font-size: 15px; font-weight: 700; line-height: 1.25; }
.readout .v { color: var(--navy); font-size: 32px; font-weight: 700; line-height: 1.15; }
.readout .v small { color: var(--muted); font-size: 17px; }
.readout svg { display: block; width: 100%; height: auto; margin-top: 4px; overflow: visible; }
.explorer-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: 15px; font-weight: 700; }
.explorer-legend span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- (2) Idea ---------- */
.triad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.triad .sub { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-content: start; }
.triad .sub .nbadge { grid-row: span 2; width: 44px; height: 44px; font-size: 16px; }
.triad h3 { font-size: 26px; line-height: 1.1; }
.triad .src { margin: 0; color: var(--muted); font-size: 15px; font-weight: 700; }
.triad p.body { grid-column: 1 / -1; margin: 10px 0 0; font-size: 17px; line-height: 1.5; }

/* ---------- (3) Method ---------- */
.stepper { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 24px; align-items: start; }
.steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.step-btn { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; width: 100%; overflow: hidden; padding: 14px 16px; border: 2px solid var(--panel-line); border-radius: 14px; background: #fff; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.step-btn:hover { border-color: var(--line-strong); }
.step-btn[aria-selected="true"] { border-color: var(--navy); box-shadow: 0 0 0 1.5px var(--navy); }
.step-btn .nbadge { grid-row: span 2; width: 36px; height: 36px; }
.step-btn h3 { align-self: center; font-size: 19px; line-height: 1.25; }
.step-btn p { display: none; grid-column: 2; margin: 4px 0 0; color: var(--text); font-size: 16.5px; line-height: 1.45; }
.step-btn[aria-selected="true"] p { display: block; }
.step-btn .prog { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--navy); transform: scaleX(0); transform-origin: 0 50%; }
.stepper.playing .step-btn[aria-selected="true"] .prog { animation: step-prog var(--step-ms, 6000ms) linear forwards; }
@keyframes step-prog { to { transform: scaleX(1); } }

.scene-card { position: relative; padding: 12px 14px 14px; }
.scene { display: block; width: 100%; height: auto; }
.scene text { font: 700 16px var(--sans); fill: var(--muted); }
.scene .t-ink { fill: var(--navy); }
.scene .t-init { fill: #c45c24; }
.scene .t-can { fill: var(--p-can); }
.scene .t-cur { fill: var(--p-cur); }
.scene .t-tau { fill: #0b86b3; }
.scene .halo { paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.scene [data-steps] { opacity: 0; transition: opacity 500ms ease; }
.scene [data-steps].on { opacity: 1; }
.scene [data-steps].on.dim { opacity: 0.3; }
.scene .draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: opacity 500ms ease, stroke-dashoffset 1100ms ease; }
.scene .draw.on { stroke-dashoffset: 0; }
.scene .mover { transition: transform 1000ms cubic-bezier(0.45, 0, 0.2, 1); }

/* Figure 2(c) style timeline. */
.lanes { margin-top: 8px; }
.lane { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 10px; }
.lane + .lane { margin-top: 6px; padding-top: 6px; border-top: 1.5px solid var(--line); }
.lane-name { color: var(--navy); font-size: 15px; font-weight: 700; line-height: 1.1; }
.lane-name small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.lane-track { position: relative; height: 30px; }
.tblock { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; overflow: hidden; border: 1.5px solid; border-radius: 7px; font-size: 13px; font-weight: 700; line-height: 1; white-space: nowrap; transition: opacity 400ms ease; opacity: 0.35; }
.tblock.on { opacity: 1; }
.tblock.init { border-color: #e8a27c; background: #fbe2d2; color: #b8531f; }
.tblock.act { border-color: #efc0a2; background: #fff0e6; color: #c45c24; }
.tblock.can { border-color: #a58bd3; background: #ece4f7; color: var(--p-can); }
.tblock.cur { border-color: #7fbf9d; background: #e2f3ea; color: var(--p-cur); }
.tblock.wait { border-color: #cfd5dd; background: #eef1f4; color: var(--muted); }
.tau-line { position: absolute; top: -40px; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--p-tau); border-radius: 2px; }
.tau-label { position: absolute; top: -44px; margin-left: 8px; color: #0b86b3; font-size: 14px; font-weight: 700; white-space: nowrap; }

/* Counterfactual crossfade (Figure 3b, "Canonical observation"). */
.cf { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; align-items: center; }
.cf-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cf-head h3 { font-size: 26px; }
.xfade-media { --a: calc(1 - var(--mix) / 100); --b: calc(var(--mix) / 100); position: relative; aspect-ratio: 1015 / 763; overflow: hidden; border: 3px solid var(--navy); border-radius: 12px; background: #eee; transition: border-color 200ms ease; }
.xfade.is-cf .xfade-media { border-color: var(--p-can); }
.xfade-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.xfade-media img.b { opacity: var(--b); }
.xfade-labels { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 18px; font-weight: 700; }
.xfade-labels span { transition: color 200ms ease; }
.xfade-labels .on { color: var(--navy); }
.xfade-controls { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.xfade-controls input { flex: 1; min-width: 0; accent-color: var(--p-can); cursor: pointer; }
.cf-steps { margin: 14px 0 0; padding: 0; list-style: none; }
.cf-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 8px 0; font-size: 17px; line-height: 1.45; }
.cf-steps .nbadge { width: 28px; height: 28px; font-size: 15px; background: var(--b2); }

/* ---------- Charts ---------- */
.viz { position: relative; width: 100%; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz text { font: 400 14px var(--sans); fill: var(--muted); }
.viz .tick { font: 400 13.5px var(--sans); fill: var(--muted); font-variant-numeric: tabular-nums; }
.viz .axis-title { font: 700 14.5px var(--sans); fill: var(--navy); }
.viz .code { font: 700 15px var(--sans); fill: var(--navy); }
.viz .val { font: 700 15px var(--sans); fill: var(--navy); font-variant-numeric: tabular-nums; }
.viz .val-rc { font: 700 14px var(--sans); fill: #2b62b0; font-variant-numeric: tabular-nums; }
.viz .val-muted { font: 400 14px var(--sans); fill: var(--muted); font-variant-numeric: tabular-nums; }
.viz .lbl { font-weight: 700; fill: var(--navy); }
.viz .grid { stroke: #e6eaf0; stroke-width: 1; }
.viz .axis { stroke: #b9c1cc; stroke-width: 1.5; }
.viz .hit { fill: transparent; outline: none; }
.viz .hit:focus-visible { fill: rgba(10, 165, 214, 0.08); }
.viz .cross { stroke: var(--line-strong); stroke-width: 1; opacity: 0; }
.viz .cross.on { opacity: 1; }
.viz .halo { paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }

.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--navy); font-size: 15.5px; }
.legend.left { justify-content: flex-start; margin: 0 0 8px; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend b { font-weight: 700; }
.sw { display: inline-block; flex-shrink: 0; width: 14px; height: 14px; border-radius: 2px; }
.sw.line { width: 22px; height: 3px; border-radius: 2px; }
.sw.rc { width: 30px; height: 12px; background: none; border-radius: 0; }

.tooltip { position: fixed; z-index: 80; max-width: 320px; padding: 10px 12px; border: 2px solid var(--navy); border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(22, 41, 61, 0.14); color: var(--text); font-size: 15px; line-height: 1.4; pointer-events: none; }
.tooltip .tt-title { margin-bottom: 6px; color: var(--navy); font-weight: 700; }
.tooltip table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 15px; }
.tooltip td { padding: 1px 0; border: 0; background: none; }
.tooltip td + td { padding-left: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.tooltip tr.me td { color: var(--navy); font-weight: 700; }
.tooltip .sw { width: 11px; height: 11px; margin-right: 6px; vertical-align: 0; }

/* Small multiples by task (Figure 4 style bars). */
.multiples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mult { padding: 14px 14px 8px; }
.mult h4 { display: flex; align-items: baseline; gap: 8px; font-size: 18px; }
.mult h4 span { color: var(--muted); font-size: 15px; font-weight: 700; }

/* Figure 4: complex motion panels. */
.motion-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 12px; }
.motion-grid .fpanel { margin-top: 26px; padding: 44px 16px 12px; }
.motion-grid .fpanel > .fchip:first-child { top: -22px; left: 16px; }
.motion-grid .traj { display: block; width: 100%; height: 92px; margin-bottom: 4px; }

/* Real robot: Figure 3(a) styling on the shared comparison component. */
.real-task-grid { display: grid; gap: 44px; }
.real-comparison { padding: 50px 20px 18px; position: relative; border: 1.5px solid var(--panel-line); border-radius: 18px; background: #fff; }
.real-comparison-head { align-items: center; }
.real-task-label { position: absolute; top: -20px; left: 20px; margin: 0; padding: 3px 14px; border: 2px solid #1f4658; border-radius: 10px; background: #fff; color: var(--navy); font: 700 19px var(--sans); letter-spacing: 0; text-transform: none; vertical-align: 0; }
.real-comparison h3 { font-size: 22px; letter-spacing: 0; }
.real-task-description { font-size: 16.5px; }
.real-transport .real-play { background: var(--navy); border-color: var(--navy); }
.real-transport .real-play:hover:not(:disabled) { background: #22405d; border-color: #22405d; }
.real-transport button, .real-transport select { font: 700 15px var(--sans); border-width: 2px; border-radius: 10px; }
.real-video-card { border: 0; border-radius: 0; background: transparent; }
.real-video-card.is-dpp { box-shadow: none; }
.real-video-card figcaption { align-items: center; min-height: 0; margin-bottom: 8px; padding: 5px 10px; border: 2px solid var(--line-strong); border-radius: 10px; background: #fff; text-align: center; }
.real-video-card.m-r figcaption { border-color: var(--m-r); background: var(--m-r-soft); }
.real-video-card.m-f figcaption { border-color: var(--m-f); background: var(--m-f-soft); }
.real-video-card.is-dpp figcaption { border-color: #3494b4; background: var(--m-dpp-soft); }
.real-method-name { justify-content: center; font-size: 20px; }
.real-method-note { font-size: 14.5px; }
.real-ours { border-radius: 6px; background: #fff; color: var(--navy); border: 2px solid var(--navy); font: 700 12px var(--sans); padding: 0 6px; }
.real-sr { margin-left: 4px; color: var(--muted); font: 700 14px var(--sans); }
.real-video-card.is-dpp .real-sr { color: #0b6f99; }
.real-video-card video { border-radius: 10px; }
.real-clock, .real-comparison-note, .real-speed-note { font-size: 14.5px; }

/* Simulation comparison component: Figure 3 method chips on each card. */
:is(#simulation-comparison, #nonlinear-comparison) .card { border: 0; background: transparent; box-shadow: none !important; }
:is(#simulation-comparison, #nonlinear-comparison) .cardhead { min-height: 0; margin-bottom: 6px; padding: 4px 10px; border: 2px solid var(--line-strong); border-radius: 10px; background: #fff; }
:is(#simulation-comparison, #nonlinear-comparison) .card[data-m="r"] .cardhead { border-color: var(--m-r); background: var(--m-r-soft); }
:is(#simulation-comparison, #nonlinear-comparison) .card[data-m="f"] .cardhead { border-color: var(--m-f); background: var(--m-f-soft); }
:is(#simulation-comparison, #nonlinear-comparison) .card[data-m="dw"] .cardhead { border-color: var(--m-dw); background: var(--m-dw-soft); }
:is(#simulation-comparison, #nonlinear-comparison) .card[data-m="dpp"] .cardhead { border-color: #3494b4; background: var(--m-dpp-soft); }
:is(#simulation-comparison, #nonlinear-comparison) .model { color: var(--navy); font-size: 16px; font-weight: 700; }
:is(#simulation-comparison, #nonlinear-comparison) .badge { background: transparent; padding: 0; font: 700 14px var(--sans); letter-spacing: 0; }
:is(#simulation-comparison, #nonlinear-comparison) .badge::before { content: "✕ "; }
:is(#simulation-comparison, #nonlinear-comparison) .badge.ok::before { content: "✓ "; }
:is(#simulation-comparison, #nonlinear-comparison) video { border: 1.5px solid var(--panel-line); border-radius: 10px; }
:is(#simulation-comparison, #nonlinear-comparison) .heading h3 { font-size: 21px; }
:is(#simulation-comparison, #nonlinear-comparison) .task-number { font-weight: 700; }
:is(#simulation-comparison, #nonlinear-comparison) .controls button.primary { background: var(--navy); border-color: var(--navy); }
:is(#simulation-comparison, #nonlinear-comparison) .controls :is(button, select) { font: 700 15px var(--sans); border-width: 2px; border-radius: 10px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.tab { display: inline-flex; align-items: baseline; gap: 8px; padding: 4px 14px; border: 2px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--navy); font: 700 16px var(--sans); cursor: pointer; }
.tab .tab-id { color: #0b6f99; }
.tab:hover { border-color: var(--navy); }
.tab[aria-selected="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.tab[aria-selected="true"] .tab-id { color: #9fdcf1; }

/* Existing Task 1 / Task 2 bar-chart markup, recolored by method. */
.performance-charts { padding: 20px 22px 14px; border: 1.5px solid var(--panel-line); border-radius: 16px; background: #fff; }
.chart-controls { display: inline-flex; gap: 3px; margin-bottom: 18px; padding: 3px; border: 2px solid var(--line-strong); border-radius: 12px; }
.metric-button { padding: 4px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 700 16px var(--sans); cursor: pointer; }
.metric-button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.chart-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 15px; }
.chart-heading > span:first-child { color: var(--navy); font-weight: 700; font-size: 16px; }
.bar-columns, .bar-axis, .bar-row { display: grid; grid-template-columns: 240px minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.bar-columns strong { font-size: 17px; }
.bar-columns span { display: block; color: var(--muted); font-size: 15px; }
.bar-axis { margin: 10px 0 2px; color: var(--muted); font-size: 13px; }
.bar-axis > div { display: flex; justify-content: space-between; padding-right: 58px; }
.bar-row { min-height: 50px; padding: 6px 0; border-top: 1px solid #eef1f5; }
.bar-method strong { display: flex; align-items: center; gap: 8px; color: var(--navy); font-size: 16.5px; line-height: 1.3; }
.bar-method strong::before { content: ""; width: 12px; height: 12px; flex-shrink: 0; border-radius: 2px; background: var(--mc, var(--m-puma)); }
.bar-method > span { display: block; margin-top: 1px; padding-left: 20px; color: var(--muted); font-size: 14.5px; line-height: 1.3; }
.bar-measure { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar-track { flex: 1; min-width: 0; height: 18px; border-radius: 0 3px 3px 0; background: var(--track); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 0 3px 3px 0; background: var(--mc, var(--m-puma)); }
.bar-value { width: 48px; color: var(--navy); font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.bar-row.m-r { --mc: var(--m-r); }
.bar-row.m-f { --mc: var(--m-f); }
.bar-row.m-dw { --mc: var(--m-dw); }
.bar-row.m-dpp { --mc: var(--m-dpp); }
.bar-row.m-dpp2 { --mc: var(--m-dpp2); }
.bar-row.m-puma { --mc: var(--m-puma); }
.bar-row.m-pi { --mc: var(--m-pi); }
.bar-row.m-aha { --mc: var(--m-aha); }
.other-methods { margin-top: 6px; border-top: 1.5px solid var(--line); }
.other-methods summary { display: block; width: fit-content; padding: 12px 0; color: var(--navy); font-size: 16.5px; font-weight: 700; list-style: none; cursor: pointer; }
.other-methods summary::-webkit-details-marker { display: none; }
.other-methods summary::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 12px 2px 2px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(-45deg); transition: transform 150ms ease; }
.other-methods[open] summary::before { transform: rotate(45deg); }
.other-methods summary > span { margin-left: 6px; color: var(--muted); font-weight: 400; }

/* ---------- Tables ---------- */
.table-shell { margin-top: 14px; overflow-x: auto; border: 1.5px solid var(--panel-line); border-radius: 12px; background: #fff; }
.table-shell.more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 16.5px; }
.compact-table { min-width: 0; }
th, td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--panel); color: var(--navy); font-size: 15px; font-weight: 700; }
th.num, td.num { text-align: right; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.ours td { background: var(--m-dpp-soft); color: var(--navy); font-weight: 700; }
tr.ours td:first-child { box-shadow: inset 4px 0 0 var(--m-dpp); }
tr.group th { background: #fff; color: var(--muted); }
td.delta { color: var(--muted); }

/* ---------- Conclusion & citation ---------- */
.closing .fpanel { padding: 56px 36px 30px; }
.closing h2 { max-width: 24ch; font-size: clamp(30px, 4vw, 50px); line-height: 1.08; }
.closing h2 span { color: #0b86b3; }
.closing .body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px 40px; margin-top: 26px; }
.closing .body p { font-size: 19.5px; line-height: 1.55; }
.limits { padding: 16px 20px; border: 2px solid var(--tint-orange-line); border-radius: 14px; background: var(--tint-orange); font-size: 16.5px; line-height: 1.5; }
.limits strong { display: block; margin-bottom: 4px; color: #b8531f; font-size: 18px; }
.bibtex { position: relative; margin-top: 8px; border: 1.5px solid var(--panel-line); border-radius: 14px; background: #fff; }
.bibtex pre { margin: 0; padding: 22px 24px; overflow-x: auto; color: var(--navy); font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.copy-btn { position: absolute; top: 12px; right: 12px; height: 34px; padding: 0 14px; border: 2px solid var(--navy); border-radius: 10px; background: #fff; color: var(--navy); font: 700 15px var(--sans); cursor: pointer; }
.cite-row { margin-top: 18px; }
.closing footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin-top: 16px; padding-top: 12px; border-top: 1.5px solid var(--line); color: var(--muted); font-size: 15.5px; }
.closing footer a { color: var(--muted); }

/* ---------- Slide components ---------- */
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--accent-ink); font: 700 16px var(--sans); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; cursor: pointer; }
.link-btn::after { content: ""; width: 10px; height: 10px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: translateY(1px); }
.link-btn:hover { color: var(--navy); }
.link-btn.inline { font-size: inherit; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 14px; }

.glance { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 26px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--text); font-size: 15.5px; }
.glance b { margin-right: 4px; color: var(--navy); font-size: 19px; }
.glance span { color: var(--muted); }

.rate-badge { position: absolute; right: 10px; bottom: 10px; padding: 2px 10px 3px; border: 2.5px solid var(--navy); border-radius: 10px; background: #fff; color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.25; }
.rate-badge b { color: var(--navy); font-size: 20px; }
.rate-badge.dpp { border-color: #0b86b3; }
.rate-badge.dpp b { color: #0b6f99; }

.scroll-cue { position: absolute; left: 50%; bottom: 6px; display: grid; place-items: center; width: 34px; height: 34px; margin-left: -17px; border: 2px solid var(--line-strong); border-radius: 50%; background: #fff; color: var(--navy); animation: cue-bob 2.2s ease-in-out infinite; }
.scroll-cue svg { width: 20px; height: 20px; }
.scroll-cue:hover { border-color: var(--navy); }
@keyframes cue-bob { 50% { transform: translateY(4px); } }

.idea-grid .fig { margin: 0; }
.idea-grid .fig figcaption { margin-top: 6px; }
.idea-grid .triad { margin: 0; }
.cf-text .lede { margin: 0; color: var(--navy); font-size: 20px; line-height: 1.45; }
.legend-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 28px; margin-top: 12px; }
.legend-row .legend { margin: 0; }
.abl-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-bottom: 4px; }
.abl-top .legend { margin: 0; }
.videos-head { align-items: center; }
.videos-note { margin-top: 6px; }

/* Real robot: task cards double as tabs (Figure 3a charts). */
.real-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.real-charts { display: grid; gap: 12px; }
.task-card { padding: 10px 12px 2px; border: 2px solid var(--panel-line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color 150ms ease, box-shadow 150ms ease; }
.task-card:hover { border-color: var(--line-strong); }
.task-card.on { border-color: var(--navy); box-shadow: 0 0 0 1.5px var(--navy); }
.task-card .fchip.task { font: 700 17px var(--sans); cursor: pointer; }
.task-card.on .fchip.task { background: var(--navy); color: #fff; }
.real-task-grid { gap: 0; }

/* Detail sheets (native dialog). */
.sheet { width: min(1100px, calc(100vw - 48px)); max-height: calc(100svh - 64px); padding: 0 24px 22px; overflow: auto; border: 3px solid var(--navy); border-radius: 20px; background: #fff; color: var(--text); }
.sheet::backdrop { background: rgba(22, 41, 61, 0.5); }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 -24px 14px; padding: 14px 24px 12px; border-bottom: 1.5px solid var(--line); background: #fff; }
.sheet .fig { margin-top: 4px; }
.sheet p { font-size: 16.5px; }

/* Slide index. */
.dots { position: fixed; top: 50%; right: 20px; z-index: 45; display: grid; gap: 11px; transform: translateY(-50%); }
.dots a { position: relative; display: block; width: 11px; height: 11px; border: 2px solid var(--navy); border-radius: 50%; background: #fff; transition: transform 150ms ease, background-color 150ms ease; }
.dots a::before { content: ""; position: absolute; inset: -7px; }
.dots a.on { background: var(--m-dpp); transform: scale(1.3); }
.dots a span { position: absolute; top: 50%; right: 20px; padding: 1px 9px; border: 2px solid var(--navy); border-radius: 8px; background: #fff; color: var(--navy); font: 700 14px var(--sans); white-space: nowrap; opacity: 0; pointer-events: none; transform: translateY(-50%); transition: opacity 150ms ease; }
.dots a:hover span, .dots a:focus-visible span { opacity: 1; }
@media (max-width: 1299px), (max-height: 599px) { .dots { display: none; } }

/* ---------- Slides: one screen per section, snapped on desktop ---------- */
:root { --nav-h: 62px; --slide-h: calc(100svh - var(--nav-h)); }

/* Without JavaScript, gentle proximity snapping; app.js replaces it with directional paging. */
@media (min-width: 761px) and (min-height: 600px) {
  html { scroll-snap-type: y proximity; }
  html.magnet { scroll-snap-type: none; }
}

@media (min-width: 761px) {
  html { scroll-padding-top: var(--nav-h); }
  .slide { display: flex; flex-direction: column; justify-content: center; min-height: var(--slide-h); padding: 38px 0 18px; scroll-snap-align: start; }
  .slide .fpanel { margin: 0; padding: 44px 30px 22px; }
  .slide-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 6px 40px; align-items: start; margin-bottom: 16px; }
  .slide-head .aside { margin: 2px 0 0; font-size: 15.5px; }

  /* Intro: title block plus Figure 1 panels; video height follows the screen. */
  .slide.hero { --hero-vid: clamp(150px, calc(var(--slide-h) - 590px), 330px); padding: 18px 0 42px; }
  .glance { gap: 4px 24px; margin-top: 10px; font-size: 15px; }
  .glance b { font-size: 18px; }
  .fig1-foot .icon-btn { height: 30px; padding: 0 10px; font-size: 14.5px; }
  .hero-tag { margin-bottom: 10px; }
  .hero h1 { max-width: none; font-size: clamp(30px, min(3.3vw, 5.4vh), 48px); line-height: 1.08; }
  .authors { margin-top: 12px; font-size: 19px; }
  .affiliation { margin-top: 2px; font-size: 16.5px; }
  .affiliation .author-notes { margin-left: 10px; font-size: 14.5px; }
  .actions { margin-top: 12px; }
  .btn { height: 38px; font-size: 16.5px; }
  .fig1 { gap: 20px; margin-top: 30px; }
  .fig1-panel { padding: 38px 14px 14px; }
  .fig1-chip { top: -22px; font-size: clamp(19px, 1.9vw, 25px); }
  .fig1-flow { margin: 0 4px 6px; }
  .fig1-flow svg { height: 36px; }
  .fig1-flow figcaption { font-size: 15px; }
  .fig1-flow .arrow { margin-top: 8px; }
  .fig1-media { width: min(100%, calc(var(--hero-vid) * 16 / 9)); margin-inline: auto; }
  .fig1-foot { margin-top: 8px; font-size: 14.5px; }

  /* (1) schematics */
  .schematic { gap: 16px; }
  .schematic figure { display: flex; flex-direction: column; align-items: center; }
  .schematic svg { max-height: calc(var(--slide-h) - 410px); }
  .schematic figcaption { align-self: stretch; }

  /* (2) prefix explorer */
  .explorer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; padding: 16px; }
  .explorer-media { width: min(100%, calc((var(--slide-h) - 300px) * 900 / 708)); justify-self: center; }
  .readout .v { font-size: 28px; }

  /* (3) Figure 1 beside When / Where / How */
  .idea-grid { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr); gap: 18px; align-items: center; }
  .idea-grid .fig-frame { max-width: calc((var(--slide-h) - 290px) * 2400 / 1300 + 36px); }
  .idea-grid .triad { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .idea-grid .triad .sub { padding: 12px 16px; }
  .idea-grid .triad .sub .nbadge { width: 38px; height: 38px; }
  .idea-grid .triad h3 { font-size: 22px; }
  .idea-grid .triad p.body { margin-top: 4px; font-size: 15.5px; }

  /* (4) stepper */
  .stepper { gap: 20px; }
  .step-btn { padding: 11px 14px; }
  .step-btn p { font-size: 15.5px; }
  .scene { max-height: calc(var(--slide-h) - 350px); }
  .scene-toggle { position: absolute; top: 12px; right: 12px; z-index: 1; }

  /* (5) canonical observation */
  .cf { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 30px; }
  .xfade { width: min(100%, calc((var(--slide-h) - 220px) * 1015 / 763)); justify-self: center; }

  /* (6) small multiples */
  .multiples { gap: 12px; }
  .mult { padding: 10px 12px 2px; }
  .mult h4 { font-size: 17px; }

  /* (7) Task 1 / Task 2 bars: all 14 methods in one compact chart */
  .slide .performance-charts { position: relative; padding: 12px 20px 6px; }
  .slide .chart-controls { position: absolute; top: 10px; right: 16px; margin: 0; }
  .slide .chart-heading { margin: 4px 0 4px; }
  .slide .chart-heading > span:last-child { display: none; }
  .slide .bar-columns, .slide .bar-axis, .slide .bar-row { grid-template-columns: 330px minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .slide .bar-columns strong { font-size: 16px; }
  .slide .bar-columns span { display: inline; margin-left: 6px; font-size: 14.5px; }
  .slide .bar-axis { margin: 2px 0 0; }
  .slide .bar-row { min-height: 0; padding: 1px 0; }
  .slide .bar-method strong { font-size: 15.5px; line-height: 1.25; }
  .slide .bar-method > span { font-size: 14px; line-height: 1.25; }
  .slide .bar-method { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .slide .bar-method > span { overflow: hidden; margin: 0; padding: 0; text-overflow: ellipsis; white-space: nowrap; }
  .slide .bar-track { height: 13px; }
  .slide .bar-value { font-size: 14.5px; }
  .slide .other-methods summary { padding: 5px 0; }

  /* (9) real robot */
  .real-comparison { padding: 38px 16px 10px; }
  .real-task-label { top: -18px; }
  .real-comparison h3 { font-size: 20px; }
  .real-task-description { font-size: 15.5px; }
  .real-video-card figcaption { margin-bottom: 6px; padding: 3px 8px; }
  .real-method-name { font-size: 18px; }

  /* (10) complex motion */
  .motion-grid { gap: 20px; margin-top: 30px; }
  .motion-grid .fpanel { padding: 38px 14px 8px; }
  .motion-grid .traj { height: clamp(56px, calc(var(--slide-h) * 0.1), 92px); }

  /* (11) videos: heading and controls share a row; video size follows the screen */
  .videos-head { grid-template-columns: minmax(0, 1fr) auto; }
  .tabs { margin-bottom: 12px; }
  .tab { padding: 3px 11px; font-size: 15px; }
  :is(#simulation-comparison, #nonlinear-comparison) .sim-task { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 20px; align-items: center; }
  :is(#simulation-comparison, #nonlinear-comparison) .sim-task > .heading,
  :is(#simulation-comparison, #nonlinear-comparison) .sim-task > .controls { margin-bottom: 10px; }
  :is(#simulation-comparison, #nonlinear-comparison) .sim-task > .grid,
  :is(#simulation-comparison, #nonlinear-comparison) .sim-task > .training-note { grid-column: 1 / -1; }
  #simulation-comparison-tasks .grid { --v: clamp(120px, calc((var(--slide-h) - 440px) / 2), 250px); grid-template-columns: repeat(3, minmax(0, calc(var(--v) * 4 / 3))); justify-content: center; gap: 10px 14px; }
  #nonlinear-comparison-tasks .grid { --v: clamp(150px, calc(var(--slide-h) - 420px), 330px); grid-template-columns: repeat(4, minmax(0, calc(var(--v) * 4 / 3))); justify-content: center; }

  /* Last slide: takeaway, BibTeX, footer */
  .slide.closing { padding-bottom: 14px; }
  .closing h2 { max-width: 32ch; font-size: clamp(26px, min(3.1vw, 4.5vh), 42px); }
  .closing .fpanel { padding: 50px 32px 24px; }
  .closing .body { margin-top: 16px; }
  .closing .body p { font-size: clamp(16px, 2.2vh, 18px); }
  .limits { font-size: clamp(14.5px, 1.9vh, 16.5px); }
  .cite-row { margin-top: 14px; }
  .bibtex pre { padding: 16px 20px; font-size: 13.5px; }
}

@media (min-width: 761px) and (max-width: 1000px) {
  .slide-head, .videos-head { grid-template-columns: minmax(0, 1fr); }
  .explorer-media, .xfade { width: 100%; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .cf, .closing .body, .stepper, .explorer, .idea-grid, .real-layout { grid-template-columns: minmax(0, 1fr); }
  .scene-card { order: -1; }
  .multiples, .motion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar-columns, .bar-axis, .bar-row { grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
}

@media (max-width: 760px) {
  body { font-size: 17.5px; }
  .wrap { width: calc(100% - 28px); }
  .nav .wrap { gap: 12px; }
  .nav-links { justify-content: flex-start; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .hero { padding-top: 40px; }
  .lg-br { display: none; }
  .authors { font-size: 19px; gap: 2px 14px; }
  .fig1 { grid-template-columns: 1fr; gap: 40px; margin-top: 48px; }
  .fig1-flow svg { height: 40px; }
  .fig1-flow figcaption { font-size: 14.5px; }
  .fpanel { padding: 48px 16px 20px; border-radius: 18px; }
  .fpanel > .fchip:first-child { left: 14px; }
  .fchip { font-size: 21px; padding: 4px 14px 5px; border-width: 3px; }
  .schematic, .triad, .multiples, .motion-grid { grid-template-columns: minmax(0, 1fr); }
  .fpanel .fpanel { padding-left: 12px; padding-right: 12px; }
  .sub { padding: 16px; }
  .slide-head .lede { font-size: 18.5px; }
  .slide { padding: 48px 0 16px; }
  .lane { grid-template-columns: 1fr; }
  .lane-name small { display: inline; margin-left: 6px; }
  .tblock { font-size: 0; }  /* too narrow for labels; the step list names each block */
  .real-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glance { display: grid; grid-template-columns: 1fr 1fr; text-align: left; }
  .scroll-cue { display: none; }
  .performance-charts { padding: 16px 12px 10px; }
  .bar-columns, .bar-axis, .bar-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 14px; }
  .bar-columns > div:first-child, .bar-axis > span { display: none; }
  .bar-method { grid-column: 1 / -1; }
  .bar-value { width: 44px; font-size: 14px; }
  .bar-axis > div { padding-right: 54px; }
  .chart-heading { flex-direction: column; gap: 2px; }
  td { white-space: nowrap; }
  .real-comparison { padding: 46px 12px 14px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: -14px; padding-inline: 14px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex-shrink: 0; }
  .closing .fpanel { padding: 52px 18px 24px; }
  .bibtex pre { padding: 56px 16px 18px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Reading layout: let sections grow instead of compressing them into a viewport. */
html { scroll-snap-type: none; }
.slide:not(.hero) { min-height: 0; padding: 76px 0 52px; scroll-snap-align: none; }
.slide:not(.hero) .fpanel { padding: 52px 40px 36px; }
.slide-head { display: block; margin-bottom: 32px; }
.slide-head .lede { max-width: 68ch; font-size: 21px; line-height: 1.6; }
.section-details { margin: 18px 0 24px; max-width: 76ch; }
.section-details summary { width: fit-content; cursor: pointer; color: var(--accent-ink); font-size: 17px; padding: 6px 0; }
.section-details[open] summary { margin-bottom: 12px; }
.section-details .aside { font-size: 17px; line-height: 1.65; }
.stepper, .idea-grid, .cf { gap: 32px; }
.steps { gap: 16px; }
.step-btn { padding: 18px; }
.step-btn p, .idea-grid .triad p.body { font-size: 17px; line-height: 1.6; }
.idea-grid .triad .sub { padding: 20px; }
.slide .bar-row { padding-block: 8px; }
@media (max-width: 760px) {
  .slide:not(.hero) { padding: 52px 0 28px; }
  .slide:not(.hero) .fpanel { padding: 42px 20px 26px; }
  .slide-head .lede { font-size: 19px; }
  .section-details { margin-block: 14px 20px; }
}

/* Overview video leads the project page. */
.hero-explainer { width: min(100%, 960px); margin: 32px auto 24px; }
.hero-explainer video { width: 100%; aspect-ratio: 16 / 9; background: #16293d; border-radius: 14px; }
.hero-comparison { margin: 24px 0; text-align: left; }
.hero-comparison > summary { width: fit-content; margin-inline: auto; padding: 8px 0; color: var(--accent-ink); cursor: pointer; }
.hero-comparison[open] > summary { margin-bottom: 28px; }

/* Compact viewport sections; details expand without clipping. */
@media (min-width: 761px) and (min-height: 600px) {
 html { scroll-snap-type: y proximity; }
 .slide, .slide:not(.hero) { min-height: var(--slide-h); padding: 38px 0 18px; scroll-snap-align: start; }
 .slide:not(.hero) .fpanel { padding: 42px 30px 22px; }
 .slide-head { margin-bottom: 16px; }
 .slide-head .lede { font-size: 20px; line-height: 1.45; }
 .section-details { margin: 6px 0 10px; }
 .section-details summary { font-size: 16px; padding: 3px 0; }
 .slide:has(details[open]) { scroll-snap-align: none; }
 .stepper, .idea-grid, .cf { gap: 22px; }
 .steps { gap: 10px; }
 .step-btn { padding: 12px 14px; }
 .step-btn p, .idea-grid .triad p.body { font-size: 16px; line-height: 1.45; }
 .idea-grid .triad .sub { padding: 12px 16px; }
 .slide .bar-row { padding-block: 2px; }
 .slide.hero { padding: 18px 0 20px; }
 .hero-explainer { width: min(100%, 960px, calc(max(180px, var(--slide-h) - 370px) * 16 / 9)); margin: 18px auto 10px; }
 .hero-comparison { margin: 6px 0; }
 .hero-comparison > summary { padding: 3px 0; font-size: 16px; }
}
@media (min-width: 761px) and (min-height: 600px) and (max-height: 800px) {
 .slide:not(.hero) { padding: 30px 0 14px; }
 .slide:not(.hero) .fpanel { padding: 38px 24px 18px; }
 .slide-head { margin-bottom: 12px; }
 .fchip { font-size: 23px; }
 .slide-head .lede { font-size: 19px; }
 .hero h1 { font-size: 32px; }
}

/* Let the introduction breathe; later sections keep their viewport layout. */
.slide.hero { min-height: 0; padding: 42px 0 48px; scroll-snap-align: none; }
.hero h1 { font-size: 48px; line-height: 1.12; }
.hero-explainer { width: min(100%, 1120px); margin: 36px auto 24px; }
.hero-comparison { margin: 24px 0; }
@media (max-width: 760px) {
 .slide.hero { padding: 30px 0 36px; }
 .hero h1 { font-size: clamp(32px, 7vw, 44px); }
 .hero-explainer { margin: 26px auto 20px; }
}

/* Five concise stages mirror the updated explainer. */
#method .steps { gap: 8px; }
#method .step-btn { padding: 10px 12px; }
#method .step-btn h3 { font-size: 18px; }
#method .step-btn p { font-size: 16px; line-height: 1.4; }
#method .scene { max-height: min(370px, calc(var(--slide-h) - 280px)); }
#method .scene-toggle { top: 8px; right: 8px; }
@media (max-width: 760px) {
 #method .scene { max-height: none; }
 #method .step-btn { padding: 14px; }
}

.cf-resolution { justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0; font-size: 14px; }
.cf-resolution span { color: var(--muted); }
