/* ==========================================================================
   AVTR project page
   Meta blue accents, with distinct colours for the reasoning routes.
   ========================================================================== */
/* Fonts from the reference site, licensed under SIL OFL; see ../fonts/OFL.txt. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
  font-style: normal; font-weight: 100 450; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2");
  font-style: normal; font-weight: 451 550; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
  font-style: normal; font-weight: 551 900; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-500-normal.woff2") format("woff2");
  font-style: normal; font-weight: 100 550; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-600-normal.woff2") format("woff2");
  font-style: normal; font-weight: 551 900; font-display: swap;
}

:root {
  --ink: #172630;
  --ink-2: #334651;
  --muted: #4f626f;
  --hair: #e0e7f1;
  --hair-2: #d1ddec;
  --panel: #f6f9fe;
  --bg: #ffffff;
  --content-width: 980px;
  --gutter: 24px;
  --content-inner: calc(var(--content-width) - var(--gutter) - var(--gutter));

  --blue: #0064e0;
  --blue-hover: #0052bb;
  --blue-fill: #edf4ff;
  --button-ink: var(--blue);
  --button-border: var(--blue);
  --button-fill: var(--blue-fill);
  --visual: var(--blue);
  --visual-fill: var(--blue-fill);
  --visual-ink: var(--blue-hover); /* visual text on light fills (AA) */
  --textual: #5f6d94;
  --textual-fill: #f0f2f9;
  --textual-ink: #4f5d83;         /* textual text on light fills (AA) */
  --direct: #8a93a3;
  --direct-fill: #f3f5f8;
  --both: #16449c;
  --both-fill: #eaf0fb;
  --ours: var(--blue);
  --correct: #2e9e6b;
  --wrong: #d0583f;
  --question: #416bd5;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(23, 38, 48, .03), 0 8px 24px rgba(23, 38, 48, .045);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink-2);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { color: var(--ink); font-weight: 600; }
code { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
button { font: inherit; }

/* keyboard focus: one consistent ring */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}
.table-wrap:focus-visible, .tab-panel:focus-visible, .bibtex:focus-visible { outline-offset: 4px; border-radius: 6px; }

.container { max-width: var(--content-width); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: 56px 0; }

/* ----------------------------------------------------------- site header */
.skip-link {
  position: fixed; top: 10px; left: 16px; z-index: 40; transform: translateY(-160%);
  padding: 8px 14px; border-radius: 6px; background: var(--blue); color: #fff;
}
.skip-link:focus { transform: none; }
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  background: rgba(255, 255, 255, .72); border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, .94); border-bottom-color: var(--hair);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.header-inner {
  max-width: none; min-height: 72px; padding: 0 clamp(24px, 3vw, 44px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 14px; flex-shrink: 0; color: var(--ink); }
.brand:hover { color: var(--blue); text-decoration: none; }
.brand-meta { display: block; width: 106px; height: 22px; flex-shrink: 0; }
.brand-divider { width: 1px; height: 20px; background: var(--hair-2); }
.brand-name { font-size: 1rem; font-weight: 500; letter-spacing: -.01em; }
.section-nav { display: flex; gap: 6px; min-width: 0; }
.section-nav a {
  padding: 7px 13px; border-radius: 999px; color: var(--ink-2);
  font-size: .92rem; font-weight: 500; white-space: nowrap; transition: color .2s, background .2s;
}
.section-nav a:hover, .section-nav a:focus-visible, .section-nav a[aria-current="location"] { color: var(--blue); background: var(--blue-fill); text-decoration: none; }

/* ------------------------------------------------------------------ hero */
.hero {
  text-align: center; padding: 108px 0 28px;
  background:
    radial-gradient(ellipse 42% 68% at 0% 26%, rgba(231, 234, 251, .65), transparent 82%),
    radial-gradient(ellipse 44% 72% at 100% 6%, rgba(213, 232, 255, .7), transparent 82%),
    linear-gradient(180deg, #fafcff 0%, #ffffff 88%);
}
.hero h1 {
  font-family: var(--font-display); font-weight: 500; color: var(--ink); margin: 0;
}
.hero-title { font-size: clamp(26px, 2.5vw, 34px); line-height: 1.25; letter-spacing: -.02em; text-wrap: balance; }
.title-prefix { color: var(--blue); font-weight: 600; white-space: nowrap; }
.authors {
  display: block; text-wrap: balance;
  font-size: 1rem; font-weight: 400; line-height: 1.7; max-width: 100%; margin: 24px auto 0;
}
.author { display: inline-block; margin: 2px 7px; color: var(--ink-2); white-space: nowrap; }
a.author:hover, a.author:focus-visible { color: var(--blue); text-decoration: none; }
.author:hover .author-name, .author:focus-visible .author-name { text-decoration: underline; text-underline-offset: 3px; }
.authors sup { font-size: .62em; line-height: 0; color: var(--muted); margin-left: 2px; }
.affiliations {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px;
  font-size: .84rem; line-height: 1.65; color: var(--muted); max-width: 100%; margin: 16px auto 0;
}
.affiliations sup { font-size: .7em; margin-right: 2px; }
.affiliations .note { flex-basis: 100%; font-size: .78rem; margin-top: 3px; }

.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.links > a, .links > .disabled {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  background: #fff; color: var(--button-ink); border: 1.5px solid var(--button-border);
  font-family: var(--font); font-weight: 500; font-size: .92rem; line-height: 1.65;
  transition: background .2s ease, border-color .2s ease;
}
.links > a:hover, .links > a:focus-visible { background: var(--button-fill); border-color: var(--button-ink); text-decoration: none; }
.links > .disabled { background: rgba(255, 255, 255, .7); border-color: var(--hair); color: var(--muted); cursor: default; }
.links .soon { font-size: .6rem; text-transform: uppercase; letter-spacing: .04em; background: var(--panel); color: var(--muted); padding: 2px 5px; border-radius: 4px; }
.links .hf-icon { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 1.05rem; line-height: 1; }

/* ----------------------------------------------------------------- video */
.video-section { padding-top: 12px; border-top: none !important; }
.video-frame, .figure-link.figure-frame {
  border-radius: 12px; overflow: hidden; background: #fff;
  box-shadow: var(--shadow); border: 1px solid var(--hair);
}
.video-frame video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #fff; cursor: pointer; }
.chapters {
  display: flex; justify-content: safe center; flex-wrap: nowrap; gap: 6px;
  width: 100%; overflow-x: auto; margin-top: 16px; padding: 3px 1px 6px;
  scrollbar-width: thin; scrollbar-color: var(--hair-2) transparent;
}
.chapters button {
  font-family: var(--font); font-size: .82rem; font-weight: 500; color: var(--ink-2);
  flex: 0 0 auto; white-space: nowrap;
  background: #fff; border: 1.5px solid var(--hair-2); border-radius: 999px; padding: 6px 9px; cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.chapters button span { font-family: var(--mono); font-size: .76rem; color: var(--muted); margin-right: 6px; }
.chapters button:hover { border-color: var(--button-ink); color: var(--button-ink); background: var(--button-fill); }
.chapters button.active, .chapters button[aria-current="true"] { border-color: var(--button-ink); color: var(--button-ink); background: var(--button-fill); }
.chapters button.active span, .chapters button[aria-current="true"] span { color: var(--button-ink); }
.chapters .video-toggle { display: inline-flex; align-items: center; justify-content: center; width: 38px; min-width: 38px; padding: 0; background: var(--panel); }
.chapters .video-toggle.is-playing { color: var(--button-ink); border-color: var(--button-ink); background: var(--button-fill); }

/* ------------------------------------------------------------- headings */
.section-title {
  font-family: var(--font-display);
  font-size: 1.875rem; font-weight: 500; line-height: 1.2; letter-spacing: -.02em;
  color: var(--ink); text-align: center; margin-bottom: 24px;
}
.section-lead { font-size: 1.04rem; line-height: 1.75; margin: 0 0 24px; }

/* --------------------------------------------------------------- figures */
.figure { margin: 8px 0 8px; }
.figure img { width: 100%; height: auto; }
.figure-link { display: block; cursor: zoom-in; }
.figure-link.figure-frame img { border-radius: 0; }
.figure figcaption { font-size: .86rem; color: var(--muted); margin-top: 16px; line-height: 1.7; }
.figure figcaption b { color: var(--ink-2); }

/* ---------------------------------------------------------------- method */
.method-block { margin: 32px 0 18px; }
.method-block:last-child, .method-block:last-child > :last-child { margin-bottom: 0; }   /* section padding alone ends it, as elsewhere */
.method-block h3 {
  font-family: var(--font); font-size: 1.25rem; font-weight: 600; color: var(--ink);
  margin: 0 0 12px; letter-spacing: -.01em;
}
.method-block p { margin-bottom: 14px; }
.adaptive-method > .method-block:first-child { margin-top: 32px; }

code.tok {
  font-size: .8em; padding: 2px 7px; border-radius: 6px; border: 1.4px solid currentColor; background: #fff;
  white-space: nowrap; line-height: 1.9;
}
code.tok.visual { color: var(--visual); }
code.tok.textual { color: var(--textual); }
code.tok.muted { color: var(--muted); border-style: dashed; }
code.tok.answer { color: var(--ink-2); border-color: var(--hair-2); }

/* route explorer */
.route-explorer { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 28px; align-items: start; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); padding: 26px; margin: 6px 0 10px; }
.route-grid { display: grid; grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 24px 92px 92px; gap: 10px; }
.axis-label { font-size: .66rem; font-weight: 700; letter-spacing: .12em; color: var(--muted); display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2; white-space: nowrap; }
.axis-label.row { justify-content: flex-end; text-align: right; }
.route-card {
  font-family: var(--font); font-size: 1.02rem; font-weight: 600; border-radius: 12px; cursor: pointer;
  border: 2px solid; background: #fff; transition: transform .15s, box-shadow .2s, background .2s; padding: 6px;
}
.route-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.route-card.direct { color: var(--muted); border-color: var(--direct); }
.route-card.visual { color: var(--visual); border-color: var(--visual); }
.route-card.textual { color: var(--textual); border-color: var(--textual); }
.route-card.both { color: var(--both); border-color: var(--both); }
.route-card.direct[aria-pressed="true"] { background: var(--direct-fill); }
.route-card.visual[aria-pressed="true"] { background: var(--visual-fill); color: var(--visual-ink); }
.route-card.textual[aria-pressed="true"] { background: var(--textual-fill); color: var(--textual-ink); }
.route-card.both[aria-pressed="true"] { background: var(--both-fill); }
.route-card[aria-pressed="true"] { box-shadow: 0 0 0 4px rgba(32,38,54,.06); }
.route-detail { min-height: 227px; }   /* JS raises this to the tallest route so switching never shifts the layout */
.route-name { font-family: var(--font); font-size: 1.35rem; font-weight: 600; margin-bottom: 12px; }
.route-name.direct { color: var(--muted); } .route-name.visual { color: var(--visual); }
.route-name.textual { color: var(--textual); } .route-name.both { color: var(--both); }
.trace { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.q-cells, .t-lines { display: inline-flex; gap: 3px; align-items: center; }
.q-cells i { width: 14px; height: 14px; border-radius: 3px; background: var(--visual); display: inline-block; }
.t-lines { flex-direction: column; gap: 3px; width: 54px; }
.t-lines i { height: 4px; border-radius: 2px; background: #cbd5e5; display: block; width: 100%; }
.t-lines i:last-child { width: 60%; align-self: flex-start; }
.route-desc { font-size: .97rem; }

/* soft target playground */
.playground { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); padding: 24px 26px; margin: 6px 0 10px; }
.pg-title { font-family: var(--font); font-weight: 600; color: var(--ink); margin-bottom: 8px; font-size: .98rem; line-height: 1.5; }
.pg-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 54px; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--hair-2); }
.pg-row:last-child { border-bottom: none; }
.pg-name { font-weight: 600; font-size: .92rem; }
.pg-row.direct .pg-name, .pg-bar-row.direct .pg-name { color: var(--muted); }
.pg-row.visual .pg-name, .pg-bar-row.visual .pg-name { color: var(--visual); }
.pg-row.textual .pg-name, .pg-bar-row.textual .pg-name { color: var(--textual); }
.pg-row.both .pg-name, .pg-bar-row.both .pg-name { color: var(--both); }
.pg-row input[type=range] { width: 100%; accent-color: var(--ink-2); }
.pg-row.direct input { accent-color: var(--direct); } .pg-row.visual input { accent-color: var(--visual); }
.pg-row.textual input { accent-color: var(--textual); } .pg-row.both input { accent-color: var(--both); }
.pg-val { font-family: var(--mono); font-size: .8rem; color: var(--muted); text-align: right; }
.pg-bar-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 54px; align-items: center; gap: 10px; padding: 8px 0; }
/* track = the full 0-100% probability scale; fill width = p x 100% */
.pg-bar-track { height: 14px; background: #fff; border: 1px solid var(--hair); border-radius: 999px; overflow: hidden; }
.pg-bar-fill { height: 100%; border-radius: 999px; transition: width .35s cubic-bezier(.3,.7,.3,1); opacity: .55; }
.pg-bar-fill.top { opacity: 1; }
.pg-bar-fill.direct { background: var(--direct); } .pg-bar-fill.visual { background: var(--visual); }
.pg-bar-fill.textual { background: var(--textual); } .pg-bar-fill.both { background: var(--both); }
.pg-pct { font-family: var(--mono); font-size: .82rem; color: var(--ink-2); text-align: right; }
.pg-note { font-size: .82rem; color: var(--muted); margin-top: 10px; }

/* tables */
.table-wrap { overflow-x: auto; margin: 18px 0 6px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }

/* ---------------------------------------------------------------- results */
.tabs { margin-top: 10px; }
.tab-buttons { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.results-data .tabs { margin-top: 0; }
.results-data .tab-buttons { max-width: var(--content-inner); margin: 0 auto 20px; justify-content: center; }
.tab-buttons button {
  font-family: var(--font); font-size: .9rem; font-weight: 500;
  padding: 7px 16px; border-radius: 999px; border: 1.5px solid var(--hair-2);
  background: #fff; color: var(--ink-2); cursor: pointer; transition: border-color .2s, color .2s, background .2s;
}
.tab-buttons button:hover { border-color: var(--button-border); color: var(--button-ink); background: var(--button-fill); }
.tab-buttons button.active, .tab-buttons button[aria-selected="true"] { background: var(--button-fill); border-color: var(--button-ink); color: var(--button-ink); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.results-table { white-space: nowrap; font-variant-numeric: tabular-nums; }
.results-table th, .results-table td { padding: 9px 10px; text-align: center; border-bottom: 1px solid var(--hair); }
.results-table thead th { font-family: var(--font); font-weight: 600; color: var(--ink); background: var(--panel); font-size: .84rem; }
.results-table thead tr:first-child th { border-bottom: 1px solid var(--hair-2); }
.results-table thead tr:last-child th { border-bottom: 2px solid var(--hair-2); }
.results-table .group-head { font-size: .8rem; letter-spacing: .01em; color: var(--muted); }
.results-table td.model-col, .results-table th.model-col { text-align: left; }
.results-table td.model-col { font-weight: 500; color: var(--ink); }
.results-table .section-row td { font-style: italic; color: var(--muted); font-size: .8rem; background: #fcfcfd; text-align: left; padding: 6px 10px; }
.results-table .ref-row td { color: var(--muted); }
.results-table .ours-row { background: var(--blue-fill); }
.results-table .ours-row td.model-col { color: var(--ours); font-weight: 650; }
.results-table td.best { font-weight: 700; color: var(--ink); }
.results-table .ours-row td.best { color: var(--ours); }

/* ------------------------------------------------------------ qualitative */
.qual-section .tab-panel { margin: 0; }
.qbar { display: flex; justify-content: space-between; gap: 18px; background: var(--panel); border: 1px solid var(--hair); border-left: 4px solid var(--question); border-radius: 10px; padding: 14px 18px; margin-bottom: 18px; }
.qbar-main { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.qbar-label { font-family: var(--font); font-weight: 600; color: var(--question); white-space: nowrap; }
.qbar-q { color: var(--ink); font-size: 1rem; }
.qbar-opts { color: var(--muted); font-size: .92rem; white-space: pre-wrap; }
.qbar-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.qbar-gt { color: var(--visual-ink); font-weight: 650; }
.qbar-src { color: var(--muted); font-size: .8rem; }
.qinputs { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.qinputs figure { text-align: center; min-width: 0; }
.qinputs img { height: 170px; width: auto; border-radius: 8px; border: 1px solid var(--hair); }
.qinputs figcaption { font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-top: 6px; }
.qcards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; }
.qcard { border-radius: 12px; border: 1.5px solid; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.qcard.visual { border-color: var(--visual); background: var(--visual-fill); }
.qcard.textual { border-color: var(--textual); background: var(--textual-fill); }
.qcard.single { margin: 18px 0 0; }
.qcard-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid rgba(32,38,54,.08); background: rgba(255,255,255,.55); }
.qcard-title { font-family: var(--font); font-weight: 600; }
.qcard.visual .qcard-title { color: var(--visual-ink); }
.qcard.textual .qcard-title { color: var(--textual-ink); }
.verdict { font-size: .82rem; font-weight: 650; padding: 2px 10px; border-radius: 999px; }
.verdict.ok { color: #1f7a50; background: #e3f4ea; }
.verdict.bad { color: #b4432b; background: #fbe8e3; }
.qcard-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.qcard-body.row { flex-direction: row; align-items: center; justify-content: space-around; flex-wrap: wrap; }
.qcard-body.row .answer { margin-top: 0; }
.vis-trace { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: center; }   /* wraps rather than clipping */
.vis-trace img { width: 132px; height: 132px; object-fit: cover; border-radius: 8px; border: 2px solid var(--visual); }
.vis-note { text-align: center; font-size: .76rem; color: var(--muted); margin-top: -4px; }
.txt-trace { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); line-height: 1.6; overflow-wrap: anywhere; }
.txt-trace p { margin: 6px 0; }
.omitted { display: block; text-align: center; font-family: var(--font); font-size: .8rem; font-weight: 600; color: var(--muted); background: rgba(255,255,255,.75); border-radius: 999px; padding: 3px 10px; margin: 6px auto; width: fit-content; }
.answer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: auto; }
.answer b { font-size: 1rem; }
.answer.ok b { color: #1f7a50; }
.answer.bad b { color: #b4432b; }
.timeline { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; margin: 6px 0 10px; }
/* the tag is taken out of flow (absolute, centred) so it can never widen its column */
.timeline figure { position: relative; text-align: center; min-width: 0; padding-top: 18px; }
.timeline img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; border: 2px solid transparent; }
.timeline figure.salient img { border-color: var(--visual); }
.timeline figcaption { font-size: .72rem; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.timeline figure.salient figcaption { color: var(--visual-ink); font-weight: 700; }
.salient-tag { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: .6rem; line-height: 16px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--visual-ink); white-space: nowrap; }

/* ----------------------------------------------------------------- bibtex */
.bibtex { position: relative; background: var(--panel); border: 1px solid var(--hair); border-radius: 12px; padding: 18px 20px; overflow-x: auto; }
.bibtex pre { font-family: var(--mono); font-size: .84rem; line-height: 1.6; color: var(--ink); white-space: pre; }
.copy-btn { position: absolute; top: 12px; right: 12px; font-size: .8rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--hair-2); background: #fff; color: var(--ink-2); cursor: pointer; }
.copy-btn:hover { border-color: var(--blue); color: var(--blue); }

.footer { text-align: center; padding: 34px 0 44px; font-size: .85rem; color: var(--muted); background: var(--panel); border-top: 1px solid var(--hair); }

/* ----------------------------------------------------------------- reveal
   Hidden only when JS is running (html.js, set in <head>), so no-JS and failed-JS pages show everything. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .tab-panel.active { animation: none; }
  .links > a:hover, .route-card:hover { transform: none; }
  .links > a, .route-card, .pg-bar-fill, .chapters button, .tab-buttons button, .section-nav a, .site-header { transition: none; }
}

@media print {
  .js .reveal, .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .tab-panel, .tab-panel[hidden] { display: block !important; animation: none !important; margin-bottom: 18px; }
  .site-header, .skip-link, .tab-buttons, .chapters, .copy-btn { display: none !important; }
  .figure, .route-explorer, .playground, .qcards { break-inside: avoid; }
  .table-wrap { overflow: visible; }
}

/* ------------------------------------------------------------- responsive */
/* the visual card needs ~300px for <imagine> [image] </imagine> on one line: stack the two cards until they get that */
@media (max-width: 900px) {
  .qcards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .route-explorer { grid-template-columns: minmax(0, 1fr); }
  .route-grid { max-width: 420px; margin: 0 auto; width: 100%; }
  .playground { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  html { scroll-padding-top: 84px; }
  .header-inner { min-height: 64px; gap: 12px; padding-left: var(--gutter); padding-right: var(--gutter); }
  .brand-divider, .brand-name { display: none; }
  .brand-meta { width: 101px; height: 21px; }
  .section-nav { width: auto; gap: 2px; }
  .section-nav a { padding: 6px 8px; font-size: .82rem; }
  .section-nav a[href="#overview"], .section-nav a[href="#method"], .section-nav a[href="#qualitative"] { display: none; }
  section { padding: 36px 0; }
  .hero { padding: 96px 0 28px; }
  .hero-title { font-size: clamp(22px, 5.7vw, 26px); line-height: 1.3; letter-spacing: -.012em; }
  .authors { font-size: .94rem; margin-top: 20px; line-height: 1.7; }
  .author { margin: 2px 5px; }
  .affiliations { font-size: .76rem; flex-direction: column; gap: 4px; margin-top: 16px; }
  .affiliations .note { font-size: .72rem; margin-top: 4px; }
  .links { margin-top: 24px; gap: 8px; }
  .section-title { font-size: 1.625rem; margin-bottom: 20px; }
  .qbar { flex-direction: column; }
  .qbar-main { flex-direction: column; gap: 4px; }
  .qbar-side { align-items: flex-start; white-space: normal; }
  .qinputs img { height: 110px; }
  .timeline { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 8px; }
  .pg-row { grid-template-columns: 96px minmax(0, 1fr) 50px; }
  .pg-bar-row { grid-template-columns: 96px minmax(0, 1fr) 50px; }
  .route-explorer, .playground { padding: 18px; }
  /* keep the model name visible while the table scrolls sideways */
  .results-table { font-size: .82rem; }
  .results-table .model-col { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: inset -1px 0 0 var(--hair-2);
    white-space: normal; min-width: 9.5rem; max-width: 10rem; line-height: 1.3; }
  .results-table .section-label { position: sticky; left: 10px; display: inline-block; }
  .results-table thead .model-col { background: var(--panel); z-index: 2; }
  .results-table .ours-row .model-col { background: var(--blue-fill); }
  .results-table .ref-row .model-col { background: #fff; }
}
@media (max-width: 420px) {
  .links > a, .links > .disabled { padding: 8px 14px; font-size: .88rem; }
}
@media (max-width: 370px) {
  .vis-trace { flex-direction: column; gap: 6px; }   /* opening tag, image, closing tag stacked on narrow phones */
}
