/* HandCDO v2 page. Dark studio page with glass controls; paper media sit on light cards.
   Digit colours come from the generator's own materials (f1 green, f2 yellow, f3 blue, thumb red, palm crimson). */
:root {
  color-scheme: dark;
  --bg: #161618;
  --bg2: #1d1d20;
  --studio: #3d3c3b;
  --ink: #ededef;
  --ink2: rgba(237, 237, 239, .74);
  --ink3: rgba(237, 237, 239, .5);
  --line: rgba(255, 255, 255, .11);
  --accent: #ff7d4d;
  --palm: #b3262e;
  --f1: #2fc46a;
  --f2: #e2c52e;
  --f3: #3b82f6;
  --thumb: #ef4f2c;
  --card: #ffffff;
  --r: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
  --w: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--ink); text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img, video { display: block; max-width: 100%; }
figure { margin: 0; }
code { font: .88em var(--mono); background: rgba(255,255,255,.08); padding: .08em .35em; border-radius: 5px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: min(var(--w), calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: 12px; z-index: 50; padding: 10px 14px; background: #fff; color: #111; border-radius: 10px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

/* ------------------------------------------------------------ glass */
.glass {
  position: relative; isolation: isolate; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 6px 22px rgba(0,0,0,.25);
}
.glass.panel { border-radius: 20px; }
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,.18) 24%, rgba(255,255,255,.04) 52%, rgba(255,255,255,.1) 76%, rgba(255,255,255,.38));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 20px; border: 0; color: var(--ink);
  font-weight: 600; font-size: 15px; text-decoration: none; transition: transform .2s, background .2s; }
.btn:hover { background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.06)); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: 13.5px; }
.chip { min-height: 34px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.05);
  font-size: 13.5px; font-weight: 600; color: var(--ink2); transition: background .2s, color .2s, border-color .2s; white-space: nowrap; }
.chip:hover { color: var(--ink); border-color: rgba(255,255,255,.3); }
.chip[aria-pressed="true"] { background: rgba(255,255,255,.9); border-color: transparent; color: #141416; }
.text-btn { border: 0; background: none; padding: 0; color: var(--ink2); font-size: 14px; font-weight: 600; text-align: left; }
.text-btn:hover { color: var(--accent); }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; padding: 4px; gap: 2px; }
.seg button { border: 0; background: none; padding: 8px 15px; min-height: 38px; border-radius: 999px; color: var(--ink2);
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: color .2s, background .25s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"], .seg button[aria-checked="true"] { color: #141416; background: rgba(255,255,255,.92); }

/* ------------------------------------------------------------ top nav */
.topnav { position: fixed; z-index: 30; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; padding: 5px;
  font-size: 13.5px; font-weight: 600; max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; background: rgba(24,24,27,.74); }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { padding: 6px 12px; border-radius: 999px; color: var(--ink2); text-decoration: none; white-space: nowrap; }
.topnav a:hover { color: var(--ink); }
.topnav a.active { color: #141416; background: rgba(255,255,255,.9); }
.topnav .brand { color: var(--ink); letter-spacing: .02em; }
.topnav .brand::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 1px; }

/* ------------------------------------------------------------ hero */
.hero { text-align: center; padding: 92px 24px 30px; background:
  radial-gradient(60% 70% at 50% 0%, rgba(179,38,46,.22), transparent 70%), var(--bg); }
.eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }
.title { margin: 0 auto 22px; max-width: 1000px; font-size: clamp(30px, 4.2vw, 52px); line-height: 1.08; letter-spacing: -.025em; font-weight: 700; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 26px; margin: 0; font-size: 18px; }
.authors a { text-decoration: none; color: var(--ink); border-bottom: 1px solid rgba(255,255,255,.22); }
.authors a:hover { border-color: var(--accent); }
.affil { margin: 8px 0 26px; color: var(--ink3); font-size: 15px; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ------------------------------------------------------------ 3D stage */
.explore { padding: 8px 0 28px; }
.stage { position: relative; width: min(1320px, calc(100% - 32px)); margin-inline: auto; height: min(78vh, 760px); min-height: 520px;
  border-radius: 28px; overflow: hidden; background:
  radial-gradient(70% 80% at 50% 42%, #5a5856 0%, var(--studio) 48%, #262626 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 30px 80px rgba(0,0,0,.45); }
.stage-canvas { position: absolute; inset: 0; cursor: grab; touch-action: pan-y; }
.stage-canvas:active { cursor: grabbing; }
.stage-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.stage-canvas:focus-visible { outline-offset: -4px; }
.stage-fallback { position: absolute; inset: 12% 20%; width: 60%; height: 76%; object-fit: contain; border-radius: 18px; }
.stage-top { position: absolute; top: 18px; left: 22px; right: 22px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; }
.stage-top > * { pointer-events: auto; }
.stage-title { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; line-height: 1.35; }
.stage-title span { color: var(--ink2); font-weight: 500; }
.reset { opacity: 0; pointer-events: none; transition: opacity .3s, transform .2s; }
.reset.show { opacity: 1; pointer-events: auto; }
.stage-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 18px; border-radius: 999px;
  background: rgba(0,0,0,.35); font-size: 14px; color: var(--ink2); transition: opacity .3s; pointer-events: none; }
.stage-loading.done { opacity: 0; }
.stage-loading.error { color: #ffb4a6; opacity: 1; }
.stage-hint { position: absolute; right: 24px; top: 64px; font-size: 12.5px; color: var(--ink3); pointer-events: none; text-align: right; }
.stage-bottom { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.stage-bottom > * { pointer-events: auto; }
.presets { justify-content: center; max-width: 100%; }
.presets button { display: inline-flex; align-items: center; gap: 7px; }
.presets .dots { display: inline-flex; gap: 2px; }
.presets .dots i { width: 4px; height: 11px; border-radius: 2px; background: currentColor; opacity: .55; }
.dock { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 22px; padding: 10px 18px; }
.slider { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink2); }
.slider output { width: 42px; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.slider input { width: 150px; accent-color: var(--accent); }
.dock-buttons { display: flex; gap: 8px; }
.explore-meta { display: grid; grid-template-columns: auto 1fr; gap: 18px 40px; align-items: start; padding-top: 22px; }
.stats { display: flex; gap: 30px; margin: 0; }
.stats div { min-width: 0; }
.stats dt { font-size: 12px; color: var(--ink3); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.stats dd { margin: 2px 0 0; font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.note { margin: 0; font-size: 14px; color: var(--ink2); line-height: 1.6; max-width: 640px; justify-self: end; }

/* ------------------------------------------------------------ type */
.kicker { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.section-title { margin: 0 0 10px; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.12; letter-spacing: -.02em; font-weight: 700; }
.section-sub { margin: 0 0 34px; max-width: 760px; font-size: 18px; color: var(--ink2); }
.lede { margin: 0 0 30px; max-width: 900px; font-size: clamp(19px, 2vw, 24px); line-height: 1.45; letter-spacing: -.01em; }
.fine { font-size: 13.5px; color: var(--ink3); margin: 18px 0 0; }
.fine a { color: var(--ink2); }
.sub { margin: 56px 0 18px; font-size: 22px; letter-spacing: -.01em; }
section { scroll-margin-top: 70px; }

/* ------------------------------------------------------------ cards */
.card { border-radius: var(--r); overflow: hidden; }
.card.light { background: var(--card); color: #24262b; }
.dark-card { background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.dark-card video { width: 100%; height: auto; }

/* TL;DR */
.tldr { padding: 72px 0 24px; }
.trio { display: grid; grid-template-columns: 1fr 1fr .78fr; gap: 16px; }
.trio .card { display: flex; flex-direction: column; }
.trio img { width: 100%; flex: 1; object-fit: contain; min-height: 0; aspect-ratio: 0.82; }
.trio .card:last-child img { aspect-ratio: .58; }
.trio figcaption { padding: 14px 18px 18px; font-size: 14px; color: #5b5e66; border-top: 1px solid #ececec; }
.trio figcaption b { display: block; color: #16171a; font-size: 15.5px; margin-bottom: 2px; }

.abstract { padding: 56px 0 30px; max-width: 900px; }
.abstract p { margin: 0; color: var(--ink2); font-size: 17px; line-height: 1.75; }

/* ------------------------------------------------------------ framework beats */
.framework { padding: 90px 0 70px; margin-top: 50px; background: linear-gradient(180deg, var(--bg), var(--bg2) 12%, var(--bg2) 88%, var(--bg)); }
.beats-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; }
.beats { list-style: none; margin: 0; padding: 6vh 0 26vh; }
.beat { position: relative; padding: 26px 0 26px 64px; min-height: 52vh; display: flex; flex-direction: column; justify-content: center; opacity: .38; transition: opacity .35s; }
.beat.is-active { opacity: 1; }
.beat-tag { position: absolute; left: 0; top: 50%; transform: translateY(-50%); min-width: 44px; height: 44px; padding: 0 8px; border-radius: 22px; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #141416; background: rgba(255,255,255,.88); }
.beat:nth-child(1) .beat-tag { background: var(--f2); }
.beat:nth-child(2) .beat-tag { background: #f28b7a; }
.beat:nth-child(3) .beat-tag { background: #c8c8c8; }
.beat:nth-child(4) .beat-tag { background: #9cc3ff; }
.beat:nth-child(5) .beat-tag { background: #8fe3b0; }
.beat:nth-child(6) .beat-tag { background: #ffcf7a; }
.beat h3 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.01em; line-height: 1.25; }
.beat p { margin: 0; color: var(--ink2); }
.beat-media-inline { display: none; }
.beat-stage { position: sticky; top: max(90px, calc(50vh - 300px)); }
.beat-frame { position: relative; aspect-ratio: 4 / 3.2; box-shadow: 0 30px 70px rgba(0,0,0,.4); }
.beat-frame figure { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; transition: opacity .45s ease, transform .6s ease; transform: scale(.985); }
.beat-frame figure.is-active { opacity: 1; transform: none; }
.beat-frame img, .beat-frame video { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: var(--card); padding: 14px; }
.beat-frame figcaption { padding: 12px 18px 14px; font-size: 13.5px; color: #575a61; border-top: 1px solid #ececec; background: var(--card); }
.beat-progress { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 16px 0 10px; }
.beat-progress button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 6px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--ink2); font-size: 12.5px; font-weight: 600; transition: background .25s, color .25s, border-color .25s; }
.beat-progress button b { padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.12); color: var(--ink); font-size: 11.5px; }
.beat-progress button:hover { color: var(--ink); border-color: rgba(255,255,255,.3); }
.beat-progress button.on { background: rgba(255,255,255,.92); color: #141416; border-color: transparent; }
.beat-progress button.on b { background: var(--accent); color: #141416; }
.beat-title { border: 0; padding: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.beat-title:hover { color: var(--accent); }
.beat-stage .text-btn { display: block; margin: 0 auto; }

/* ------------------------------------------------------------ design space */
.design-space { padding: 90px 0 40px; }
.ds-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.ds-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 28px; }
.ds-panel > .text-btn { grid-column: 1 / -1; }
.clip video { width: 100%; aspect-ratio: 4 / 3; height: auto; background: var(--card); }
.clip h3 { margin: 16px 0 4px; font-size: 19px; }
.clip p { margin: 0; color: var(--ink2); font-size: 15.5px; }

/* ------------------------------------------------------------ demos */
.demos { padding: 90px 0; background: var(--bg2); margin-top: 60px; }
.demo-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: auto; gap: 14px; }
.demo { position: relative; border-radius: 18px; overflow: hidden; background: #000; }
.demo.is-large { grid-column: span 2; grid-row: span 2; }
.demo video { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.demo figcaption { position: absolute; left: 10px; bottom: 10px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(20,20,22,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* ------------------------------------------------------------ results */
.results { padding: 90px 0 40px; }
.bigstats { display: grid; grid-template-columns: repeat(4, auto) 1fr; gap: 20px 46px; margin: 0 0 10px; padding: 26px 0; border-block: 1px solid var(--line); }
.bigstats dt { order: 2; font-size: 13.5px; color: var(--ink3); }
.bigstats div { display: flex; flex-direction: column; }
.bigstats dd { margin: 0; font-size: 44px; line-height: 1.05; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.bigstats dd.words { font-size: 22px; line-height: 1.3; letter-spacing: -.01em; padding-top: 8px; }
.designs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.design img { width: 100%; aspect-ratio: 1.45; object-fit: contain; padding: 10px 10px 0; }
.design figcaption { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 18px 16px; font-size: 14px; color: #575a61; }
.design figcaption b { font-size: 18px; color: #16171a; font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 3px; background: #e7e7e5; overflow: hidden; }
.bar i { display: block; height: 100%; width: calc(var(--v) * 100%); background: linear-gradient(90deg, var(--palm), var(--accent)); border-radius: 3px;
  transform-origin: left; transition: transform 1.1s cubic-bezier(.2,.7,.2,1); }
.js .bar i { transform: scaleX(0); }
.js .designs.in .bar i { transform: scaleX(1); }
.figure-thumb { position: relative; display: block; width: 100%; margin-top: 26px; padding: 18px; border: 0; cursor: zoom-in; }
.figure-thumb img { width: 100%; height: auto; }
.figure-thumb .zoom { position: absolute; right: 14px; top: 14px; padding: 5px 12px; border-radius: 999px; background: rgba(20,20,22,.75); color: #fff; font-size: 12.5px; font-weight: 600; }
.results > p { color: var(--ink2); max-width: 820px; }
.results .dark-card { margin: 22px 0 14px; }

.video { padding: 70px 0 30px; }
.cite { padding: 70px 0 40px; }
.bib { position: relative; padding: 22px 24px; }
.bib .btn { position: absolute; right: 14px; top: 14px; }
.bib pre { margin: 0; font: 13.5px/1.75 var(--mono); color: var(--ink2); white-space: pre-wrap; overflow-wrap: anywhere; padding-right: 130px; }
.foot { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 30px 0 48px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink3); }
.foot p { margin: 0; }
.foot a { color: var(--ink2); }

/* ------------------------------------------------------------ dialog */
dialog { width: min(1300px, 95vw); max-height: 94vh; padding: 18px; border: 0; border-radius: 20px; background: #f7f7f6; color: #222; }
dialog::backdrop { background: rgba(8,8,10,.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.dlg-head p { margin: 0; font-size: 14px; font-weight: 600; }
.dlg-head .btn { color: #222; background: #e6e6e4; }
dialog img { width: 100%; max-height: 78vh; object-fit: contain; }
dialog a { display: inline-block; margin-top: 10px; color: #333; font-size: 14px; }

/* ------------------------------------------------------------ reveal */
.js .rv { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .rv.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 980px) {
  .beats-layout { grid-template-columns: 1fr; }
  .beat-stage { display: none; }
  .beats { padding: 0; }
  .beat { min-height: 0; opacity: 1; padding: 22px 0 22px 58px; }
  .beat-tag { top: 22px; transform: none; }
  .beat-media-inline { display: block; margin-top: 16px; }
  .beat-media-inline .card { aspect-ratio: auto; }
  .beat-media-inline img, .beat-media-inline video { width: 100%; max-height: 420px; object-fit: contain; background: var(--card); }
  .beat-media-inline figcaption { padding: 10px 14px; font-size: 13px; color: #575a61; background: var(--card); }
  .explore-meta { grid-template-columns: 1fr; }
  .note { justify-self: start; }
  .demo-grid { grid-template-columns: 1fr 1fr; }
  .bigstats { grid-template-columns: repeat(4, auto); }
  .bigstats div:last-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .topnav { top: 8px; font-size: 12.5px; }
  .topnav a { padding: 6px 9px; }
  .hero { padding: 84px 16px 26px; }
  .authors { font-size: 16px; gap: 2px 16px; }
  .btn { padding: 9px 15px; min-height: 40px; font-size: 14px; }
  .stage { width: calc(100% - 16px); height: 82vh; min-height: 560px; border-radius: 22px; }
  .stage-top { top: 14px; left: 16px; right: 16px; }
  .stage-title { font-size: 16px; }
  .stage-title { white-space: normal; }
  .stage-hint { display: none; }
  .stage-bottom { left: 8px; right: 8px; bottom: 8px; }
  .presets { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: 100%; scrollbar-width: none; border-radius: 22px; }
  .presets::-webkit-scrollbar { display: none; }
  .presets button { padding: 7px 12px; font-size: 13px; }
  .dock { width: 100%; gap: 6px 14px; padding: 10px 14px; }
  .slider input { width: 110px; }
  .stats { gap: 18px; flex-wrap: wrap; }
  .stats dd { font-size: 21px; }
  .trio { grid-template-columns: 1fr 1fr; }
  .trio .card:last-child { grid-column: 1 / -1; }
  .trio .card:last-child img { aspect-ratio: 1.1; }
  .ds-panel { grid-template-columns: 1fr; }
  .seg button { padding: 7px 11px; font-size: 13px; }
  .demo-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .designs { grid-template-columns: 1fr; }
  .bigstats { grid-template-columns: 1fr 1fr; gap: 18px 24px; }
  .bigstats dd { font-size: 34px; }
  .bib pre { padding-right: 0; padding-top: 40px; font-size: 12px; }
  .framework, .design-space, .demos, .results { padding-top: 64px; }
}
/* ============================================================ interactive pipeline overview */
.pipe-wrap { position: relative; }
.pipe-hint { margin: -12px 0 10px; font-size: 13px; color: var(--ink3); }
.pipe-scroll { border-radius: 26px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.4); overflow: hidden; }
.pipe { position: relative; aspect-ratio: 1600 / 760; color: #24262b; }
.pgroup { position: absolute; border: 1.5px dashed rgba(0,0,0,.16); border-radius: 22px; transition: opacity .25s; }
.pgroup span { position: absolute; left: 16px; top: -1px; transform: translateY(-50%); padding: 1px 10px; background: #fff;
  font-size: clamp(10px, .95vw, 13px); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a8c92; }
.g-inner { border-color: rgba(200,160,30,.35); }

.pipe-arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.pipe-arrows path { fill: none; stroke: #c9a227; stroke-width: 3; marker-end: url(#ah); transition: opacity .25s, stroke .25s, stroke-width .25s; }
.pipe-arrows path.loop { stroke: #b3262e; stroke-dasharray: 8 7; animation: dash 1.2s linear infinite; }
.pipe-arrows marker path { fill: #c9a227; stroke: none; }
@keyframes dash { to { stroke-dashoffset: -15; } }
.pipe-arrows .al { font: italic 600 15px Georgia, serif; fill: #6b6d73; text-anchor: middle; transition: opacity .25s; }
.pstage { position: absolute; display: flex; flex-direction: column; padding: 0; border: 1px solid rgba(0,0,0,.08); border-radius: 16px;
  background: #fff; color: inherit; text-align: left; overflow: hidden; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.06); transition: opacity .25s, filter .25s, transform .25s, box-shadow .25s; }
.st-head { display: flex; align-items: center; gap: 7px; padding: 6px 9px; font-size: clamp(9px, .9vw, 13px); font-weight: 650; line-height: 1.2; color: #2b2d31; border-bottom: 1px solid #eee; }
.st-head b { flex: none; padding: 1px 7px; border-radius: 999px; background: #2b2d31; color: #fff; font-size: .9em; }
.st-media { position: relative; flex: 1; min-height: 0; display: block; }
.st-media > img, .st-media > video, .st-media > svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.st-media .faded { opacity: .55; }
.trio3 { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1.25fr 1fr; gap: 4px; padding: 6px; }
.trio3 video { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.trio3 video:first-child { grid-column: 1 / -1; }
.mini-axes { padding: 18% !important; overflow: visible; }
.mini-axes line { stroke-width: 5; stroke-linecap: round; } .mini-axes .x { stroke: #d62828; } .mini-axes .y { stroke: #2e8b3a; } .mini-axes .z { stroke: #2f6fd6; }
.mini-axes circle { fill: #fff; stroke: #333; stroke-width: 2; }
.pstage .radar text { font-size: 15px; }
/* focus mode: lowlight everything except the active stage and its arrows */
.pipe.focus .pstage:not(.on) { opacity: .22; filter: grayscale(.85); }
.pipe.focus .pgroup { opacity: .45; }
.pipe.focus .pipe-arrows path:not(.on), .pipe.focus .pipe-arrows .al { opacity: .15; }
.pipe.focus .pipe-arrows path.on { stroke: #ff7d4d; stroke-width: 4.5; }
.pstage.on { transform: scale(1.04); box-shadow: 0 0 0 3px #ff7d4d, 0 18px 40px rgba(0,0,0,.18); z-index: 2; }
.pstage:focus-visible { outline: none; box-shadow: 0 0 0 3px #ff7d4d; }
.pipe-card { position: absolute; z-index: 25; width: 470px; padding: 14px 16px 16px; border-radius: 18px; color: var(--ink);
  background: rgba(30,30,33,.9); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 24px 60px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(6px) scale(.98); transition: opacity .18s, transform .22s cubic-bezier(.2,.7,.2,1); pointer-events: none; }
.pipe-card.show { opacity: 1; transform: none; pointer-events: auto; }
.pipe-card.docked { position: relative; left: auto; top: auto; width: auto; margin-top: 12px; }
.pc-head { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink3); }
.pc-tag { font-weight: 700; color: #141416; background: var(--accent); padding: 1px 9px; border-radius: 999px; }
.pc-group { padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.08); }
.pc-close { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); font-size: 16px; line-height: 1; }
.pc-title { margin: 8px 0 10px; font-size: 19px; letter-spacing: -.01em; }
.pc-body { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: start; }
.pipe-card.no-media .pc-body { grid-template-columns: 1fr; }
.pc-media[hidden] { display: none; }
.pc-media { border-radius: 12px; overflow: hidden; background: #fff; aspect-ratio: 1; }
.pc-media img, .pc-media video { width: 100%; height: 100%; object-fit: contain; }
.pc-text { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: var(--ink2); }
.pc-facts { margin: 0 0 10px; display: grid; gap: 4px; font-size: 12.5px; }
.pc-facts div { display: grid; grid-template-columns: 92px 1fr; gap: 8px; }
.pc-facts dt { color: var(--ink3); } .pc-facts dd { margin: 0; color: var(--ink); }
.pc-link { font-size: 13.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
@media (max-width: 900px) {
  .pipe-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pipe { min-width: 940px; }
  .pipe-hint::after { content: ' Scroll sideways to see all stages.'; }
}
@media (max-width: 520px) { .pc-body { grid-template-columns: 1fr; } .pc-media { aspect-ratio: 4 / 3; } }

/* real-world experiments: synced camera rows + live slip plots */
.xp-list { display: grid; gap: 14px; margin: 18px 0 14px; }
.xp { display: grid; grid-template-columns: 1.32fr 1fr; gap: 0; align-items: stretch; padding: 0; }
.xp-media { position: relative; background: #fff; }
.xp-media video { display: block; width: 100%; height: auto; }   /* the talk's cells exactly: no crop, the row takes the video's height */
.xp-task { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 3px 11px; border-radius: 999px; background: rgba(20,20,22,.72); color: #fff; font-size: 13px; font-weight: 650; }
.xp-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.xp-col { border: 0; padding: 0; background: transparent; cursor: pointer; display: flex; align-items: flex-start; justify-content: flex-end; transition: background .2s, box-shadow .2s; }
.xp-col span { margin: 10px 10px 0 0; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; color: #fff; background: rgba(20,20,22,.6); }
.xp-col[data-hand="high"] span { background: #32cd32; color: #08240b; } .xp-col[data-hand="mid"] span { background: #4169e1; } .xp-col[data-hand="low"] span { background: #ff4500; }
.xp.focus .xp-col:not(.on) { background: rgba(255,255,255,.55); }
.xp-col.on { box-shadow: inset 0 0 0 3px var(--accent); }
.xp-side { padding: 10px 16px 8px; display: flex; flex-direction: column; color: #24262b; contain: size; }   /* never taller than the video */
.xp-title { margin: 0 0 2px; font: 600 14px/1.3 Georgia, "Times New Roman", serif; text-align: center; }
.xp-plot { width: 100%; height: auto; flex: 1; min-height: 0; }
.xp-axis { margin: -4px 0 0; text-align: center; font: 13px Georgia, serif; color: #333; }
.xp-grid line { stroke: #e6e6e6; stroke-width: 1; }
.xp-grid text, .xp-ylab { font: 13px Georgia, "Times New Roman", serif; fill: #333; }
.xp-ylab { text-anchor: middle; }
.xp-frame { fill: none; stroke: #9a9a9a; stroke-width: 1; }
.xp-line { fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.xp-mean { stroke-dasharray: 5 4; stroke-width: 1.4; opacity: .6; }
.xp-hand { transition: opacity .2s; }
.xp.focus .xp-hand:not(.on) { opacity: .12; }
.xp.focus .xp-hand.on .xp-line { stroke-width: 3; }
.xp-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin-top: 4px; }
.xp-legend button { border: 0; background: none; padding: 2px 6px; border-radius: 6px; font-size: 12.5px; color: #3c3f45; cursor: pointer; }
.xp-legend button.on { background: #f1f1ef; }
.xp-legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: 3px; margin-right: 6px; }
.xp-legend i.high { background: #32cd32; } .xp-legend i.mid { background: #4169e1; } .xp-legend i.low { background: #ff4500; }
@media (max-width: 980px) { .xp { grid-template-columns: 1fr; } .xp-side { contain: none; } .xp-plot { height: 220px; flex: none; } }

/* overview = the IROS presentation's framework slide, with its animations as live clips */
.pipe.ov { aspect-ratio: 720 / 405; background: #fff; }
.ov-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ov-clip { position: absolute; overflow: hidden; }
.ov-clip { mix-blend-mode: multiply; }   /* white clip backgrounds drop out; slide labels drawn above the GIFs stay visible */
.ov-clip video { position: absolute; max-width: none; background: #fff; }
.ov-layer { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; mix-blend-mode: multiply; pointer-events: none; transition: opacity .25s; }
.ov-bg, .ov-clip { transition: opacity .25s; }
.pipe.focus .ov-bg, .pipe.focus .ov-clip:not(.on) { opacity: .18; }   /* everything fades ... */
.ov-layer.on { opacity: 1; }                                             /* ... except the hovered stage's own shapes and clips */
.ov-spot { position: absolute; border: 0; padding: 0; background: transparent; cursor: pointer; }
.ov-spot:focus-visible { outline: none; }

/* ============================================================ components (from the paper's PowerPoint sources) */
/* teaser */
.teaser { display: grid; grid-template-columns: 1.15fr 1fr .72fr; gap: 14px; }
.tz { margin: 0; border-radius: var(--r); padding: 16px 18px 14px; color: #24262b; display: flex; flex-direction: column; }
.tz-sim { background: #f2fbf6; } .tz-real { background: #fdf3f3; } .tz-task { background: #f2fbf6; }
.tz figcaption { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(0,0,0,.12); font-size: 15px; }
.tz figcaption b { color: #16171a; }
.tag { font-size: 12.5px; font-weight: 600; padding: 2px 10px; border: 1px solid #2b2b2b; background: #fdf6d8; border-radius: 4px; white-space: nowrap; }
.tz > p { margin: 10px 0 0; font-size: 13.5px; color: #5b5e66; }
.tz img { width: 100%; height: auto; display: block; }
.tz-sim-body { flex: 1; display: grid; grid-template-rows: 1fr auto 1fr; align-items: center; gap: 4px; padding-top: 10px; }
.tz-iter { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 13px; line-height: 1.25; color: #3c3f45; }
.tz-iter svg { width: 54px; height: 54px; }
.tz-ring { fill: none; stroke: rgba(179,38,46,.15); stroke-width: 6; }
.tz-arc, .tz-head { fill: none; stroke: #b3262e; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.tz-iter svg { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tz-real-body { flex: 1; display: grid; grid-template-rows: 1fr 1fr; gap: 6px; padding-top: 10px; align-items: center; }
.tz-real-body img { max-height: 260px; object-fit: contain; }
.tz-task-body { flex: 1; display: grid; grid-template-rows: 1fr 1fr; gap: 8px; padding-top: 10px; }
.tz-task-body > div { position: relative; }
.tz-task-body img { height: 100%; max-height: 270px; width: 100%; object-fit: contain; }
.pill { position: absolute; left: 0; top: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; }
.pill.bad { background: #ffe2dd; color: #9b1c12; } .pill.good { background: #dff6e6; color: #106b33; }

/* framework beat media */
.radar-panel { position: relative; flex: 1; min-height: 0; background: #fff; }
.radar-panel > img, .radar-panel > svg { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; padding: 0 !important; }
.tpe .dot { stroke: #2b2b2b; stroke-width: .55; transition: fill .45s, opacity .6s; }
.tpe .dot.new { fill: #f7cf48; animation: pop .35s ease-out; } .tpe .dot.hi { fill: #5cb85c; } .tpe .dot.lo { fill: #e05a5a; }
@keyframes pop { from { r: 0; } }
.tpe-iter { font: 7px/1 -apple-system, "Segoe UI", sans-serif; fill: #8a8c92; }
.solo { flex: 1; min-height: 0; display: flex; background: var(--card); }
.task-render { flex: 1; min-height: 0; display: grid; grid-template-rows: 1fr auto; background: var(--card); }
.task-render > img { min-height: 0; width: 100%; height: 100%; object-fit: contain; }
.task-render .tools { grid-template-columns: 1fr 1fr; gap: 14px; padding: 4px 18px 14px; }
.task-render .tools img { width: 100% !important; max-height: 56px; object-fit: contain; }
.radar-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 10px 18px; background: var(--card); }
.radar { width: 100%; height: 100%; max-height: 100%; }
.radar .ring { fill: #f1f1f0; stroke: #c9c9c9; } .radar .ring.r2 { fill: #e9e9e8; } .radar .ring.r3 { fill: #e1e1e0; }
.radar .spoke { stroke: #2b2b2b; stroke-width: 1.4; stroke-dasharray: 6 5; }
.radar text { font: 13px/1 Georgia, "Times New Roman", serif; fill: #1d1d1d; text-anchor: middle; dominant-baseline: middle; }
.radar .dot { stroke: #333; stroke-width: 1; transition: fill .5s, r .4s, opacity .5s; }
.radar .dot.new { fill: #fdd65b; } .radar .dot.hi { fill: #5cb85c; } .radar .dot.lo { fill: #e05a5a; } .radar .dot.off { opacity: 0; }
.radar-key { list-style: none; margin: 0; padding: 0; font-size: 13px; color: #3c3f45; display: grid; gap: 6px; }
.radar-key i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1px solid #333; margin-right: 7px; vertical-align: -1px; }
.radar-key .new { background: #fdd65b; } .radar-key .lo { background: #e05a5a; } .radar-key .hi { background: #5cb85c; }
.cycle { position: relative; flex: 1; min-height: 0; background: var(--card); }
.cycle img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; animation: cyc 2.7s infinite; padding: 16px; }
.cycle img:nth-child(2) { animation-delay: .9s; } .cycle img:nth-child(3) { animation-delay: 1.8s; }
@keyframes cyc { 0% { opacity: 0; transform: scale(.97); } 4%, 31% { opacity: 1; transform: none; } 35%, 100% { opacity: 0; } }
.demo-pair, .duo { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.25fr 1fr; gap: 0; background: var(--card); }
.duo { grid-template-columns: 1fr 1fr; }
.demo-pair video { height: 100%; object-fit: cover; padding: 0 !important; background: #000 !important; }
.demo-side { display: grid; grid-template-rows: 1fr auto; min-height: 0; }
.demo-side > img { min-height: 0; }
.tools { display: grid; gap: 6px; padding: 6px 12px 12px; }
.tools img { padding: 0 !important; height: auto !important; flex: none; }
.duo img, .duo video { min-height: 0; }
.wrench { position: relative; flex: 1; min-height: 0; background: var(--card); }
.wrench img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .5; }
.wrench-axes { position: absolute; left: 50%; top: 50%; width: 46%; transform: translate(-46%, -52%); overflow: visible; }
.ax line { stroke-width: 5; stroke-linecap: round; } .ax ellipse { fill: none; stroke-width: 2.5; }
.ax text { font: 600 22px/1 Georgia, serif; }
.ax-x line, .ax-x ellipse { stroke: #d62828; } .ax-x path, .ax-x text { fill: #d62828; }
.ax-y line, .ax-y ellipse { stroke: #2e8b3a; } .ax-y path, .ax-y text { fill: #2e8b3a; }
.ax-z line, .ax-z ellipse { stroke: #2f6fd6; } .ax-z path, .ax-z text { fill: #2f6fd6; }
.ax-c { fill: #fff; stroke: #333; stroke-width: 2; } .ax-c2 { stroke: #333; stroke-width: 2; }
.ax { opacity: .35; animation: axis 4.5s infinite; transform-origin: 0 0; }
.ax-y { animation-delay: 1.5s; } .ax-z { animation-delay: 3s; }
@keyframes axis { 0%, 100% { opacity: .35; transform: scale(1); } 8%, 26% { opacity: 1; transform: scale(1.12); } 34% { opacity: .35; transform: scale(1); } }

/* design-space parts strip */
.parts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 4px; }
.parts.two { grid-template-columns: 1fr 1fr; max-width: 760px; }
.parts.kin { grid-template-columns: repeat(6, 1fr); }
.parts.kin .wide { grid-row: span 2; }
.parts figure { margin: 0; background: var(--card); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; transition: transform .25s; }
.parts figure:hover { transform: translateY(-3px); }
.parts img { flex: 1; min-height: 0; width: 100%; height: auto; max-height: 220px; object-fit: contain; }
.parts.kin .wide img { max-height: 470px; }
.parts figcaption { margin-top: 6px; font-size: 12.5px; color: #575a61; line-height: 1.35; }
.parts figcaption b { color: #16171a; }

/* optimization + interactive SHAP */
.opt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; }
.opt { padding: 16px 16px 12px; }
.opt img { width: 100%; height: auto; }
.opt figcaption { margin-top: 8px; font-size: 13.5px; color: #575a61; }
.opt figcaption b { color: #16171a; } .hint { color: #a3462d; }
.group-plot { position: relative; }
.group-bar { position: absolute; top: 4%; height: 92%; border: 0; padding: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.group-bar:hover, .group-bar.on, .group-bar:focus-visible { background: rgba(255,125,77,.16); outline: 2px solid rgba(255,125,77,.7); outline-offset: 0; }
.shap-intro { color: var(--ink2); max-width: 820px; margin: 0 0 18px; }
.shap-intro b { color: var(--ink); }
.shap-wrap { position: relative; max-width: 760px; }
.shap-plot { position: relative; padding: 14px; }
.shap-plot img { width: 100%; height: auto; }
.shap-inner { position: relative; }
.shap-row { position: absolute; border: 0; padding: 0; background: transparent; border-radius: 4px; cursor: pointer; }
.shap-row:hover, .shap-row.on, .shap-row:focus-visible { background: rgba(255,125,77,.14); outline: 1.5px solid rgba(255,125,77,.75); outline-offset: 0; }
.shap-inner.filtering .shap-row.member { background: rgba(255,125,77,.18); outline: 1.5px solid rgba(255,125,77,.8); }
.shap-inner.filtering img { opacity: .55; transition: opacity .2s; }
.shap-card { position: absolute; z-index: 20; width: 340px; padding: 14px 16px 14px; border-radius: 18px; color: var(--ink);
  background: rgba(30,30,33,.86); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 24px 60px rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.12);
  opacity: 0; transform: translateY(6px) scale(.98); transition: opacity .18s, transform .22s cubic-bezier(.2,.7,.2,1), top .18s ease; pointer-events: none; }
.shap-card.show { opacity: 1; transform: none; pointer-events: auto; }
.shap-card.docked { position: sticky; bottom: 12px; top: auto; left: auto; width: auto; margin-top: 12px; }
.sc-head { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink3); }
.sc-rank { font-weight: 700; color: var(--accent); }
.sc-group { padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.08); }
.sc-close { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); font-size: 16px; line-height: 1; }
.sc-label { margin: 8px 0 2px; font-size: 18px; letter-spacing: -.01em; }
.sc-digit { margin: 0 0 10px; font-size: 13px; color: var(--ink2); }
.sc-digit i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.sc-video { border-radius: 12px; overflow: hidden; background: #fff; aspect-ratio: 4 / 3; }
.sc-video video { width: 100%; height: 100%; object-fit: contain; }
.sc-meaning { margin: 10px 0 6px; font-size: 14px; line-height: 1.5; color: var(--ink2); }
.sc-range-row { margin: 0; font-size: 13px; color: var(--ink3); }
.sc-range-row b { color: var(--ink); margin-left: 4px; }

/* designs as component pairs */
.design .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 10px 10px 0; }
.design .pair img { aspect-ratio: 1; object-fit: contain; padding: 0; width: 100%; }

/* experiments */
.exp { display: grid; grid-template-columns: .55fr 1fr; gap: 14px; padding: 16px; margin: 20px 0 16px; }
.exp-photos { display: grid; gap: 8px; }
.exp-photos figure { margin: 0; position: relative; }
.exp-photos img { width: 100%; height: auto; border-radius: 10px; }
.exp-photos figcaption { position: absolute; left: 8px; top: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.85); font-size: 12px; font-weight: 600; color: #222; }
.exp-plot { margin: 0; display: flex; flex-direction: column; justify-content: center; }
.exp-plot img { width: 100%; height: auto; }
.exp-plot figcaption { font-size: 13px; color: #575a61; margin-top: 6px; }

@media (max-width: 980px) {
  .teaser { grid-template-columns: 1fr 1fr; } .tz-task { grid-column: 1 / -1; } .tz-task-body { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .parts, .parts.kin { grid-template-columns: repeat(3, 1fr); } .parts.kin .wide { grid-row: auto; }
  .opt-row, .exp { grid-template-columns: 1fr; }
  .beat-media-inline .radar-wrap, .beat-media-inline .cycle, .beat-media-inline .wrench, .beat-media-inline .duo, .beat-media-inline .demo-pair, .beat-media-inline .task-render { aspect-ratio: 4 / 3; }
  .beat-media-inline .radar-panel { aspect-ratio: 222 / 234; flex: none; }
  .beat-media-inline .solo { flex: none; }
  .beat-media-inline .solo video { max-height: none; }
}
@media (max-width: 700px) {
  .teaser { grid-template-columns: 1fr; }
  .parts, .parts.kin, .parts.two { grid-template-columns: 1fr 1fr; }
  .radar-wrap { grid-template-columns: 1fr; } .radar-key { grid-auto-flow: column; justify-content: center; gap: 12px; }
  .design .pair img { aspect-ratio: .9; }
}

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

/* ============================================================ phones: added last so it wins over the rules above */
@media (max-width: 700px) {
  /* nav spans the screen and scrolls; the active link is kept in view by app.js */
  .topnav { left: 8px; right: 8px; transform: none; max-width: none; justify-content: flex-start; gap: 0; border: 1px solid rgba(255,255,255,.16); }
  .topnav::before { display: none; }   /* the glass ring would scroll away with the links */
  .topnav a { padding: 6px 10px; }
  /* hero links as a 2 x 2 grid instead of 3 + 1 */
  .links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 320px; margin-inline: auto; }
  .links .btn { justify-content: center; }
  /* pipeline slide fits the width (no sideways scrolling); the tapped stage's card docks below it */
  .pipe-scroll { overflow: hidden; border-radius: 16px; }
  .pipe, .pipe.ov { min-width: 0; }
  .pipe-hint { margin-top: -18px; }
  .pipe-hint::after { content: ''; }
  /* tighter vertical rhythm */
  .abstract { padding: 40px 0 10px; }
  .framework { margin-top: 24px; padding-bottom: 40px; }
  .design-space, .results { padding-bottom: 24px; }
  .video, .cite { padding-top: 48px; }
  .section-sub { margin-bottom: 24px; font-size: 16.5px; }
  /* framework steps: badge beside the title, text and media use the full width */
  .beat { padding: 16px 0; }
  .beat-tag { top: 16px; min-width: 40px; height: 40px; }
  .beat h3 { min-height: 40px; display: flex; align-items: center; padding-left: 52px; font-size: 20px; margin-bottom: 10px; }
  /* experiments: task name moves to the bottom-left so it doesn't cover the High chip */
  .xp-task { top: auto; bottom: 8px; left: 8px; font-size: 12px; padding: 2px 9px; }
  .xp-col span { margin: 6px 6px 0 0; font-size: 11px; padding: 1px 8px; }
  .xp-side { padding: 10px 10px 8px; }
  .xp-plot { height: auto; }
  /* BibTeX keeps its line breaks and scrolls sideways instead of wrapping mid-field */
  .bib { padding: 16px; }
  .bib pre { white-space: pre; overflow-wrap: normal; overflow-x: auto; font-size: 11.5px; padding-top: 44px; }
  .foot { padding-bottom: 32px; }
}
