/* GIST project page.
   Layout follows the Nerfies family (centered masthead, pill links, one column);
   colors come from the paper figures: Okabe-Ito green for the semantic target and
   GIST, slate for the pixel target and KARL-dagger, and Okabe-Ito vermillion for
   the playground's unprotected preset. */

/* Dark only: the light palette was dropped on 2026-10-11. */
:root {
  --bg: #0e1412;
  --surface: #151d1a;
  --surface-2: #1d2824;
  --line: #29352f;
  --ink: #e4ece8;
  --ink-2: #b4c1bc;
  --muted: #8a9893;
  --sem: #1aa97e;
  --sem-ink: #45d0a2;
  --sem-wash: #123228;
  --pix: #b6bec6;
  --pix-ink: #c4cbd2;
  --pix-wash: #262d32;
  --gist1: #4f97e0;
  --warn: #e8793a;
  --warn-ink: #ffa36b;
  --warn-wash: #3a2416;
  --plate: #f4f7f6;
  --heat-lo: #16231f;
  --heat-hi: #6fe3bb;
  --pill-bg: #e4ece8;
  --pill-ink: #0e1412;
  --shadow: none;

  --font-display: "Bricolage Grotesque", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-quote: "Newsreader", Georgia, "Times New Roman", serif;

  --radius: 16px;
  --radius-sm: 10px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sem-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--sem); outline-offset: 3px; border-radius: 4px; }
sup { font-size: .7em; line-height: 0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ε symbols carry their target's color as an underline, never as text color */
.eps { white-space: nowrap; font-style: italic; }
.eps sub { font-style: normal; font-size: .72em; }
.eps.pix { box-shadow: inset 0 -2px 0 var(--pix-wash); }
.eps.sem { box-shadow: inset 0 -2px 0 var(--sem-wash); }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: 20px; }
.wrap.wide { max-width: 1120px; }
.text { max-width: 680px; margin-inline: auto; }
.wrap.text { max-width: 720px; }
.wrap.text { padding-inline: 20px; }
main { display: flex; flex-direction: column; gap: 88px; padding-block: 8px 96px; }

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-align: center;
  text-wrap: balance;
  margin: 0 0 20px;
}
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.section-head { margin-bottom: 28px; }
.section-head p { color: var(--ink-2); }

.caption { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); margin: 14px auto 0; max-width: 74ch; }

/* ---------- masthead ---------- */
.masthead { text-align: center; padding-block: 56px 48px; }
.wordmark {
  display: inline-flex; align-items: flex-end; gap: 6px;
  margin: 0 0 6px;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(56px, 9vw, 88px); line-height: .9; letter-spacing: -0.03em;
  color: var(--ink);
}
.wordmark img { width: clamp(64px, 9vw, 100px); height: auto; margin-bottom: .04em; }
.masthead h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(26px, 4vw, 42px); line-height: 1.15; letter-spacing: -0.02em;
  max-width: 22ch; margin: 10px auto 26px; text-wrap: balance;
}
.authors, .affiliations { list-style: none; padding: 0; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; }
.authors { gap: 4px 22px; font-size: 18px; }
.authors a { color: var(--ink); text-decoration-color: var(--sem); text-decoration-thickness: 2px; }
.authors a:hover { color: var(--sem-ink); }
.authors sup { color: var(--muted); margin-left: 1px; }
.affiliations { gap: 2px 18px; margin-top: 8px; font-size: 14.5px; color: var(--muted); }
.affiliations a { color: inherit; }
.affiliations sup { margin-right: 2px; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px 9px 14px; border-radius: 999px;
  background: var(--pill-bg); color: var(--pill-ink);
  font-weight: 600; font-size: 15px; line-height: 1; text-decoration: none;
  transition: transform .15s ease, background-color .15s ease;
}
.pill svg { width: 18px; height: 18px; flex: none; }
.pill:hover { transform: translateY(-1px); text-decoration: none; }
.pill[aria-disabled="true"] { opacity: .42; cursor: not-allowed; transform: none; }

/* ---------- shared bits ---------- */
.tile {
  display: block; width: 100%; aspect-ratio: 1; height: auto;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.picker { display: flex; flex-wrap: wrap; gap: 6px; }
.thumb {
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 9px; cursor: pointer;
  background: var(--surface-2) center / cover no-repeat;
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow .15s ease, transform .15s ease;
}
.thumb:hover { transform: translateY(-1px); }
.thumb[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--sem); }

.range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer;
  --p: 0%; --c: var(--sem);
}
.range.pix { --c: var(--pix); }
.range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(to right, var(--c) var(--p), var(--line) var(--p));
}
.range::-moz-range-track { height: 6px; border-radius: 99px; background: var(--line); }
.range::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--c); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: var(--bg); border: 4px solid var(--c);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 4px solid var(--c);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--sem-wash); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--sem-wash); }

/* ---------- teaser stage ---------- */
.stage {
  background: var(--surface);
  border-radius: 22px;
  padding: clamp(16px, 3vw, 32px);
}
.stage-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 22px; }
.stage-head h2 { font-size: clamp(20px, 2.4vw, 25px); text-align: left; margin: 0; }

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2vw, 22px); }
.panel { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.panel figcaption { display: grid; gap: 2px; }
.model { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.3; }
.model .badge { margin-left: 6px; vertical-align: 2px; }
.sub { font-size: 13.5px; color: var(--muted); }
.badge {
  font-family: var(--font-body); font-weight: 600; font-size: 12.5px;
  padding: 2px 8px; border-radius: 99px;
  background: var(--sem-wash); color: var(--sem-ink); font-style: italic;
}
.badge sub { font-style: normal; }
.meter { display: block; height: 6px; border-radius: 99px; background: var(--line); margin-top: 8px; overflow: hidden; }
.meter > span { display: block; height: 100%; width: 100%; border-radius: 99px; transition: width .25s ease; }
.panel-karl .meter > span { background: var(--pix); }
.panel-gist .meter > span { background: var(--sem); }
.readout { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }
.readout b { color: var(--ink); font-weight: 600; }

.scrub {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "play label" "play range" ". ends";
  column-gap: 16px; align-items: center; margin-top: 26px;
}
.play {
  grid-area: play; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--pill-bg); color: var(--pill-ink); display: grid; place-items: center;
}
.play svg { width: 18px; height: 18px; }
.play[aria-pressed="true"] .i-play, .play[aria-pressed="false"] .i-pause { display: none; }
.scrub-label { grid-area: label; font-size: 14.5px; color: var(--ink-2); }
.scrub-label output { color: var(--ink); font-weight: 600; }
.scrub .range { grid-area: range; }
.scrub-ends { grid-area: ends; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ---------- abstract ---------- */
.epigraph { margin: 0 0 40px auto; max-width: 30em; text-align: right; }
.epigraph p { font-family: var(--font-quote); font-style: italic; font-size: 21px; line-height: 1.45; color: var(--ink-2); margin: 0 0 6px; }
.epigraph footer { font-size: 13px; color: var(--muted); }
.epigraph cite { font-style: italic; }
.tldr { font-size: 18px; line-height: 1.6; margin-bottom: 44px; }
.tldr-tag {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .08em;
  color: var(--sem-ink); background: var(--sem-wash);
  padding: 3px 8px; border-radius: 6px; margin-right: 8px; vertical-align: 2px;
}
#abstract h2 { margin-bottom: 14px; }

/* ---------- method ---------- */
.method-steps {
  list-style: none; padding: 0; margin: 32px 0 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}
.method-steps li {
  padding: 24px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.step-number {
  display: inline-block; padding: 4px 9px; margin-bottom: 18px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--sem-ink); background: var(--sem-wash);
}
.method-steps h3 {
  margin: 0 0 12px; font-family: var(--font-display); font-size: 21px;
  font-weight: 700; line-height: 1.3; letter-spacing: -.01em;
}
.method-steps p { font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.method-note {
  margin: 22px 0 0; font-size: 14.5px; color: var(--ink-2); text-align: center;
}
.method-note strong { color: var(--ink); }

/* ---------- figures on plates ---------- */
.plate-fig { margin: 32px 0 0; }
.plate-fig.narrow { max-width: 880px; margin-inline: auto; }
.plate { background: var(--plate); border-radius: var(--radius); padding: clamp(10px, 2vw, 22px); border: 1px solid var(--line); }
.plate img { width: 100%; }

/* ---------- playground ---------- */
.lab {
  display: grid; grid-template-columns: clamp(280px, 37.5%, 380px) minmax(0, 1fr);
  grid-template-areas: "picker picker" "controls view";
  gap: 22px clamp(20px, 3.5vw, 44px);
  background: var(--surface); border-radius: 22px; padding: clamp(16px, 3vw, 32px);
}
.lab > .picker { grid-area: picker; }
.lab-controls { grid-area: controls; display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.pad-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "y pad" ". x" ". ramp"; gap: 8px 10px; }
.axis-y { grid-area: y; writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; font-size: 13px; color: var(--ink-2); }
.axis-x { grid-area: x; font-size: 13px; color: var(--ink-2); }
.pad {
  grid-area: pad; position: relative; aspect-ratio: 1; width: 100%;
  border-radius: 12px; overflow: hidden; cursor: crosshair; touch-action: none;
  box-shadow: 0 0 0 1px var(--line);
}
.pad canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.puck {
  position: absolute; width: calc(100% / 19); height: calc(100% / 19);
  border-radius: 4px; pointer-events: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink);
  transition: left .12s ease, top .12s ease;
}
.pad-tip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--ink); color: var(--bg); font-size: 12px; line-height: 1.35;
  padding: 6px 8px; border-radius: 6px; white-space: nowrap;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.legend-ramp {
  grid-area: ramp; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 4px 10px; font-size: 12px; color: var(--muted);
}
.ramp { height: 8px; border-radius: 99px; }
.ramp-ticks { grid-column: 1; position: relative; height: 15px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ramp-ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.ramp-ticks span:first-child { transform: none; }
.ramp-ticks span:last-child { transform: translateX(-100%); }
.sliders { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); align-items: center; gap: 6px 12px; font-size: 14.5px; }
.sliders output { font-weight: 600; margin-left: 4px; }

.lab-view { grid-area: view; display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 20px; align-items: start; min-width: 0; }
.lab-main { display: grid; gap: 14px; min-width: 0; }
.tile.big { border-radius: 14px; }
.lab-side { display: flex; flex-direction: column; gap: 20px; }
.mini { margin: 0; }
.mini figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.stats { margin: 0; display: grid; gap: 14px; }
.stats div { display: grid; gap: 0; }
.stats dt { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 0; font-size: 15px; color: var(--muted); }
.stats dd b { font-size: 26px; font-weight: 600; color: var(--ink); }
.presets { container-type: inline-size; }
.preset-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
/* Each preset carries its colour in --c; the one matching the grid position is pressed. */
.preset {
  --c: var(--ink); --c-ink: var(--ink); --c-wash: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-width: 0; padding: 11px 4px 10px; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1.15; white-space: nowrap;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line);
  transition: border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.preset svg { width: 20px; height: 20px; flex: none; color: var(--c); }
.preset:hover { border-color: var(--c); }
.preset[aria-pressed="true"] { background: var(--c-wash); border-color: var(--c); color: var(--c-ink); box-shadow: inset 0 0 0 1px var(--c); }
.preset:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.preset.protected { --c: var(--sem); --c-ink: var(--sem-ink); --c-wash: var(--sem-wash); }
.preset.unprotected { --c: var(--warn); --c-ink: var(--warn-ink); --c-wash: var(--warn-wash); }
/* Icon beside the label once the row has room for it. */
@container (min-width: 480px) {
  .preset { flex-direction: row; gap: 8px; padding: 11px 12px; font-size: 14px; }
  .preset svg { width: 18px; height: 18px; }
}
.presets-note { margin: -4px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }

/* ---------- results chart ---------- */
.chart-card { background: var(--bg); border: 1px solid var(--line); border-radius: 22px; padding: clamp(14px, 2.6vw, 28px); box-shadow: var(--shadow); }
.chart-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 14px; }
.seg { display: inline-flex; max-width: 100%; overflow-x: auto; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.seg button {
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: 8px 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink-2);
}
.seg button[aria-checked="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.legend { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.key { width: 18px; height: 2px; border-radius: 2px; position: relative; }
.key::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 50%; transform: translate(-50%, -50%); background: inherit; box-shadow: 0 0 0 2px var(--bg); }
.k-karl { background: var(--pix); }
.k-gist1 { background: var(--gist1); }
.k-gist { background: var(--sem); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-body); }
.chart-tip {
  position: absolute; top: 0; left: 0; pointer-events: none; z-index: 2;
  min-width: 168px; padding: 10px 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(0, 0, 0, .14);
  font-size: 13px; line-height: 1.45;
}
.chart-tip .t-head { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.chart-tip .t-row { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 8px; }
.chart-tip .t-row i { height: 2px; border-radius: 2px; }
.chart-tip .t-row b { font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip .t-row span { color: var(--ink-2); }
.chart-tip .t-gap { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--ink-2); }
.chart-tip .t-gap b { color: var(--ink); font-family: var(--font-mono); }

.numbers { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 32px; }
.numbers li { display: grid; gap: 4px; align-content: start; padding-top: 14px; border-top: 2px solid var(--sem); }
.numbers b { font-family: var(--font-display); font-weight: 700; font-size: 38px; line-height: 1; letter-spacing: -0.02em; }
.numbers span { font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }

/* ---------- full paper ---------- */
.paper-cta { text-align: center; }
.paper-cta h2 { margin-bottom: 12px; }
.paper-cta p { color: var(--ink-2); margin-bottom: 20px; }
.paper-cta .pill {
  min-height: 44px; padding: 11px 20px; line-height: 1.35;
  background: var(--surface); color: var(--sem-ink); border: 1px solid var(--line);
}
.paper-cta .pill:hover:not([aria-disabled="true"]) { background: var(--sem-wash); border-color: var(--sem-ink); }

/* ---------- bibtex + footer ---------- */
.bib { position: relative; }
.bib pre {
  margin: 0; padding: 20px 22px; border-radius: 14px; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; color: var(--ink);
}
.copy {
  position: absolute; top: 12px; right: 12px;
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: var(--bg); color: var(--ink-2); border: 1px solid var(--line);
}
.copy:hover { color: var(--ink); border-color: var(--sem); }
.site-foot { border-top: 1px solid var(--line); padding-block: 28px 48px; font-size: 13.5px; color: var(--muted); }
.site-foot a { color: inherit; }
.credit { margin-top: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .lab { grid-template-columns: minmax(0, 1fr); grid-template-areas: "picker" "view" "controls"; }
  .pad-wrap { max-width: 420px; }
}
@media (max-width: 760px) {
  .method-steps { grid-template-columns: minmax(0, 1fr); }
  .method-steps li { padding: 20px; }
  .step-number { margin-bottom: 12px; }
  .method-note { text-align: left; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  main { gap: 64px; }
  .wrap, .wrap.text { padding-inline: 16px; }
  .masthead { padding-block: 36px 32px; }
  .authors { font-size: 16.5px; gap: 2px 16px; }
  .thumb { width: 34px; height: 34px; border-radius: 8px; }
  .trio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-orig { grid-column: 1 / -1; display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 12px; }
  .model { font-size: 17px; }
  .readout { font-size: 11.5px; }
  .lab-view { grid-template-columns: minmax(0, 1fr); }
  .lab-side { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
  .stats dd b { font-size: 22px; }
  .numbers { grid-template-columns: minmax(0, 1fr); }
  .legend { margin-left: 0; }
  .seg button { padding: 8px 10px; font-size: 13.5px; }
  .epigraph p { font-size: 19px; }
  /* Keep paper figures legible by scrolling them sideways on small screens. */
  .plate { overflow-x: auto; }
  .plate img { min-width: 640px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
