/* Vision-as-a-Tool — white paper-demo page */

@font-face {
  font-family: "Inter Paper";
  src: url("assets/fonts/inter-latin.woff2") format("woff2");
  font-style: normal; font-weight: 400 700; font-display: swap;
}

:root {
  --ink: #15171c;
  --ink-2: #3c414b;
  --muted: #6a707c;
  --rule: #e6e7eb;
  --rule-2: #d6d8de;
  --hair: #eef0f3;
  --bg: #ffffff;
  --soft: #f6f7f9;
  --frame: #eef0f3;
  --accent: #3f55c9;
  --peri: #5b6ee1;
  --code: #b4471a;
  --code-soft: #fbefe8;
  --heat-lo: rgb(240, 163, 174);  /* worse (q = 0): light red */
  --heat-mid: rgb(255, 255, 255); /* midpoint (q = 0.5): white */
  --heat-hi: rgb(154, 183, 232);  /* better (q = 1): light blue */
  --heat-grid: #e3e5ea;
  --radius: 12px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.is-locked { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .9em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.sr {
  position: absolute !important; top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.page { max-width: 100%; overflow-x: clip; }
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: #fff; padding: .5rem .9rem; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap { width: min(1200px, 100% - 3rem); margin-inline: auto; }
.wrap.tk-wrap { width: min(800px, 100% - 3rem); }

/* ---------- top nav ---------- */
.top { padding: 1.1rem 0 0; }
.topnav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem 1.15rem;
  width: calc(100% - 2rem); margin: 0 auto;
  font-size: .86rem;
}
.topnav a { color: var(--muted); text-decoration: none; padding: .35rem .1rem; }
.topnav a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  width: min(1180px, 100% - 3rem);
  margin: 0 auto;
  padding: clamp(1.6rem, 3.4vw, 2.8rem) 0 .4rem;
  text-align: center;
}
.title {
  margin: 0 auto; max-width: 980px;
  font-size: clamp(1.75rem, 1.05rem + 3.3vw, 3.55rem);
  font-weight: 750; line-height: 1.08; letter-spacing: -.03em;
  color: var(--ink);
  text-wrap: balance; overflow-wrap: break-word;
}
.title-main {
  color: #4355d6; /* fallback if background-clip:text is unsupported */
  background: linear-gradient(100deg, #4355d6 0%, #6c5bd0 48%, #ec6b14 96%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .title-main { color: transparent; -webkit-text-fill-color: transparent; }
}
.title-main { display: inline; font-weight: 750; letter-spacing: -.04em; }
.title-sub {
  display: inline; margin: 0;
  font-size: .82em; font-weight: 500; letter-spacing: -.03em;
  color: #5d6068;
  color: color-mix(in srgb, var(--ink) 62%, transparent);
}
.hero-q {
  margin: clamp(3.6rem, 5.2vw, 4.6rem) auto calc(clamp(2.5rem, 4vw, 3.8rem) + 20px);
  max-width: 100%;
  font-size: clamp(1.25rem, 2.4vw, 2.05rem);
  line-height: 1.32; font-weight: 500; letter-spacing: -.02em;
  color: var(--ink);
  white-space: nowrap; text-wrap: nowrap;
}
.hq-key {
  color: #3f55c9; font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: .22em; text-decoration-color: rgba(67, 85, 214, .38);
}
.hq-bash {
  font-family: var(--mono); font-weight: 600; font-size: .88em;
  color: #b64d06; background: #fff3eb; border: 1px solid #f5d0b8;
  padding: .06em .42em; border-radius: 7px;
  box-shadow: 0 1px 2px rgba(236, 107, 20, .08);
  white-space: nowrap;
}

/* ---------- authors and paper resources ---------- */
.authors {
  display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem 1rem;
  list-style: none; max-width: 1080px; padding: 0; margin: 1.5rem auto 0;
  font-family: "Inter Paper", var(--sans); font-size: clamp(.94rem, 1.3vw, 1.05rem);
  font-weight: 400; line-height: 1.75; letter-spacing: 0; color: var(--ink);
}
.authors li { white-space: nowrap; }
.authors sup, .affiliation > sup { margin-left: .12rem; font-size: .65em; color: var(--accent); }
.affiliations {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1.2rem 2.2rem;
  list-style: none; padding: 0; margin: 1.65rem auto 1.8rem;
}
.affiliation { display: flex; align-items: center; gap: .55rem; }
.affiliation > sup { align-self: flex-start; margin-top: .15rem; }
.affiliation img { flex: 0 0 auto; object-fit: contain; }
.affiliation-pku img { width: 46px; height: 46px; }
.affiliation-pku span { font-family: "Inter Paper", var(--sans); font-size: 1.02rem; font-weight: 500; letter-spacing: -.01em; color: #9a0000; }
.affiliation-ms img { width: 30px; height: 30px; }
.affiliation-ms span { font-size: 1.3rem; font-weight: 550; color: #606060; }
.affiliation-edinburgh img { width: 195px; height: auto; }
.affiliation-nju img { width: 155px; height: auto; }
.hero-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .55rem; }
.hero-link {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .5rem 1.15rem; border: 0; border-radius: 999px;
  background: var(--soft); color: var(--ink); text-decoration: none; font-size: .85rem; font-weight: 550;
}
.hero-link:disabled { opacity: 1; cursor: default; }
.hero-link-primary { background: var(--ink); color: #fff; }
.hero-link img, .hero-link svg { width: 18px; height: 18px; flex: 0 0 auto; }
.hero-link-primary img { filter: brightness(0) invert(1); }
.hero-link svg { fill: currentColor; }
.hero-link[href] svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.hero-link[href]:hover { background: #e9ebf2; }
@media (max-width: 759px) {
  .authors { gap: .3rem .75rem; margin-top: 1.2rem; }
  .hero-q { white-space: normal; text-wrap: balance; }
  .affiliations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .affiliation { justify-content: center; min-width: 0; gap: .3rem; }
  .affiliation-pku { flex-wrap: wrap; }
  .affiliation-pku img { width: 36px; height: 36px; }
  .affiliation-pku span { font-size: .9rem; }
  .affiliation-ms img { width: 24px; height: 24px; }
  .affiliation-ms span { font-size: 1rem; }
  .affiliation-edinburgh img, .affiliation-nju img { width: min(100%, 155px); max-width: calc(100% - 14px); }
  .hero-link { padding: .45rem .85rem; font-size: .8rem; }
}

/* ---------- carousel ---------- */
.feature { position: relative; padding: .25rem 0 .6rem; overflow: hidden; overflow: clip; max-width: 100%; }
.cx {
  --vh: 100vh;
  --sw: min(1000px, 66vw, max(520px, (var(--vh) - 470px) * 1.6));
  --gap: 28px;
  position: relative;
}
@supports (height: 100svh) { .cx { --vh: 100svh; } }
.cx-stage {
  position: relative;
  height: calc(var(--sw) * .625 + .5rem);
  margin: .5rem 0 0;
}
.cx-slides { position: absolute; inset: 0; }

.slide {
  --o: 0;
  position: absolute; top: 0; left: 50%;
  width: var(--sw);
  transform: translateX(calc(-50% + var(--o) * (var(--sw) + var(--gap)))) scale(.94);
  transform-origin: 50% 40%;
  opacity: 0;
  pointer-events: none;
  transition: transform .8s var(--ease), opacity .8s var(--ease);
  will-change: transform;
}
.slide.is-near { opacity: .42; pointer-events: auto; cursor: pointer; }
.slide.is-near:hover { opacity: .62; }
.slide.is-active { transform: translateX(-50%) scale(1); opacity: 1; pointer-events: auto; }
.slide.warp { transition: opacity .45s ease; }
@media (prefers-reduced-motion: reduce) {
  .slide, .slide.warp { transition: none; }
}

.slide-open {
  position: relative; display: block; width: 100%;
  padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: var(--radius);
}
.slide-open .media {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(17, 20, 28, .06), 0 12px 32px -14px rgba(17, 20, 28, .28);
}
.slide.is-near .slide-open .media { box-shadow: none; }

/* shared teaser media */
.media {
  position: relative; display: block; width: 100%;
  overflow: hidden; background: var(--frame);
}
.media .poster, .media video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;
}
.media video { opacity: 0; transition: opacity .35s ease; }
.media .is-live > video, .media.is-live > video { opacity: 1; }
.media-split { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr); gap: 3px; background: #fff; }
.media-split .pane { position: relative; display: block; overflow: hidden; background: var(--frame); }
.media-split .pane > img:not(.poster) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pane-tag {
  position: absolute; left: .55rem; bottom: .55rem; z-index: 2;
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  padding: .12rem .5rem; border-radius: 999px;
  background: rgba(255, 255, 255, .9); color: var(--ink);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}

/* model badge (modal only) */
.badge {
  position: absolute; top: .55rem; right: .55rem; z-index: 3;
  display: inline-block;
  padding: .24rem .6rem .24rem .52rem;
  max-width: calc(100% - 1.1rem);
  border-radius: 999px;
  font-size: .72rem; line-height: 1.25; white-space: normal; text-align: left;
  pointer-events: none; user-select: none;
  background: rgba(255, 255, 255, .94); color: var(--ink);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px rgba(17, 20, 28, .08), 0 4px 14px -6px rgba(17, 20, 28, .35);
}
.badge-dot {
  display: inline-block; width: 7px; height: 7px; margin-right: .42rem;
  border-radius: 50%; background: #5b6ee1; vertical-align: .08em;
}
.badge-model { font-weight: 700; }
.badge-sep { color: var(--muted); }
.badge-task { font-weight: 600; color: var(--ink-2); }
.badge-text {
  background: rgba(22, 24, 31, .92); color: #fff;
  box-shadow: 0 4px 16px -6px rgba(0, 0, 0, .5);
}
.badge-text .badge-dot { background: #ff8a4c; box-shadow: 0 0 0 2px rgba(255, 138, 76, .22); }
.badge-text .badge-kind { color: #ffb48a; font-weight: 600; }
.badge-text .badge-sep { color: rgba(255, 255, 255, .55); }
.badge-text .badge-task { color: #fff; }
.badge.badge-modal { position: static; max-width: none; font-size: .78rem; padding: .3rem .72rem .3rem .62rem; }

.play-hint {
  position: absolute; left: 50%; top: 50%; z-index: 3;
  display: inline-flex; align-items: center; gap: .5rem;
  transform: translate(-50%, -50%) scale(.96);
  padding: .55rem 1rem .55rem .8rem; border-radius: 999px;
  background: rgba(21, 23, 28, .78); color: #fff; font-size: .88rem; font-weight: 600;
  opacity: 0; transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.play-hint svg { width: 18px; height: 18px; fill: currentColor; }
.slide.is-near .slide-open:hover .play-hint,
.slide.is-active .slide-open:hover .play-hint,
.slide.is-active .slide-open:focus-visible .play-hint,
.no-autoplay .slide.is-active .play-hint { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.to { font-weight: 700; }

.cx-arrow {
  position: absolute; z-index: 5;
  top: calc(var(--sw) * .3125);
  width: 46px; height: 46px; margin-top: -23px;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--rule); background: #fff; cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(17, 20, 28, .35);
  transition: background .15s ease, transform .15s ease;
}
.cx-arrow:hover { background: var(--soft); }
.cx-arrow:active { transform: scale(.96); }
.cx-arrow svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cx-prev { left: calc(50% - var(--sw) / 2 - 23px); }
.cx-next { right: calc(50% - var(--sw) / 2 - 23px); }

.cx-controls {
  width: min(1200px, 100% - 3rem);
  margin: .6rem auto 0;
  display: flex; align-items: center; justify-content: center; gap: 1rem;
}
/* compact, visual-only thumbnail strip: six across on desktop,
   scrolls inside itself (never the page) when space is short */
.cx-thumbs {
  position: relative;
  display: flex; gap: .55rem;
  flex: 0 1 auto; min-width: 0;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  padding: .25rem .2rem .4rem;
}
.thumb {
  position: relative; display: block; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 7px;
  flex: 0 1 6.5rem; width: 6.5rem; min-width: 4.6rem;
}
.thumb-img {
  display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 7px;
  background: var(--frame);
  box-shadow: 0 0 0 1px var(--rule);
  opacity: .55; transition: opacity .2s ease, box-shadow .2s ease;
}
.thumb-img img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover .thumb-img { opacity: .85; }
.thumb[aria-current="true"] .thumb-img { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
.thumb-bar { display: block; height: 3px; margin-top: .4rem; border-radius: 3px; background: var(--rule); overflow: hidden; }
.thumb-bar i { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.thumb[aria-current="true"] .thumb-bar i { transform: scaleX(1); }
.cx.is-auto .thumb.run .thumb-bar i { transform: scaleX(0); animation: fill var(--dwell, 10s) linear forwards; }
.cx.is-held .thumb.run .thumb-bar i { animation-play-state: paused; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }


/* ---------- sections ---------- */
.sec { padding: clamp(3.5rem, 7vw, 5.5rem) 0 0; }
.sec-h {
  margin: 0 0 1.6rem; text-align: center;
  font-size: clamp(1.75rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.2;
}
.sec-lede { max-width: 640px; margin: -.6rem auto 2rem; text-align: center; color: var(--muted); font-size: 1rem; }
.sec-lede.gallery-lede { max-width: 100%; }
.gallery-lede > span { display: block; }

/* ---------- key takeaways: plain numbered editorial list ---------- */
.tk { list-style: none; margin: 0; padding: 0; counter-reset: tk; }
.tk-item {
  counter-increment: tk;
  position: relative;
  padding: 1.1rem 0 1.1rem 3rem;
  border-top: 1px solid var(--hair);
}
.tk-item:first-child { border-top: 0; padding-top: .4rem; }
.tk-item:last-child { padding-bottom: .4rem; }
.tk-item::before {
  content: counter(tk);
  position: absolute; left: .2rem; top: 1.1rem;
  font-size: 1.05rem; font-weight: 650; line-height: 1.75; font-variant-numeric: tabular-nums;
  color: var(--peri);
}
.tk-item:first-child::before { top: .4rem; }
.tk-item p { margin: 0; font-size: 1.02rem; line-height: 1.75; color: var(--ink-2); font-weight: 400; }
.tk-lead { color: var(--ink); font-weight: 700; }

/* ---------- results ---------- */
.sub { margin-top: 1rem; }
.sub + .sub { margin-top: 3.8rem; }
.sub-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem;
  padding-bottom: .7rem; border-bottom: 1px solid var(--rule);
}
.sub-h { margin: 0; font-size: 1.35rem; font-weight: 650; letter-spacing: -.01em; }
.sub-n { font-family: var(--mono); font-size: .95rem; color: var(--accent); margin-right: .7rem; font-weight: 600; }
.csv {
  font-size: .85rem; text-decoration: none; color: var(--ink-2);
  border: 1px solid var(--rule); padding: .25rem .7rem; border-radius: 999px; white-space: nowrap;
}
.csv::before { content: "↓ "; color: var(--muted); }
.csv:hover { background: var(--soft); }
.sub-cap { margin: 1rem 0 1.1rem; font-size: .95rem; color: var(--muted); max-width: 880px; }

.tbl-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.2rem; margin-bottom: 1rem; }
.tabs { display: inline-flex; max-width: 100%; gap: .25rem; padding: .25rem; background: var(--soft); border-radius: 999px; }
.tab {
  position: relative; min-width: 0;
  border: 0; background: none; padding: .45rem 1.05rem; border-radius: 999px;
  font-size: .9rem; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(17, 20, 28, .12); }
.heat-key { margin: 0; display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--muted); }
.heat-ramp { width: 4.5rem; height: 10px; border-radius: 2px; background: linear-gradient(90deg, var(--heat-lo), var(--heat-mid) 50%, var(--heat-hi)); box-shadow: inset 0 0 0 1px var(--heat-grid); }

/* positioned + clipping container so .sr spans stay inside the scroll area */
.scroll { position: relative; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabpanel { min-width: 0; }

/* compact red–blue heatmap tables */
.tbl {
  width: 100%; border-collapse: collapse;
  font-size: .88rem; font-variant-numeric: tabular-nums;
}
.tbl th, .tbl td { padding: .5rem .6rem; white-space: nowrap; }
.tbl .l { text-align: left; }
.tbl thead th {
  font-weight: 600; color: var(--ink-2); font-size: .8rem; text-align: center;
  vertical-align: bottom; padding: .3rem .2rem .45rem;
}
.tbl thead th.l { padding-left: .6rem; }
.tbl thead tr.grp th { padding: 0 .2rem .1rem; color: var(--muted); font-weight: 500; font-size: .74rem; letter-spacing: .03em; text-transform: uppercase; }
.tbl thead tr.grp th span { display: block; border-bottom: 1px solid var(--rule); padding-bottom: .3rem; }
.tbl abbr { text-decoration: none; }
.arr { color: var(--muted); margin-left: .12rem; font-weight: 500; }

.tbl tbody th, .tbl tbody td.cfg {
  background: #fff; color: var(--ink); font-weight: 500; text-align: left;
  border-bottom: 1px solid var(--rule);
}
.tbl tbody td.cfg { color: var(--ink-2); }
.tbl td.heat {
  min-width: 4.6rem; padding: .55rem .7rem; text-align: center;
  color: var(--ink); border: 1px solid var(--heat-grid); font-weight: 500;
}
.tbl td.heat strong { color: var(--ink); font-weight: 750; }

/* company icon before each model name (main table only) */
.model-name { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; }
.model-icon { flex: 0 0 auto; width: 17px; height: 17px; object-fit: contain; display: inline-block; }
.tbl-main .model, .tbl-abl tbody th, .tbl-abl tfoot th, .tbl-abl thead th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; }

/* sortable metric headers */
.sort {
  display: inline-flex; align-items: center; gap: .15rem;
  padding: .3rem .4rem; border: 0; border-radius: 6px; background: none;
  font: inherit; color: inherit; cursor: pointer; white-space: nowrap;
}
.sort:hover { background: var(--soft); color: var(--ink); }
.sort-ind { display: inline-block; width: .8em; margin-left: .15rem; font-size: .72em; color: #c0c5d3; text-align: center; }
th[aria-sort="ascending"] .sort, th[aria-sort="descending"] .sort { color: var(--ink); }
th[aria-sort="ascending"] .sort-ind, th[aria-sort="descending"] .sort-ind { color: var(--accent); }
/* Model header: resets to the default model-grouped (paper) order */
.tbl-main thead th.model { padding-left: .2rem; }
th[aria-sort="other"] .sort { color: var(--ink); }
th[aria-sort="other"] .sort-ind { color: var(--accent); }
/* model-group boundaries (grouped mode only): neutral 2px rule across all columns */
.tbl-main tbody tr.grp-end > th,
.tbl-main tbody tr.grp-end > td { border-bottom: 2px solid var(--rule-2); }

.fine { margin: .8rem 0 0; font-size: .85rem; color: var(--muted); }

/* Main comparison: raw scores stay white; only paired Δ/pp carries gain shading. */
.gain-key { margin: 0; display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--muted); }
.gain-key-ramp { width: 4rem; height: 10px; background: linear-gradient(90deg, #fff, rgb(172, 218, 215)); border: 1px solid var(--rule); }
.main-results-note { margin-top: 1rem; line-height: 1.6; }
#results .tbl-main { border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
#results .tbl-main thead th { padding: .35rem .45rem .6rem; }
#results .tbl-main thead tr:last-child th { border-bottom: 1px solid var(--ink); }
#results .tbl-main tbody + tbody { border-top: 1px solid var(--rule-2); }
#results .tbl-main tbody th, #results .tbl-main tbody td { border-bottom: 0; }
#results .tbl-main .model { min-width: 172px; }
#results .tbl-main tbody .model { vertical-align: top; padding-top: .8rem; font-weight: 550; }
#results .tbl-main .main-kind { display: block; margin-top: .2rem; font-size: .75rem; color: var(--muted); font-weight: 500; }
#results .tbl-main .subset-star { margin-left: .08rem; font-size: .7em; }
#results .tbl-main .cfg { min-width: 76px; color: var(--ink-2); font-size: .76rem; font-weight: 500; }
#results .tbl-main td.num { min-width: 4.3rem; text-align: center; padding: .4rem .55rem; background: #fff; color: var(--ink); font-weight: 500; }
#results .tbl-main td.num strong { font-weight: 750; }
#results .tbl-main tbody tr:first-child td { padding-top: .8rem; }
#results .tbl-main tbody tr:last-child > * { padding-bottom: .8rem; }
#results .tbl-main .gain-row .cfg { color: var(--ink); }
#results .tbl-main td.gain-delta { text-align: center; padding: .35rem .55rem; font-size: .8rem; font-weight: 600; }
#results .tbl-main td.gain-delta.improved { color: #086963; }
#results .tbl-main td.gain-delta.regressed { color: #9b3e17; }
#results .tbl-main td.gain-delta.unchanged, #results .tbl-main td.gain-delta.missing { color: var(--muted); }
@media (max-width: 759px) {
  .gain-key { align-self: flex-end; }
  #results .tbl-main .model { min-width: 145px; }
}

/* ---------- ablation ---------- */
.abl-study { margin-top: 2.8rem; }
.abl-download { margin: 0 0 1rem; }
.abl-q {
  display: block; max-width: 100%;
  margin: 1.8rem 0 .6rem;
  font-size: 1.25rem; color: var(--accent);
  font-weight: 600; line-height: 1.35; letter-spacing: -.01em;
  text-align: left; overflow-wrap: break-word;
}
.abl-setup, .abl-finding { margin: 0 0 .5rem; max-width: 880px; text-align: left; font-size: .97rem; color: var(--ink-2); }
.abl-finding { margin-bottom: 1.4rem; }
.abl-finding:empty, .abl-setup:empty { display: none; }
.tbl-abl tbody th { white-space: nowrap; }
/* ablation only: intrinsic (content-sized) width, left-aligned with the setup copy,
   instead of stretching across the whole wrapper; .scroll still handles overflow */
.tbl.tbl-abl { width: auto; min-width: min(100%, 880px); margin: 0; }
.tbl-abl thead th { padding: .3rem .25rem .45rem; }
.tbl-abl thead th.l, .tbl-abl tbody th, .tbl-abl tfoot th { padding-left: .6rem; padding-right: 1rem; }
/* ablation: plain uncoloured cells + scaled Δ/pp footer */
.tbl-abl td.num {
  min-width: 4.6rem; padding: .55rem .7rem; text-align: center;
  background: #fff; color: var(--ink); font-weight: 500;
  border-bottom: 1px solid var(--rule);
}
.tbl-abl td.num strong { color: var(--ink); font-weight: 750; }
.tbl-abl tfoot th, .tbl-abl tfoot td {
  background: #fff; color: var(--ink); font-weight: 500;
  border-top: 1px solid var(--rule-2);
}
.tbl-abl tfoot th { text-align: left; color: var(--ink-2); }
.tbl-abl tfoot td.delta { padding: .55rem .7rem; text-align: center; }

/* ---------- library ---------- */
.lib { position: relative; }
.lib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.lib-col-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 0 1rem; padding-bottom: .55rem; border-bottom: 1px solid var(--rule);
  font-size: 1.05rem; font-weight: 650;
}
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.65rem; container-type: inline-size; }
.lib-card {
  display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  border-radius: 10px;
}
.lib-frame { position: relative; display: block; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--rule); }
.lib-frame .media { aspect-ratio: 3 / 2; background: #fff; }
.lib-play {
  position: absolute; right: .6rem; bottom: .6rem; z-index: 3;
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, .94); box-shadow: 0 2px 10px -3px rgba(0, 0, 0, .35);
  transition: transform .15s ease;
}
.lib-play svg { width: 14px; height: 14px; fill: var(--ink); margin-left: 2px; }
.lib-card:hover .lib-play, .lib-card:focus-visible .lib-play { transform: scale(1.08); }
.lib-card:hover .lib-frame { box-shadow: 0 0 0 1px var(--rule-2), 0 10px 24px -14px rgba(17, 20, 28, .4); }
/* one calm caption row: title left (ellipsis only as a narrow-card safety), model right, never wrapped */
.lib-meta {
  display: grid; grid-template-columns: minmax(0, 1fr) max-content; column-gap: .7rem;
  align-items: center; margin-top: .65rem; min-width: 0;
}
.lib-title {
  display: block; min-width: 0; font-size: .95rem; font-weight: 600; line-height: 1.35; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-model { display: block; justify-self: end; font-size: .85rem; line-height: 1.35; color: var(--muted); text-align: right; white-space: nowrap; }
.lib-model .to { color: var(--muted); }

/* ---------- approved comparisons (showcase layout stays unchanged) ---------- */
#cmp .cmp-frame .media { aspect-ratio: 3 / 2; }
#cmp .cmp-still { margin: 0; }
#cmp .cmp-panels {
  display: grid; grid-template-columns: repeat(var(--cmp-n, 3), minmax(0, 1fr));
  gap: 8px; padding: 8px;
  background: #f3f4f6; border-radius: 6px;
}
#cmp .cmp-pane {
  display: flex; flex-direction: column; min-width: 0; padding: 6px;
  border: 1.5px solid #aeb9c7; border-radius: 6px; background: #fff;
  box-shadow: 0 2px 8px rgba(23, 21, 27, .04);
  width: 100%; text-align: inherit; cursor: pointer; color: var(--ink-2);
}
#cmp .cmp-pane:hover { border-color: var(--ink-2); }
#cmp .cmp-label {
  display: flex; align-items: center; justify-content: center; min-height: calc(2.4em + 6px);
  padding-bottom: 6px; margin-bottom: 8px; text-align: center;
  border-bottom: 1px solid rgba(23, 21, 27, .1);
  font-size: clamp(.5rem, .75vw, .75rem); font-weight: 600; line-height: 1.2;
}
#cmp .cmp-img { display: block; width: 100%; aspect-ratio: inherit; overflow: hidden; background: #fff; }
#cmp .cmp-img img { display: block; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 680px) {
  #cmp .cmp-panels { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- VaaT paradigm ---------- */
.para-lede { max-width: 780px; }
.para-unit { max-width: 880px; margin: 0 auto; }
.para-fig { display: block; width: 100%; height: auto; }
.vh-cli {
  list-style: none; margin: 1.2rem 0 0; padding: .5rem 0 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem 1.1rem;
  border-top: 1px solid var(--hair);
}
.vh-cli li { min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.vh-cmd { font-family: var(--mono); font-size: .95rem; font-weight: 600; color: var(--ink); }
.vh-desc { font-size: .9rem; line-height: 1.4; color: var(--muted); overflow-wrap: break-word; }

.lib.is-collapsed .lib-item.is-extra:not(.is-peek) { display: none; }
.lib.is-collapsed .lib-item.is-peek {
  max-height: 33.3333cqw; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 95%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent 95%);
}
.lib-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 9rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .85) 55%, #fff 92%);
  pointer-events: none; display: none;
}
.lib.is-collapsed .lib-fade { display: none; }
.lib-more { display: flex; justify-content: center; margin-top: 1.2rem; }
.lib:not(.is-collapsed) + .lib-more { margin-top: 2.4rem; }
.pill {
  border: 0; border-radius: 999px; padding: .62rem 1.25rem;
  background: var(--ink); color: #fff; font-size: .92rem; font-weight: 600; cursor: pointer;
}
.pill:hover { background: #2a2e38; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.05rem 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 1.05rem; font-weight: 575; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 9px; height: 9px; margin-left: 1rem; flex: 0 0 auto;
  border-right: 1.6px solid var(--ink-2); border-bottom: 1.6px solid var(--ink-2);
  transform: rotate(45deg) translateY(-3px); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.faq summary:hover { color: var(--accent); }
.faq .ans { padding: 0 2.5rem 1.2rem 0; color: var(--ink-2); font-size: .97rem; max-width: 880px; }
.faq .ans p { margin: 0; }

/* ---------- footer ---------- */
.foot { margin-top: clamp(4rem, 8vw, 6rem); border-top: 1px solid var(--rule); padding: 1.6rem 0 2.2rem; }
.foot-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.foot-row p { margin: 0; }
.foot-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--accent); }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: rgba(16, 18, 24, .62);
  opacity: 0; transition: opacity .2s ease;
}
.modal[hidden] { display: none; }
.modal.is-open { opacity: 1; }
.modal-box {
  --mh: calc(100vh - 12rem);
  position: relative;
  width: min(1360px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: #fff; border-radius: 14px;
  padding: 12px; scrollbar-gutter: stable;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5);
}
@supports (height: 100dvh) {
  .modal-box { --mh: calc(100dvh - 12rem); max-height: calc(100dvh - 2rem); }
}
.modal-head { height: 0; margin: 0; }
.modal-box.is-showcase { width: min(1360px, 100%, calc((100dvh - 144px) * 1.73913)); }
.modal-titles { flex: 1 1 auto; min-width: 0; }
.modal-kicker { margin: 0; font-size: .8rem; color: var(--muted); }
.modal-kicker:empty { display: none; }
.modal-badge { flex: 0 0 auto; display: flex; align-items: center; }
.modal-badge:empty { display: none; }
.iteration-pill {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; min-width: 124px; padding: 0 12px; border: 0; border-radius: 999px;
  background: #18212b; color: #c7d0d9; font-family: "Inter Paper", var(--sans);
  font-size: 12px; font-weight: 400; line-height: 1; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.iteration-value { color: #fff; font-family: var(--mono); font-size: 13px; font-weight: 700; }
.iteration-pill.is-light { background: #fff; color: #475569; box-shadow: 0 0 0 1px rgba(20, 30, 40, .08), 0 1px 5px rgba(0, 0, 0, .1); }
.iteration-pill.is-light .iteration-value { color: #172526; }
.iteration-cover { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.modal-title { margin: .1rem 0 0; font-size: 1.15rem; font-weight: 650; line-height: 1.3; }
.modal-close {
  position: fixed; top: var(--close-top, 12px); right: var(--close-right, 12px); z-index: 3;
  flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--rule); border-radius: 50%; background: #fff; cursor: pointer;
}
.modal-close:hover { background: var(--soft); }
.modal-close svg { width: 18px; height: 18px; stroke: var(--ink); stroke-width: 2; fill: none; stroke-linecap: round; }
.modal-media { display: flex; justify-content: center; }
.m-showcase { width: 100%; min-width: 0; overflow: hidden; border-radius: 8px; background: var(--stage-bg); color: var(--stage-ink); }
.showcase-head { position: relative; height: 80px; }
.stage-label {
  position: absolute; bottom: 8px; height: 28px; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: "Inter Paper", var(--sans); font-size: 14px; font-weight: 600; line-height: 1.25;
}
.stage-model { white-space: nowrap; }
.showcase-head .iteration-pill, .m-single > .iteration-pill { position: absolute; top: 12px; right: 14px; }
.showcase-crop { position: relative; width: 100%; overflow: hidden; }
.showcase-crop video { position: absolute; left: 0; top: 0; width: 100%; height: auto; max-width: none; }
.m-single {
  position: relative;
  aspect-ratio: var(--arn, 1.6);
  width: 100%;
  background: var(--frame); border-radius: 8px; overflow: hidden;
}
.m-single video, .m-pane video, .m-pane img { width: 100%; height: 100%; object-fit: contain; background: var(--frame); }
.m-split { display: flex; justify-content: center; gap: 10px; width: 100%; }
.m-pane {
  position: relative; margin: 0; flex: 0 0 auto;
  aspect-ratio: var(--arn, .8);
  width: min(calc(50% - 5px), calc(max(200px, var(--mh)) * var(--arn, .8)));
  border-radius: 8px; overflow: hidden; background: var(--frame);
}
.m-pane figcaption {
  position: absolute; left: .6rem; top: .6rem; z-index: 2;
  font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px;
  background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); pointer-events: none;
}
/* Static comparisons open the complete, ordered image group in one dialog. */
.m-comparison {
  display: grid; grid-template-columns: repeat(var(--cmp-n), minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 18px); width: 100%; align-items: start;
}
.m-comparison-pane {
  min-width: 0; margin: 0; padding: clamp(6px, .7vw, 10px);
  border: 1.5px solid #aeb9c7; border-radius: 6px; background: #fff;
}
.m-comparison-pane figcaption {
  display: flex; align-items: center; justify-content: center; min-height: calc(2.4em + 9px);
  margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
  font-size: clamp(.65rem, 1.1vw, .9rem); font-weight: 600; line-height: 1.2; text-align: center;
}
.m-comparison-pane img { width: 100%; height: auto; max-height: max(160px, var(--mh)); object-fit: contain; }
/* comparison films: plain gray model line in the modal header (no pill) */
.modal-model { display: block; font-size: .9rem; line-height: 1.35; color: var(--muted); white-space: nowrap; }
.modal-model .to { color: var(--muted); }
.modal-note { margin: .7rem 0 0; font-size: .85rem; color: var(--muted); text-align: center; }
.modal-note:empty { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .cx { --sw: min(80vw, max(480px, (var(--vh) - 420px) * 1.6)); --gap: 20px; }
  .lib-grid { gap: 1.25rem; }
}
@media (max-width: 759px) {
  body { font-size: 16px; }
  .wrap, .wrap.tk-wrap, .hero { width: calc(100% - 2.5rem); }
  .cx { --sw: 86vw; --gap: 12px; }
  .cx-stage { height: calc(var(--sw) * .625 + .5rem); }
  .cx-arrow { width: 38px; height: 38px; margin-top: -19px; }
  .cx-prev { left: calc(50% - var(--sw) / 2 - 8px); }
  .cx-next { right: calc(50% - var(--sw) / 2 - 8px); }
  .cx-controls { width: calc(100% - 2.5rem); flex-direction: column; gap: .7rem; }
  .cx-thumbs { max-width: 100%; gap: .45rem; }
  .thumb { flex: 0 0 4.6rem; width: 4.6rem; }
  .pane-tag { font-size: .62rem; left: .35rem; bottom: .35rem; }
  .tk-item { padding-left: 2rem; }
  .tk-item::before { left: 0; }
  .lib-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .lib.is-collapsed .lib-col:not(:last-child) .lib-item.is-peek { display: none; }
  .tbl-tools { flex-direction: column; align-items: stretch; }
  .heat-key { align-self: flex-end; }
  .tabs { display: flex; width: 100%; }
  .tab { flex: 1 1 0; padding: .45rem .3rem; font-size: .84rem; line-height: 1.25; white-space: normal; text-align: center; }
  .sub-h { font-size: 1.15rem; }
  .abl-q { margin-top: 1.5rem; font-size: 1.15rem; }
  .vh-cli { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { padding: .5rem; }
  .modal-box { padding: .8rem .8rem .9rem; --mh: calc(100vh - 13rem); }
  .showcase-head { height: 104px; }
  .stage-label { height: 48px; font-size: 12px; }
  .modal-title { font-size: 1rem; }
  .faq .ans { padding-right: 0; }
}
@media (max-width: 479px) {
  /* "Image-to-" stays in the accessible name but is visually dropped so three tabs fit */
  .tab-pre { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 400px) {
  .vh-cli { grid-template-columns: 1fr; }
}
@media (max-width: 359px) {
  .title { font-size: 1.62rem; }
  .hero-q { font-size: 1.04rem; }
}

/* ---------- left section rail ---------- */
.pnav[hidden] { display: none !important; }
.pnav {
  position: fixed; left: .6rem; top: 50%; transform: translateY(-50%); z-index: 30;
  display: none;
}
.pnav-list { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.pnav-track {
  display: block; pointer-events: none;
  position: absolute; left: 4px; top: 14px; bottom: 14px; width: 2px;
  border-radius: 2px; background: var(--rule);
}
.pnav-fill {
  display: block;
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, #4355d6 0%, #6c5bd0 50%, #ec6b14 100%);
  clip-path: inset(0 0 calc((1 - var(--p, 0)) * 100%) 0);
  transition: clip-path .25s var(--ease);
}
.pnav a {
  position: relative; display: flex; align-items: center; gap: .45rem;
  height: 28px; text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 500;
}
.pnav b {
  position: relative; z-index: 1; flex: 0 0 auto;
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 1.5px solid #c5cadc;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pnav-list a > span {
  white-space: nowrap; padding: .12rem .22rem; border-radius: 6px;
  background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 1px rgba(17, 20, 28, .05);
  opacity: 0; transform: translateX(-6px); pointer-events: none;
  transition: opacity .2s ease, transform .2s var(--ease), color .2s ease;
}
.pnav:hover .pnav-list a > span, .pnav:focus-within .pnav-list a > span { opacity: 1; transform: none; pointer-events: auto; }
.pnav a:hover { color: var(--ink); }
.pnav a:hover b { border-color: #4355d6; }
.pnav a.on { color: var(--ink); font-weight: 600; }
.pnav a.on b { background: #4355d6; border-color: #4355d6; box-shadow: 0 0 0 4px rgba(67, 85, 214, .16); }
@media (prefers-reduced-motion: reduce) {
  .pnav-fill, .pnav b, .pnav-list a > span { transition: none; }
}
@media (min-width: 1180px) {
  .pnav { display: block; }
  .topnav { display: none; }
  /* reserve a left/right gutter so rail labels never cover content or media */
  .wrap { width: min(1200px, 100% - 19rem); }
  .wrap.tk-wrap { width: min(800px, 100% - 19rem); }
  .feature { margin-inline: 9.5rem; }
}
@media (min-width: 1600px) {
  .pnav-list a > span { opacity: 1; transform: none; pointer-events: auto; }
}
