/* ==========================================================================
   MT-OPSD project page
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-2: #f5f7fa;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --muted: #8390a3;
  --line: #e4e8ee;
  --line-2: #cfd6e0;

  --accent: #2f55d4;          /* MT-OPSD */
  --accent-soft: #e9eefc;
  --teacher: #4f78b0;         /* matches method figure: clean / teacher */
  --teacher-soft: #e3ebf6;
  --student: #c8625a;         /* matches method figure: rollout / student */
  --student-soft: #f7e3e0;
  --gold: #a9832f;            /* curriculum */
  --gold-soft: #f5ecd6;
  --good: #2f8a57;
  --bad: #c9432f;

  --series-ours: #2f55d4;
  --series-base: #e8743b;
  --series-ctx: #b4bcc8;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 28px rgba(15, 23, 42, .06);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .04), 0 24px 60px rgba(15, 23, 42, .10);

  --serif: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --w: 1120px;
  --w-text: 760px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1017;
    --bg-2: #121822;
    --surface: #161d28;
    --ink: #e9eef6;
    --ink-2: #b2bccb;
    --muted: #7b8698;
    --line: #222b38;
    --line-2: #2e3949;
    --accent: #6f8dff;
    --accent-soft: #19244a;
    --teacher: #7ea3d8;
    --teacher-soft: #1b2635;
    --student: #e48a81;
    --student-soft: #36201e;
    --gold: #d2ae5c;
    --gold-soft: #2f2716;
    --good: #5cc28a;
    --bad: #ef7b67;
    --series-ours: #6f8dff;
    --series-base: #f0854f;
    --series-ctx: #556070;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 60px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1017;
  --bg-2: #121822;
  --surface: #161d28;
  --ink: #e9eef6;
  --ink-2: #b2bccb;
  --muted: #7b8698;
  --line: #222b38;
  --line-2: #2e3949;
  --accent: #6f8dff;
  --accent-soft: #19244a;
  --teacher: #7ea3d8;
  --teacher-soft: #1b2635;
  --student: #e48a81;
  --student-soft: #36201e;
  --gold: #d2ae5c;
  --gold-soft: #2f2716;
  --good: #5cc28a;
  --bad: #ef7b67;
  --series-ours: #6f8dff;
  --series-base: #f0854f;
  --series-ctx: #556070;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 60px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
b, strong { font-weight: 600; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
.wrap-text { max-width: var(--w-text); margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  height: 56px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transform: translateY(-100%);
  transition: transform .35s ease, border-color .35s ease;
}
.nav.show { transform: none; border-bottom-color: var(--line); }
.nav .brand { font-weight: 700; letter-spacing: -.01em; text-decoration: none; font-size: 15px; }
.nav .brand span { color: var(--accent); }
.nav ul { display: flex; gap: 4px; list-style: none; margin: 0 auto; padding: 0; }
.nav ul a {
  display: block; padding: 6px 12px; border-radius: 999px;
  font-size: 14px; color: var(--ink-2); text-decoration: none;
  transition: background .2s, color .2s;
}
.nav ul a:hover { background: var(--bg-2); color: var(--ink); }
.nav ul a.active { background: var(--ink); color: var(--bg); }
.theme-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2);
  background: transparent; color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center; flex: none;
}
.theme-btn:hover { color: var(--ink); border-color: var(--ink-2); }
.theme-btn svg { width: 16px; height: 16px; }
.hero .theme-btn { position: absolute; top: 20px; right: 24px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 104px 0 40px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 420px at 18% -10%, color-mix(in srgb, var(--teacher) 16%, transparent), transparent 70%),
    radial-gradient(800px 420px at 85% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 75%);
  opacity: .55;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2); box-shadow: var(--shadow);
}
.eyebrow .pill {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff;
}
h1.title {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(34px, 5.2vw, 62px);
  line-height: 1.1;
  letter-spacing: -.03em;
  text-wrap: balance;
  margin: 26px auto 18px;
  max-width: 980px;
}
h1.title em { font-style: normal; color: var(--accent); }
.subtitle {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-2);
  max-width: 700px;
  margin: 0 auto 30px;
}
.authors { font-size: 18px; margin-bottom: 6px; }
.authors a { text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line-2); transition: border-color .2s, color .2s; }
.authors a:hover { color: var(--accent); border-color: var(--accent); }
.authors sup { font-size: 11px; color: var(--muted); margin-left: 1px; }
.authors .sep { color: var(--line-2); margin: 0 10px; }
.affils { font-size: 15px; color: var(--muted); display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.affils sup { margin-right: 3px; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 30px 0 0; }
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: 15px; font-weight: 500; text-decoration: none;
  border: 1px solid var(--ink);
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn .soon {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  padding: 1px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 22%, transparent); color: inherit; opacity: .8;
}
.btn.ghost .soon { background: var(--bg-2); }

/* ---------- sections ---------- */
section { padding: 88px 0; }
section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kicker {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px;
}
h2 {
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(28px, 3.6vw, 42px); line-height: 1.15; letter-spacing: -.025em; text-wrap: balance;
  margin: 0 0 20px;
}
h2 em { font-style: normal; color: var(--accent); }
h3 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 8px; }
.lead { font-size: 19px; color: var(--ink-2); max-width: 760px; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- figure ---------- */
figure { margin: 0; }
.figure {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--line);
  padding: 18px; box-shadow: var(--shadow); overflow: hidden;
}
.figure img { width: 100%; height: auto; border-radius: 8px; cursor: zoom-in; }
figcaption { font-size: 14.5px; color: var(--muted); margin-top: 14px; line-height: 1.6; }
figcaption b { color: var(--ink-2); }

/* ---------- explorer (turn slider) ---------- */
.explorer {
  margin-top: 44px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 22px; text-align: left;
}
.explorer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.explorer-head .t { font-weight: 600; font-size: 15px; }
.explorer-head .t small { display: block; font-weight: 400; color: var(--muted); font-size: 13.5px; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button {
  font: inherit; font-size: 13.5px; border: 0; background: transparent; color: var(--ink-2);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }

.panels { display: grid; gap: 14px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.panel { position: relative; }
.panel .frame {
  position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-2);
  outline: 1px solid var(--line); outline-offset: -1px;
}
.panel .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.panel.ours .frame { outline: 2.5px solid var(--accent); outline-offset: -2.5px; }
.panel .label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13.5px; font-weight: 600; margin-bottom: 8px; min-height: 22px;
}
.panel .label .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel.ours .label .n { color: var(--accent); }
.panel .frame .status { position: absolute; top: 8px; left: 8px; z-index: 2; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.panel .frame .status:empty { display: none; }
.status {
  flex: none; font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; letter-spacing: .02em;
  transition: background .25s, color .25s;
}
.status.ok { background: rgba(236, 248, 240, .92); color: #23784a; }
.status.bad { background: rgba(253, 235, 231, .92); color: #b3381f; }
.status.neutral { background: rgba(255, 255, 255, .85); color: #5f5b53; }

.scrub { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.play {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: var(--ink); color: var(--bg); cursor: pointer; display: grid; place-items: center;
  transition: transform .15s;
}
.play:hover { transform: scale(1.06); }
.play svg { width: 16px; height: 16px; }
.track { flex: 1; min-width: 0; }
.track input[type=range] { width: 100%; margin: 0; accent-color: var(--accent); height: 26px; cursor: pointer; }
.ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding: 0 4px; user-select: none; }
.ticks span { width: 20px; text-align: center; cursor: pointer; transition: color .2s; }
.ticks span.on { color: var(--accent); font-weight: 700; }
.turn-readout { flex: none; font-family: var(--mono); font-size: 13px; color: var(--ink-2); min-width: 78px; text-align: right; }
.turn-readout b { font-size: 22px; color: var(--ink); font-weight: 600; }

.steps > *, .stats > *, .branches > *, .result-cards > *, .charts > *, .split > *, .bench > *, .panels > * { min-width: 0; }

/* ---------- TL;DR stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 20px; box-shadow: var(--shadow);
}
.stat .k { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.stat .v { font-family: var(--serif); font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: -.02em; }
.stat .v .from { color: var(--muted); font-size: 24px; font-weight: 600; }
.stat .v .arrow { color: var(--line-2); font-size: 26px; margin: 0 4px; font-family: var(--sans); }
.stat .v .to { color: var(--accent); }
.stat .d { font-size: 14px; color: var(--ink-2); margin-top: 10px; }

.abstract p { font-size: 18px; color: var(--ink-2); }

/* ---------- problem ---------- */
.split { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; }
.split.rev { grid-template-columns: 1.15fr 1fr; }
.mismatch { display: grid; gap: 12px; margin: 26px 0 8px; }
.flow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  font-size: 14.5px;
}
.flow .tag { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; width: 78px; color: var(--muted); }
.flow .chip { padding: 4px 10px; border-radius: 8px; font-weight: 500; }
.flow .chip.clean { background: var(--teacher-soft); color: var(--teacher); }
.flow .chip.dirty { background: var(--student-soft); color: var(--student); }
.flow .chip.model { background: var(--bg-2); color: var(--ink); border: 1px solid var(--line-2); }
.flow .ar { color: var(--muted); }
.callout {
  border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; margin: 24px 0 0;
  font-family: var(--serif); font-weight: 700; font-size: 21px; line-height: 1.35; color: var(--ink);
}

/* ---------- method ---------- */
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 24px 20px; box-shadow: var(--shadow);
}
.step .num {
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .06em;
  display: inline-block; padding: 3px 9px; border-radius: 999px; margin-bottom: 12px;
}
.step.c1 .num { background: var(--gold-soft); color: var(--gold); }
.step.c2 .num { background: var(--student-soft); color: var(--student); }
.step.c3 .num { background: var(--teacher-soft); color: var(--teacher); }
.step.c4 .num { background: var(--accent-soft); color: var(--accent); }
.step p { color: var(--ink-2); font-size: 15.5px; margin: 0; }
.step .eq { margin: 14px 0 0; padding: 12px 14px; background: var(--bg-2); border-radius: 10px; overflow-x: auto; font-size: 15px; }
.step .eq .katex-display { margin: 0; }
.branches { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.branch { padding: 12px 14px; border-radius: 10px; background: var(--bg-2); font-size: 14.5px; color: var(--ink-2); }
.branch b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.branch .eq { margin: 8px 0 0; padding: 0; background: none; overflow-x: auto; }
.insight {
  margin-top: 28px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center;
  padding: 20px 24px; border-radius: var(--radius); background: var(--ink); color: var(--bg);
}
.insight .ts { display: flex; gap: 8px; }
.insight .ts span { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.insight .ts .t { background: var(--teacher); color: #fff; }
.insight .ts .s { background: var(--student); color: #fff; }
.insight p { margin: 0; font-size: 15.5px; opacity: .92; }

/* ---------- benchmark ---------- */
.bench { display: grid; grid-template-columns: 340px 1fr; gap: 48px; align-items: start; margin-top: 28px; }
.donut { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.donut img { background: #fff; border-radius: 50%; cursor: zoom-in; }
.mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.mini-stats div { background: var(--bg-2); border-radius: 10px; padding: 10px 12px; }
.mini-stats b { display: block; font-family: var(--serif); font-size: 24px; font-weight: 800; line-height: 1.1; }
.mini-stats span { font-size: 12.5px; color: var(--muted); }
.session { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.session-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.session-head b { font-size: 15px; }
.legend-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tchip { font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tchip.local { background: var(--gold-soft); color: var(--gold); }
.tchip.soft { background: color-mix(in srgb, #2a9d8f 16%, transparent); color: #2a9d8f; }
.tchip.hard { background: var(--teacher-soft); color: var(--teacher); }
.session ol { list-style: none; margin: 0; padding: 6px 0; counter-reset: t; }
.session li {
  display: grid; grid-template-columns: 34px 96px 1fr; gap: 10px; align-items: baseline;
  padding: 9px 20px; font-size: 14.5px; color: var(--ink-2); counter-increment: t;
}
.session li:nth-child(even) { background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.session li::before { content: counter(t, decimal-leading-zero); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.metric { padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 12px; font-size: 14.5px; color: var(--ink-2); }
.metric b { color: var(--ink); font-family: var(--mono); font-size: 14px; }

/* ---------- results / charts ---------- */
.result-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.rcard h3 { font-size: 15px; margin-bottom: 14px; }
.rrow { display: grid; grid-template-columns: 62px 1fr; gap: 10px; align-items: center; margin-top: 10px; font-size: 13px; }
.rrow .lab { font-family: var(--mono); font-weight: 600; color: var(--ink-2); font-size: 12px; }
.bar { position: relative; height: 22px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; width: 0; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.bar i.base { background: var(--series-base); }
.bar i.ours { background: var(--series-ours); }
.bar em { position: absolute; top: 50%; transform: translateY(-50%); font-style: normal; font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ink); padding-left: 6px; transition: left 1.1s cubic-bezier(.2,.8,.2,1); left: 0; }
.rsub { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 12px; }
.rsub span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.rsub .b::before { background: var(--series-base); }
.rsub .o::before { background: var(--series-ours); }

.chart-card { margin-top: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); }
.chart-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.chart { position: relative; }
.chart h4 { margin: 10px 0 4px; font-size: 14px; font-weight: 600; }
.chart h4 span { color: var(--muted); font-weight: 400; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-family: var(--mono); font-size: 11px; }
.chart .ctx { fill: none; stroke: var(--series-ctx); stroke-width: 1.5; stroke-dasharray: 3 3; }
.chart .ln { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .dlab { font-family: var(--mono); font-size: 11px; font-weight: 600; fill: var(--ink); }
.chart .dlab.muted { fill: var(--muted); font-weight: 500; }
.chart .hair { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 3; }
.tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--ink); color: var(--bg); border-radius: 10px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.5; min-width: 170px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s;
}
.tip.on { opacity: 1; transform: none; }
.tip .h { font-family: var(--mono); font-size: 11px; opacity: .7; margin-bottom: 4px; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; }
.tip .r i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.tip .r b { font-family: var(--mono); font-weight: 600; }

/* tables */
details.tbl { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
details.tbl summary {
  cursor: pointer; list-style: none; padding: 16px 20px; font-weight: 600; font-size: 15px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
details.tbl summary::-webkit-details-marker { display: none; }
details.tbl summary::after { content: "+"; font-family: var(--mono); font-size: 20px; color: var(--muted); transition: transform .2s; }
details.tbl[open] summary::after { transform: rotate(45deg); }
details.tbl summary small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 8px; }
.tscroll { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: center; white-space: nowrap; }
th { font-weight: 600; color: var(--ink-2); font-size: 12.5px; background: var(--bg-2); }
thead tr:first-child th { border-bottom: 1px solid var(--line); }
td:first-child, th:first-child { text-align: left; }
td { border-bottom: 1px solid var(--line); color: var(--ink-2); font-family: var(--mono); font-size: 12.5px; }
td:first-child { font-family: var(--sans); font-size: 13.5px; color: var(--ink); }
tr.group td { background: var(--bg-2); font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; }
tr.ours td { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--ink); }
tr.ours td:first-child { color: var(--accent); font-weight: 600; }
tr.base td:first-child { font-weight: 600; }
td.best { font-weight: 700; color: var(--ink); }
td.sub { padding-left: 26px; color: var(--ink-2); }

/* table figures */
.tables { margin-top: 20px; }
.tables .seg { margin-bottom: 14px; }
.tables .pane { display: none; }
.tables .pane.on { display: block; animation: fade .35s ease; }
.tfig .figure { padding: 22px; }
.tfig .figure img { border-radius: 0; }
.tfig .tscroll-img { overflow-x: auto; }
.tfig .tscroll-img img { min-width: 560px; }
.abl-table { margin-top: 24px; }
.abl-table .figure { padding: 14px; }

/* ---------- gallery ---------- */
.tabs { display: flex; justify-content: center; margin: 28px 0 22px; }
.gallery .pane { display: none; }
.gallery .pane.on { display: block; animation: fade .35s ease; }
.gallery .tall { max-width: 860px; margin: 0 auto; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- bibtex ---------- */
.bib { position: relative; background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 22px 24px; overflow-x: auto; }
.bib pre { margin: 0; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; }
.copy {
  position: absolute; top: 12px; right: 12px; font: inherit; font-size: 12.5px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); border: 1px solid color-mix(in srgb, var(--bg) 22%, transparent);
}
.copy:hover { background: color-mix(in srgb, var(--bg) 24%, transparent); }

footer { padding: 48px 0 64px; text-align: center; font-size: 13.5px; color: var(--muted); }
footer a { color: var(--ink-2); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(12, 12, 11, .88); backdrop-filter: blur(6px);
  overflow: auto; cursor: zoom-out; padding: 32px;
}
.lightbox.on { display: grid; place-items: center; }
.lightbox img { max-width: min(1800px, 100%); height: auto; background: #fff; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }

/* ---------- reveal ---------- */
.reveal { transform: translateY(14px); transition: transform .7s ease; }
.reveal.in { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .split, .split.rev, .bench { grid-template-columns: 1fr; gap: 32px; }
  .bench .donut { max-width: 420px; margin: 0 auto; width: 100%; }
  .nav ul { display: none; }
  .nav .brand { margin-right: auto; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  section { padding: 64px 0; }
  .wrap, .wrap-text { padding: 0 16px; }
  .hero { padding-top: 76px; }
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px; }
  .stats, .result-cards, .steps, .charts, .metrics { grid-template-columns: 1fr; }
  .branches { grid-template-columns: 1fr; }
  .explorer, .chart-card { padding: 14px; }
  .figure { padding: 8px; border-radius: var(--radius); }
  .ticks span:nth-child(even) { visibility: hidden; }
  .turn-readout { min-width: 0; }
  .session li { grid-template-columns: 26px 1fr; }
  .session li .tchip { grid-column: 2; justify-self: start; }
  .session li .ins { grid-column: 2; }
  .insight { grid-template-columns: 1fr; }
    .authors .sep { margin: 0 6px; }
  .explorer-head { flex-direction: column; align-items: flex-start; }
  .hero .theme-btn { top: 14px; right: 16px; }
}
