/* VLM-UQBench project page. Restrained academic layout: one accent (deep blue), three validated modality
   hues (Image / Text / Cross), one single-hue sequential ramp for heatmaps, neutral grays. */
:root {
  --ink: #1d2125;
  --ink-2: #4a525a;
  --ink-3: #6f7781;
  --rule: #e3e6ea;
  --rule-2: #eef0f3;
  --surface: #ffffff;
  --panel: #f7f8fa;
  --accent: #1f4e8c;
  --accent-ink: #1a4377;
  --accent-wash: #edf2f9;
  --img: #2f6db5; --img-wash: #eaf1fa;
  --txt: #d4683a; --txt-wash: #fbeee7;
  --crs: #5e9e3a; --crs-wash: #eef6e9;
  --warn: #d6604d;          /* loops / rejected / compressed baseline */
  --warn-ink: #b0432f;
  --warn-wash: #fbece9;
  --ref: #5f6670;           /* full-history reference */
  --other: #b8bec6;         /* other methods */
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Google Sans", "Noto Sans", system-ui, sans-serif;
  --w: 960px;
  --w-wide: 1120px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font: 400 17px/1.68 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code { font-family: var(--mono); font-size: .86em; }
img { max-width: 100%; height: auto; display: block; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 6px 12px; border-radius: 6px; z-index: 10; }
.skip-link:focus { left: 12px; }

main { padding: 0 20px; }
main > *, .site-footer { max-width: var(--w); margin-left: auto; margin-right: auto; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 64px 0 18px; }
.kicker { font: 500 13px/1.4 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 14px; }
.hero h1 { font: 500 clamp(28px, 4.4vw, 42px)/1.18 var(--display); letter-spacing: -.01em; margin: 0 auto 22px; max-width: 880px; }
.brand { color: var(--accent); font-weight: 700; }
.nw { white-space: nowrap; }
.authors { font: 400 17px/1.75 var(--sans); max-width: 860px; margin: 0 auto; }
.authors > span { white-space: nowrap; }
.authors a { color: var(--accent); }
.author-name { color: var(--ink); }
.authors sup, .affiliations sup { font-size: .68em; margin-left: 1px; color: var(--ink-2); }
.affiliations { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 10px auto 0; color: var(--ink-2); font-size: 15px; }
.affiliations .note { color: var(--ink-3); }
.venue { margin: 6px 0 2px; font: 500 15px/1.4 var(--display); color: var(--accent); letter-spacing: .01em; }
.resources { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 26px 0 6px; }
.button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; background: var(--ink); color: #fff; font: 500 15px/1 var(--display); transition: background .15s ease; }
.button:hover { background: #3a4048; text-decoration: none; }
.button svg { width: 17px; height: 17px; fill: currentColor; }
.button .hf { font-size: 16px; line-height: 1; }
.button.disabled { background: var(--rule-2); color: var(--ink-3); cursor: not-allowed; }
.button.disabled small { font: 400 12px/1 var(--sans); }

/* ---------- figures ---------- */
.teaser { max-width: var(--w-wide); margin: 26px auto 8px; }
figure { margin: 22px 0; }
figcaption { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; margin-top: 10px; }
.figure-link { display: block; cursor: zoom-in; }
.figure-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.swipe-hint { display: none; color: var(--ink-3); margin-left: 6px; }
@media (max-width: 720px) {
  .figure-scroll .figure-link img { width: 760px; max-width: none; }
  .swipe-hint { display: inline; }
}

.tldr { margin: 26px auto 10px; padding: 16px 20px; border-left: 3px solid var(--accent); background: var(--accent-wash); border-radius: 0 8px 8px 0; font-size: 16.5px; }
.tldr b { color: var(--accent-ink); margin-right: 6px; font-family: var(--display); }

/* ---------- sections ---------- */
section { padding-top: 46px; }
.section-heading h2, .abstract h2 { font: 500 27px/1.25 var(--display); margin: 0 0 14px; letter-spacing: -.005em; }
.abstract h2 { text-align: center; }
.abstract .prose { max-width: 820px; margin: 0 auto; }
.prose p { margin: 0 0 14px; }
.section-intro { color: var(--ink-2); margin: 0 0 18px; }
h3 { font: 500 21px/1.3 var(--display); margin: 30px 0 6px; }
.result { border-top: 1px solid var(--rule); padding-top: 4px; margin-top: 18px; }
.result:first-of-type { border-top: 0; }
.setting { font-size: 14.5px; color: var(--ink-2); margin: 0 0 10px; }
.setting b { color: var(--ink); font-weight: 600; }
.setting span { margin: 0 6px; color: var(--ink-3); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.two-col figure { margin: 8px 0; }
.findings p b, .facts b { font-weight: 600; }
.facts { padding-left: 1.1em; }
.facts li { margin-bottom: 8px; }
.note-line { font-size: 15px; color: var(--ink-2); text-align: center; margin: 6px 0 0; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- method ---------- */
.steps { list-style: none; padding: 0; margin: 4px 0 0; counter-reset: none; }
.steps li { padding: 12px 0 12px 0; border-bottom: 1px solid var(--rule-2); }
.steps li:last-child { border-bottom: 0; }
.steps strong { font-family: var(--display); font-weight: 500; color: var(--ink); }
.method-grid { grid-template-columns: 1.05fr 1fr; }
.equation { overflow-x: auto; margin: 18px 0 8px; padding: 14px 10px; background: var(--panel); border-radius: 10px; text-align: center; }
.katex { font-size: 1.04em; }
.equation .katex { font-size: 1.12em; }

/* ---------- details ---------- */
details { margin: 14px 0 0; border: 1px solid var(--rule); border-radius: 10px; padding: 0 16px; }
details[open] { padding-bottom: 12px; }
summary { cursor: pointer; padding: 11px 0; font: 500 15.5px/1.4 var(--display); color: var(--ink-2); list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; display: inline-block; width: 1.1em; color: var(--accent); font-weight: 700; }
details[open] summary::before { content: "−"; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
table.results { border-collapse: collapse; width: 100%; font-size: 14.5px; font-variant-numeric: tabular-nums; margin: 6px 0; }
table.results th, table.results td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
table.results th:first-child, table.results td:first-child, table.results th:nth-child(2), table.results td:nth-child(2) { text-align: left; }
table.results.compact th { text-align: center !important; }
table.results.compact td { text-align: center; }
table.results.compact td:first-child { text-align: left; }
table.results.compact th:first-child { text-align: left !important; vertical-align: bottom; }
table.results thead th { font: 500 13.5px/1.3 var(--display); color: var(--ink-2); border-bottom: 1px solid var(--rule); background: var(--panel); }
table.results tr.group td { background: var(--surface); color: var(--ink-3); font-style: italic; font-size: 13px; padding-top: 10px; }
table.results tr.row-base td { background: var(--warn-wash); }
table.results tr.row-ours td { background: var(--accent-wash); font-weight: 600; }
table.results td.ours { color: var(--accent-ink); font-weight: 600; }
table.results .delta { color: var(--ink-3); font-weight: 400; font-size: .86em; margin-left: 3px; }
.table-note { font-size: 13.5px; color: var(--ink-3); margin: 6px 0 0; }

/* ---------- segmented control ---------- */
.segmented { display: inline-flex; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--rule); border-radius: 999px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; color: var(--ink-2); font: 500 13.5px/1 var(--display); padding: 8px 13px; border-radius: 999px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,24,28,.12); }
.segmented button:focus-visible, .ctl:focus-visible, .copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- bibtex ---------- */
.bibtex { position: relative; background: var(--panel); border-radius: 10px; padding: 16px 18px; overflow-x: auto; }
.bibtex pre { margin: 0; font: 400 13.5px/1.6 var(--mono); color: var(--ink); }
.copy { position: absolute; top: 10px; right: 10px; border: 1px solid var(--rule); background: #fff; border-radius: 6px; padding: 5px 10px; font: 500 12.5px/1 var(--display); cursor: pointer; color: var(--ink-2); }

/* ---------- footer ---------- */
.site-footer { margin-top: 64px; padding: 26px 20px 48px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 13.5px; text-align: center; }
.site-footer p { margin: 4px 0; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(250,250,250,.97); display: flex; align-items: center; justify-content: center; padding: 28px; z-index: 20; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-close { position: absolute; top: 14px; right: 18px; font-size: 30px; line-height: 1; background: none; border: 0; color: var(--ink-2); cursor: pointer; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding-top: 40px; }
  .authors { font-size: 15.5px; }
}
@media print {
  .resources, .demo-toolbar, .copy, .skip-link { display: none !important; }
  .trace li { opacity: 1; transform: none; }
}

/* ---------- sources / components ---------- */
.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 820px) { .source-grid { grid-template-columns: 1fr; } }
.source-card { border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px 12px; border-top: 3px solid var(--rule); }
.source-card h3 { margin: 10px 0 4px; font-size: 18px; }
.source-card p { margin: 0 0 8px; font-size: 15.5px; }
.source-card .example { font-style: italic; color: var(--ink-2); }
.source-card .action { font-size: 14px; color: var(--ink-3); margin: 0; }
.src-image { border-top-color: var(--img); } .src-text { border-top-color: var(--txt); } .src-cross { border-top-color: var(--crs); }
.tag { display: inline-block; font: 500 12.5px/1 var(--display); padding: 5px 9px; border-radius: 999px; white-space: nowrap; }
.tag-image { background: var(--img-wash); color: #1f4f86; box-shadow: inset 0 0 0 1px #bcd3ee; }
.tag-text { background: var(--txt-wash); color: #9c4520; box-shadow: inset 0 0 0 1px #f0c6b1; }
.tag-cross { background: var(--crs-wash); color: #3d6b24; box-shadow: inset 0 0 0 1px #c6e0b6; }
.components { list-style: none; padding: 0; margin: 6px 0 4px; display: grid; gap: 10px; }
.components li { display: grid; grid-template-columns: 74px 1fr; gap: 14px; align-items: start; padding: 12px 14px; background: var(--panel); border-radius: 12px; }
.components .num { font: 500 30px/1.1 var(--display); color: var(--accent); text-align: right; }
.components strong { font-family: var(--display); font-weight: 500; }
.perturb-list { display: grid; gap: 8px; font-size: 15px; color: var(--ink-2); margin: 4px 0 6px; }
.perturb-list .tag { margin-right: 8px; }
.metric { background: var(--panel); border-radius: 12px; padding: 4px 16px 10px; }
.metric h3 { font-size: 18px; margin-top: 14px; }
.metric .katex-display { margin: .6em 0 .2em; overflow-x: auto; overflow-y: hidden; }
.setting.center { text-align: center; margin-top: 18px; }
h4 { font: 500 17.5px/1.35 var(--display); margin: 24px 0 4px; }
.two-col.tables { align-items: start; }
details.inline { margin-top: 6px; }
table.results caption { caption-side: top; text-align: left; font: 500 13.5px/1.4 var(--display); color: var(--ink-2); padding: 0 0 6px; }
table.results.plain td, table.results.plain th { text-align: left; white-space: normal; }
table.results.compact th, table.results.compact td { text-align: center; }
table.results.compact th:first-child, table.results.compact td:first-child { text-align: left; }

/* ---------- heatmaps ---------- */
.heatmap-wrap { position: relative; margin: 14px 0 6px; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 18px; margin-bottom: 10px; }
.heatmap { overflow-x: auto; }
.heatmap svg { display: block; width: 100%; height: auto; min-width: 640px; }
.heatmap .rl { font: 400 12.5px var(--sans); fill: var(--ink-2); }
.heatmap .gl { font: 500 12.5px var(--display); fill: var(--ink); }
.heatmap .cl { font: 400 11.5px var(--sans); fill: var(--ink-3); }
.heatmap .gline { stroke: var(--rule); stroke-width: 1; }
.heatmap .cell { stroke: #fff; stroke-width: 2; }
.heatmap .na { fill: #f1f2f4; }
.heatmap .v { font: 500 11.5px var(--sans); font-variant-numeric: tabular-nums; pointer-events: none; }
.heatmap .best { fill: none; stroke: var(--ink); stroke-width: 2; pointer-events: none; }
.heatmap g.c:focus { outline: none; }
.heatmap g.c:focus .cell, .heatmap g.c:hover .cell { stroke: var(--ink); stroke-width: 2; }
.heatmap .bandlabel { font: 500 11.5px var(--display); letter-spacing: .03em; }
.scale-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.scale-legend .bar { width: 120px; height: 10px; border-radius: 3px; background: linear-gradient(90deg, #92b5de, #729fd4, #5587c7, #3d6fb5, #2a5898, #1d4377); }
.tooltip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.45; color: var(--ink); box-shadow: 0 4px 14px rgba(20,24,28,.08); max-width: 300px; z-index: 5; }
.tooltip .muted { color: var(--ink-3); }
.urr-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
.hcc-fig .segmented { margin-bottom: 10px; }
.hcc-fig .figure-link img { width: 100%; max-width: 760px; margin: 0 auto; }
@media (max-width: 720px) { .hcc-fig .figure-scroll .figure-link img { width: 680px; max-width: none; } }
#hm-rq3 .heatmap svg { max-width: 720px; margin: 0 auto; }

.two-col > * { min-width: 0; }
.metric .katex-display > .katex { white-space: nowrap; }
.swipe-hint.block { display: none; font-size: 13px; color: var(--ink-3); margin: 4px 0 0; }
@media (max-width: 720px) { .swipe-hint.block { display: block; } .heatmap svg { min-width: 700px; } }
table.results th[scope="row"] { font-weight: 400; text-align: left; white-space: nowrap; }
table.results .muted { color: var(--ink-3); font-size: .88em; }
@media (max-width: 560px) {
  .metric .katex-display .katex { font-size: .86em; }
  .setting.center > span:not(.nw) { display: none; }
  .setting.center > .nw { display: block; white-space: normal; }
}
