/* Theme colours and six corruption-family colours. */

:root {
  color-scheme: light;
  --page: #f6f6f3;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #6f6e69;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --brand-cc: #c4501c;
  --accent-ink: #1c5cab;
  --accent-wash: rgba(42, 120, 214, 0.10);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);

  --fam-sensor_exposure: #2a78d6;
  --fam-optics_motion: #eb6834;
  --fam-environment: #1baf7a;
  --fam-encoding_resolution: #eda100;
  --fam-scene_clutter: #e87ba4;
  --fam-visibility_loss: #008300;

  --grp-1: #2a78d6;
  --grp-2: #eb6834;
  --grp-3: #1baf7a;
  --grp-4: #4a3aa7;

  --div-neg: #2a78d6;
  --div-mid: #f0efec;
  --div-pos: #d03b3b;

  /* ordinal blue ramp (severity): light, moderate, high */
  --seq-1: #86b6ef;
  --seq-2: #2a78d6;
  --seq-3: #104281;

  --radius: 14px;
  --maxw: 1180px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --ink-3: #9b9a93;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --brand-cc: #eb6834;
    --accent-ink: #86b6ef;
    --accent-wash: rgba(57, 135, 229, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --fam-sensor_exposure: #3987e5;
    --fam-optics_motion: #d95926;
    --fam-environment: #199e70;
    --fam-encoding_resolution: #c98500;
    --fam-scene_clutter: #d55181;
    --fam-visibility_loss: #008300;
    --grp-1: #3987e5;
    --grp-2: #d95926;
    --grp-3: #199e70;
    --grp-4: #9085e9;
    --div-neg: #3987e5;
    --div-mid: #383835;
    --div-pos: #e66767;
    --seq-1: #184f95;
    --seq-2: #3987e5;
    --seq-3: #86b6ef;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --ink-3: #9b9a93;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #3987e5;
  --brand-cc: #eb6834;
  --accent-ink: #86b6ef;
  --accent-wash: rgba(57, 135, 229, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --fam-sensor_exposure: #3987e5;
  --fam-optics_motion: #d95926;
  --fam-environment: #199e70;
  --fam-encoding_resolution: #c98500;
  --fam-scene_clutter: #d55181;
  --fam-visibility_loss: #008300;
  --grp-1: #3987e5;
  --grp-2: #d95926;
  --grp-3: #199e70;
  --grp-4: #9085e9;
  --div-neg: #3987e5;
  --div-mid: #383835;
  --div-pos: #e66767;
  --seq-1: #184f95;
  --seq-2: #3987e5;
  --seq-3: #86b6ef;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: 0.88em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 20px; height: 22px; flex: none; }
.brand .cc { color: var(--brand-cc); }
.nav-links { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--ink-2); padding: 6px 11px; border-radius: 8px; font-size: 0.92rem; font-weight: 500; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { background: var(--accent-wash); color: var(--ink); text-decoration: none; }
.theme-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); border-radius: 9px; width: 36px; height: 36px; cursor: pointer; display: grid; place-items: center; flex: none; }
.theme-toggle:hover { color: var(--ink); }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 500px at 12% 0%, rgba(57, 135, 229, .35), transparent 60%),
    radial-gradient(800px 500px at 95% 20%, rgba(124, 92, 255, .30), transparent 60%),
    radial-gradient(600px 400px at 60% 110%, rgba(232, 123, 164, .18), transparent 60%),
    #070a14;
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 40% 30%, #000 30%, transparent 75%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 80px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); font-size: .84rem; font-weight: 600; letter-spacing: .01em; color: #dfe6ff; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #3dd68c; box-shadow: 0 0 0 4px rgba(61,214,140,.18); }
.hero h1 { margin: 20px 0 8px; font-size: clamp(3.2rem, 7.5vw, 5.6rem); line-height: .95; letter-spacing: -0.045em; font-weight: 850;
  display: flex; align-items: center; gap: .22em; }
.hero h1 .grad { background: linear-gradient(100deg, #ffffff 0%, #bcd4ff 60%, #c7b8ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .cc { color: #eb6834; }
.hero-mark { width: .72em; height: .8em; flex: none; }
.hero .subtitle { font-size: clamp(1.15rem, 2.1vw, 1.45rem); line-height: 1.35; font-weight: 600; color: #e9edf8; margin: 0 0 22px; letter-spacing: -0.01em; max-width: 34ch; }
.authors { font-size: 1.05rem; color: #fff; font-weight: 600; margin: 0; }
.affil { color: #a9b3cc; margin: 2px 0 26px; font-size: .97rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 11px; font-weight: 600; font-size: .95rem; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.07); color: #fff; cursor: pointer; transition: background .15s, transform .15s; }
.btn:hover { background: rgba(255,255,255,.14); text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: #fff; color: #0b1020; border-color: #fff; }
.btn.primary:hover { background: #e8eeff; }
.btn svg { width: 17px; height: 17px; }
.btn .soon { font-size: .72rem; font-weight: 600; opacity: .7; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.14); }
.btn.primary .soon { background: rgba(11,16,32,.08); }

.hero-visual { position: relative; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.12); background: #000; aspect-ratio: 4 / 3; }
.hero-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease; }
.hero-visual img.on { opacity: 1; }
.hero-caption { position: absolute; left: 14px; bottom: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; z-index: 2; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: .86rem; font-weight: 600; background: rgba(8,10,20,.72); color: #fff; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.14); }
.pill .sw { width: 9px; height: 9px; border-radius: 3px; }
.hero-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(255,255,255,.12); z-index: 2; }
.hero-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #86b6ef, #c7b8ff); }

/* ------------------------------------------------------------------ stats */
.stats { margin-top: -38px; position: relative; z-index: 3; }
.stats .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.stat .v { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.stat .v small { font-size: 1.05rem; font-weight: 700; color: var(--ink-2); letter-spacing: -0.01em; }
.stat .l { color: var(--ink-2); font-size: .93rem; margin-top: 6px; }

/* ------------------------------------------------------------------ sections */
section.block { padding: 88px 0 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent-ink); margin: 0 0 10px; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); letter-spacing: -0.03em; line-height: 1.12; margin: 0 0 14px; font-weight: 800; }
h3 { font-size: 1.2rem; letter-spacing: -0.015em; margin: 0 0 8px; font-weight: 700; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 70ch; margin: 0 0 28px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.abstract { padding: 30px 34px; font-size: 1.06rem; line-height: 1.75; color: var(--ink); }
.abstract p { margin: 0; }

/* pipeline diagram (the paper's Figure 1) */
.pl-wrap { padding: 28px 28px 30px; overflow: hidden; }
.pl { --wide: 1; position: relative; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1.15fr) 72px minmax(0, 1fr);
  grid-template-rows: auto 64px auto 52px auto;
  grid-template-areas: "clutter . scene . visib" ". . . . ." "env . optics . sensor" ". . . . ." ". . model . enc"; }
.pl-clutter { grid-area: clutter; } .pl-visib { grid-area: visib; } .pl-scene { grid-area: scene; }
.pl-env { grid-area: env; } .pl-optics { grid-area: optics; } .pl-sensor { grid-area: sensor; }
.pl-enc { grid-area: enc; } .pl-model { grid-area: model; }
.pl-wires { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 0; }
.pl-wire { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 6 5; animation: pl-flow 1.4s linear infinite; }
.pl-head { fill: var(--accent); }
.pl-cambox { fill: color-mix(in srgb, var(--accent) 4%, transparent); stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 4; }
@keyframes pl-flow { to { stroke-dashoffset: -11; } }
.pl-cam { position: absolute; z-index: 1; transform: translate(-100%, -50%); display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.pl-card { position: relative; z-index: 1; font: inherit; text-align: left; color: var(--ink); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--fc, var(--ink-3)) 45%, var(--border)); background: color-mix(in srgb, var(--fc, var(--ink-3)) 7%, var(--surface)); box-shadow: var(--shadow); }
button.pl-card { cursor: pointer; transition: transform .15s, box-shadow .15s; }
button.pl-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 12px 28px rgba(0,0,0,.12); }
.pl-ic { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: var(--fc, var(--ink-2)); background: color-mix(in srgb, var(--fc, var(--ink-3)) 15%, var(--surface)); }
.pl-ic svg { width: 26px; height: 26px; }
.pl-ic-sm svg { width: 15px; height: 15px; display: block; }
.pl-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pl-txt b { font-size: .98rem; letter-spacing: -0.01em; }
.pl-eg { font-size: .84rem; color: var(--ink-2); }
.pl-n { font-size: .74rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }
.pl-scene { position: relative; z-index: 1; margin: 0; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); border: 2px solid var(--surface); }
.pl-scene img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pl-scene figcaption { position: absolute; left: 10px; top: 10px; font-size: .8rem; padding: 4px 10px; }
.pl-model { --fc: var(--grp-4); }
.prec-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.prec-chips span { font-size: .76rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: color-mix(in srgb, var(--fc, var(--ink-3)) 14%, var(--surface)); color: var(--ink-2); }
.pl-model .prec-chips { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .pl-wire { animation: none; } }

/* families */
.families { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.family { overflow: hidden; display: flex; flex-direction: column; }
.family .thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.family .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.family:hover .thumb img { transform: scale(1.04); }
.family .thumb .pill { position: absolute; left: 10px; top: 10px; }
.family .body { padding: 16px 18px 18px; border-top: 3px solid var(--fc); }
.family .body h3 { display: flex; align-items: baseline; justify-content: space-between; }
.family .body h3 small { color: var(--ink-3); font-weight: 600; font-size: .85rem; }
.family ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.family li button { font: inherit; font-size: .86rem; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); border-radius: 8px; padding: 4px 9px; cursor: pointer; }
.family li button:hover { border-color: var(--fc); background: color-mix(in srgb, var(--fc) 12%, var(--surface)); }
.mark-alt { color: var(--ink-3); font-weight: 700; margin-left: 2px; }
.legend-note { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; color: var(--ink-2); font-size: .92rem; }
.callout { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 20px 22px; margin-top: 18px; align-items: start; }
.callout .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent-ink); }
.callout p { margin: 0; color: var(--ink-2); }
.callout b { color: var(--ink); }
.formula { font-family: var(--mono); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; color: var(--ink); font-size: .9em; }

/* ------------------------------------------------------------------ explorer */
.explorer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
.viewer-card { padding: 14px; }
.scenes { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.scene-btn { flex: none; border: 2px solid transparent; border-radius: 10px; padding: 0; cursor: pointer; background: none; position: relative; }
.scene-btn img { width: 92px; height: 60px; object-fit: cover; border-radius: 8px; opacity: .72; transition: opacity .15s; }
.scene-btn:hover img, .scene-btn[aria-pressed="true"] img { opacity: 1; }
.scene-btn[aria-pressed="true"] { border-color: var(--accent); }
.scene-btn span { position: absolute; left: 5px; bottom: 4px; font-size: .68rem; font-weight: 700; color: #fff; background: rgba(0,0,0,.55); padding: 1px 5px; border-radius: 4px; }
.compare { position: relative; border-radius: 12px; overflow: hidden; background: #000; user-select: none; touch-action: pan-y; }
.compare img { width: 100%; height: auto; display: block; }
.compare .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .after img { width: 100%; height: 100%; object-fit: cover; }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); transform: translateX(-1px); pointer-events: none; }
.compare .handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; font-size: 18px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare .lbl { position: absolute; top: 10px; z-index: 2; pointer-events: none; }
.compare .lbl.l { left: 10px; } .compare .lbl.r { right: 10px; }
.compare.loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); animation: shimmer 1s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.viewer-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--ink-3); font-size: .86rem; flex-wrap: wrap; }

.panel { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.ctrl-label { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 7px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; width: 100%; }
.seg button { flex: 1; font: inherit; font-size: .9rem; font-weight: 600; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
select.sel { width: 100%; font: inherit; font-size: .95rem; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
.fam-row { display: flex; flex-wrap: wrap; gap: 6px; }
.fam-chip { font: inherit; font-size: .82rem; font-weight: 600; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.fam-chip .sw { width: 9px; height: 9px; border-radius: 3px; }
.fam-chip[aria-pressed="true"] { color: var(--ink); border-color: var(--ink-3); background: var(--surface-2); }
.corr-list { display: flex; flex-direction: column; gap: 4px; }
/* Side by side, the image sets the row height and the control panel scrolls. */
@media (min-width: 1021px) {
  .explorer .panel { height: 0; min-height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .explorer .panel > * { flex: none; }
}
.corr-btn { font: inherit; text-align: left; font-size: .93rem; padding: 7px 10px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.corr-btn:hover { background: var(--surface-2); color: var(--ink); }
.corr-btn[aria-pressed="true"] { background: var(--accent-wash); color: var(--ink); border-color: color-mix(in srgb, var(--accent) 35%, transparent); font-weight: 600; }
.info h3 { margin: 0 0 4px; }
.info p { margin: 0 0 10px; color: var(--ink-2); font-size: .93rem; }
.kv { width: 100%; border-collapse: collapse; font-size: .86rem; }
.kv td { padding: 4px 0; border-bottom: 1px solid var(--grid); vertical-align: top; }
.kv td:first-child { color: var(--ink-3); font-family: var(--mono); font-size: .8rem; padding-right: 10px; word-break: break-all; }
.kv td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.flag { display: inline-flex; gap: 6px; align-items: center; font-size: .84rem; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); margin: 0 6px 8px 0; }

.link-btn { font: inherit; font-size: .88rem; font-weight: 600; color: var(--accent-ink); background: var(--accent-wash); border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; margin: 0 0 12px; }
.link-btn:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ annotations */
.x-mark { color: #eb6834; }
.annot-card { padding: 14px; }
.annot-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.annot-top .scenes { margin: 0; flex: 1 1 420px; min-width: 0; }
.annot-top .scene-btn img { width: 80px; height: 54px; }
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.annot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.annot-pane { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: #000; }
.annot-pane canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: pan-y; }
.annot-pane .lbl { position: absolute; left: 10px; top: 10px; pointer-events: none; max-width: calc(100% - 20px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.annot-summary { margin-top: 14px; }
.annot-summary p { margin: 10px 0 4px; color: var(--ink-2); font-size: .95rem; }
.an-count { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 1.02rem; color: var(--ink-2); margin-bottom: 8px; }
.an-count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.an-gone { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.an-bar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.an-bar span { display: block; height: 100%; }
.an-bar .k { background: #1baf7a; }
.an-bar .g { background: #eb6834; }
.an-bar.sm { height: 6px; border-radius: 3px; margin-top: 6px; }
.mk { display: inline-block; width: 12px; height: 12px; }
.mk.dot { border-radius: 50%; background: #1baf7a; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--border); }
.mk.x { color: #eb6834; font-weight: 900; font-size: 18px; line-height: 12px; text-align: center; }
.annot-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.an-tile { font: inherit; text-align: left; padding: 0; border: 2px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--ink); cursor: pointer; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.an-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; opacity: .8; transition: opacity .15s; }
.an-tile:hover img, .an-tile[aria-pressed="true"] img { opacity: 1; }
.an-tile[aria-pressed="true"] { border-color: var(--accent); }
.an-tile .t { padding: 7px 8px 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.an-tile .nm { font-size: .8rem; font-weight: 600; line-height: 1.25; }
.an-tile .v { font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ findings */
.findings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.finding { padding: 22px; position: relative; overflow: hidden; }
.finding .big { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.finding .big small { font-size: 1rem; color: var(--ink-2); font-weight: 700; }
.finding h3 { margin-top: 10px; }
.finding p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.finding .n { position: absolute; right: 16px; top: 12px; font-size: .78rem; font-weight: 800; color: var(--ink-3); }

/* ------------------------------------------------------------------ charts */
.chart-card { padding: 20px 22px 16px; margin-top: 18px; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-head h3 { margin: 0; }
.chart-head p { margin: 2px 0 0; color: var(--ink-2); font-size: .92rem; max-width: 70ch; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.controls .seg { width: auto; }
.controls .seg button { flex: none; padding: 6px 11px; font-size: .86rem; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .86rem; color: var(--ink-2); margin: 6px 0 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
svg text { fill: var(--ink-2); font-family: var(--font); }
svg .axis line, svg .axis path { stroke: var(--axis); }
svg .gridline { stroke: var(--grid); }
.viz { width: 100%; overflow-x: auto; }
.tooltip { position: fixed; z-index: 100; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 10px; padding: 9px 11px; font-size: .85rem; line-height: 1.45; opacity: 0; transform: translateY(4px); transition: opacity .1s, transform .1s; max-width: 280px; }
.tooltip.on { opacity: 1; transform: none; }
.tooltip b { font-weight: 700; }
.tooltip .t-row { display: flex; justify-content: space-between; gap: 14px; color: var(--ink-2); }
.tooltip .t-row span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.figs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 18px; }
.fig { padding: 14px; }
.fig img { border-radius: 8px; background: #fff; cursor: zoom-in; }
.fig figcaption { color: var(--ink-2); font-size: .9rem; margin-top: 10px; }
.fig figcaption b { color: var(--ink); }

/* ------------------------------------------------------------------ leaderboard */
.lb-wrap { overflow-x: auto; }
table.lb { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; min-width: 820px; }
table.lb th { position: sticky; top: 0; text-align: right; font-size: .8rem; letter-spacing: .01em; color: var(--ink-3); font-weight: 700; padding: 10px 10px; border-bottom: 1px solid var(--axis); background: var(--surface); cursor: pointer; white-space: nowrap; user-select: none; }
table.lb th:nth-child(-n+3) { text-align: left; }
table.lb th[aria-sort] { color: var(--ink); }
table.lb th[aria-sort="ascending"]::after { content: " ↑"; }
table.lb th[aria-sort="descending"]::after { content: " ↓"; }
table.lb td { padding: 9px 10px; border-bottom: 1px solid var(--grid); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.lb td:nth-child(-n+3) { text-align: left; }
table.lb tr:hover td { background: var(--accent-wash); }
table.lb td.rank { color: var(--ink-3); width: 36px; }
table.lb td.model { font-weight: 600; }
.grp { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: .86rem; }
.grp i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.best { font-weight: 800; color: var(--ink); }
.best::before { content: "★ "; color: var(--accent); font-size: .8em; }
.bar-cell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-cell .b { height: 6px; border-radius: 0 3px 3px 0; background: var(--accent); opacity: .55; }
.delta-pos { color: #b42323; } .delta-neg { color: #1c5cab; }
:root[data-theme="dark"] .delta-pos { color: #f08b8b; } :root[data-theme="dark"] .delta-neg { color: #86b6ef; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .delta-pos { color: #f08b8b; } :root:where(:not([data-theme="light"])) .delta-neg { color: #86b6ef; } }
.table-note { color: var(--ink-3); font-size: .86rem; margin-top: 10px; }

/* heatmap */
.hm-wrap { overflow-x: auto; }
.swipe-hint { display: none; margin: 0 0 8px; font-size: .82rem; color: var(--ink-3); }
.hm-rank { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; }
.rank-list { display: flex; flex-direction: column; gap: 2px; font-size: .86rem; }
.rank-item { display: grid; grid-template-columns: 22px 128px 1fr 58px; gap: 8px; align-items: center; padding: 3px 4px; border-radius: 6px; }
.rank-item:hover { background: var(--accent-wash); }
.rank-item .r { color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.rank-item .name { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-item .bar { position: relative; height: 10px; }
.rank-item .bar b { position: absolute; left: 0; top: 0; height: 10px; border-radius: 0 4px 4px 0; }
.rank-item .v { font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; }

/* ------------------------------------------------------------------ code + bib */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.step .k { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; background: var(--accent-wash); color: var(--accent-ink); }
.step p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.codebox { position: relative; background: #0b1020; color: #e6edf7; border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: .84rem; line-height: 1.6; margin: 0; }
.codebox .c { color: #7f8aa8; }
.copy { position: absolute; top: 8px; right: 8px; font: inherit; font-size: .76rem; font-weight: 600; padding: 4px 9px; border-radius: 7px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #e6edf7; cursor: pointer; }
.copy:hover { background: rgba(255,255,255,.16); }
.bib { margin-top: 6px; }

footer { margin-top: 56px; border-top: 1px solid var(--border); padding: 20px 0 28px; color: var(--ink-3); font-size: .84rem; }

footer p { margin: 0 0 4px; }
.foot-brand b { color: var(--ink); }
.foot-mark { width: 14px; height: 16px; vertical-align: -3px; margin-right: 6px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(5,8,16,.86); display: none; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox.on { display: grid; }
.lightbox img { max-height: 92vh; border-radius: 10px; background: #fff; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-visual img { transition: none; }
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1020px) {
  .pl { --wide: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; row-gap: 46px; column-gap: 14px;
    grid-template-areas: "clutter visib" "scene scene" "env env" "optics optics" "sensor sensor" "enc enc" "model model"; }
  .pl-scene { justify-self: center; width: min(100%, 420px); }
  .pl-optics { margin-top: 18px; }
  .pl-sensor { margin-bottom: 6px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; padding-top: 48px; }
  .stats .grid { grid-template-columns: repeat(2, 1fr); }
  .families, .findings, .steps { grid-template-columns: repeat(2, 1fr); }
  .explorer, .hm-rank { grid-template-columns: 1fr; }
  .annot-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .figs { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .swipe-hint { display: block; }
  /* Leaderboard: drop rank, type and params; keep the model name in view while scrolling. */
  table.lb { min-width: 560px; }
  table.lb th:nth-child(1), table.lb td:nth-child(1), table.lb th:nth-child(3), table.lb td:nth-child(3),
  table.lb th:nth-child(4), table.lb td:nth-child(4) { display: none; }
  table.lb th:nth-child(2), table.lb td:nth-child(2) { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; }
  table.lb th:nth-child(2) { z-index: 2; }
  .wrap { padding: 0 16px; }
  .nav-links { display: none; }
  .theme-toggle { margin-left: auto; }
  .stats .grid, .families, .findings, .steps { grid-template-columns: 1fr; }
  .abstract { padding: 22px 20px; }
  .pl-wrap { padding: 20px 16px 22px; }
  .pl-clutter, .pl-visib { flex-direction: column; align-items: flex-start; gap: 8px; }
  section.block { padding-top: 64px; }
  .stat .v { font-size: 1.9rem; }
  .annot-pair { grid-template-columns: 1fr; }
  .annot-strip { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .an-tile { flex: none; width: 138px; }
}
@media (max-width: 640px) {
  #hero-scene { display: none; }
  .hero-caption .pill { font-size: .8rem; }
}
