/* AgileDP project page.
   Look: RFS (weirdlabuw.github.io/rfs) — video-mosaic hero, tinted page with white sheets, Space Grotesk / Noto Sans /
   Fira Code, floating table of contents. Interactions after DISCO (distilled-search.github.io). Colours from the CoRL
   poster: teal header, navy section numbers, orange = AgileDP, blue = TADA, green = MERD. */

/* ------------------------------------------------------------------ tokens */
:root {
  --font: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Space Grotesk", "Noto Sans", system-ui, sans-serif;
  --mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ink: #14212b;
  --ink-2: #3a4a57;
  --muted: #677788;
  --faint: #9aa8b5;
  --line: #e1e8ef;
  --line-2: #c9d4de;
  --soft: #eef3f7;
  --soft-2: #f6f9fb;
  --bg: #e6eef4;           /* page tint, as on RFS */
  --surface: #ffffff;

  /* poster palette */
  --poster: #2c5d6c;       /* header bar of the poster */
  --poster-ink: #1d3b50;   /* numbered section circles */
  --ui: #1f6f8b;           /* tabs and controls */
  --ui-soft: #e7f2f7;

  --brand: #f07a22;        /* AgileDP orange */
  --brand-dark: #c2560f;
  --brand-soft: #fff4ea;
  --brand-glow: rgba(240, 122, 34, 0.18);

  --tada: #3d7cc9;
  --tada-dark: #23589e;
  --tada-soft: #eaf2fb;

  --merd: #4f9a4a;
  --merd-dark: #2f7330;
  --merd-soft: #edf6ea;

  --bad: #d62f2f;
  --bad-soft: #fdf0f0;
  --warn: #e39b17;
  --warn-soft: #fff8e8;

  /* methods in charts */
  --c-fp32: #14212b;
  --c-ptq: #9aa8b5;
  --c-agile: var(--brand);

  --radius: 22px;
  --shadow: 0 1px 2px rgba(20, 33, 43, 0.04), 0 10px 30px rgba(20, 33, 43, 0.07);
  --shadow-lg: 0 18px 44px rgba(20, 33, 43, 0.16);
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink-2); font-family: var(--font); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, svg, canvas { max-width: 100%; }
img, video { display: block; }
a { color: var(--ui); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }
b, strong { font-weight: 650; color: var(--ink); }
h1, h2, h3, h4, h5 { font-family: var(--display); color: var(--ink); margin: 0; letter-spacing: -0.02em; line-height: 1.2; font-weight: 600; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--ui); outline-offset: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.t-tada { color: var(--tada-dark); font-weight: 700; }
.t-merd { color: var(--merd-dark); font-weight: 700; }
.t-agile { color: var(--brand-dark); font-weight: 700; }
.t-bad { color: var(--bad); font-weight: 700; }

.container { width: min(1180px, 100% - 32px); margin: 0 auto; }
.narrow { width: min(960px, 100% - 32px); margin: 0 auto; }

/* ------------------------------------------------------------------ floating table of contents (RFS) */
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 70; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--tada), var(--merd), var(--brand)); }
.toc { position: fixed; left: 18px; top: 50%; transform: translateY(-50%); z-index: 60; }
.toc-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
}
.toc-btn:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }
.toc-panel {
  position: absolute; left: 0; top: 50%; transform: translate(-12px, -50%); min-width: 250px; padding: 16px 12px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.25s var(--ease);
}
.toc:hover .toc-panel, .toc.is-open .toc-panel, .toc:focus-within .toc-panel { opacity: 1; pointer-events: auto; transform: translate(0, -50%); }
.toc-title { font: 700 1.05rem/1 var(--display); color: var(--ink); padding: 0 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.toc-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 0.92rem; font-weight: 600; color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}
.toc-link:hover { background: var(--soft); text-decoration: none; color: var(--ink); }
.toc-link b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--soft); color: var(--muted); font: 700 0.75rem/1 var(--display); flex: none; }
.toc-link.is-active { background: var(--ui-soft); color: var(--ink); }
.toc-link.is-active b { background: var(--poster-ink); color: #fff; }
@media (max-width: 1320px) { .toc { left: 10px; } .toc-btn { width: 46px; height: 46px; } }
@media (max-width: 760px) { .toc { top: auto; bottom: 16px; left: 14px; transform: none; } .toc-panel { top: auto; bottom: 0; transform: translate(-8px, 0); }
  .toc:hover .toc-panel, .toc.is-open .toc-panel, .toc:focus-within .toc-panel { transform: none; } }

/* ------------------------------------------------------------------ hero: video mosaic (RFS) */
.hero { position: relative; overflow: hidden; isolation: isolate; color: #e8eef3; text-align: center; background: #05080c; }
.hero-mosaic { position: absolute; inset: 0; z-index: -2; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); gap: 3px; }
.hero-mosaic figure { position: relative; margin: 0; overflow: hidden; background: #0b1218; border-radius: 4px; }
/* the eval renders are 128 px: a touch of blur hides the upscaling under the shade */
.hero-mosaic video { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85) blur(0.8px); transform: scale(1.03); }
.hero-mosaic figcaption {
  position: absolute; left: 10px; bottom: 8px; font: 500 0.68rem/1 var(--mono); letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
}
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(80% 70% at 50% 45%, rgba(5, 10, 16, 0.78) 0%, rgba(5, 10, 16, 0.62) 55%, rgba(5, 10, 16, 0.5) 100%),
              linear-gradient(180deg, rgba(5, 10, 16, 0.25), rgba(5, 10, 16, 0.55));
}
.hero-inner { width: min(1100px, 100% - 32px); margin: 0 auto; padding: clamp(3.4rem, 9vw, 6.2rem) 0 clamp(4.6rem, 9vw, 6.4rem); }
.hero-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 1.4rem; }
.hero-pill {
  font: 500 0.72rem/1 var(--mono); letter-spacing: 0.04em; padding: 8px 14px; border-radius: 999px; color: #ffd2ad;
  background: rgba(240, 122, 34, 0.14); border: 1px solid rgba(240, 122, 34, 0.35);
}
.hero-title {
  font: 700 clamp(3.6rem, 13vw, 7.2rem)/0.95 var(--display); letter-spacing: -0.045em; color: #fff; margin: 0 0 1rem;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.45);
}
.hero-title span { color: var(--brand); }
.hero-sub {
  max-width: 30em; margin: 0 auto 1.8rem; font: 400 clamp(1.2rem, 3.4vw, 2rem)/1.3 var(--font); color: #eef3f7; text-wrap: balance;
}
.hero-sub .k-tada { color: #a9cbf3; font-weight: 600; }
.hero-sub .k-merd { color: #aedca5; font-weight: 600; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 1.4rem; margin: 0 0 0.5rem; padding: 0; list-style: none; }
.authors li { font: 500 clamp(1rem, 2.4vw, 1.22rem)/1.4 var(--display); color: #8fc3ff; white-space: nowrap; }
.authors sup, .affil sup { font-size: 0.66em; color: #c2ced8; margin-left: 1px; }
.affils { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem 1.4rem; font-size: 0.92rem; color: #c2ced8; }
.affil a { color: #fff; font-weight: 600; }
.affil.corr { color: #93a3b1; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin: 1.8rem 0 1.4rem; }
.link-btn {
  display: inline-flex; align-items: center; gap: 0.5em; padding: 0.62em 1.2em; border-radius: 999px;
  border: 1.5px solid rgba(143, 195, 255, 0.55); background: rgba(10, 18, 28, 0.45); color: #fff;
  font: 500 1rem/1 var(--font); cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.15s; backdrop-filter: blur(4px);
}
.link-btn:hover { background: rgba(31, 111, 139, 0.55); border-color: #8fc3ff; text-decoration: none; transform: translateY(-1px); }
.link-btn.is-soon { color: #9fb0bf; border-color: rgba(255, 255, 255, 0.18); cursor: default; }
.link-btn.is-soon:hover { transform: none; background: rgba(10, 18, 28, 0.45); }
.link-btn.is-soon small { font: 500 0.66em/1 var(--mono); letter-spacing: 0.04em; }
.venue {
  display: inline-block; padding: 0.55rem 1.4rem; border-radius: 999px; background: var(--poster); color: #fff;
  font: 700 1.2rem/1 var(--display); letter-spacing: 0.01em; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.hero-credit { position: absolute; right: 14px; bottom: 8px; margin: 0; font: 400 0.68rem/1 var(--mono); color: rgba(255, 255, 255, 0.45); }

/* teaser video facade */
.teaser { width: min(1100px, 100% - 32px); margin: -2.6rem auto 0; position: relative; z-index: 2; }
.yt { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow-lg); border: 6px solid #fff; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-facade { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; background: #000; }
.yt-facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.2s, transform 0.4s; }
.yt-facade:hover img { opacity: 1; transform: scale(1.015); }
.yt-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px 14px 18px; border-radius: 999px; background: rgba(20, 33, 43, 0.8); color: #fff; font: 600 1rem/1 var(--font);
  backdrop-filter: blur(6px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.yt-play svg { width: 26px; height: 26px; }
.teaser-cap { margin-top: 0.7rem; text-align: center; font-size: 0.88rem; color: var(--muted); }

/* ------------------------------------------------------------------ sections and headings */
.section { padding: clamp(2.2rem, 5vw, 3.6rem) 0; position: relative; }
.section + .section { padding-top: clamp(0.6rem, 2vw, 1.2rem); }
.chapter { padding-top: clamp(3rem, 7vw, 4.6rem); }
/* poster-style numbered heading with an RFS gradient underline */
.chapter-head {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 1rem; align-items: center;
  margin-bottom: clamp(1.4rem, 3.4vw, 2.2rem); padding-bottom: 1.1rem;
}
.chapter-head::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: min(720px, 80%); height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--poster) 0%, rgba(61, 124, 201, 0.6) 35%, rgba(230, 238, 244, 0) 100%);
}
.chapter-num {
  grid-row: span 2; width: clamp(46px, 7vw, 58px); height: clamp(46px, 7vw, 58px); border-radius: 50%; display: grid; place-items: center;
  background: var(--poster-ink); color: #fff; font: 700 clamp(1.3rem, 3.4vw, 1.7rem)/1 var(--display); box-shadow: 0 6px 16px rgba(29, 59, 80, 0.25);
}
.chapter-kicker { font: 500 0.74rem/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--poster); align-self: end; }
.chapter-title { font: 600 clamp(1.55rem, 3.8vw, 2.25rem)/1.15 var(--display); letter-spacing: -0.025em; text-wrap: balance; align-self: start; }

.sub-head { display: flex; align-items: baseline; gap: 0.7rem; margin: 0 0 0.55rem; }
.sub-head .idx { font: 500 0.9rem/1 var(--mono); color: var(--brand-dark); }
.sub-head h3 { font: 600 clamp(1.25rem, 2.8vw, 1.6rem)/1.25 var(--display); }
.lead { max-width: 54rem; font-size: clamp(1rem, 2.2vw, 1.07rem); color: var(--ink-2); line-height: 1.7; margin-bottom: 1.4rem; }
.lead.center { margin-left: auto; margin-right: auto; text-align: center; }
/* every sub-section sits on its own white sheet, as on RFS */
.block {
  background: var(--surface); border: 1px solid #dfe7ee; border-radius: 26px; padding: clamp(18px, 3.4vw, 34px);
  box-shadow: var(--shadow);
}
.block + .block, .problem-grid .block + .block { margin-top: clamp(1.4rem, 3vw, 2rem); }
.block .card { box-shadow: none; border-color: var(--line); }
.note { font-size: 0.86rem; color: var(--muted); line-height: 1.6; }
.note b { color: var(--ink-2); }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font: 500 0.66rem/1.4 var(--mono); letter-spacing: 0.06em;
  text-transform: uppercase; background: var(--soft); color: var(--muted); vertical-align: 2px;
}
.tag.is-measured { background: #e5f4f7; color: #1b6577; }
.tag.is-illus { background: #fff3d9; color: #8a5a00; }
.tag.is-tada { background: var(--tada-soft); color: var(--tada-dark); }
.tag.is-merd { background: var(--merd-soft); color: var(--merd-dark); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ generic controls */
/* boxy tabs as on RFS: the selected one gets a tinted fill and a coloured border */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 14px; background: var(--soft-2); border: 1px solid var(--line); }
.seg-btn {
  padding: 7px 14px; border: 1.5px solid transparent; border-radius: 11px; background: transparent; cursor: pointer; white-space: nowrap;
  font: 500 0.9rem/1.2 var(--font); color: var(--ink-2); transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.seg-btn:hover { color: var(--ink); background: #fff; }
.seg-btn[aria-pressed="true"], .seg-btn[aria-selected="true"] { background: var(--ui-soft); border-color: var(--ui); color: var(--ink); font-weight: 600; }
.seg-btn small { font-weight: 400; color: var(--muted); }
.ctrl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ctrl-row.spread { justify-content: space-between; }
.ctrl-label { font: 500 0.68rem/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 12px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); font: 600 0.86rem/1 var(--font); cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { background: var(--soft); }
.btn:active { transform: scale(0.97); }
.btn.is-primary { background: var(--poster-ink); border-color: var(--poster-ink); color: #fff; }
.btn.is-primary:hover { background: var(--poster); }
.btn.is-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.is-brand:hover { background: var(--brand-dark); }
.btn svg { width: 14px; height: 14px; }
.range { display: flex; align-items: center; gap: 10px; font-size: 0.86rem; font-weight: 600; color: var(--ink-2); }
.range input[type="range"] { flex: 1; min-width: 120px; accent-color: var(--brand); }
.range output { min-width: 4.5em; text-align: right; font-family: var(--mono); font-size: 0.85rem; color: var(--ink); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: clamp(14px, 3vw, 22px); }
.widget { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); overflow: hidden; }
.widget-stage { background: var(--soft-2); border-right: 1px solid var(--line); padding: clamp(10px, 2vw, 18px); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.widget-side { padding: clamp(14px, 2.4vw, 20px); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.widget-side h4 { font-size: 1.1rem; font-weight: 600; }
.widget-side p { margin: 0; font-size: 0.95rem; line-height: 1.55; }
@media (max-width: 900px) {
  .widget { grid-template-columns: minmax(0, 1fr); }
  .widget-stage { border-right: 0; border-bottom: 1px solid var(--line); }
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.stat { padding: 10px 12px; border-radius: 12px; background: var(--soft-2); border: 1px solid var(--line); }
.stat-k { font: 500 0.64rem/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat-v { font: 600 1.3rem/1.2 var(--display); color: var(--ink); transition: color 0.3s; font-variant-numeric: tabular-nums; }
.stat.is-bad .stat-v { color: var(--bad); }
.stat.is-warn .stat-v { color: #b45309; }
.stat.is-good .stat-v { color: var(--merd-dark); }
.callout { padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); border: 1px solid #fed7aa; font-size: 0.93rem; line-height: 1.5; }
.callout.is-tada { background: var(--tada-soft); border-color: #bfdbfe; }
.callout.is-merd { background: var(--merd-soft); border-color: #cfe6c9; }
.callout.is-bad { background: var(--bad-soft); border-color: #fecaca; }
.svg-fig { width: 100%; height: auto; display: block; font-family: var(--font); overflow: visible; }
.svg-fig text { font-family: var(--font); }

/* ------------------------------------------------------------------ abstract + stats */
.abstract { text-align: left; }
.abstract p { font-size: clamp(1rem, 2.3vw, 1.12rem); line-height: 1.7; }
.abstract-q {
  margin: 0.2rem 0 1.1rem; padding: 1rem 1.3rem; border-radius: 12px; background: var(--soft); border-left: 4px solid var(--brand);
  font-size: clamp(1.05rem, 2.6vw, 1.3rem) !important; font-weight: 600; font-style: italic; line-height: 1.5; color: var(--ink);
}
.abstract-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s ease; }
.abstract-more.is-open { grid-template-rows: 1fr; }
.abstract-more > div { min-height: 0; overflow: hidden; }
.pill-toggle {
  display: flex; align-items: center; gap: 6px; margin: 0.3rem auto 0; padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: 500 14px/1 var(--font); cursor: pointer;
}
.pill-toggle:hover { background: var(--soft); }
.pill-toggle svg { transition: transform 0.3s; }
.pill-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 1.8rem; }
.kpi { padding: 16px 16px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--kc, var(--brand)); }
.kpi-v { font: 600 clamp(1.6rem, 4vw, 2.2rem)/1.05 var(--font); letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-v small { font-size: 0.55em; font-weight: 700; color: var(--muted); margin-left: 2px; }
.kpi-l { margin-top: 6px; font-size: 0.86rem; line-height: 1.4; color: var(--ink-2); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ background: quantization playground */
.qp-line { width: 100%; height: auto; }
.qp-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 600 0.92rem/1.4 var(--mono); color: var(--ink); }
.qp-steps .op { color: var(--muted); }
.qp-steps .v { padding: 3px 8px; border-radius: 8px; background: #fff; border: 1px solid var(--line); transition: background 0.3s, color 0.3s; }
.qp-steps .v.is-clip { background: var(--bad-soft); border-color: #fecaca; color: var(--bad); }
.qp-steps .v.is-out { background: var(--brand-soft); border-color: #fed7aa; color: var(--brand-dark); }
.qp-bits { display: flex; flex-direction: column; gap: 6px; }
.qp-bitrow { display: grid; grid-template-columns: 4.2em 1fr auto; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 700; }
.qp-cells { display: grid; grid-template-columns: repeat(32, minmax(0, 1fr)); gap: 1.5px; }
.qp-cells i { height: 14px; border-radius: 2px; background: var(--line-2); transition: background 0.25s; }
.qp-cells i.on { background: var(--brand); }
.qp-cells.is-fp i.on { background: var(--ink); }
.mat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mat { display: inline-grid; grid-template-columns: repeat(2, minmax(3.4em, auto)); gap: 4px; padding: 6px 8px; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); border-radius: 6px; }
.mat > * {
  padding: 5px 6px; border-radius: 7px; text-align: center; font: 700 0.9rem/1.1 var(--mono); color: var(--ink);
  background: #fff; border: 1px solid var(--line); transition: background 0.35s, color 0.35s, border-color 0.35s, transform 0.35s;
}
.mat button { cursor: pointer; }
.mat button:hover { border-color: var(--brand); }
.mat button.is-sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-glow); }
.mat .is-int { background: var(--brand-soft); border-color: #fed7aa; color: var(--brand-dark); }
.mat .is-clip { background: var(--bad-soft); border-color: #fecaca; color: var(--bad); }
.mat-cap { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-align: center; margin-top: 3px; }
.mat-op { font: 600 1.1rem/1 var(--mono); color: var(--muted); }

/* quantized layer pipeline */
.pipe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pipe-stage {
  position: relative; padding: 14px 14px 12px; border-radius: 14px; background: #fff; border: 2px solid var(--line);
  transition: border-color 0.35s, box-shadow 0.35s, opacity 0.35s, transform 0.35s; opacity: 0.55;
}
.pipe-stage.is-on { opacity: 1; border-color: var(--brand); box-shadow: 0 10px 28px var(--brand-glow); transform: translateY(-2px); }
.pipe-stage.is-done { opacity: 0.9; }
.pipe-stage h5 { margin: 0 0 6px; font-size: 0.95rem; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.pipe-stage h5 b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 0.74rem; }
.pipe-stage.is-on h5 b { background: var(--brand); }
.pipe-stage .eq { font: 700 0.95rem/1.4 var(--mono); color: var(--ink); margin: 4px 0 8px; }
.pipe-stage p { font-size: 0.86rem; color: var(--ink-2); margin: 0; line-height: 1.45; }
.pipe-stage .mat-row { gap: 6px; margin-top: 8px; }
.pipe-stage .mat { grid-template-columns: repeat(2, minmax(2.9em, auto)); }
.pipe-stage .mat > * { font-size: 0.8rem; padding: 4px 4px; }
.pipe-arrow { position: absolute; right: -10px; top: 50%; width: 10px; height: 2px; background: var(--line-2); }
.pipe-stage:last-child .pipe-arrow { display: none; }
@media (max-width: 820px) { .pipe { grid-template-columns: minmax(0, 1fr); } .pipe-arrow { display: none; } }

/* stepper bottom bar (shared) */
.stepper-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dots { display: flex; flex-wrap: wrap; gap: 5px; }
.dot-btn { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: width 0.25s, background 0.25s; }
.dot-btn.is-done { background: #fdba74; }
.dot-btn.is-on { width: 26px; background: var(--brand-dark); }
.progress { height: 3px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--brand); }

/* denoising loop */
.dn-lanes { display: grid; gap: 10px; }
.dn-lane { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) 6.5em; align-items: center; gap: 12px; }
.dn-name { font-weight: 600; font-size: 0.92rem; color: var(--ink); line-height: 1.25; }
.dn-name small { display: block; font-weight: 600; font-size: 0.75rem; color: var(--muted); }
.dn-canvas { width: 100%; height: 86px; border-radius: 12px; background: #0b1324; display: block; }
.dn-meta { text-align: right; font: 700 0.86rem/1.35 var(--mono); color: var(--ink); }
.dn-meta small { display: block; font: 600 0.72rem/1.3 var(--font); color: var(--muted); }
@media (max-width: 640px) { .dn-lane { grid-template-columns: minmax(0, 1fr); gap: 6px; } .dn-meta { text-align: left; } }

/* ------------------------------------------------------------------ problem panels */
.problem-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.axis-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  background: var(--tada-soft); color: var(--tada-dark);
}
.axis-badge b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--tada); color: #fff; font-size: 0.78rem; }
.axis-badge.is-merd { background: var(--merd-soft); color: var(--merd-dark); }
.axis-badge.is-merd b { background: var(--merd); }
.ts-figs { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 640px) { .ts-figs { grid-template-columns: minmax(0, 1fr); } }
.fig-cap { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 2px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.fig-cap .tag { flex: none; white-space: nowrap; }
.stat-k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verdict { padding: 8px 12px; border-radius: 10px; font-size: 0.9rem; font-weight: 700; transition: background 0.3s, color 0.3s; }
.verdict.is-bad { background: var(--bad-soft); color: var(--bad); }
.verdict.is-warn { background: var(--warn-soft); color: #b45309; }
.verdict.is-good { background: var(--merd-soft); color: var(--merd-dark); }
.cursor-hint { font-size: 0.78rem; color: var(--muted); }

/* ------------------------------------------------------------------ method walkthrough (dark band) */
.al {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, 1fr); max-width: 1180px; margin: 0 auto;
  border: 1px solid #e2e8f0; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}
.al:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.al-stage { background: #f6f7f9; border-right: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: center; padding: 10px; min-width: 0; }
.al-svg { width: 100%; height: auto; display: block; font-family: var(--font); }
.al-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px 18px 14px; color: var(--ink-2); }
.al-head { font-size: 0.98rem; color: var(--ink); padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.al-io { font-size: 0.8rem; line-height: 1.45; color: var(--ink-2); padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.al-code { list-style: none; margin: 0; padding: 0; font-size: 0.82rem; line-height: 1.32; }
.al-sec { margin: 4px 0 2px 2.1em; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.al-line { display: flex; gap: 8px; padding: 2.5px 6px 2.5px 0; border-radius: 6px; color: var(--ink-2); cursor: pointer; transition: background 0.3s, color 0.3s, box-shadow 0.3s; }
.al-line:hover { background: var(--soft); }
.al-ln { flex: none; width: 1.6em; text-align: right; color: var(--faint); font-size: 0.74rem; font-variant-numeric: tabular-nums; padding-top: 1px; }
.al-src { padding-left: calc(var(--ind, 0) * 1.1em); min-width: 0; overflow-wrap: anywhere; }
.al-src i { font-family: "Cambria Math", "STIX Two Math", Georgia, serif; font-size: 1.06em; }
.al-line.is-hl { background: var(--brand-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--brand-dark); }
.al-line.is-hl .al-ln { color: var(--brand-dark); font-weight: 600; }
.al-card { padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); border: 1px solid #fed7aa; min-height: 6.4em; }
.al-card.is-tada { background: var(--tada-soft); border-color: #bfdbfe; }
.al-card.is-merd { background: var(--merd-soft); border-color: #bbf7d0; }
.al-card-head { font-weight: 600; color: var(--ink); font-size: 1rem; }
.al-card-num { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-dark); margin-right: 6px; }
.al-card.is-tada .al-card-num { color: var(--tada-dark); }
.al-card.is-merd .al-card-num { color: var(--merd-dark); }
.al-card-text { margin: 3px 0 0; font-size: 0.9rem; line-height: 1.45; color: var(--ink-2); }
@media (max-width: 960px) { .al { grid-template-columns: minmax(0, 1fr); } .al-stage { border-right: 0; border-bottom: 1px solid var(--line); } }

/* walkthrough scene */
.sc { transition: opacity 0.45s ease; }
.sc.is-hidden { opacity: 0; pointer-events: none; }
.sc.is-dim { opacity: 0.28; }
.sc-box { fill: #fff; stroke: #94a3b8; stroke-width: 1.6; transition: fill 0.4s, stroke 0.4s, stroke-width 0.3s; }
.sc.is-on .sc-box { stroke: var(--brand-dark); stroke-width: 2.6; fill: #fffaf5; }
.sc.is-on.k-tada .sc-box { stroke: var(--tada-dark); fill: #f5f9ff; }
.sc.is-on.k-merd .sc-box { stroke: var(--merd-dark); fill: #f4fdf7; }
.sc-title { font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.sc-sub { font-size: 10.5px; font-weight: 600; fill: var(--muted); }
.sc-math { font-family: "Cambria Math", "STIX Two Math", Georgia, serif; font-size: 13px; font-style: italic; fill: var(--ink); }
.sc-edge { fill: none; stroke: #b6c0cd; stroke-width: 2; transition: stroke 0.35s, stroke-width 0.35s, opacity 0.35s; }
.sc-edge.is-on { stroke: var(--brand-dark); stroke-width: 2.6; stroke-dasharray: 7 6; animation: flow 0.6s linear infinite; }
.sc-edge.is-on.k-tada { stroke: var(--tada-dark); }
.sc-edge.is-on.k-merd { stroke: var(--merd-dark); }
.sc-edge.is-grad { stroke: #f59e0b; stroke-width: 2.6; stroke-dasharray: 8 6; animation: flow-rev 0.6s linear infinite; }
.sc-edge.is-hidden { opacity: 0; }
.sc-edge.is-dim { opacity: 0.25; }
@keyframes flow { to { stroke-dashoffset: -26; } }
@keyframes flow-rev { to { stroke-dashoffset: 28; } }
.sc-cell { stroke: #fff; stroke-width: 1; transition: fill 0.5s, opacity 0.4s; }
.sc-cell.is-top { stroke: var(--merd-dark); stroke-width: 2.2; }
.sc-chip rect { transition: fill 0.4s; }
.sc-halo { fill: none; stroke: var(--brand); stroke-width: 3; opacity: 0; }
.sc.is-on .sc-halo { opacity: 1; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.2; } }
.sc-frozen { font-size: 12px; }

/* ------------------------------------------------------------------ deep dives */
.dd-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.dd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 4px; }
.dd-head h3 { font-size: clamp(1.25rem, 2.8vw, 1.55rem); font-weight: 600; }
.eq-box { padding: 10px 14px; border-radius: 12px; background: var(--soft-2); border: 1px solid var(--line); overflow-x: auto; font-size: 0.95rem; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 4px; border-radius: 2px; background: var(--c); display: inline-block; }
.legend i.is-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend i.is-band { height: 10px; opacity: 0.35; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid #d9dde4; background: #f6f7f9; font: 500 0.82rem/1.2 var(--font); color: var(--ink-2); transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { background: #eceef2; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.dumbbell-row { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) 7.5em; align-items: center; gap: 10px; font-size: 0.85rem; }

/* ------------------------------------------------------------------ results charts */
.chart-card { padding: clamp(14px, 2.6vw, 22px); }
.chart-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; }
.chart-controls { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.bars { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(48px, 1fr); gap: 6px; height: 280px; padding: 0 0 0 34px; }
.bars-scroll { overflow-x: auto; padding: 14px 0 4px; }
.bars-inner { min-width: 640px; }
.bars-grid { position: absolute; inset: 0 0 0 34px; pointer-events: none; }
.bars-grid div { position: absolute; left: 0; right: 0; border-top: 1px dashed #e5e9ef; }
.bars-grid span { position: absolute; left: -34px; width: 28px; text-align: right; transform: translateY(-50%); font: 600 0.7rem/1 var(--mono); color: var(--faint); }
.bar-col { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; padding: 0 2px; border-radius: 8px; transition: background 0.2s; }
.bar-col:hover { background: rgba(20, 33, 43, 0.035); }
.bar { flex: 1; max-width: 16px; min-height: 2px; height: 0; border-radius: 4px 4px 1px 1px; background: var(--c); transition: height 0.7s var(--ease); position: relative; }
.bar.is-agile { box-shadow: 0 0 0 1px rgba(194, 65, 12, 0.25); }
.bar.is-zero { background: repeating-linear-gradient(45deg, var(--c), var(--c) 2px, transparent 2px, transparent 4px); opacity: 0.6; }
.fp-mark { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed var(--c-fp32); transition: bottom 0.7s var(--ease); pointer-events: none; }
.bar-labels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(48px, 1fr); gap: 6px; padding-left: 34px; margin-top: 6px; }
.bar-labels div { text-align: center; font-size: 0.74rem; font-weight: 700; color: var(--ink); line-height: 1.15; }
.bar-labels small { display: block; font-weight: 600; color: var(--muted); }
.bar-tip {
  position: fixed; z-index: 80; pointer-events: none; padding: 9px 11px; border-radius: 10px; background: var(--ink); color: #e2e8f0;
  font-size: 0.78rem; line-height: 1.5; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s; min-width: 170px;
}
.bar-tip.is-on { opacity: 1; transform: none; }
.bar-tip b { color: #fff; }
.bar-tip .row { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); }
.bar-tip .row i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--c); margin-right: 6px; }
.summary-line { margin-top: 12px; font-size: 0.95rem; color: var(--ink-2); }
.summary-line b { font-variant-numeric: tabular-nums; }

/* ablation build-up */
.abl-stages { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.abl-stage {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; border: 2px solid var(--line);
  background: #fff; font: 600 0.9rem/1 var(--font); color: var(--ink-2); cursor: pointer; transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.abl-stage i { width: 22px; height: 22px; border-radius: 50%; background: var(--c); display: grid; place-items: center; color: #fff; font-style: normal; font-size: 0.75rem; }
.abl-stage[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); color: var(--ink); }
.abl-arrow { color: var(--faint); font-weight: 600; }
.delta-tag { position: absolute; left: 50%; transform: translate(-50%, -6px); bottom: 0; font: 600 0.72rem/1 var(--mono); color: var(--c); white-space: nowrap; transition: bottom 0.7s var(--ease), opacity 0.3s; }

/* efficiency race */
.race { display: grid; gap: 10px; }
.race-lane { display: grid; grid-template-columns: 9.6em minmax(0, 1fr) 9.4em; align-items: center; gap: 12px; }
.race-name { font-weight: 600; font-size: 0.9rem; color: var(--ink); line-height: 1.2; }
.race-name small { display: block; font-weight: 600; font-size: 0.72rem; color: var(--muted); }
.race-track { position: relative; height: 26px; border-radius: 8px; background: var(--soft); overflow: hidden; }
.race-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--c); border-radius: 8px; }
.race-fill.is-done::after { content: "✓"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: #fff; font-weight: 700; font-size: 0.8rem; }
.race-val { font: 700 0.86rem/1.3 var(--mono); color: var(--ink); text-align: right; }
.race-val small { display: block; font: 700 0.74rem/1.2 var(--font); color: var(--c); }
.race-na { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; color: var(--muted); }
@media (max-width: 640px) { .race-lane { grid-template-columns: minmax(0, 1fr) 7em; } .race-track { grid-column: 1 / -1; grid-row: 2; } }
.size-bars { display: grid; gap: 8px; }

/* full table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; }
table.results { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
table.results th, table.results td { padding: 7px 8px; text-align: center; white-space: nowrap; border-bottom: 1px solid #edf0f4; }
table.results thead th { background: var(--soft-2); font-weight: 600; color: var(--ink); font-size: 0.74rem; }
table.results td.m { text-align: left; font-weight: 700; color: var(--ink); }
table.results td.m small { color: var(--muted); font-weight: 600; margin-left: 4px; }
table.results tr.is-fp td { color: var(--muted); }
table.results tr.is-agile td { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
table.results tr.grp td { border-top: 2px solid var(--line); }
table.results td.is-best { font-weight: 600; }
details.more > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 700; font-size: 0.88rem; color: var(--ink); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; transition: transform 0.2s; }
details.more[open] > summary::before { transform: rotate(90deg); }

/* ------------------------------------------------------------------ rollouts: simulation method grid */
.ro { display: flex; flex-direction: column; gap: 12px; }
.ro-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ro-eps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ro-ep {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid #d9dde4; background: #fff; font: 500 0.84rem/1 var(--font); color: var(--ink-2);
}
.ro-ep b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #eef1f5; color: var(--ink); font-size: 0.78rem; }
.ro-ep[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.ro-ep[aria-pressed="true"] b { background: #fff; }
.ro-ep .marks { display: inline-flex; gap: 2px; }
.ro-ep .marks i { width: 7px; height: 7px; border-radius: 2px; background: var(--bad); }
.ro-ep .marks i.ok { background: var(--merd); }
.ro-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 820px) { .ro-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ro-cell { margin: 0; border-radius: 14px; overflow: hidden; border: 2px solid var(--line); background: #fff; transition: border-color 0.3s, box-shadow 0.3s; }
.ro-cell.is-agile { border-color: var(--brand); box-shadow: 0 10px 28px var(--brand-glow); }
.ro-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 10px; background: var(--soft-2); }
.ro-cell.is-agile .ro-head { background: var(--brand-soft); }
.ro-name { font-weight: 600; font-size: 0.86rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro-cell.is-agile .ro-name { color: var(--brand-dark); }
.ro-badge { flex: none; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: var(--bad-soft); color: var(--bad); opacity: 0; transition: opacity 0.3s; }
.ro-badge.is-ok { background: var(--merd); color: #fff; }
.ro-badge.is-shown { opacity: 1; }
.ro-video { position: relative; aspect-ratio: 1 / 1; background: #0b1324; }
.ro-video video { width: 100%; height: 100%; object-fit: cover; }
.ro-time { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.2); }
.ro-time span { display: block; height: 100%; width: 0; background: var(--brand); }
.ro-foot { padding: 6px 10px 8px; font-size: 0.74rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.ro-foot .mini { flex: 1; height: 5px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.ro-foot .mini span { display: block; height: 100%; background: var(--c); border-radius: 999px; transition: width 0.6s var(--ease); }
.ro-foot b { font-family: var(--mono); color: var(--ink); font-size: 0.78rem; }

/* real-world compare */
.rw { display: flex; flex-direction: column; gap: 14px; }
.rw-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rw-tab {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; border: 2px solid var(--line); background: #fff;
  cursor: pointer; text-align: left; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.rw-tab:hover { transform: translateY(-1px); }
.rw-tab img { width: 64px; height: 50px; object-fit: cover; border-radius: 9px; flex: none; }
.rw-tab b { display: block; font-size: 0.92rem; color: var(--ink); line-height: 1.2; }
.rw-tab small { font-size: 0.76rem; color: var(--muted); font-weight: 600; }
.rw-tab[aria-selected="true"] { border-color: var(--brand); box-shadow: 0 8px 22px var(--brand-glow); }
@media (max-width: 700px) { .rw-tabs { grid-template-columns: minmax(0, 1fr); } }
.rw-info { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(150px, 210px); gap: 14px 22px; align-items: center; }
.rw-ptq .rw-vid video { height: 210px; width: 100%; object-fit: cover; }
.rw-ptq .rw-vid figcaption { padding: 6px 10px; font-size: 0.8rem; }
@media (max-width: 980px) { .rw-info { grid-template-columns: minmax(0, 1fr) minmax(150px, 210px); } .rw-info > :first-child { grid-column: 1 / -1; } }
@media (max-width: 560px) { .rw-info { grid-template-columns: minmax(0, 1fr); } .rw-ptq { max-width: 240px; } }
.rw-blurb { margin: 0; font-size: 0.95rem; color: var(--ink-2); line-height: 1.55; }
.rw-bars { display: grid; grid-template-columns: auto minmax(100px, 1fr) auto; align-items: center; gap: 6px 10px; }
.rw-bars-title { grid-column: 1 / -1; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.rw-bar-name { font-weight: 600; font-size: 0.88rem; color: var(--ink); }
.rw-bar-track { height: 11px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.rw-bar-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--c); transition: width 0.8s var(--ease); }
.rw-bar-val { font: 600 0.9rem/1 var(--mono); color: var(--ink); min-width: 3em; text-align: right; }
.rw-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (max-width: 760px) { .rw-pair { grid-template-columns: minmax(0, 1fr); } }
.rw-vid { margin: 0; border-radius: 14px; overflow: hidden; border: 2px solid var(--line); background: #000; }
.rw-vid.is-agile { border-color: var(--brand); box-shadow: 0 10px 28px var(--brand-glow); }
.rw-vid.is-ptq { border-color: #fecaca; }
.rw-vid figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; background: #fff; font-size: 0.86rem; font-weight: 600; color: var(--ink); }
.rw-vid.is-agile figcaption { background: var(--brand-soft); color: var(--brand-dark); }
.rw-vid.is-ptq figcaption { background: var(--bad-soft); color: var(--bad); }
.rw-vid figcaption small { font-weight: 600; color: var(--muted); font-size: 0.76rem; }
.rw-vid video { width: 100%; height: auto; background: #000; }
.rw-extra { margin-top: 4px; }
.rw-extra .rw-vid video { max-height: 260px; object-fit: contain; }
.rw-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.rw-steps li { counter-increment: s; position: relative; padding: 8px 10px 8px 34px; border-radius: 10px; background: var(--soft-2); border: 1px solid var(--line); font-size: 0.82rem; line-height: 1.4; }
.rw-steps li::before { content: counter(s); position: absolute; left: 9px; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 0.7rem; font-weight: 600; display: grid; place-items: center; }

/* ------------------------------------------------------------------ results carousel (DISCO style) */
.res { position: relative; max-width: 1180px; margin: 0 auto; }
.res-viewport { overflow: hidden; border-radius: 18px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.res-track { display: flex; transition: transform 0.7s var(--ease); }
.res-slide { flex: 0 0 100%; min-width: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: 28px; padding: 26px 70px 26px 30px; }
.res-fig { min-height: 260px; display: flex; align-items: center; justify-content: center; }
.res-fig svg { width: 100%; height: auto; }
.res-text { display: flex; flex-direction: column; gap: 10px; }
.res-kicker { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand-dark); }
.res-title { margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.55rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); }
.res-points { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.res-points li { position: relative; padding-left: 20px; font-size: 0.98rem; line-height: 1.5; }
.res-points li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.res-src { font-size: 0.76rem; color: var(--muted); }
.res-arrow {
  position: absolute; top: calc(50% - 22px); transform: translateY(-50%); z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font: 700 26px/1 var(--font); padding: 0 0 4px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(20, 33, 43, 0.12); transition: transform 0.15s, background 0.15s;
}
.res-arrow:hover { background: var(--soft); transform: translateY(-50%) scale(1.06); }
.res-prev { left: -22px; }
.res-next { right: -22px; }
.res-nav { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; }
.res-dots { display: flex; gap: 8px; }
.res-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: width 0.3s, background 0.3s; }
.res-dot[aria-selected="true"] { width: 28px; background: var(--brand-dark); }
.res-progress { width: 120px; height: 3px; border-radius: 999px; background: var(--line); overflow: hidden; }
.res-progress > span { display: block; height: 100%; width: 0; background: var(--brand); }
@media (max-width: 900px) {
  .res-slide { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 18px 22px; }
  .res-prev { left: 6px; } .res-next { right: 6px; }
  .res-arrow { top: 160px; width: 38px; height: 38px; font-size: 22px; background: rgba(255, 255, 255, 0.92); }
}

/* ------------------------------------------------------------------ conclusion */
.concl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .concl-grid { grid-template-columns: minmax(0, 1fr); } }
.concl-card { padding: 18px 18px 16px; }
.concl-card h4 { font-size: 1.02rem; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.concl-card h4 i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.concl-card p, .concl-card li { font-size: 0.93rem; line-height: 1.55; }
.concl-card ul { margin: 0; padding-left: 1.1em; }

/* ------------------------------------------------------------------ BibTeX + footer */
.bib-box { position: relative; }
.bib-code {
  margin: 0; padding: 18px 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--soft-2);
  font: 0.84rem/1.6 var(--mono); color: var(--ink);
}
.bib-copy { position: absolute; top: 10px; right: 10px; }
.ack-text { max-width: 60rem; margin: 0 auto; font-size: 0.95rem; line-height: 1.7; }
.ack-text p { margin-bottom: 0.8em; }
.dedication { font-style: italic; padding-left: 14px; border-left: 3px solid var(--poster); }
.footer { padding: 26px 16px 70px; text-align: center; font-size: 0.82rem; color: var(--muted); }
.footer p { margin: 0.3em 0; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 600px) {
  body { font-size: 15px; }
  .hero-mosaic { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 1fr); }
  .hero-credit { display: none; }
  .chapter-head { gap: 0.15rem 0.8rem; }
  .seg-btn { padding: 6px 11px; font-size: 0.84rem; }
  .link-btn { font-size: 0.92rem; padding: 0.55em 1em; }
  .block { border-radius: 20px; }
  .bars { height: 230px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sc-edge.is-on, .sc-edge.is-grad, .sc.is-on .sc-halo { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .res-track, .bar, .fp-mark, .rw-bar-fill { transition: none; }
}

/* ------------------------------------------------------------------ type roles (RFS): display titles, mono labels */
.kpi-v, .res-title, .dd-head h3, .concl-card h4, .al-card-head, .al-head, .pipe-stage h5, .widget-side h4, .race-name, .dn-name,
.ro-name, .rw-tab b, .rw-vid figcaption, .abl-stage, .rw-bar-name { font-family: var(--display); }
.al-sec, .al-card-num, .rw-bars-title, .res-kicker, .res-src, .fig-cap, .race-val small, .dn-meta small,
.axis-badge, .ro-foot, .ro-badge { font-family: var(--mono); font-weight: 500; }
.kpi-v { font-weight: 700; letter-spacing: -0.03em; }
.al { box-shadow: var(--shadow); border-color: #dfe7ee; border-radius: 26px; }
.ack-text { color: var(--ink-2); }
.dedication { color: var(--ink); }
