@charset "UTF-8";

/* ---------- Tokens ---------- */
:root {
  --bg: #fafbf9;
  --bg-tint: #f0f3f1;
  --paper: #ffffff;
  --ink: #1d2733;
  --ink-2: #46515d;
  --muted: #66717d;
  --line: #e1e6e8;
  --line-strong: #c9d1d6;
  --accent: #315bd6;
  --accent-soft: #8ea8ec;
  --accent-bg: #edf2ff;
  --mark: #aab4c0;
  --green: #4b7a6b;
  --green-soft: #cbdcd5;
  --green-bg: #eef4f1;
  --code-bg: #f1f3f5;
  --figure-bg: #ffffff;
  --shadow: 0 8px 30px rgba(20, 35, 50, .05);
  --radius: 16px;
  --max: 1100px;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b;
    --bg-tint: #151a21;
    --paper: #1a2029;
    --ink: #e7eaef;
    --ink-2: #c3c9d2;
    --muted: #97a1ae;
    --line: #2a313c;
    --line-strong: #3a4350;
    --accent: #7c9cff;
    --accent-soft: #4a5f9e;
    --accent-bg: #1e2846;
    --mark: #5f6a78;
    --green: #7fb3a2;
    --green-soft: #2c3d38;
    --green-bg: #18221f;
    --code-bg: #161b22;
    --figure-bg: #f4f5f2;
    --shadow: none;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { line-height: 1.2; font-weight: 650; letter-spacing: -.03em; }
.container { width: min(var(--max), calc(100% - 48px)); margin-inline: auto; }
.reading-width { max-width: 780px; }
.accent-text { color: var(--accent); }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); font-weight: 500; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 20; top: 12px; left: 12px; background: var(--paper); padding: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(14px);
}
.nav-wrap { max-width: var(--max); margin: auto; height: 60px; display: flex; align-items: center; justify-content: space-between; padding-inline: 24px; }
.wordmark { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 17px; letter-spacing: -.03em; color: var(--ink); }
nav { display: flex; gap: 28px; font-size: 13px; font-weight: 600; }
nav a { color: var(--muted); }
nav a:hover, nav a.active { color: var(--accent); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 64px 0 72px; }
.title-acronym { display: block; color: var(--accent); font-size: 76px; line-height: 1.1; letter-spacing: -.055em; font-weight: 800; margin-bottom: 14px; }
.title-expanded { display: block; font-size: 34px; line-height: 1.28; letter-spacing: -.03em; font-weight: 620; max-width: 960px; margin: auto; }

.author-block { margin: 30px auto 0; max-width: 940px; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; font-size: 16.5px; font-weight: 500; }
.authors a { color: var(--ink); background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0 1.5px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .2s, color .2s; }
.authors a:hover { color: var(--accent); background-size: 100% 1.5px; }
.authors sup, .affiliations sup, .equal-note sup { font-size: .68em; margin-left: 1px; color: var(--muted); font-weight: 500; }
.affiliations { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.affiliations sup { margin: 0 3px 0 0; }
.equal-note { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 28px 0 0; }
.button {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 10px 18px;
  border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink);
  transition: background .15s, border-color .15s, transform .15s;
}
.button:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.button svg.fill-icon { fill: currentColor; stroke: none; }
.button .emoji { font-size: 17px; line-height: 1; }
.button.is-placeholder { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); cursor: default; }
.button.is-placeholder:hover { transform: none; background: transparent; color: var(--muted); border-color: var(--line-strong); }
.button.is-placeholder .emoji { filter: grayscale(1); opacity: .75; }
.soon { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; border-radius: 999px; background: var(--code-bg); color: var(--muted); }

.tldr { margin: 40px auto 34px; font-size: 21px; line-height: 1.5; letter-spacing: -.015em; color: var(--muted); }
.tldr em { color: var(--ink-2); }
.tldr strong { color: var(--ink); font-weight: 650; }

.teaser {
  display: grid; grid-template-columns: 1fr 1.15fr; text-align: left; max-width: 900px; margin: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.mini-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mini-sub { font-weight: 500; letter-spacing: .02em; text-transform: none; }
.teaser-visual { padding: 28px 34px; background: var(--green-bg); border-right: 1px solid var(--line); }
.token-flow { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 12px; }
.token-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; width: 124px; flex-shrink: 0; aspect-ratio: 1; }
.token-grid i { border-radius: 1.5px; background: var(--green-soft); aspect-ratio: 1; }
.full-grid i:nth-child(3n) { background: color-mix(in srgb, var(--green) 70%, var(--green-soft)); }
.full-grid i:nth-child(7n) { background: var(--green); }
.sparse-grid i { background: transparent; box-shadow: inset 0 0 0 1px var(--green-soft); }
.sparse-grid i.retained { background: var(--green); box-shadow: none; }
.flow-arrow { font-size: 24px; color: var(--muted); }
.token-labels { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--muted); }
.token-labels > span { display: flex; justify-content: space-between; width: 124px; }
.token-labels b { color: var(--green); }
.teaser-result { padding: 28px 34px; }
.teaser-bar { margin-top: 20px; }
.teaser-bar > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--ink-2); }
.teaser-bar strong { font-size: 24px; letter-spacing: -.04em; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-track { height: 10px; background: var(--code-bg); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.bar-track > span { display: block; width: var(--value); height: 100%; border-radius: 4px; }
.fill-baseline { background: var(--mark); }
.fill-ours { background: var(--accent); }
.teaser-result > p { font-size: 12px; color: var(--muted); margin-top: 20px; }

.headline-stats { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 780px; margin: 40px auto 0; }
.headline-stats > div + div { border-left: 1px solid var(--line); }
.headline-stats strong { font-size: 38px; letter-spacing: -.045em; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.headline-stats strong > span { font-size: 21px; }
.headline-stats p { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- Sections ---------- */
.section { padding-block: 80px; }
.section-tinted { background: var(--bg-tint); border-block: 1px solid var(--line); }
.section-kicker { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; }
.section-heading { text-align: center; margin-bottom: 36px; }
.section h2 { font-size: 34px; letter-spacing: -.035em; }
.section-lead { font-size: 17px; color: var(--muted); max-width: 720px; margin: 12px auto 0; }
.section-lead strong { color: var(--ink); font-weight: 650; }
.abstract-text { margin-top: 22px; font-size: 17px; line-height: 1.8; color: var(--ink-2); }
.abstract-text p + p { margin-top: 16px; }
.abstract-text strong { color: var(--ink); font-weight: 650; }

.paper-figure { margin-top: 8px; }
.figure-zoom { position: relative; display: block; border: 1px solid var(--line); background: var(--figure-bg); border-radius: 12px; padding: 22px; cursor: zoom-in; }
.figure-zoom img { display: block; width: 100%; }
.zoom-hint { position: absolute; right: 12px; bottom: 10px; background: rgba(255, 255, 255, .95); color: #56606b; border: 1px solid #e1e6e8; border-radius: 6px; padding: 3px 8px; font-size: 11px; opacity: 0; transition: opacity .15s; }
.figure-zoom:hover .zoom-hint, .figure-zoom:focus-visible .zoom-hint { opacity: 1; }
figcaption { font-size: 14px; line-height: 1.7; color: var(--muted); padding: 16px 8px 0; max-width: 900px; margin: auto; text-align: center; }

.method-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px; }
.method-steps li { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 22px 22px 20px 60px; }
.step-number { position: absolute; left: 20px; top: 22px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-size: 13px; font-weight: 700; }
.method-steps h3 { font-size: 18px; margin-bottom: 8px; }
.method-steps p { font-size: 14.5px; color: var(--muted); line-height: 1.6; }
.step-meta { display: inline-block; margin-top: 12px; font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.step-meta-plus { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-bg); }
.method-footnotes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.method-footnotes li { font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 12px; }
.method-footnotes li::before { content: "✓"; color: var(--green); font-weight: 700; margin-right: 7px; }

/* ---------- Panels & dot plots ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 34px; }
.selection-panel { max-width: 860px; margin: 48px auto 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-head h3 { font-size: 19px; letter-spacing: -.02em; }
.panel-head p { font-size: 13.5px; color: var(--muted); margin-top: 6px; max-width: 560px; }
.panel-note { font-size: 13.5px; color: var(--muted); margin-top: 18px; }
.panel-note em { color: var(--ink-2); }

.budget-control { display: flex; gap: 3px; padding: 4px; border-radius: 10px; background: var(--code-bg); flex-shrink: 0; }
.budget-control::before { content: "Tokens kept"; align-self: center; font-size: 12px; color: var(--muted); padding: 0 8px 0 6px; }
.budget-control button { min-height: 36px; padding: 6px 14px; font-size: 14px; font-weight: 650; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-variant-numeric: tabular-nums; }
.budget-control button:hover { color: var(--ink); }
.budget-control button[aria-pressed="true"] { background: var(--paper); color: var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }

.dot-plot { --name-w: 200px; --value-w: 96px; --gap: 16px; position: relative; padding-bottom: 30px; }
.dp-row { position: relative; z-index: 1; display: grid; grid-template-columns: var(--name-w) 1fr var(--value-w); gap: var(--gap); align-items: center; height: 40px; border-radius: 8px; }
.dp-row:hover { background: color-mix(in srgb, var(--code-bg) 70%, transparent); }
.dp-name { font-size: 14px; color: var(--ink-2); padding-left: 8px; }
.dp-track { position: relative; height: 100%; }
.dp-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.dp-dot { position: absolute; top: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: var(--mark); box-shadow: 0 0 0 2px var(--paper); transition: left .45s cubic-bezier(.3, .7, .3, 1); }
.dp-value { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.dp-value small { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.dp-scopd .dp-dot { background: var(--accent-soft); }
.dp-ours .dp-dot { background: var(--accent); width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; }
.dp-ours .dp-name, .dp-ours .dp-value { font-weight: 700; color: var(--ink); }
.dp-ours .dp-value small { color: var(--accent); font-weight: 600; }
.dp-layer, .dp-axis { position: absolute; left: calc(var(--name-w) + var(--gap)); right: calc(var(--value-w) + var(--gap)); }
.dp-layer { top: 0; bottom: 30px; }
.dp-grid { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.dp-reference { border-left: 1.5px solid var(--muted); }
.dp-axis { bottom: 0; height: 22px; }
.dp-axis span { position: absolute; transform: translateX(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dp-axis span:last-child:not(:first-child) { transform: translateX(-85%); }
.result-summary { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; font-size: 14.5px; color: var(--ink-2); min-height: 3.4em; }

.benchmark-details { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; }
.benchmark-details summary { list-style: none; padding: 16px 22px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; }
.benchmark-details summary::-webkit-details-marker { display: none; }
.benchmark-details summary span { color: var(--muted); font-size: 20px; line-height: 1; transition: transform .2s; }
.benchmark-details[open] summary span { transform: rotate(45deg); }
.table-description { font-size: 13px; color: var(--muted); padding: 0 22px 12px; }
.table-scroll { overflow-x: auto; padding: 0 22px 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
tbody th { font-weight: 500; }
td.best { font-weight: 700; }
#benchmark-table td:last-child { background: var(--accent-bg); }

/* ---------- Generalization ---------- */
.transfer-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 20px; }
.transfer-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 26px; display: flex; flex-direction: column; }
.card-category { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.transfer-card h3 { font-size: 21px; line-height: 1.3; margin: 10px 0 18px; }
.transfer-values { margin-top: auto; }
.transfer-values > div { font-size: 30px; letter-spacing: -.04em; line-height: 1.2; color: var(--muted); font-variant-numeric: tabular-nums; }
.transfer-values div > span { font-size: 20px; padding: 0 4px; }
.transfer-values strong { font-weight: 700; color: var(--accent); }
.transfer-values p { font-size: 13px; color: var(--muted); margin-top: 8px; }
.mini-table th, .mini-table td { padding: 6px 8px; font-size: 14px; }
.mini-table thead th { font-size: 11.5px; }
.mini-table tbody th { padding-left: 0; }
.mini-table td:last-child { color: var(--accent); font-weight: 700; }
.mini-table tbody tr:last-child > * { border-bottom: 0; }
.card-source { font-size: 12px; color: var(--muted); margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- Citation & footer ---------- */
.citation-box { position: relative; background: var(--code-bg); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; }
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.copy-button { position: absolute; right: 12px; top: 12px; font-size: 12px; font-weight: 600; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 6px 12px; color: var(--ink); }
.copy-button:hover { border-color: var(--accent); color: var(--accent); }
.copy-status { font-size: 13px; min-height: 20px; color: var(--muted); margin-top: 10px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0 30px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

.figure-dialog { max-width: 96vw; width: 1400px; max-height: 94vh; border: 0; border-radius: 12px; padding: 52px 20px 20px; background: #fff; box-shadow: 0 15px 60px rgba(0, 0, 0, .3); }
.figure-dialog::backdrop { background: rgba(16, 32, 53, .72); backdrop-filter: blur(4px); }
.figure-dialog > img { display: block; margin: auto; max-height: calc(90vh - 90px); width: auto; object-fit: contain; }
.dialog-close { position: absolute; right: 10px; top: 8px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f1f3f5; color: #1d2733; font-size: 15px; }
body.dialog-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .desktop-break { display: none; }
  .title-acronym { font-size: 62px; }
  .title-expanded { font-size: 28px; }
  .section { padding-block: 60px; }
  .section h2 { font-size: 29px; }
  .method-steps { grid-template-columns: 1fr; gap: 12px; }
  .transfer-grid { grid-template-columns: 1fr; }
  .panel-head { flex-direction: column; }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .nav-wrap { padding-inline: 16px; height: 54px; }
  nav { gap: 16px; font-size: 12.5px; }
  .hero { padding: 40px 0 52px; }
  .title-acronym { font-size: 52px; }
  .title-expanded { font-size: 22px; }
  .author-block { margin-top: 24px; }
  .authors { font-size: 15px; gap: 2px 14px; }
  .affiliations { font-size: 12.5px; gap: 0 12px; }
  .button { font-size: 13px; padding: 9px 14px; min-height: 40px; }
  .tldr { font-size: 18px; margin: 32px auto 26px; }
  .teaser { grid-template-columns: 1fr; }
  .teaser-visual { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px; }
  .token-flow, .token-labels { max-width: 300px; margin-inline: auto; }
  .token-grid { width: 110px; }
  .token-labels > span { width: 110px; }
  .teaser-result { padding: 22px; }
  .headline-stats strong { font-size: 26px; }
  .headline-stats strong > span { font-size: 15px; }
  .headline-stats p { font-size: 11.5px; padding-inline: 6px; }
  .section { padding-block: 48px; }
  .section h2 { font-size: 25px; }
  .section-lead, .abstract-text { font-size: 15.5px; }
  .figure-zoom { padding: 10px; border-radius: 10px; }
  figcaption { font-size: 13px; text-align: left; padding-inline: 2px; }
  .panel { padding: 20px 16px; }
  .budget-control { width: 100%; }
  .budget-control button { flex: 1; }
  .dot-plot { --name-w: 92px; --value-w: 50px; --gap: 8px; }
  .dp-name { font-size: 12.5px; padding-left: 2px; line-height: 1.2; }
  .dp-value { font-size: 13px; }
  .dp-value small { display: none; }
  #selection-chart { --name-w: 118px; }
  .site-footer { flex-direction: column; gap: 4px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
