/* Layout: one reading column (~68ch) for prose, figure bands that widen to 1120px.
   Identity: the two feature tokens of Figure 1 (orange = averaged image token, cyan = lava patch). */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --ink: #121621;
  --ink-2: #3b4252;
  --muted: #5d6576;
  --line: #dde1e8;
  --accent: #c8440c;      /* token orange */
  --accent-soft: #fbe6da;
  --patch: #0b8f90;       /* patch cyan */
  --patch-soft: #d6f0ef;
  --s-base: #8b92a0;      /* chart: unconditional baseline */
  --s-dino: #2a78d6;      /* chart: REPA-G w/ DINOv2 features */
  --s-sit: #eb6834;       /* chart: REPA-G w/ internal SiT features */
  --logo-bg: #ffffff;
  --s-3: #1baf7a;         /* chart: third categorical slot */
  --code-bg: #121621;
  --code-ink: #e7eaf0;
  --shadow: 0 1px 2px rgba(18,22,33,.06), 0 8px 24px rgba(18,22,33,.06);

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --col: 37rem;
  --wide: 1120px;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1016; --surface: #151a23; --surface-2: #1c2230; --ink: #e9ecf2; --ink-2: #c4cad6;
    --muted: #98a1b3; --line: #283041; --accent: #ff7d42; --accent-soft: #3a2117; --patch: #2cc3c1;
    --patch-soft: #12302f; --s-base: #8f949e; --s-dino: #3987e5; --s-sit: #d95926; --s-3: #199e70; --logo-bg: #f2f3f5;
    --code-bg: #0a0d12; --code-ink: #e7eaf0; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1016; --surface: #151a23; --surface-2: #1c2230; --ink: #e9ecf2; --ink-2: #c4cad6;
  --muted: #98a1b3; --line: #283041; --accent: #ff7d42; --accent-soft: #3a2117; --patch: #2cc3c1;
  --patch-soft: #12302f; --s-base: #8f949e; --s-dino: #3987e5; --s-sit: #d95926; --s-3: #199e70; --logo-bg: #f2f3f5;
  --code-bg: #0a0d12; --code-ink: #e7eaf0; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 17.5px; line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--patch); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--f-display); color: var(--ink); text-wrap: balance; line-height: 1.15; margin: 0; }
p { margin: 0; }
sup { line-height: 0; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: var(--wide); margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 20px; height: 54px; }
.brand { font-family: var(--f-display); font-weight: 800; font-stretch: 112%; letter-spacing: -.01em; color: var(--ink); text-decoration: none; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.brand-mark { display: inline-grid; grid-template-columns: repeat(2, 7px); gap: 2px; }
.brand-mark i { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: var(--patch); }
.brand-mark i:nth-child(4) { background: var(--ink); opacity: .25; }
.nav-links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { font-family: var(--f-ui); font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.nav-links a:hover, .nav-links a.on { color: var(--ink); background: var(--surface-2); }
.theme-btn { font: 500 13px var(--f-ui); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 6px; padding: 5px 9px; cursor: pointer; flex: none; }
@media (max-width: 720px) { .nav-links { display: none; } .theme-btn { margin-left: auto; } }

/* ---------- page frame ---------- */
main { padding-inline: 20px; }
.band { max-width: var(--wide); margin: 0 auto; }
.prose { max-width: var(--col); margin: 0 auto; }
.prose p + p { margin-top: 1em; }
section.sec { padding-block: 64px 8px; }
.sec-head { max-width: var(--col); margin: 0 auto 28px; display: grid; gap: 10px; }
.eyebrow { font: 600 12.5px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
h2 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; font-stretch: 108%; letter-spacing: -.015em; }
h3 { font-size: 21px; font-weight: 700; letter-spacing: -.005em; }
.lede { color: var(--ink-2); }
.sub { padding-block: 40px 0; }
.sub > h3 { max-width: var(--col); margin: 0 auto 12px; }
.sub > .prose { margin-bottom: 22px; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); }

/* ---------- hero ---------- */
.hero { padding-block: 56px 24px; text-align: center; }
.kicker { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 10px; align-items: center; font: 600 13px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kicker b { color: var(--surface); background: var(--ink); padding: 5px 8px; border-radius: 5px; letter-spacing: .04em; }
.hero h1 { margin: 22px auto 0; font-size: clamp(24px, 2.35vw, 30px); font-weight: 750; font-stretch: 100%; letter-spacing: -.015em; line-height: 1.2; }
@media (min-width: 1100px) { .hero h1 { white-space: nowrap; } }
.hero h1 .ttl-name { color: var(--accent); }
.hero .ttl-sub { display: block; margin: 18px auto 0; max-width: 30ch; font-size: clamp(19px, 2.5vw, 26px); font-weight: 600; font-stretch: 100%; letter-spacing: -.01em; line-height: 1.25; color: var(--ink-2); }
.authors { margin: 30px auto 0; max-width: 820px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; font-family: var(--f-ui); font-size: 18px; }
.authors a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.authors a:hover { border-color: var(--accent); }
.authors sup { font-size: 11px; color: var(--muted); margin-left: 1px; }
.affils { margin: 12px auto 0; max-width: 820px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; font-family: var(--f-ui); font-size: 14px; color: var(--muted); }
.affils sup { font-size: 10px; margin-right: 2px; }
.buttons { margin: 28px auto 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1 var(--f-ui); text-decoration: none; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn svg { width: 17px; height: 17px; }

.stats { margin: 44px auto 0; max-width: var(--wide); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 20px 18px; text-align: left; display: grid; gap: 6px; align-content: start; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .n { font: 800 clamp(30px, 4vw, 42px)/1 var(--f-display); font-stretch: 110%; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .n small { font-size: .5em; font-weight: 700; color: var(--muted); margin-left: 3px; }
.stat .l { font: 14px/1.4 var(--f-ui); color: var(--muted); }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, minmax(0,1fr)); } .stat:nth-child(3) { border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* ---------- figures ---------- */
figure { margin: 0; }
figcaption { max-width: none; margin: 14px 0 0; font-size: 15px; line-height: 1.55; color: var(--muted); font-style: italic; }
figcaption b { font-style: normal; color: var(--ink); font-family: var(--f-ui); font-weight: 700; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.note { font: 13px/1.45 var(--f-ui); color: var(--muted); }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { font: 600 13.5px/1 var(--f-ui); border: 0; background: transparent; color: var(--muted); padding: 8px 11px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--ink); }
.ctl-label { font: 600 12px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
input[type="range"] { accent-color: var(--accent); width: 180px; max-width: 100%; }

/* ---------- teaser (Fig 1) ---------- */
.teaser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 0; overflow: hidden; padding: 0; }
.teaser-col { padding: 20px 22px 22px; min-width: 0; }
.teaser-col + .teaser-col { border-left: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-soft), transparent 140px); }
.teaser-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font: 700 18px var(--f-display); margin-bottom: 14px; }
.teaser-h span { font: 600 12px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.trow { display: grid; align-items: center; gap: 14px; padding-block: 14px; }
.trow + .trow { border-top: 1px dashed var(--line); }
.teaser-col:first-child .trow { grid-template-columns: minmax(0,1fr) 34px minmax(0,1fr); }
.teaser-col:last-child .trow { grid-template-columns: minmax(0,1.25fr) 34px minmax(0,1fr); }
.cond-card { font: 14px/1.45 var(--f-ui); color: var(--ink-2); }
.cond-card .tag { display: inline-block; font: 600 11px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.cond-card .cls { font: 700 17px var(--f-display); color: var(--ink); }
.prompt { font: italic 13px/1.45 var(--f-body); color: var(--ink-2); max-height: 150px; overflow: auto; border-left: 2px solid var(--line); padding-left: 10px; }
.out { border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); position: relative; }
.out img { width: 100%; height: 100%; object-fit: cover; }
.out .badge { position: absolute; left: 8px; bottom: 8px; font: 600 11px/1 var(--f-mono); color: #fff; background: rgba(0,0,0,.55); padding: 5px 7px; border-radius: 4px; letter-spacing: .04em; }
.flow { height: 2px; background: repeating-linear-gradient(90deg, var(--muted) 0 6px, transparent 6px 11px); position: relative; background-size: 22px 2px; animation: flow 1.1s linear infinite; }
.flow::after { content: ""; position: absolute; right: -2px; top: -4px; border-left: 7px solid var(--muted); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.flow.hot { background-image: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 11px); }
.flow.hot::after { border-left-color: var(--accent); }
@keyframes flow { to { background-position: 22px 0; } }
.cond-vis { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.8fr); gap: 10px; align-items: center; }
.cond-vis .src { border-radius: 6px; overflow: hidden; aspect-ratio: 1; position: relative; }
.cond-vis .src img { width: 100%; height: 100%; object-fit: cover; }
.feat-stack { display: grid; gap: 6px; justify-items: start; font: 600 11px/1.2 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.featmap { width: 100%; max-width: 92px; aspect-ratio: 1; image-rendering: pixelated; border-radius: 4px; }
.token { display: inline-flex; align-items: center; gap: 6px; }
.token i { width: 18px; height: 18px; border-radius: 3px; display: inline-block; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.token i.orange { background: #f07b19; animation: pulse 2.2s ease-in-out infinite; }
.token i.cyan { background: #3fd7cf; animation: pulse 2.2s ease-in-out .6s infinite; }
@keyframes pulse { 50% { transform: scale(1.18); } }
.patch-box { position: absolute; width: 7%; height: 7%; left: 73%; top: 86%; border: 2px solid #ffd400; box-shadow: 0 0 0 1px #000; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.plus { font: 700 16px var(--f-display); color: var(--muted); }
@media (max-width: 860px) {
  .teaser { grid-template-columns: 1fr; }
  .teaser-col + .teaser-col { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- abstract ---------- */
.tldr { max-width: var(--col); margin: 0 auto 26px; font: 600 clamp(19px, 2.3vw, 23px)/1.42 var(--f-display); letter-spacing: -.005em; color: var(--ink); }
.tldr em { font-style: normal; color: var(--accent); }

/* ---------- method diagram ---------- */
.loop svg { width: 100%; height: auto; display: block; }
.loop .lbl { font: 600 13px var(--f-ui); fill: var(--ink); }
.loop .lbl-s { font: 12px var(--f-mono); fill: var(--muted); }
.loop .box { fill: var(--surface-2); stroke: var(--line); }
.loop .box-a { fill: var(--accent-soft); stroke: var(--accent); }
.loop .box-p { fill: var(--patch-soft); stroke: var(--patch); }
.loop .wire { stroke: var(--muted); stroke-width: 1.6; fill: none; }
.loop .grad { stroke: var(--accent); stroke-width: 2.2; fill: none; stroke-dasharray: 6 6; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -12; } }
.loop .pulse { fill: var(--accent); }
.loop-wrap { overflow-x: auto; }
.loop-wrap .loop-r { display: block; width: 100%; max-width: 640px; margin: 0 auto; }
@media (max-width: 640px) { .loop.panel { padding: 8px; } }
.loop .bar { fill: var(--surface); stroke: var(--line); }
.loop .bar-g { fill: var(--accent-soft); stroke: color-mix(in srgb, var(--accent) 45%, transparent); }
.loop .bar-8 { stroke: var(--patch); stroke-width: 2; }
.eq { overflow-x: auto; text-align: center; padding: 6px 0; color: var(--ink); }
.eq mjx-container { color: var(--ink); }

/* potential explorer */
.pot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.pot-viz { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.pot-viz figure { position: relative; }
.pot-viz canvas, .pot-viz .outimg { width: 100%; aspect-ratio: 1; border-radius: 8px; display: block; background: var(--surface-2); }
.pot-viz .cap { font: 600 11.5px/1 var(--f-mono); color: var(--muted); letter-spacing: .05em; text-transform: uppercase; margin-top: 8px; }
.pot-text h4 { font-size: 19px; margin-bottom: 8px; }
.pot-text p { font-size: 16px; color: var(--ink-2); }
.pot-text .eq { text-align: left; margin-top: 10px; }
.pot-tabs { margin-bottom: 18px; }
.spa-ctl { margin-top: 14px; display: grid; gap: 6px; }
@media (max-width: 860px) { .pot { grid-template-columns: 1fr; } }

/* ---------- clusters ---------- */
.refs { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ref { width: 58px; height: 58px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: none; }
.ref img { width: 100%; height: 100%; object-fit: cover; }
.ref[aria-pressed="true"] { border-color: #e03131; box-shadow: 0 0 0 3px color-mix(in srgb, #e03131 25%, transparent); }
.spaces { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.space h4 { font: 700 15px var(--f-ui); margin-bottom: 4px; display: flex; justify-content: space-between; gap: 6px; }
.space h4 span { font: 600 11px var(--f-mono); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.space .verdict { font: 12.5px/1.35 var(--f-ui); color: var(--muted); margin-bottom: 8px; min-height: 2.7em; }
.cgrid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 3px; }
.ctile { display: block; aspect-ratio: 1; width: 100%; border-radius: 3px; background-repeat: no-repeat; background-color: var(--surface-2); opacity: .25; transform: scale(.94); animation: pop .45s ease forwards; }
.cgrid .refimg { outline: 2.5px solid #e03131; outline-offset: -2.5px; }
@keyframes pop { to { opacity: 1; transform: none; } }
.space.bad .cgrid { filter: saturate(.85); }
@media (max-width: 900px) { .spaces { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 460px) { .spaces { grid-template-columns: 1fr; } }

/* charts */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .ax { font: 12px var(--f-mono); fill: var(--muted); }
.chart .axt { font: 600 12.5px var(--f-ui); fill: var(--ink-2); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--ink-2); stroke-width: 1; }
.chart .vlab { font: 600 11.5px var(--f-mono); fill: var(--ink-2); }
.chart .hit { fill: transparent; cursor: default; }
.chart .mark { transition: opacity .15s, y .5s cubic-bezier(.2,.8,.2,1), height .5s cubic-bezier(.2,.8,.2,1); }
.chart .dim { opacity: .35; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 13px var(--f-ui); color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; border-radius: 2px; width: 16px; }
.tip { position: absolute; pointer-events: none; z-index: 5; background: var(--ink); color: var(--bg); font: 12.5px/1.4 var(--f-ui); padding: 7px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .12s; }
.tip b { font: 700 14px var(--f-mono); display: block; }
.tip.on { opacity: 1; }
.charts-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.charts-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
@media (max-width: 860px) { .charts-2, .charts-3 { grid-template-columns: 1fr; } }
.chart-title { font: 700 14.5px var(--f-ui); margin-bottom: 6px; color: var(--ink); }
.chart-title span { font-weight: 500; color: var(--muted); }

/* interpolation pad */
.interp { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px; align-items: center; }
.pad-wrap { display: grid; gap: 10px; }
.pad { position: relative; aspect-ratio: 8 / 4; border-radius: 10px; background: var(--surface-2); touch-action: none; cursor: crosshair; overflow: hidden; border: 1px solid var(--line); }
.pad .corner { position: absolute; width: 21%; aspect-ratio: 1; opacity: .9; pointer-events: none; }
.pad .corner img { width: 100%; height: 100%; object-fit: cover; }
.pad .c0 { left: 0; top: 0; border-bottom-right-radius: 10px; overflow: hidden; } .pad .c1 { right: 0; top: 0; border-bottom-left-radius: 10px; overflow: hidden; }
.pad .c2 { left: 0; bottom: 0; border-top-right-radius: 10px; overflow: hidden; } .pad .c3 { right: 0; bottom: 0; border-top-left-radius: 10px; overflow: hidden; }
.pad .knob { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.35); transform: translate(-50%,-50%); pointer-events: none; }
.pad .wts { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); font: 600 11px/1.3 var(--f-mono); color: var(--muted); text-align: center; pointer-events: none; }
.interp-big { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.interp-big img { width: 100%; height: 100%; object-fit: cover; }
.igrid { display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); gap: 3px; }
.igrid button { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 3px; overflow: hidden; outline-offset: -2px; aspect-ratio: 1; }
.igrid img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; opacity: .55; }
.igrid button.on img, .igrid button:hover img { opacity: 1; }
.igrid button.on { outline: 3px solid var(--accent); }
.interp-right { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; align-items: center; }
@media (max-width: 860px) { .interp, .interp-right { grid-template-columns: 1fr; } .interp-big { max-width: 360px; } }

/* toy */
.toy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.toy canvas { width: 100%; aspect-ratio: 1; display: block; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); touch-action: none; }
.toy .cv-cap { font: 600 11.5px/1 var(--f-mono); color: var(--muted); letter-spacing: .05em; text-transform: uppercase; margin-top: 8px; text-align: center; }
.toy-ctl { display: grid; gap: 14px; margin-top: 16px; }
@media (max-width: 760px) { .toy { grid-template-columns: 1fr; } }

/* gallery */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.gcard { display: grid; gap: 6px; }
.gpair { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.gpair img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .35s ease; }
.gpair .anc { opacity: 0; }
.gpair:hover .anc, .gpair:focus-visible .anc { opacity: 1; }
.gpair .mini { position: absolute; left: 6px; top: 6px; width: 32%; aspect-ratio: 1; border-radius: 5px; overflow: hidden; border: 2px solid var(--surface); box-shadow: 0 2px 6px rgba(0,0,0,.3); z-index: 2; }
.gpair .mini img { position: static; }
.gpair .mini.mask { left: auto; right: 6px; width: 22%; image-rendering: pixelated; }
.gcap { font: 12px var(--f-mono); color: var(--muted); display: flex; justify-content: space-between; }
.gmore { display: flex; justify-content: center; margin-top: 16px; }

/* image compare wipe */
.wipe { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); touch-action: none; cursor: ew-resize; user-select: none; }
.wipe img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.wipe .top { clip-path: inset(0 0 0 50%); }
.wipe .bar { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; left: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.wipe .bar::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; font: 700 15px var(--f-ui); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.wipe .wl { position: absolute; top: 10px; font: 600 11px/1 var(--f-mono); color: #fff; background: rgba(0,0,0,.55); padding: 5px 7px; border-radius: 4px; pointer-events: none; }

/* composition */
.comp { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.ccard { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto auto; gap: 6px 8px; align-items: center; }
.ccard .srcs { display: grid; gap: 6px; }
.ccard .srcs div { position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 1; }
.ccard .srcs img { width: 100%; height: 100%; object-fit: cover; }
.ccard .srcs span { position: absolute; left: 4px; bottom: 4px; font: 600 10px/1 var(--f-mono); color: #fff; background: rgba(0,0,0,.55); padding: 3px 5px; border-radius: 3px; text-transform: uppercase; letter-spacing: .04em; }
.ccard .res { grid-column: 3; border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.ccard .res img { width: 100%; height: 100%; object-fit: cover; }
.ccard .arrow { width: 26px; }
.ccard { grid-template-columns: minmax(0, .55fr) 26px minmax(0, 1fr); }
.bgstrip { display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); gap: 6px; margin-top: 16px; }
.bgstrip figure { display: grid; gap: 4px; }
.bgstrip img { aspect-ratio: 1; object-fit: cover; border-radius: 5px; width: 100%; }
.bgstrip span { font: 11px var(--f-mono); color: var(--muted); text-align: center; }
@media (max-width: 640px) { .bgstrip { grid-template-columns: repeat(4, minmax(0,1fr)); } }

/* baselines */
.cmp-table { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; }
.cmp-table .hd { font: 600 12px/1.25 var(--f-ui); color: var(--muted); text-align: center; padding-bottom: 4px; align-self: end; }
.cmp-table .hd.ours { color: var(--accent); }
.cmp-table img { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: 5px; transition: transform .2s; }
.cmp-table img:hover { transform: scale(1.04); }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.t { border-collapse: collapse; width: 100%; font: 13.5px/1.35 var(--f-ui); font-variant-numeric: tabular-nums; }
table.t th, table.t td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.t th { font-weight: 600; color: var(--muted); font-size: 12.5px; background: var(--surface-2); }
table.t td:first-child, table.t th:first-child, table.t td.l, table.t th.l { text-align: left; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num { font-family: var(--f-mono); font-size: 13px; }
table.t td.best { font-weight: 700; color: var(--ink); background: var(--accent-soft); }
table.t tr.grp td { border-top: 2px solid var(--line); }
table.t .ours { color: var(--accent); font-weight: 700; }
.bar-cell { position: relative; }
.bar-cell .fill { position: absolute; left: 0; top: 18%; bottom: 18%; background: var(--patch-soft); border-radius: 0 3px 3px 0; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar-cell span { position: relative; }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; font: 600 14px var(--f-ui); color: var(--ink-2); padding: 6px 0; }
details.more summary:hover { color: var(--accent); }
details.more[open] summary { margin-bottom: 10px; }

/* failures, misc */
.fails { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fail { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 4px; }
.fail img { aspect-ratio: 1; object-fit: cover; border-radius: 4px; width: 100%; }
.fail p { grid-column: 1 / -1; font: 13px/1.4 var(--f-ui); color: var(--muted); }
.fail p b { color: var(--ink); }
@media (max-width: 820px) { .fails { grid-template-columns: 1fr; } }
.div-strip { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; margin-top: 14px; }
.div-strip img { aspect-ratio: 1; object-fit: cover; border-radius: 4px; width: 100%; }
.div-strip .first { outline: 2px solid var(--ink); outline-offset: -2px; }
.div-head { display: grid; grid-template-columns: 1fr 3fr 3fr; gap: 4px; font: 600 11.5px var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; text-align: center; margin-top: 14px; }
.hires { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; width: 54px; height: 54px; cursor: pointer; background: none; }
.thumbs button[aria-pressed="true"] { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .hires { grid-template-columns: 1fr; } }

/* bibtex */
.bib { position: relative; max-width: 52rem; }
.bib pre { margin: 0; background: var(--code-bg); color: var(--code-ink); border-radius: var(--r); padding: 20px 22px; overflow-x: auto; font: 13.5px/1.6 var(--f-mono); }
.copy { position: absolute; top: 12px; right: 12px; font: 600 12.5px var(--f-ui); background: rgba(255,255,255,.1); color: var(--code-ink); border: 1px solid rgba(255,255,255,.2); border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.copy:hover { background: rgba(255,255,255,.18); }

footer { margin-top: 80px; border-top: 1px solid var(--line); padding: 26px 20px 40px; }
footer .band { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font: 14px var(--f-ui); color: var(--muted); }
footer a { color: var(--muted); }

@media (max-width: 420px) { .gal { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; } .gcap span:last-child { display: none; } }

.isp { display: block; width: 100%; height: 100%; aspect-ratio: 1; background-image: url(../img/interp_grid.webp); background-size: 800% 400%; background-repeat: no-repeat; }
.igrid .isp { opacity: .55; transition: opacity .2s; }
.igrid button.on .isp, .igrid button:hover .isp { opacity: 1; }

.sf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.sf-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sf-pair figure { display: grid; gap: 5px; }
.sf-pair img { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: 6px; }
.sf-pair span { font: 600 11px/1.2 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sf-pair figure:last-child span { color: var(--accent); }
@media (max-width: 760px) { .sf-grid { grid-template-columns: 1fr; } }

.logos { margin: 22px auto 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 28px; }
.logos a { display: flex; align-items: center; background: var(--logo-bg); border-radius: 10px; padding: 8px 14px; }
.logos img { display: block; width: auto; }
.logos .lg-valeo { height: 30px; }
.logos .lg-sq { height: 52px; }
.logos .lg-enpc { height: 64px; }
@media (max-width: 480px) { .logos { gap: 10px; } .logos a { padding: 6px 9px; } .logos .lg-valeo { height: 20px; } .logos .lg-sq { height: 38px; } .logos .lg-enpc { height: 46px; } }

.out .badge.ours { line-height: 1.3; right: 8px; max-width: calc(100% - 16px); }
.out .badge.ours b { display: block; color: #ffb38a; font-weight: 700; }
@media (max-width: 480px) { .out .badge { font-size: 9.5px; left: 5px; bottom: 5px; padding: 4px 5px; } .out .badge.ours { right: auto; } }

#alignTable td.sim { min-width: 120px; }
@media (max-width: 640px) {
  #alignTable table.t { font-size: 11.5px; }
  #alignTable table.t th, #alignTable table.t td { padding: 6px 5px; white-space: normal; }
  #alignTable table.t td.num { font-size: 11.5px; white-space: nowrap; }
  #alignTable td.sim { min-width: 54px; }
  #alignTable .wd { display: none; }
  #results .panel { padding: 12px; }
}
@media (max-width: 640px) { #alignTable table.t td:first-child { white-space: nowrap; } }

.loop .blk { fill: var(--surface); stroke: var(--line); stroke-width: 1.2; }
.loop .blk-g { fill: var(--accent-soft); stroke: color-mix(in srgb, var(--accent) 45%, transparent); }
.loop .blk-tap { stroke: var(--patch); stroke-width: 2; }
.loop .enc { fill: var(--surface-2); stroke: var(--line); }

.hl { color: var(--accent); font-weight: 600; }
.loop .frz { fill: var(--surface-2); stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 5 4; }
