@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../assets/fonts/BricolageGrotesque.ttf") format("truetype-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("../assets/fonts/InstrumentSans.ttf") format("truetype-variations");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #16181a;
  --ink-2: #464c52;
  --ink-3: #747c84;
  --slate: #768696;
  --slate-dark: #4f5d6b;
  --line: #dfe4e8;
  --soft: #f6f8fa;
  --alt-bg: #fafcfd;
  --stage: #0D1821;
  --fore: #73A5C6;
  --fore-mid: #4F83A6;
  --fore-deep: #244B63;
  --fore-border: #B8D2E6;
  --fore-bg: #EEF4F9;
  --coral: #A8423B;
  --coral-fill: #E29B95;
  --coral-border: #E5B9B5;
  --coral-bg: #FBEEEC;
  --green: #1D7A2A;
  --green-ink: #0E4716;
  --green-fill: #BFE8C4;
  --green-bg: #EDF8EF;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --col: 780px;
  --fig-med: 920px;
  --wide: 1060px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font: 400 18px/1.68 var(--body);
  -webkit-font-smoothing: antialiased;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: var(--fore-deep); text-underline-offset: 3px; }
a:hover { color: var(--fore-mid); }
h1, h2, h3, h4, p, figure, ul, ol, pre { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--fore-deep); outline-offset: 3px; border-radius: 3px; }
sup { line-height: 0; font-size: .65em; }
sub { font-size: .68em; line-height: 0; vertical-align: baseline; position: relative; top: .28em; }

.wrap { width: min(1160px, 100% - 48px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 4px; z-index: 100; }
.skip:focus { left: 8px; }
.brand-inline { font-family: var(--display); font-weight: 680; letter-spacing: -0.02em; color: var(--fore-deep); }

/* ── Top Navigation ── */
.nav {
  position: absolute; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center;
  padding: 18px max(24px, calc((100vw - 1160px) / 2));
  color: #fff;
}
.mark {
  font: 660 22px/1 var(--display); letter-spacing: -0.03em;
  color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.mark:hover { color: #fff; }
.mark-cube { width: 28px; height: 28px; display: block; flex: none; }
.nav nav { display: flex; flex-wrap: wrap; gap: 22px; margin-left: auto; }
.nav nav a { color: #fff; text-decoration: none; font-size: 15px; opacity: .88; }
.nav nav a:hover { color: #fff; opacity: 1; text-decoration: underline; }

/* ── Hero ── */
.hero {
  position: relative; min-height: clamp(520px, 70svh, 720px);
  padding-top: 82px; display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--stage); color: #fff; overflow: hidden;
}
.hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(8,15,23,.48) 0%, rgba(8,15,23,.10) 38%, rgba(8,15,23,.88) 100%),
    linear-gradient(90deg, rgba(8,15,23,.64) 0%, rgba(8,15,23,0) 64%);
}
.hero-copy { position: relative; padding-bottom: 18px; }
.hero-venue {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 13.5px/1.2 var(--body); letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255,255,255,.85); margin-bottom: 14px;
}
.hero-venue::before { content: ""; width: 4px; height: 16px; background: var(--fore); display: inline-block; }
.hero h1 { font: 660 clamp(66px, 10.5vw, 140px)/0.9 var(--display); letter-spacing: -0.04em; margin-left: -0.02em; display: flex; align-items: center; gap: 0.14em; }
.hero-cube { width: 0.86em; height: 0.86em; flex: none; filter: drop-shadow(0 4px 14px rgba(0,0,0,.35)); }
.hero-title {
  font: 500 clamp(21px, 2.35vw, 31px)/1.24 var(--display);
  letter-spacing: -0.015em; margin-top: 12px; max-width: 36ch; color: rgba(255,255,255,.95);
}
.hero-authors {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px;
  margin-top: 16px; font: 550 17px/1.4 var(--body); color: rgba(255,255,255,.95);
}
.hero-authors a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.35); transition: border-color .15s, color .15s; }
.hero-authors a:hover { color: #9CC5E0; border-bottom-color: #9CC5E0; }
.hero-affils {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin-top: 5px; font: 450 14.5px/1.4 var(--body); color: rgba(255,255,255,.78);
}
.affil-sep { opacity: .55; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.hero-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 6px;
  font: 600 14.5px/1.15 var(--body); text-decoration: none;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); color: #fff;
  backdrop-filter: blur(6px); transition: background .16s, border-color .16s, transform .14s;
}
.hero-btn svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }
.hero-btn:hover { color: #fff; background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.52); transform: translateY(-1px); }
.hero-btn.primary { background: var(--fore-deep); border-color: var(--fore); color: #fff; }
.hero-btn.primary:hover { background: var(--fore-mid); border-color: #9CC5E0; }
.hero-foot { position: relative; padding: 0 0 22px; font-size: 14px; color: rgba(255,255,255,.74); }
.hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-speed {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 4px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff;
  font: 600 12.5px/1.2 var(--body);
}
.hero-speed svg { width: 13px; height: 11px; fill: currentColor; }

/* ── Side rail: a hairline with the current section marked; full labels on wide screens ── */
.rail { display: none; }
@media (min-width: 1180px) {
  .rail {
    display: block; position: fixed; left: 14px; top: 108px; z-index: 20;
    width: 14px; padding: 8px 0; overflow: hidden; white-space: nowrap; border-radius: 0 8px 8px 0;
    opacity: 0; pointer-events: none;
    transition: opacity .25s, width .22s ease, background .2s, box-shadow .2s;
  }
  .rail.show { opacity: 1; pointer-events: auto; }
  .rail:hover, .rail:focus-within { width: 204px; background: rgba(255,255,255,.97); box-shadow: 0 6px 24px rgba(20,35,50,.13); }
  .rail nav { display: grid; width: 190px; border-left: 1px solid var(--line); }
  .rail a {
    display: block; padding: 7px 0 7px 15px; margin-left: -1px;
    border-left: 2px solid transparent; font-size: 14.5px; line-height: 1.35;
    color: var(--ink-2); text-decoration: none; transition: color .15s, border-color .2s;
  }
  .rail a:hover { color: var(--ink); }
  .rail a.on { color: var(--ink); border-left-color: var(--ink); }
  .rail a.sub {
    max-height: 0; padding-block: 0; padding-left: 27px; overflow: hidden; opacity: 0;
    font-size: 13.5px; color: var(--ink-3);
    transition: max-height .28s ease, padding .28s ease, opacity .2s, color .15s, border-color .2s;
  }
  .rail a.sub.open { max-height: 30px; padding-block: 4px; opacity: 1; }
  .rail a.sub.on { color: var(--fore-deep); border-left-color: var(--fore-mid); }
}
@media (min-width: 1440px) {
  .rail, .rail:hover, .rail:focus-within {
    left: 22px; width: 172px; padding: 0; overflow: visible; white-space: normal;
    background: none; box-shadow: none; border-radius: 0;
  }
  .rail nav { width: auto; }
}

/* ── Section Rhythm & Containers (Advantage-Guidance Pacing) ── */
[id] { scroll-margin-top: 24px; }
.section-band { padding: 56px 0; background: #ffffff; }
.section-band.tight-top { padding-top: 44px; }
.section-band.alt { background: var(--alt-bg); }
.section-sep { margin: 0; border: 0; border-top: 1px solid var(--line); }

.col { width: min(var(--col), 100% - 40px); margin-inline: auto; }
.fig-med { width: min(var(--fig-med), 100% - 40px); margin: 28px auto; }
.fig-wide { width: min(var(--wide), 100% - 40px); margin: 28px auto; }

/* ── Typography & Prose ── */
.analysis-kicker {
  margin-bottom: 6px;
  color: #2D7355;
  font: 700 13px/1.25 var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-heading {
  font: 700 clamp(26px, 3vw, 33px)/1.22 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 10px;
}
.section-heading .accent { color: var(--fore-deep); }
.analysis-subtitle {
  max-width: var(--col);
  margin-bottom: 24px;
  color: var(--ink-3);
  font-size: 17px;
  line-height: 1.48;
}

.prose p { color: var(--ink-2); font-size: 18px; line-height: 1.7; }
.prose p + p { margin-top: 1.05em; }
.prose strong, .prose b { color: var(--fore-deep); font-weight: 650; }
.prose strong.ink { color: var(--ink); }
.prose strong.coral { color: var(--coral); }
.prose u { text-decoration-color: rgba(168, 66, 59, 0.45); text-underline-offset: 3px; }

/* Step Subheadings inside Section 2 */
.step-block { margin-top: 52px; padding-top: 42px; border-top: 1px dashed #d5dce2; }
.step-block.first { margin-top: 28px; padding-top: 0; border-top: 0; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.step-num {
  display: inline-flex; width: 30px; height: 30px; flex: 0 0 30px;
  align-items: center; justify-content: center;
  border-radius: 50%; background: var(--fore-bg); border: 1.5px solid var(--fore-border);
  color: var(--fore-deep); font: 700 14px/1 var(--display);
}
.step-title {
  font: 680 clamp(20px, 2.2vw, 24px)/1.26 var(--display);
  letter-spacing: -0.015em; color: var(--ink);
}
.step-subtitle {
  color: var(--ink-3); font-size: 16px; line-height: 1.45; margin: -4px 0 16px 42px;
}

/* ── TL;DR Box (Advantage-Guidance Clean Style) ── */
.tldr-card {
  width: min(var(--col), 100% - 40px);
  margin: 0 auto 34px;
  padding: 26px 32px;
  background: var(--fore-bg);
  border: 1px solid var(--fore-border);
  border-radius: 12px;
}
.tldr-heading {
  font: 700 22px/1.2 var(--display);
  color: var(--fore-mid);
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.tldr-card p {
  font-size: 17.5px;
  line-height: 1.68;
  color: var(--ink);
}
.tldr-card p + p { margin-top: 0.75em; }
.tldr-card strong { color: var(--fore-deep); font-weight: 680; }

/* ── KaTeX Equation Cards ── */
.method-equation {
  margin: 18px 0 20px;
  padding: 12px 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}
.method-equation.emphasized {
  background: #fcfdfe;
  border-color: var(--fore-border);
}
.method-equation .katex-display { margin: 0.35rem 0; overflow-x: auto; overflow-y: hidden; }
.katex { font-size: 1.03em; }
.method-equation.compact .katex { font-size: 0.95em; }

/* ── Clean Question & Answer / Insight Callouts ── */
.qa-box {
  width: min(var(--col), 100% - 40px);
  margin: 26px auto 0;
  padding: 16px 20px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--fore-mid);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  font-size: 16.8px;
  line-height: 1.58;
}
.qa-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.qa-tag {
  font: 700 12.5px/1.2 var(--body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.qa-tag.ans { color: var(--fore-deep); }
.qa-row p { color: var(--ink-2); font-size: 16.5px; line-height: 1.56; }
.qa-row p strong { color: var(--ink); font-weight: 650; }
.qa-row p em { color: var(--ink); }

.insight-box {
  width: min(var(--col), 100% - 40px);
  margin: 26px auto 0;
  padding: 16px 22px;
  background: var(--fore-bg);
  border: 1px solid var(--fore-border);
  border-radius: 9px;
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
}
.insight-box strong { color: var(--fore-deep); font-weight: 700; }

/* ── Clean Bordered Figures & Captions ── */
.fig-frame {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
}
.fig-frame.soft { background: var(--soft); }
.fig-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.fig-title {
  font: 680 17.5px/1.28 var(--display);
  color: var(--ink);
}
.fig-sub {
  font-size: 14.5px; color: var(--ink-3); margin-top: 2px;
}
.fig-caption {
  margin-top: 11px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.55;
}
.fig-caption strong { color: var(--ink); font-weight: 660; }

.fig-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
}
.fig-card.soft {
  background: var(--soft);
}
.fig-svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.two-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch;
}
.panel-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.panel-card h4 { font: 680 16.5px/1.28 var(--display); color: var(--ink); margin-bottom: 3px; }
.panel-card .sub { font-size: 14px; color: var(--ink-2); margin-bottom: 10px; line-height: 1.45; }

/* Heatmap Legend */
.hm-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; }
.hm-bar {
  width: 112px; height: 11px; border-radius: 3px; border: 1px solid #c8cfd6;
  background: linear-gradient(90deg, #983831 0%, #E29B95 28%, #FAFBFB 50%, #9CC5E0 72%, #244B63 100%);
  display: inline-block;
}

/* Interactive Pill Buttons */
.pill-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pill-lbl { font: 700 12px/1 var(--body); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); margin-right: 4px; }
.f3-btn, .f3-task-btn {
  border: 1px solid #cfd6dc; background: #ffffff; color: var(--ink-2);
  font: 600 13px/1.1 var(--body); padding: 7px 11px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  transition: all .15s ease;
}
.f3-btn:hover, .f3-task-btn:hover { border-color: var(--fore-mid); color: var(--ink); }
.f3-btn.on { background: var(--fore-deep); border-color: var(--fore-deep); color: #fff; }
.f3-task-btn .sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.f3-task-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── Section 1 Problem Stage (Calm & Focused) ── */
.f1-tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.f1-tab {
  border: 1px solid #cfd6dc; background: #fff; color: var(--ink-2);
  font: 600 13px/1.1 var(--body); padding: 7px 12px; border-radius: 6px;
  transition: all .15s ease;
}
.f1-tab:hover { border-color: #888; color: var(--ink); }
.f1-tab[data-beat="0"].active { background: #475569; border-color: #475569; color: #fff; }
.f1-tab[data-beat="1"].active { background: var(--coral); border-color: var(--coral); color: #fff; }
.f1-tab[data-beat="2"].active { background: var(--fore-deep); border-color: var(--fore-deep); color: #fff; }

.f1-rows { display: grid; gap: 14px; margin-top: 8px; }
.f1-row { display: grid; grid-template-columns: 148px 1fr 86px; align-items: center; gap: 10px; font-size: 14.5px; }
.f1-row .rname { font-weight: 650; color: var(--ink); line-height: 1.25; }
.f1-row .rname small { display: block; font-weight: 450; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.f1-bars { display: grid; gap: 4px; }
.f1-bar-line { display: flex; align-items: center; gap: 8px; height: 15px; transition: opacity .28s ease; }
.f1-track { flex: 1; height: 12px; background: #eef0f2; border-radius: 2.5px; overflow: hidden; }
.f1-bar-fill { height: 100%; border-radius: 2.5px; transition: width .45s cubic-bezier(.22,1,.36,1); }
.f1-num { width: 42px; font: 650 13px/1 var(--body); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.f1-badge {
  justify-self: end; padding: 4px 8px; border-radius: 4px;
  font: 700 12.5px/1.1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--fore-bg); color: var(--fore-deep); border: 1px solid var(--fore-border);
}
.f1-badge.st-mode { background: #f1f4f7; color: #475569; border-color: #cbd5e1; }
.f1-badge.mt-mode { background: var(--coral-bg); color: var(--coral); border-color: var(--coral-border); }
.f1-badge.sg-mode { background: var(--fore-bg); color: var(--fore-deep); border-color: var(--fore-border); }

.task-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 14px; }
.task-item { border: 1px solid var(--line); background: #fafbfc; border-radius: 6px; padding: 4px; text-align: center; }
.task-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.task-item span { display: block; font-size: 12px; font-weight: 600; margin-top: 4px; color: var(--ink-2); }

/* ── Section 3: Our Method (Advantage-Guidance Cards + Video Context Thumbnails) ── */
.method-detail {
  width: min(var(--wide), 100% - 40px);
  margin: 28px auto;
  padding: 26px 28px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.method-detail.featured {
  background: #f4f8fc;
  border-color: var(--fore-border);
}
.method-detail-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.method-detail-title {
  display: flex; align-items: center; gap: 12px;
}
.method-number {
  display: inline-flex; width: 32px; height: 32px; flex: 0 0 32px;
  align-items: center; justify-content: center;
  background: #ffffff; border: 1.5px solid var(--fore-border); border-radius: 50%;
  color: var(--fore-deep); font: 700 15px/1 var(--display);
}
.method-detail-title h3 {
  font: 700 clamp(21px, 2.3vw, 25px)/1.25 var(--display);
  letter-spacing: -0.015em; color: var(--ink);
}
.stage-tag {
  flex-shrink: 0; padding: 6px 11px; border-radius: 5px;
  font: 700 12.5px/1.2 var(--body); letter-spacing: 0.02em;
  background: var(--fore-deep); color: #fff;
}
.method-prose { max-width: 820px; margin-bottom: 18px; }
.method-prose p { font-size: 17px; line-height: 1.65; color: var(--ink-2); }
.method-prose p + p { margin-top: 0.8em; }
.method-prose strong { color: var(--fore-deep); font-weight: 650; }

/* Video-Style Compact Left Context Thumbnail + Arrow + Main Method Stage */
.ctx-method-grid {
  display: grid;
  grid-template-columns: 242px 26px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  margin-top: 16px;
}
.ctx-mini-card {
  background: #ffffff;
  border: 1px dashed #b9c8d6;
  border-radius: 9px;
  padding: 13px 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.ctx-badge {
  display: inline-block; align-self: flex-start;
  padding: 3px 8px; border-radius: 4px;
  background: #e9eff5; color: var(--slate-dark);
  font: 700 10.8px/1.2 var(--body); letter-spacing: 0.05em; text-transform: uppercase;
}
.ctx-mini-card h5 {
  margin: 4px 0 2px;
  font: 680 14.5px/1.25 var(--display); color: var(--ink);
}
.ctx-mini-card p {
  font-size: 12.8px; line-height: 1.42; color: var(--ink-2);
}
.ctx-mini-note {
  padding: 8px 10px; border-radius: 6px;
  background: var(--fore-bg); border: 1px solid var(--fore-border);
  font-size: 12.4px; line-height: 1.4; color: var(--fore-deep); font-weight: 600;
}
.ctx-mini-note.coral {
  background: var(--coral-bg); border-color: var(--coral-border); color: #7F2F2A;
}
.ctx-arrow {
  display: flex; align-items: center; justify-content: center;
  color: var(--fore-deep); font: 800 20px/1 var(--display);
}
.method-main-stage {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.f3-readout {
  margin-top: 8px; padding: 9px 12px; border-radius: 5px;
  background: #f6f8fa; border-left: 4px solid var(--fore-deep);
  font-size: 13.8px; line-height: 1.45; color: var(--ink);
}
.f3-readout b { font-weight: 700; }

@keyframes gradFlow {
  from { stroke-dashoffset: 28; }
  to { stroke-dashoffset: 0; }
}
.grad-stream { stroke-dasharray: 9 5; animation: gradFlow 0.9s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .grad-stream { animation: none; stroke-dasharray: none; }
}

/* Interactive 4x5 Gate Matrix */
.gate-grid { display: grid; grid-template-columns: 88px repeat(5, 1fr); gap: 6px; align-items: center; font-size: 14px; margin-top: 4px; }
.gate-grid .gh {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-align: center; font-weight: 700; font-size: 12.5px; color: var(--ink);
  padding: 4px 2px; border-radius: 4px; cursor: pointer; white-space: nowrap;
}
.gate-grid .gh .tsw { width: 9px; height: 9px; border-radius: 2px; display: block; }
.gate-grid .gh:hover, .gate-grid .gh.col-on { background: #f1f4f7; }
.gate-grid .gr {
  font-weight: 700; color: var(--ink); text-align: right; padding: 5px 6px 5px 2px;
  font-size: 13px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: flex-end; gap: 5px;
}
.gate-grid .gr .msw { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.gate-cell {
  border-radius: 5px; padding: 10px 3px; text-align: center;
  font: 700 14px/1 var(--display); font-variant-numeric: tabular-nums;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, opacity .18s ease;
}
.gate-cell:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.09); }
.gate-cell.spot { outline: 2px solid var(--ink); outline-offset: 1px; }
.gate-cell.dim { opacity: 0.42; }

/* ── Expandable Algorithm 1 & Disclosures (Advantage-Guidance Style) ── */
.disclosure-bar {
  width: min(var(--wide), 100% - 40px);
  margin: 18px auto 0;
}
.disclosure-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.disclosure-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 7px;
  border: 1px solid var(--fore-border); background: var(--fore-bg);
  color: var(--fore-deep); font: 650 15px/1.2 var(--body);
  transition: background .15s;
}
.disclosure-toggle:hover { background: #dfecf6; }
.disclosure-chev { display: inline-block; transition: transform .16s ease; }
.disclosure-toggle[aria-expanded="true"] .disclosure-chev { transform: rotate(90deg); }
.disclosure-panel[hidden] { display: none; }

.algorithm-box {
  margin-top: 14px;
  background: #ffffff;
  border-block: 2px solid var(--fore-deep);
  border-inline: 1px solid var(--line);
  border-radius: 4px;
  font-size: 15px;
  line-height: 1.48;
  color: var(--ink);
}
.algorithm-caption {
  padding: 10px 16px;
  background: var(--fore-bg);
  border-bottom: 1px solid var(--fore-border);
  font: 700 15.5px/1.3 var(--display);
  color: var(--fore-deep);
}
.algorithm-columns {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.algorithm-part { padding: 14px 18px; min-width: 0; }
.algorithm-part + .algorithm-part { border-left: 1px solid var(--line); }
.algorithm-part h4 {
  font: 700 15px/1.3 var(--display); color: var(--ink);
  padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.algorithm-part p { margin-bottom: 6px; color: var(--ink-2); font-size: 14.5px; }
.alg-indent { padding-left: 16px; border-left: 2px solid #e6ecf1; margin: 6px 0; }
.alg-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.alg-tag { font: 650 12.5px/1.2 var(--body); color: var(--fore-mid); white-space: nowrap; }
.alg-tag.green { color: var(--green); }
.practitioner-box {
  margin-top: 14px; padding: 16px 22px;
  background: var(--fore-bg); border: 1px solid var(--fore-border); border-radius: 8px;
  font-size: 16px; line-height: 1.62; color: var(--ink-2);
}
.practitioner-box ul { padding-left: 20px; }
.practitioner-box li + li { margin-top: 8px; }
.practitioner-box strong { color: var(--fore-deep); }

/* ── Section 4: Results & Highlight Banner ── */
.result-highlight {
  width: min(var(--wide), 100% - 40px);
  margin: 26px auto;
  padding: 22px 28px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; align-items: center;
  background: var(--fore-bg); border: 1px solid var(--fore-border); border-radius: 10px;
}
.result-big {
  font: 700 22px/1.32 var(--display); color: var(--ink); letter-spacing: -0.015em;
}
.result-big span { color: var(--fore-deep); }
.result-highlight p { color: var(--ink-2); font-size: 16.5px; line-height: 1.58; }

/* ── Live figures ── */
.viz-grid { display: grid; gap: 30px 36px; }
.viz-grid.quad { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; grid-auto-flow: column; }
.viz-grid.duo { grid-template-columns: 1fr 1fr; }
.viz-grid.duo.wide-left { grid-template-columns: 1.32fr 1fr; }
.viz-grid.trio { grid-template-columns: repeat(3, 1fr); gap: 24px; }
.viz-grid.fwd { grid-template-columns: 0.56fr 1fr 1.22fr; gap: 26px; align-items: start; }
.viz-panel { min-width: 0; }
.viz-title { font: 650 16px/1.3 var(--display); color: var(--ink); }
.viz-title b { font-weight: 700; margin-right: 7px; }
.viz-sub { font-size: 13.5px; line-height: 1.42; color: var(--ink-3); margin-top: 3px; }
.viz-panel .chart { margin-top: 10px; }
.viz-axis { font-size: 13.5px; color: var(--ink-3); margin-top: 12px; }
.chart-scroll { overflow-x: auto; }
.chart-scroll > .chart { min-width: 760px; }

.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-bottom: 20px; font-size: 14.5px; color: var(--ink); }
.legend.small { justify-content: flex-start; gap: 4px 14px; margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.k { width: 13px; height: 13px; border-radius: 2px; display: inline-block; flex: none; vertical-align: -1px; }
.k.st { background: #F4F6F8; border: 1.3px dashed #98A2AD; }
.k.mt { background: #6E7681; }
.k.su { background: #F28C28; }
.k.dot { height: 0; border-top: 2px dotted #6b7480; border-radius: 0; vertical-align: 3px; }
.k.lo { background: #DE958E; margin-right: 5px; }
.k.hi { background: #5E93BD; margin: 0 5px 0 12px; }

.seg { display: inline-flex; padding: 3px; border-radius: 8px; background: #e8edf1; margin-bottom: 16px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 6px; font: 600 14px/1.15 var(--body); color: var(--ink-2); transition: background .18s, color .18s, box-shadow .18s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--fore-deep); box-shadow: 0 1px 3px rgba(20,35,50,.16); }

.chart svg { display: block; width: 100%; height: auto; font-family: var(--body); overflow: visible; fill: var(--ink); }
.chart .mi { font-family: KaTeX_Math, "Times New Roman", serif; font-style: italic; }
.chart .grid { stroke: #e4e8ec; stroke-width: 1; fill: none; }
.chart .axis { stroke: #3a4047; stroke-width: 1.2; }
.chart .zero { stroke: #6b7480; stroke-width: 1.1; stroke-dasharray: 4 3.5; }
.chart .sep { stroke: #b4bbc3; stroke-width: 1; stroke-dasharray: 3 3; }
.chart .guide { stroke: #b4bbc3; stroke-width: 1.1; stroke-dasharray: 4 4; }
.chart .tick { font-size: 12.5px; fill: #6d757d; }
.chart .tick.halo { paint-order: stroke; stroke: #fff; stroke-width: 3.5px; stroke-linejoin: round; }
.chart .tick.up { fill: var(--green); }
.chart .tick.blue { fill: var(--fore-deep); }
.chart .xlab { font-size: 13.5px; fill: var(--ink); }
.chart .xlab.sub { fill: var(--ink-2); }
.chart .xlab.em { font-weight: 650; }
.chart .ylab { font-size: 12.5px; fill: var(--ink-2); }
.chart .rlab { fill: var(--ink-2); }
.chart .ptitle { font-family: var(--display); font-weight: 650; fill: var(--ink); }
.chart .val { font-size: 12px; font-weight: 600; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart .val.su, .chart .val.delta { fill: #C2570C; }
.chart .val.delta { font-size: 12.5px; font-weight: 700; }
.chart .val.nil { fill: var(--coral); font-weight: 700; }
.chart .bar.st { fill: #F4F6F8; stroke: #98A2AD; stroke-width: 1.2; stroke-dasharray: 3.5 2.5; }
.chart .bar.mt { fill: #6E7681; }
.chart .bar.su { fill: #F28C28; }
.chart .ring { fill: none; stroke: #e1e5ea; stroke-width: 1; stroke-dasharray: 3 3; }
.chart .ring.outer { stroke: #c3c9d0; stroke-dasharray: none; }
.chart .spoke { stroke: #e4e8ec; stroke-width: 1; }
.chart .shape { fill: none; stroke-linejoin: round; }
.chart .shape.st { stroke: #98A2AD; stroke-width: 1.6; stroke-dasharray: 5 3.5; }
.chart .shape.mt { stroke: #4d545c; stroke-width: 1.9; }
.chart .shape.su { stroke: #E0700F; stroke-width: 2.6; fill: rgba(242,140,40,.16); }
.chart .vertex { fill: #E0700F; stroke: #fff; stroke-width: 1.4; }
.chart .axis-hit { stroke: transparent; stroke-width: 30; stroke-linecap: round; cursor: crosshair; outline: none; }
.chart .radar-tip { opacity: 0; pointer-events: none; transition: opacity .16s ease; }
.chart .radar-tip.on { opacity: 1; }
.chart .spoke-hi { stroke: #5b6672; stroke-width: 1.3; }
.chart .tipdot { stroke: #fff; stroke-width: 1.4; }
.chart .tipdot.st { fill: #98A2AD; }
.chart .tipdot.mt { fill: #4d545c; }
.chart .tipdot.su { fill: #E0700F; }
.chart .tipbox { fill: #fff; stroke: #cfd5dc; stroke-width: 1; filter: drop-shadow(0 4px 10px rgba(20,32,45,.14)); }
.chart .tiptitle { font-size: 12.5px; font-weight: 650; }
.chart .tiprow { font-size: 12px; fill: #4d545c; }
.chart .tipval { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chart .cellv { font-weight: 550; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke-width: 2.3; stroke-linejoin: round; }
.chart .line.base { stroke: #6b7480; stroke-width: 1.5; stroke-dasharray: 2 3.5; }
.chart .mark { stroke: #fff; stroke-width: 1.4; }
.chart .endlab { font-size: 13px; font-weight: 650; }
.chart .zone { fill: #EEF4F9; }
.chart .zone-lab { fill: var(--fore-deep); font-style: italic; }
.chart .hb.lo { fill: #DE958E; }
.chart .hb.hi { fill: #5E93BD; }
.chart .slab-lab { font-size: 14.5px; font-weight: 550; }
.chart .flow-arrow { stroke: var(--fore-deep); stroke-width: 2.2; fill: none; }
.chart .flow-arrow.thin { stroke-width: 1.7; }
.chart .flow-head { fill: var(--fore-deep); }
.chart .colhead { font-size: 13.5px; font-weight: 600; }
.chart .range.pos { fill: #9fc0da; }
.chart .range.neg { fill: #DE958E; }
.chart .range.glob { fill: #e9edf1; stroke: #98A2AD; stroke-dasharray: 3 2.5; }
.chart .median { fill: #fff; stroke-width: 2; }
.chart .pct { font-size: 14px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart .pct.bad { fill: var(--coral); font-weight: 700; }
.chart .g-state { font: 700 19px/1 var(--display); }
.chart .g-read { font-size: 13.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart .g-read.strong { font-size: 14.5px; font-weight: 650; fill: var(--ink); }
.chart .hint { font-size: 12px; fill: var(--ink-3); display: none; }
@media (hover: hover) { .chart .hint { display: inline; } }
.chart .box { fill: #fff; stroke: #c3c9d0; stroke-width: 1.4; transition: stroke-width .2s, filter .25s; }
.chart .box.trunk { fill: #FBEEEC; stroke: #E5B9B5; }
.chart .box.lora, .chart .box.samp { fill: #EEF4F9; stroke: #B8D2E6; }
.chart .box.src, .chart .box.loss, .chart .box.probe { fill: #f6f8fa; stroke: #c3c9d0; }
.chart .box.vis { fill: #EEF4F9; stroke: #7FA6C4; }
.chart .box.lang { fill: #FBF2EC; stroke: #C99A84; }
.chart .box.flow { fill: #ECF5F0; stroke: #7DB5A0; }
.chart .box.head { fill: #F3F4F6; stroke: #A3A9B2; }
.chart .box.hot { stroke-width: 2.8; filter: drop-shadow(0 3px 7px rgba(36,75,99,.22)); }
.chart .box-t { font-size: 14.5px; font-weight: 600; }
.chart .box-t.vis { fill: #244B63; } .chart .box-t.lang { fill: #6b3a26; } .chart .box-t.flow { fill: #1f5a45; }
.chart .box-s { font-size: 12.5px; fill: var(--ink-3); }
.chart .box-s.coral { fill: var(--coral); }
.chart .wire { fill: none; stroke-width: 1.6; stroke-dasharray: 5 4; }
.chart .wire.trunk { stroke: var(--coral); } .chart .wire.lora { stroke: var(--fore-deep); }
.chart .valve { fill: #fff; stroke: var(--coral); stroke-width: 1.6; }
.chart .gate-lab { fill: var(--coral); font-weight: 650; font-variant-numeric: tabular-nums; }
.chart .gate-lab.lora { fill: var(--fore-deep); }
.chart .cell { cursor: default; }
.chart .pick { fill: none; stroke: var(--ink); stroke-width: 2.4; pointer-events: none; transition: x .35s cubic-bezier(.2,.7,.2,1), y .35s cubic-bezier(.2,.7,.2,1); }
.chart .chan { fill: none; stroke-width: 1.5; stroke-dasharray: 4 3.5; }
.chart .chan.down { stroke: #8a929b; } .chart .chan.up { stroke: var(--green); } .chart .chan.back { stroke: var(--fore-deep); }
.chart .status { font-size: 14px; font-weight: 550; fill: var(--ink-2); }

/* scroll-triggered states: everything waits for .in on the chart host */
.chart .rise { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform .95s cubic-bezier(.2,.7,.2,1) calc(var(--d, 0) * 1ms); }
.chart .growx { transform: scaleX(0); transition: transform .95s cubic-bezier(.2,.7,.2,1) calc(var(--d, 0) * 1ms); }
.chart .pop { transform: scale(0); transition: transform 1.05s cubic-bezier(.2,.7,.2,1) calc(var(--d, 0) * 1ms); }
.chart .fade { opacity: 0; transition: opacity .45s ease calc(var(--d, 0) * 1ms); }
.chart .draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.35s cubic-bezier(.45,.1,.35,1) calc(var(--d, 0) * 1ms); }
.chart .slab { opacity: 0; transform: translateY(-14px); transition: opacity .5s ease calc(var(--d, 0) * 1ms), transform .65s cubic-bezier(.2,.7,.2,1) calc(var(--d, 0) * 1ms); }
.chart.in .rise, .chart.in .growx, .chart.in .pop, .chart.in .slab { transform: none; }
.chart.in .fade, .chart.in .slab { opacity: 1; }
.chart.in .draw { stroke-dashoffset: 0; }
.chart.noanim *, .hbars.noanim * { transition: none !important; }

.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(150px, 46%) 1fr; align-items: center; gap: 14px; font-size: 14.5px; line-height: 1.3; }
.hbar .name { color: var(--ink-2); text-align: right; }
.hbar.ours .name { color: var(--ink); font-weight: 650; }
.hbar .track { position: relative; height: 26px; margin-right: 96px; border-left: 1.2px solid #3a4047; }
.hbar .track::after { content: ""; position: absolute; left: var(--base); top: -5px; bottom: -5px; border-left: 1.2px dashed #6b7480; }
.hbar .track i { position: absolute; left: 0; top: 0; height: 100%; width: 0; border-radius: 0 3px 3px 0; transition: width .95s cubic-bezier(.2,.7,.2,1); }
.hbar i.mt { background: #6E7681; } .hbar i.s1 { background: #D9DEE3; } .hbar i.s2 { background: #F7D5B0; } .hbar i.s3 { background: #F5B066; } .hbar i.full { background: #F28C28; }
.hbar .lab { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; white-space: nowrap; font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .4s .9s; }
.hbar .lab b { color: var(--ink); font-weight: 650; margin-right: 6px; }
.hbar.ours .lab, .hbar.ours .lab b { color: #C2570C; }
.hbars.in .lab { opacity: 1; }

/* content blocks ease in once as they enter the viewport (class added by JS only) */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s ease var(--rd, 0ms), transform .8s cubic-bezier(.2,.7,.2,1) var(--rd, 0ms); }
.rv.seen { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chart .rise, .chart .growx, .chart .pop, .chart .fade, .chart .draw, .chart .slab, .chart .pick, .hbar .track i, .hbar .lab, .rv, .rail, .rail a.sub { transition: none; }
}

/* Physical Rollout Player */
.fs { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; }
.fs-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.fs-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.fs-tabs button, .play {
  border: 1px solid #cfd6dc; background: #fff; color: var(--ink-2);
  font-size: 14px; font-weight: 600; line-height: 1.15; padding: 8px 13px;
  border-radius: 6px; transition: color .15s, border-color .15s, background .15s;
}
.fs-tabs button sub, .fs-tabs button sup { font-size: 0.72em; line-height: 0; position: relative; vertical-align: baseline; }
.fs-tabs button sup { top: -0.45em; }
.fs-tabs button sub { bottom: -0.20em; }
.fs-tabs button:hover, .play:hover { color: var(--ink); border-color: #888; }
.fs-tabs button.on, .play.on { background: var(--fore-deep); color: #fff; border-color: var(--fore-deep); }
.fs-views.single { display: block; }
.fs-single { border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.fs-single .vwrap video { aspect-ratio: 16 / 9; object-fit: contain; background: #fff; }
.fs-single .vbadge, .fs-single .vspeed { display: none; }
.fs-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.fs-read { flex: 1; min-width: 240px; font-size: 15px; line-height: 1.48; color: var(--ink-2); }
.fs-read b { color: var(--ink); font-weight: 650; }
.fs-ctrl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.vwrap { position: relative; border-radius: 6px; overflow: hidden; background: var(--soft); height: 100%; }
.vwrap video { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; cursor: pointer; }
.vbadge { position: absolute; left: 7px; bottom: 7px; font-size: 11.5px; font-weight: 550; line-height: 1; padding: 5px 8px; border-radius: 4px; background: rgba(17,17,17,.68); color: #fff; pointer-events: none; }
.vspeed { position: absolute; left: 7px; top: 7px; z-index: 3; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 4px; border: 0; background: rgba(17,17,17,.74); color: #fff; font: 600 12px/1 var(--body); }
.vspd-ctl { flex: none; height: 24px; padding: 0 7px; border: 1px solid #d2d2cf; border-radius: 4px; background: #fff; color: var(--ink); font: 600 11.5px/1 var(--body); }
.vctl { position: absolute; left: 5px; right: 5px; bottom: 5px; display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 6px; background: rgba(250,250,249,.95); box-shadow: 0 2px 10px rgba(0,0,0,.18); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.vwrap:hover .vctl, .vwrap:focus-within .vctl { opacity: 1; transform: none; }
.vbtn { flex: none; width: 24px; height: 24px; border: 0; border-radius: 4px; background: var(--ink); color: #fff; display: grid; place-items: center; padding: 0; }
.vbtn.ghost { background: none; color: var(--ink); }
.vbtn svg { width: 14px; height: 14px; fill: currentColor; }
.vbtn svg.line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.vtime { flex: none; font: 500 11.5px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink); min-width: 28px; text-align: center; }
.vctl input[type=range] { --p: 0%; flex: 1; min-width: 40px; height: 16px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.vctl input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ink) var(--p), #d2d2cf var(--p)); }
.vctl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 12px; margin-top: -4px; border-radius: 2px; background: #fff; border: 1px solid #777; }

/* Tables */
.tbl-wrap { overflow-x: auto; margin-top: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; line-height: 1.45; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 8px 0 8px 14px; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 0; white-space: normal; }
thead th { font-weight: 650; color: var(--ink-2); border-bottom: 1.5px solid var(--ink); font-size: 14px; }
tbody td { border-bottom: 1px solid var(--line); }
tr.sep td { border-top: 1px solid #bbb; }
td.best { font-weight: 700; color: var(--ink); }
td.zero { color: var(--coral); font-weight: 650; }
tr.ours td:first-child { font-weight: 680; color: var(--fore-deep); }
tr.ours td.best { color: var(--fore-deep); }
.cap { font-size: 14.5px; color: var(--ink-3); margin: 8px 0 22px; }

/* ── Section 5: 3-Regime Recipe Cards ── */
.regime-grid {
  display: grid;
  grid-template-columns: 0.92fr 0.96fr 1.12fr;
  grid-template-rows: auto auto 1fr auto 1fr auto;
  column-gap: 16px;
}
.regime-card {
  position: relative; overflow: hidden;
  grid-row: span 6; display: grid; grid-template-rows: subgrid; row-gap: 12px;
  background: var(--soft); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 22px 18px 18px; min-width: 0;
}
.regime-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--slate-dark); }
.regime-card.featured { border-color: var(--fore-deep); background: #fff; }
.regime-card.featured::before { background: var(--fore-deep); }
.regime-tag {
  justify-self: start; align-self: center; padding: 4px 10px; border-radius: 4px;
  font: 700 11.5px/1.2 var(--body); letter-spacing: 0.04em; text-transform: uppercase;
  background: #e8ecef; color: var(--slate-dark);
}
.regime-card.featured .regime-tag { background: var(--fore-deep); color: #fff; }
.regime-head { display: flex; flex-direction: column; gap: 3px; align-self: start; }
.regime-card h3 { font: 700 19.5px/1.24 var(--display); color: var(--ink); }
.regime-card .rbench { font-size: 14.5px; color: var(--ink-3); font-weight: 550; }
.regime-box {
  align-self: stretch; background: #fff; border: 1px solid var(--line); border-radius: 7px;
  padding: 13px 14px; font-size: 14.8px; line-height: 1.48; color: var(--ink-2);
}
.regime-card.featured .regime-box { background: var(--soft); }
.regime-box b { color: var(--ink); font-weight: 650; }
.regime-box small {
  display: block; font: 700 11px/1.2 var(--body); letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px;
}
.regime-box.rx { background: var(--fore-bg); border: 1.5px solid var(--fore-border); color: var(--ink); }
.regime-box.rx small { color: var(--fore-deep); }
.regime-box.rx strong { display: block; font: 700 16.5px/1.25 var(--display); color: var(--ink); margin-bottom: 4px; }
.regime-arrow { display: flex; align-items: center; justify-content: center; color: var(--fore-deep); margin: -3px 0; }
.regime-arrow svg { width: 15px; height: 22px; display: block; }
.regime-gain {
  align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; border-radius: 6px; padding: 10px; text-align: center;
  font: 700 13.8px/1.3 var(--display); color: #fff; background: var(--ink);
}
.regime-gain > span { display: block; white-space: nowrap; }
.regime-card.featured .regime-gain { background: var(--fore-deep); }

/* ── BibTeX & Footer ── */
.bib-box { position: relative; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; margin-top: 14px; }
.bib-box pre { font: 450 13.8px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink); overflow-x: auto; }
.copy-btn {
  position: absolute; top: 12px; right: 12px; padding: 6px 12px; border-radius: 5px;
  border: 1px solid #cfd6dc; background: #fff; color: var(--ink-2);
  font: 600 13px/1.2 var(--body); transition: all .15s;
}
.copy-btn:hover { border-color: var(--fore-deep); color: var(--fore-deep); }
.copy-btn.copied { background: var(--fore-deep); border-color: var(--fore-deep); color: #fff; }

.foot { background: #f6f8fa; border-top: 1px solid var(--line); padding: 28px 0 42px; font-size: 15px; color: var(--ink-2); }

/* ── Responsive ── */
@media (max-width: 960px) {
  .two-panel, .viz-grid.quad, .viz-grid.duo, .viz-grid.duo.wide-left, .viz-grid.trio, .viz-grid.fwd, .regime-grid, .algorithm-columns, .result-highlight { grid-template-columns: 1fr; }
  .viz-grid.quad { grid-template-rows: none; grid-auto-flow: row; }
  .viz-panel .chart { max-width: 560px; margin-inline: auto; }
  #vFwdGain { max-width: 240px; margin-inline: 0; }
  .ctx-method-grid { grid-template-columns: 1fr; gap: 12px; }
  .ctx-arrow { transform: rotate(90deg); height: 22px; }
  .algorithm-part + .algorithm-part { border-left: 0; border-top: 1px solid var(--line); }
  .regime-grid { grid-template-rows: none; row-gap: 16px; }
  .regime-card { grid-row: auto; display: flex; flex-direction: column; gap: 12px; }
  .qa-row { grid-template-columns: 1fr; gap: 3px; }
  .step-subtitle { margin-left: 0; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .section-band { padding: 40px 0; }
  .wrap { width: calc(100% - 32px); }
  .nav { padding-inline: 16px; }
  .nav nav { gap: 12px; font-size: 13.5px; }
  .tldr-card, .method-detail { padding: 18px 18px; }
  .f1-row { grid-template-columns: 120px 1fr 74px; }
  .hbar { grid-template-columns: 1fr; gap: 4px; }
  .hbar .name { text-align: left; }
  .fig-card { padding: 14px 12px; }
  .regime-gain > span { white-space: normal; }
}
