/* GroupBrief project page */

:root {
  --bg: #ffffff;
  --band: #f5f8fa;
  --surface: #ffffff;
  --surface-2: #f1f5f8;
  --ink: #16232c;
  --muted: #475763;
  --soft: #687985;
  --line: #e2e8ed;
  --line-strong: #cdd7de;

  --blue: #1f6391;
  --blue-2: #2f80b5;
  --blue-tint: #e9f2f8;
  --green: #4d7a38;
  --green-tint: #edf4e8;
  --orange: #bf6d25;
  --orange-tint: #fbf0e4;
  --bar: #b3bfc8;
  --grid: #e8edf1;

  --shadow-sm: 0 1px 2px rgba(15, 34, 48, .05);
  --shadow: 0 1px 2px rgba(15, 34, 48, .04), 0 10px 30px -12px rgba(15, 34, 48, .16);
  --shadow-lg: 0 2px 4px rgba(15, 34, 48, .04), 0 24px 60px -24px rgba(15, 34, 48, .28);
  --radius: 14px;
  --radius-sm: 9px;

  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --display: "Raleway", var(--font);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1418;
  --band: #121a1f;
  --surface: #172128;
  --surface-2: #1c2830;
  --ink: #e8eff3;
  --muted: #b4c3cc;
  --soft: #8d9fac;
  --line: #24323b;
  --line-strong: #31424d;

  --blue: #7dbfe9;
  --blue-2: #a0d2f2;
  --blue-tint: #183041;
  --green: #a6c991;
  --green-tint: #1b2a1e;
  --orange: #eba866;
  --orange-tint: #33251a;
  --bar: #5d7180;
  --grid: #22303a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 32px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .25), 0 26px 60px -26px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.68 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; cursor: pointer; color: var(--ink); -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
p { margin: 0 0 16px; color: var(--muted); }
strong { font-weight: 650; color: var(--ink); }
h1, h2, h3 { font-family: var(--display); font-feature-settings: "lnum" 1; line-height: 1.2; color: var(--ink); }
h2 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 700; letter-spacing: -.015em; margin: 0 0 16px; }
h3 { font-size: 19px; font-weight: 700; letter-spacing: -.005em; margin: 0 0 8px; }
code, pre { font-family: var(--mono); }
code { font-size: .86em; padding: .08em .36em; border-radius: 5px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); white-space: nowrap; }
pre code { padding: 0; border: 0; background: none; color: inherit; white-space: pre; }
sup { font-size: 10px; color: var(--soft); margin-left: 1px; }
.method { font-variant: small-caps; letter-spacing: .02em; font-weight: 600; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.text-column { max-width: 820px; margin: 0 auto; padding: 0 28px; }
.section { padding: 96px 0; position: relative; }
.band { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-heading { max-width: 780px; margin: 0 auto 44px; text-align: center; }
.section-heading > p:last-child { margin-bottom: 0; font-size: 18px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  color: var(--blue); margin: 0 0 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; opacity: .6; }
.section-heading .eyebrow::after { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; opacity: .6; }
.muted-small { font-size: 13px; color: var(--soft); }

.skip-link { position: fixed; top: -60px; left: 16px; z-index: 100; background: var(--surface); padding: 9px 15px; border-radius: 8px; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }

/* ---------- Progress + top bar ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 40; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--blue), var(--green) 60%, var(--orange)); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.topbar.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.topbar-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 62px; padding: 0 28px; }
.wordmark { display: flex; align-items: center; gap: 10px; font: 700 18px/1 var(--display); color: var(--ink); letter-spacing: -.01em; }
.wordmark:hover { text-decoration: none; }
.wordmark img { display: block; }
.nav { display: flex; gap: 4px; font-size: 13.5px; font-weight: 550; }
.nav a { color: var(--muted); padding: 7px 11px; border-radius: 999px; transition: color .2s, background-color .2s; }
.nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--blue); background: var(--blue-tint); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.pill-link {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px;
  border-radius: 999px; font-size: 13px; font-weight: 650; color: var(--ink);
  border: 1px solid var(--line-strong); background: var(--surface);
}
.pill-link:hover { text-decoration: none; border-color: var(--blue); color: var(--blue); }
.icon-button {
  width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); display: grid; place-items: center; flex: none; padding: 0;
  transition: border-color .2s, color .2s;
}
.icon-button:hover { border-color: var(--blue); color: var(--blue); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; text-align: center; padding: 64px 0 64px; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: -20% -10% 30%;
  background:
    radial-gradient(42% 46% at 18% 22%, color-mix(in srgb, var(--blue-2) 20%, transparent), transparent 70%),
    radial-gradient(36% 42% at 84% 16%, color-mix(in srgb, var(--orange) 15%, transparent), transparent 70%),
    radial-gradient(40% 40% at 56% 62%, color-mix(in srgb, var(--green) 12%, transparent), transparent 72%);
  filter: blur(8px);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 14%, transparent) 1px, transparent 0);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(70% 55% at 50% 22%, #000 10%, transparent 75%);
  mask-image: radial-gradient(70% 55% at 50% 22%, #000 10%, transparent 75%);
  opacity: .55;
}
.microsoft-mark { display: block; width: 26px; height: 26px; margin: 0 auto 18px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 550; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm);
  margin-bottom: 26px;
}
.hero-badge:hover { text-decoration: none; color: var(--ink); border-color: var(--blue); }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 22%, transparent); }
.badge-sep { color: var(--soft); }
.hero h1 {
  font-size: clamp(36px, 5.4vw, 62px); font-weight: 800; letter-spacing: -.025em; line-height: 1.08;
  margin: 0 auto 22px; max-width: 1000px;
}
.title-accent {
  background: linear-gradient(100deg, var(--blue) 10%, var(--blue-2) 45%, var(--green) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-tagline { font-size: clamp(18px, 2vw, 21px); line-height: 1.55; color: var(--muted); max-width: 720px; margin: 0 auto 30px; }
.authors { list-style: none; padding: 0; max-width: 940px; margin: 0 auto 10px; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 20px; font-size: 16.5px; font-weight: 500; }
.authors li { white-space: nowrap; }
.affiliations { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 22px; font-size: 14.5px; margin-bottom: 4px; }
.affiliations span { white-space: nowrap; }
.affiliations sup { margin-right: 3px; }
.author-note { font-size: 12.5px; color: var(--soft); margin: 0; }
.hero-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 30px 0 46px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px;
  border: 1px solid var(--line-strong); font-size: 14.5px; font-weight: 600; line-height: 1.2;
  text-decoration: none !important;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s, border-color .18s, color .18s;
}
.button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.secondary { background: var(--surface); color: var(--ink); }
.secondary:hover { border-color: var(--blue); color: var(--blue); }

.paper-figure { margin: 0; }
.hero-figure { max-width: 1120px; margin: 0 auto; }
.figure-zoom {
  position: relative; display: block; width: 100%; padding: 16px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  box-shadow: var(--shadow); cursor: zoom-in;
  transition: box-shadow .25s ease, border-color .25s ease, transform .25s ease;
}
.hero-figure .figure-zoom { padding: 20px; box-shadow: var(--shadow-lg); }
.figure-zoom:hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); box-shadow: var(--shadow-lg); }
.figure-zoom img { display: block; width: 100%; height: auto; }
:root[data-theme="dark"] .figure-zoom { border-color: var(--line-strong); }
.zoom-hint {
  position: absolute; right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(22, 35, 44, .78); color: #fff;
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s;
}
.zoom-hint svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.figure-zoom:hover .zoom-hint, .figure-zoom:focus-visible .zoom-hint { opacity: 1; transform: none; }
figcaption { text-align: left; color: var(--soft); font-size: 14px; line-height: 1.62; padding: 14px 4px 0; max-width: 980px; }
figcaption strong { color: var(--ink); }
.hero figcaption { margin: 0 auto; text-align: center; }

.highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 44px; text-align: left; }
.highlight {
  padding: 22px 22px 20px; border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.highlight p { font-size: 14.5px; line-height: 1.6; margin: 0; }
.highlight .highlight-value { font: 800 34px/1.1 var(--display); font-feature-settings: "lnum" 1, "tnum" 1; color: var(--blue); margin-bottom: 10px; letter-spacing: -.02em; }
.highlight-value small { font: 600 14px var(--font); color: var(--soft); letter-spacing: 0; }
.highlight.accent { background: linear-gradient(160deg, var(--orange-tint), color-mix(in srgb, var(--surface) 85%, transparent) 70%); border-color: color-mix(in srgb, var(--orange) 30%, var(--line)); }
.highlight.accent .highlight-value { color: var(--orange); }

/* ---------- Abstract ---------- */
#abstract { padding-top: 64px; }
#abstract h2 { margin-bottom: 26px; }
.abstract-body p { font-size: 17.5px; line-height: 1.78; color: var(--muted); }
.abstract-body p:first-child::first-letter {
  float: left; font: 800 58px/.9 var(--display); color: var(--blue); padding: 6px 10px 0 0;
}

/* ---------- Benchmark ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 18px 22px; text-align: center; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat strong { display: block; font: 800 44px/1.05 var(--display); font-feature-settings: "lnum" 1, "tnum" 1; letter-spacing: -.02em; color: var(--blue); }
.stat span { display: block; font-size: 13.5px; margin-top: 10px; color: var(--muted); }

.composition { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 26px 28px; box-shadow: var(--shadow-sm); }
.composition-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.composition-head h3 { font-size: 16px; margin: 0; }
.composition-bar { display: flex; height: 34px; border-radius: 10px; overflow: hidden; gap: 3px; margin-bottom: 24px; }
.seg { width: var(--w); display: flex; align-items: center; padding: 0 12px; color: #fff; font-size: 12.5px; transform-origin: left; }
.seg b { font-weight: 650; font-feature-settings: "tnum" 1; }
.seg.past { background: var(--blue); }
.seg.friction { background: var(--orange); }
.seg.opportunity { background: var(--green); }
:root[data-theme="dark"] .seg { color: #0e1418; }
.categories { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.category { --c: var(--blue); padding-left: 16px; border-left: 3px solid var(--c); }
.category.friction { --c: var(--orange); }
.category.opportunity { --c: var(--green); }
.category-count { display: block; font-size: 12.5px; font-weight: 650; color: var(--c); margin-bottom: 4px; font-feature-settings: "tnum" 1; }
.category h3 { font-size: 18px; margin-bottom: 6px; }
.category p { font-size: 15px; margin: 0; line-height: 1.6; }

.domains { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.domain { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.domain h3 { font-size: 16px; margin: 0 0 2px; }
.domain p { font-size: 12.5px; line-height: 1.5; margin: 0; color: var(--soft); font-feature-settings: "tnum" 1; }
.domain p span { display: block; }
.domain-icon { flex: none; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-tint); color: var(--blue); }
.domain-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.scope-note { font-size: 13.5px; color: var(--soft); line-height: 1.65; margin: 28px auto 0; max-width: 900px; text-align: center; }

/* ---------- Method ---------- */
.pipeline { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: none; }
.pipe-step { position: relative; padding: 24px 22px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.pipe-step:not(:last-child)::after {
  content: ""; position: absolute; top: 50%; right: -13px; width: 10px; height: 10px; z-index: 1;
  border-top: 2px solid var(--line-strong); border-right: 2px solid var(--line-strong); transform: translateY(-50%) rotate(45deg);
}
.pipe-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 700 14px/1 var(--font); margin-bottom: 14px; }
.pipe-step p { font-size: 15px; margin: 0; line-height: 1.6; }

.concepts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.concept { --c: var(--blue); --t: var(--blue-tint); padding: 22px; border-radius: var(--radius); background: var(--t); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
.concept.dyn { --c: var(--green); --t: var(--green-tint); }
.concept.gap { --c: var(--orange); --t: var(--orange-tint); }
.concept h3 { color: var(--c); font-size: 18px; }
.concept p { font-size: 15px; margin: 0; line-height: 1.6; color: var(--muted); }
.concept-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface); color: var(--c); margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.concept-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.eval-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.eval-card { padding: 24px; border-radius: var(--radius); border: 1px dashed var(--line-strong); background: var(--band); }
.eval-card p { font-size: 15px; margin: 0; line-height: 1.6; }
.eval-card .eval-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); margin-bottom: 8px; }

/* ---------- Charts ---------- */
.chart-panel { padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); }
.chart-controls { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-end; margin-bottom: 28px; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
legend { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); margin-bottom: 8px; padding: 0; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.segmented button { border: 0; background: transparent; color: var(--muted); border-radius: 999px; font-size: 13.5px; font-weight: 550; padding: 7px 15px; line-height: 1.3; min-height: 34px; transition: background-color .2s, color .2s, box-shadow .2s; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--blue); font-weight: 650; box-shadow: 0 1px 3px rgba(15, 34, 48, .12), 0 0 0 1px var(--line); }
:root[data-theme="dark"] .segmented button[aria-pressed="true"] { background: var(--blue-tint); box-shadow: none; }
.segmented code { background: none; border: 0; padding: 0; color: inherit; }
.chart-heading { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.chart-heading h3 { font-size: 18px; margin: 0; }
.scope-tag { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); white-space: nowrap; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }
.chart-context { font-size: 13px; margin: 6px 0 24px; color: var(--soft); }

.bar-chart { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: center; border-radius: 8px; }
.bar-label { text-align: right; font-size: 13.5px; line-height: 1.3; color: var(--muted); display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.bar-label.model { font: 12.5px var(--mono); }
.bar-row.ours .bar-label { color: var(--ink); font-weight: 650; }
.ours-badge { font: 700 9.5px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--blue); border-radius: 999px; padding: 4px 6px; }
:root[data-theme="dark"] .ours-badge { color: #0e1418; }
.bar-track {
  height: 28px; position: relative;
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), var(--grid) calc(25% - 1px), var(--grid) 25%);
  border-left: 1px solid var(--line-strong);
}
.bar-fill { position: absolute; inset: 5px auto 5px 0; width: 0; background: var(--bar); border-radius: 0 6px 6px 0; transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.bar-chart.models .bar-fill { background: color-mix(in srgb, var(--blue) 62%, var(--bar)); }
.bar-row.ours .bar-fill { background: linear-gradient(90deg, var(--blue), var(--blue-2)); box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--blue) 60%, transparent); }
.bar-row.ours { background: color-mix(in srgb, var(--blue-tint) 70%, transparent); }
.bar-value { position: absolute; top: 50%; left: 0; transform: translate(8px, -50%); font-size: 12.5px; font-weight: 550; font-variant-numeric: tabular-nums; line-height: 1; color: var(--ink); transition: left .7s cubic-bezier(.2, .8, .2, 1); white-space: nowrap; }
.bar-value.best::after { content: "best"; margin-left: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--green); }
.chart-axis { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; margin-top: 8px; }
.chart-axis > div { display: flex; justify-content: space-between; border-top: 1px solid var(--line-strong); color: var(--soft); font-size: 11.5px; padding-top: 6px; font-variant-numeric: tabular-nums; }
.axis-title { text-align: center; font-size: 12.5px; color: var(--soft); margin: 8px 0 0; padding-left: 166px; }

.results-details { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
summary { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); font-size: 14px; font-weight: 650; cursor: pointer; list-style: none; user-select: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s; margin-right: 2px; }
details[open] > summary::before { transform: rotate(45deg) translate(-2px, -1px); }
details[open] > summary { margin-bottom: 18px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; text-align: right; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-size: 13px; color: var(--soft); padding: 12px 14px; caption-side: top; }
th, td { padding: 10px 14px; border-top: 1px solid var(--line); white-space: nowrap; }
thead th { font-weight: 650; background: var(--surface-2); color: var(--ink); font-size: 12.5px; }
tbody th { font-weight: 500; }
th:first-child, td:first-child { text-align: left; }
tbody tr:hover { background: var(--surface-2); }
tr.highlight { background: var(--blue-tint) !important; }
tr.highlight th { font-weight: 700; color: var(--blue); }
td.best { font-weight: 700; color: var(--ink); }
.note { font-size: 12.5px; margin: 14px 0 0; color: var(--soft); }

.takeaways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.takeaway { padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--ink); box-shadow: var(--shadow-sm); }
.takeaway-label { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); margin-bottom: 10px; }
.takeaway h3 { font-size: 17px; }
.takeaway p:last-child { font-size: 14.5px; margin: 0; line-height: 1.6; }

.figure-details { margin-top: 28px; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.figure-details[open] { padding-bottom: 24px; }
.figure-details .paper-figure + .paper-figure { margin-top: 28px; }
.figure-details .figure-zoom { box-shadow: none; }

/* ---------- Optimization ---------- */
.search-loop { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.search-loop li { position: relative; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.search-loop li:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -12px; width: 9px; height: 9px; z-index: 1; border-top: 2px solid var(--line-strong); border-right: 2px solid var(--line-strong); transform: translateY(-50%) rotate(45deg); }
.search-loop h3 { font-size: 17px; margin: 10px 0 6px; }
.search-loop p { font-size: 14px; line-height: 1.55; margin: 0; }
.loop-tag { display: inline-block; font-size: 11.5px; font-weight: 650; color: var(--blue); background: var(--blue-tint); border-radius: 999px; padding: 3px 10px; font-feature-settings: "tnum" 1; }
.search-loop .loop-final { border-color: color-mix(in srgb, var(--orange) 40%, var(--line)); background: linear-gradient(160deg, var(--orange-tint), var(--surface) 75%); }
.loop-final .loop-tag { color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); }

.opt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 28px; align-items: center; margin-top: 26px; }
.optimization-chart { display: grid; gap: 18px; }
.opt-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; align-items: center; }
.opt-label { font-size: 14px; text-align: right; line-height: 1.35; color: var(--muted); }
.opt-label.optimized { color: var(--ink); font-weight: 650; }
.opt-track { height: 36px; position: relative; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), var(--grid) calc(25% - 1px), var(--grid) 25%); border-left: 1px solid var(--line-strong); }
.opt-fill { position: absolute; height: 24px; top: 6px; left: 0; width: 0; background: var(--bar); border-radius: 0 7px 7px 0; transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.opt-fill.base { background: linear-gradient(90deg, var(--blue), var(--blue-2)); }
.opt-fill.optimized { background: linear-gradient(90deg, color-mix(in srgb, var(--orange) 85%, #000), var(--orange)); box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--orange) 65%, transparent); }
.opt-dot { position: absolute; width: 16px; height: 16px; top: 10px; left: 0; border-radius: 50%; background: var(--blue); transform: translateX(-50%); box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line-strong); transition: left .7s cubic-bezier(.2, .8, .2, 1); }
.opt-dot.optimized { background: var(--orange); }
.opt-value { position: absolute; top: 50%; left: 0; transform: translate(12px, -50%); font-size: 14.5px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; transition: left .7s cubic-bezier(.2, .8, .2, 1); white-space: nowrap; }
.opt-value.flip { transform: translate(calc(-100% - 16px), -50%); }
.opt-value.on-bar { transform: translate(calc(-100% - 10px), -50%); color: #fff; }
:root[data-theme="dark"] .opt-value.on-bar { color: #0e1418; }
.optimization-axis { margin: 8px 0 0 198px; display: flex; justify-content: space-between; border-top: 1px solid var(--line-strong); padding-top: 6px; font-size: 11.5px; color: var(--soft); font-variant-numeric: tabular-nums; }
.delta-card { text-align: center; padding: 22px 16px; border-radius: var(--radius); background: var(--orange-tint); border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent); }
.delta-value { font: 800 42px/1 var(--display); font-feature-settings: "lnum" 1, "tnum" 1; color: var(--orange); margin: 0 0 8px; letter-spacing: -.02em; }
.delta-label { font-size: 13px; line-height: 1.45; margin: 0; color: var(--muted); }
.chart-note { text-align: center; font-size: 13px; color: var(--soft); margin: 26px auto 0; max-width: 760px; }
.paper-figure.narrow { max-width: 900px; margin: 32px auto 0; }
.paper-figure.narrow figcaption { margin: 0 auto; }

/* ---------- Case study ---------- */
.compare { display: grid; grid-template-columns: 1fr 1.25fr; gap: 18px; margin-bottom: 32px; align-items: stretch; }
.compare-card { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); padding: 22px 24px; box-shadow: var(--shadow-sm); }
.compare-card header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.compare-card h3 { margin: 0; font-size: 18px; }
.compare-card.initial h3 { color: var(--blue); }
.compare-card.optimized { border-color: color-mix(in srgb, var(--green) 35%, var(--line)); box-shadow: var(--shadow); }
.compare-card.optimized h3 { color: var(--green); }
.score-chip { font: 700 13px/1 var(--font); font-variant-numeric: tabular-nums; padding: 6px 11px; border-radius: 999px; white-space: nowrap; }
.initial .score-chip { color: var(--soft); background: var(--surface-2); border: 1px solid var(--line); }
.initial .score-chip::before { content: "Missed "; font-weight: 550; }
.optimized .score-chip { color: var(--green); background: var(--green-tint); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); }
.optimized .score-chip::before { content: "Covered "; font-weight: 550; }
.compare-item { padding: 14px 0 2px; }
.compare-item + .compare-item { border-top: 1px dashed var(--line); }
.compare-item p { font-size: 15px; line-height: 1.6; margin: 0 0 10px; }
.compare-item .q { display: flex; align-items: center; gap: 9px; font: 700 15.5px/1.3 var(--display); color: var(--ink); margin-bottom: 6px; }
.q-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 700 12px/1 var(--font); flex: none; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 650; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.tag.friction { color: var(--orange); background: var(--orange-tint); }
.tag.opportunity { color: var(--green); background: var(--green-tint); }
.record-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 14px 0 4px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; color: var(--muted); }
.record-label { font-weight: 650; color: var(--blue); }
.record { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.record b { color: var(--ink); font-weight: 650; }
.dots { display: inline-block; height: 9px; width: calc(var(--n) * 14px - 4px); background: repeating-linear-gradient(90deg, var(--blue) 0 10px, transparent 10px 14px); border-radius: 3px; opacity: .75; }

/* ---------- Citation ---------- */
.citation-section { padding-bottom: 88px; }
.citation-box { max-width: 900px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; background: #0f1a21; border: 1px solid #22323c; box-shadow: var(--shadow-lg); }
.code-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 18px; background: #15232c; border-bottom: 1px solid #22323c; }
.code-lang { font: 600 12px var(--mono); color: #8fa6b4; letter-spacing: .04em; }
.copy-button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #2c404c; background: #1b2c37; color: #d9e6ee; border-radius: 8px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; transition: background-color .2s, border-color .2s; }
.copy-button:hover { background: #22394a; border-color: #3d5869; }
.copy-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copy-button.copied { color: #a6d98c; border-color: #3d6b33; }
.citation-box pre { margin: 0; padding: 20px 22px 24px; overflow-x: auto; font-size: 13px; line-height: 1.75; color: #d7e3ea; }
.copy-status { text-align: center; min-height: 20px; font-size: 12.5px; margin: 10px 0 0; color: var(--green); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 30px 0 36px; font-size: 13px; background: var(--band); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand p { margin: 0; color: var(--muted); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--blue); }

.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 25; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  display: grid; place-items: center; padding: 0; opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .25s, transform .25s, border-color .2s, color .2s;
}
.to-top.visible { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { border-color: var(--blue); color: var(--blue); }
.to-top svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Dialog ---------- */
dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); max-width: min(1480px, 95vw); max-height: 94vh; width: max-content; padding: 16px; overflow: auto; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(8, 14, 18, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog[open] { animation: pop .22s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 12px; }
.dialog-toolbar p { font-size: 14px; font-weight: 600; margin: 0; color: var(--ink); }
dialog img { display: block; background: #fff; border-radius: 8px; max-height: 78vh; object-fit: contain; width: 100%; padding: 10px; }
.dialog-hint { text-align: center; font-size: 12.5px; margin: 12px 0 0; color: var(--soft); }
.no-scroll { overflow: hidden; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav a { padding: 7px 8px; }
  .nav a[href="#citation"] { display: none; }
}
@media (max-width: 960px) {
  .nav { display: none; }
  .section { padding: 76px 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .domains { grid-template-columns: repeat(2, 1fr); }
  .search-loop { grid-template-columns: repeat(2, 1fr); }
  .search-loop li:nth-child(2)::after { display: none; }
  .opt-layout { grid-template-columns: 1fr; }
  .delta-card { display: flex; align-items: baseline; justify-content: center; gap: 12px; padding: 16px; }
  .delta-value { font-size: 32px; margin: 0; }
  .compare { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap, .text-column { padding: 0 20px; }
  .topbar-inner { padding: 0 16px; min-height: 56px; }
  .section { padding: 60px 0; }
  .section-heading { margin-bottom: 32px; }
  .section-heading > p:last-child { font-size: 16.5px; }
  .hero { padding: 44px 0 60px; }
  .desktop-break { display: none; }
  .hero-badge { font-size: 12px; margin-bottom: 20px; }
  .authors { font-size: 14.5px; gap: 3px 14px; }
  .affiliations { font-size: 13px; gap: 2px 14px; }
  .hero-links { margin: 24px 0 34px; gap: 8px; }
  .button { min-height: 40px; padding: 8px 16px; font-size: 14px; }
  .figure-zoom, .hero-figure .figure-zoom { padding: 8px; border-radius: 10px; }
  figcaption { font-size: 13px; }
  .highlights, .pipeline, .concepts, .eval-cards, .takeaways, .categories { grid-template-columns: 1fr; }
  .highlights { gap: 12px; margin-top: 32px; }
  .pipe-step:not(:last-child)::after { top: auto; bottom: -12px; right: 50%; transform: translateX(50%) rotate(135deg); }
  .abstract-body p { font-size: 16.5px; text-align: left; }
  .abstract-body p:first-child::first-letter { font-size: 48px; }
  .stat strong { font-size: 36px; }
  .stat { padding: 20px 12px 18px; }
  .composition { padding: 20px 18px; }
  .seg { padding: 0 8px; font-size: 11.5px; }
  .domains { grid-template-columns: 1fr 1fr; gap: 10px; }
  .domain { padding: 12px; gap: 10px; }
  .domain-icon { width: 36px; height: 36px; }
  .domain h3 { font-size: 15px; }
  .domain p { font-size: 11.5px; }
  .chart-panel { padding: 20px 16px; border-radius: var(--radius); }
  .chart-controls { gap: 14px; margin-bottom: 22px; }
  .segmented button { font-size: 12.5px; padding: 6px 11px; }
  .bar-row, .chart-axis { grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
  .bar-label { font-size: 12px; }
  .bar-label.model { font-size: 11px; }
  .bar-value { font-size: 11.5px; }
  .bar-value.best::after { display: none; }
  .ours-badge { display: none; }
  .axis-title { padding-left: 122px; }
  .chart-context { font-size: 12px; }
  .search-loop { grid-template-columns: 1fr; }
  .search-loop li::after { display: none; }
  .opt-row { grid-template-columns: 120px minmax(0, 1fr); gap: 10px; }
  .opt-label { font-size: 12.5px; }
  .opt-value { font-size: 12.5px; transform: translate(9px, -50%); }
  .optimization-axis { margin-left: 130px; }
  .delta-card { flex-direction: column; align-items: center; gap: 4px; }
  .citation-box pre { font-size: 11px; padding: 16px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-links { gap: 14px; }
  .to-top { right: 14px; bottom: 14px; }
  .compare-card { padding: 18px; }
}
@media (max-width: 440px) {
  .pill-link { display: none; }
  .hero-links { display: grid; grid-template-columns: 1fr 1fr; max-width: 320px; margin-left: auto; margin-right: auto; }
  .segmented { border-radius: 18px; }
  .opt-value.on-bar { transform: translate(calc(-100% - 8px), -50%); }
  .wordmark { font-size: 16px; }
  .hero h1 { font-size: 33px; }
  .hero-tagline { font-size: 17px; }
  .wrap, .text-column { padding: 0 16px; }
  .domains { grid-template-columns: 1fr; }
  .chart-panel { padding: 18px 12px; }
  .chart-heading { flex-wrap: wrap; gap: 8px; }
  .chart-heading h3 { font-size: 15.5px; }
  .segmented button { padding: 6px 9px; }
  .bar-row, .chart-axis { grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }
  .bar-label.model { font-size: 10px; }
  .axis-title { padding-left: 104px; }
  .opt-row { grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }
  .opt-label { font-size: 11.5px; }
  .optimization-axis { margin-left: 104px; }
  .stat strong { font-size: 30px; }
  .seg b { display: none; }
}

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

@media print {
  .topbar, .progress, .hero-links, .chart-controls, .icon-button, .figure-details, footer, dialog, .to-top, .hero-bg { display: none; }
  .js .reveal { opacity: 1; transform: none; }
  .section { padding: 24px 0; }
  .band { background: #fff; }
  .figure-zoom { border: 0; box-shadow: none; }
  body { font-size: 11pt; }
  .chart-panel, .compare, .citation-box { break-inside: avoid; }
}
