/* O-SCD series — shared theme for every paper page under docs/.
   Each page sets <body data-paper="oscd|oscdpp"> to pick its accent. */

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;

  --bg: #fcfcfb;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --ink: #16181d;
  --ink-2: #474c56;
  --ink-3: #6b717c;
  --line: #e2e4e8;
  --line-strong: #c9ccd3;
  --paper: #ffffff;            /* figures always sit on white */
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);

  --oscd: #1f77b4;             /* the papers' own colours: O-SCD blue ... */
  --oscdpp: #d62728;           /* ... and O-SCD++ red */
  --neutral-mark: #8b919c;


  --wide: 1100px;
  --prose: 760px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101216;
    --surface: #15181d;
    --surface-2: #1c2026;
    --ink: #e8eaee;
    --ink-2: #b4b9c3;
    --ink-3: #8b919c;
    --line: #2a2f37;
    --line-strong: #3a404a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --oscd: #3b8fd0;
    --oscdpp: #e8524e;
    --neutral-mark: #7d838e;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #101216;
  --surface: #15181d;
  --surface-2: #1c2026;
  --ink: #e8eaee;
  --ink-2: #b4b9c3;
  --ink-3: #8b919c;
  --line: #2a2f37;
  --line-strong: #3a404a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --oscd: #3b8fd0;
  --oscdpp: #e8524e;
  --neutral-mark: #7d838e;
  color-scheme: dark;
}

/* The accent and its tints live on <body> so they follow data-paper. */
body {
  --accent: var(--oscd);
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--surface));
  --accent-line: color-mix(in srgb, var(--accent) 35%, var(--line));
}
body[data-paper="oscdpp"] { --accent: var(--oscdpp); }

/* ---------- base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
strong { font-weight: 600; }
sup { font-size: .68em; line-height: 0; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--ink); color: var(--bg); border-radius: 8px; }
.skip-link:focus { left: 8px; }

.wrap { width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--prose); margin-left: auto; margin-right: auto; }

/* ---------- series bar ---------- */

.series-bar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.series-bar .wrap { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.series-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; letter-spacing: .01em; white-space: nowrap; }
.series-brand img { width: 22px; height: 22px; }
.series-brand span { color: var(--ink-3); font-weight: 500; }
.series-nav { display: flex; gap: 2px; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
.series-nav::-webkit-scrollbar { display: none; }
.series-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.series-nav a:hover { background: var(--surface-2); color: var(--ink); }
.series-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.series-nav .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.series-nav .dot.oscd { background: var(--oscd); }
.series-nav .dot.oscdpp { background: var(--oscdpp); }
.series-nav small { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.series-tools { margin-left: auto; display: flex; gap: 4px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
@media (max-width: 560px) {
  .series-brand span { display: none; }
  .series-nav { margin-left: 0; }
  .series-nav small { display: none; }
}

/* ---------- hero ---------- */

.hero { padding: clamp(40px, 8vw, 88px) 0 28px; text-align: center; }
.venue {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.venue .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  font-family: var(--font-serif); font-weight: 600;
  font-size: clamp(30px, 5.2vw, 52px); line-height: 1.12; letter-spacing: -.015em;
  margin: 22px auto 0; max-width: 940px; text-wrap: balance;
}
.hero h1 .lead { color: var(--accent); }
.authors { margin: 26px auto 0; max-width: 860px; font-size: 17px; line-height: 1.9; }
.authors a, .authors span.name { color: var(--ink); text-decoration: none; font-weight: 500; white-space: nowrap; }
.authors a:hover { color: var(--accent); }
.authors sup { color: var(--ink-3); margin-left: 1px; }
.authors .list > * + *::before { content: ""; display: inline-block; width: 14px; }
.affils { margin: 8px auto 0; max-width: 860px; color: var(--ink-3); font-size: 14.5px; line-height: 1.8; }
.affils span { white-space: nowrap; }
.affils span + span::before { content: ""; display: inline-block; width: 14px; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: 15px; font-weight: 500; text-decoration: none; line-height: 1.2;
  border: 1px solid var(--ink);
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink-3); }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn .tag { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 20%, transparent); }
.btn.ghost .tag { background: var(--surface-2); color: var(--ink-3); }

.tldr {
  margin: 28px auto 0; max-width: var(--prose);
  font-family: var(--font-serif); font-size: clamp(18px, 2.2vw, 21px); line-height: 1.5; color: var(--ink-2);
  text-wrap: pretty;
}
.tldr b { font-family: var(--font-sans); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-right: 8px; vertical-align: 2px; }

/* ---------- sections ---------- */

.section { padding: clamp(44px, 7vw, 80px) 0; }
.section.tint { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section + .section:not(.tint) { padding-top: 8px; }
.tint + .section { padding-top: clamp(44px, 7vw, 80px) !important; }
.eyebrow { display: block; text-align: center; color: var(--accent); font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.section h2 {
  font-family: var(--font-serif); font-weight: 600; text-align: center;
  font-size: clamp(26px, 3.4vw, 34px); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 24px;
  text-wrap: balance;
}
.section h3 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
.section p { margin: 0 0 1em; }
.lede { color: var(--ink-2); text-align: center; max-width: var(--prose); margin: -8px auto 28px !important; text-wrap: pretty; }
.abstract p { color: var(--ink); text-wrap: pretty; }
.abstract p strong { color: var(--ink); }

/* ---------- media ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 16px; }
.tabs [role="tab"] {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 7px 14px; border-radius: 999px; font: 500 14px/1.2 var(--font-sans); cursor: pointer;
}
.tabs [role="tab"]:hover { color: var(--ink); border-color: var(--line-strong); }
.tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
[role="tabpanel"][hidden] { display: none; }

.video-stage { position: relative; background: #000; aspect-ratio: 1920 / 966; }
.video-stage [role="tabpanel"] { position: absolute; inset: 0; }
.video-stage video { width: 100%; height: 100%; object-fit: cover; }
.video-stage.auto { aspect-ratio: auto; }
.video-stage.auto [role="tabpanel"] { position: relative; inset: auto; }
.video-stage.auto video { height: auto; object-fit: fill; }
.quad { position: absolute; inset: 0; pointer-events: none; }
.quad::before, .quad::after { content: ""; position: absolute; background: rgba(255, 255, 255, .3); }
.quad::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.quad::after { top: 50%; left: 0; right: 0; height: 1px; }
.quad .chip:nth-child(2) { left: calc(50% + 10px); }
.quad .chip:nth-child(3) { top: calc(50% + 10px); }
.quad .chip:nth-child(4) { left: calc(50% + 10px); top: calc(50% + 10px); }
@media (max-width: 560px) {
  .quad .chip { font-size: 10px; padding: 2px 6px; left: 5px; top: 5px; }
  .quad .chip:nth-child(2) { left: calc(50% + 5px); }
  .quad .chip:nth-child(3) { top: calc(50% + 5px); }
  .quad .chip:nth-child(4) { left: calc(50% + 5px); top: calc(50% + 5px); }
}
.video-ctrl {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 8px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .55); color: #fff; font: 500 12.5px/1 var(--font-sans);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.video-ctrl svg { width: 14px; height: 14px; }
@media (max-width: 560px) { .video-ctrl span { display: none; } .video-ctrl { padding: 7px; } }
.video-ctrl .play { display: none; }
.video-ctrl[aria-pressed="false"] .play { display: block; }
.video-ctrl[aria-pressed="false"] .pause { display: none; }
.media-caption { padding: 12px 16px; font-size: 14px; color: var(--ink-3); border-top: 1px solid var(--line); background: var(--surface); }

.fig { margin: 0; }
.fig.prose { margin-left: auto; margin-right: auto; }
.fig .paper { background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); padding: clamp(10px, 2vw, 22px); box-shadow: var(--shadow); }
.fig .paper.flush { padding: 0; overflow: hidden; }
.fig .paper.dark { background: #000; border-color: #000; }
.fig img { width: 100%; height: auto; margin: 0 auto; }
.fig a.zoom { display: block; cursor: zoom-in; }
.fig figcaption { margin: 14px auto 0; max-width: 900px; color: var(--ink-2); font-size: 15px; line-height: 1.6; text-wrap: pretty; }
.fig figcaption b:first-child { color: var(--ink); }
.zoom-hint { display: block; text-align: right; font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin: 0 0 16px; font-size: 13.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 22px; height: 12px; border-radius: 3px; border: 1px solid var(--line-strong); display: inline-block; }

/* ---------- stats ---------- */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 16px 14px; text-align: left; }
.stat .v { font-family: var(--font-serif); font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -.01em; color: var(--ink); }
.stat .v small { font-family: var(--font-sans); font-size: 14px; font-weight: 600; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.stat .k { margin-top: 6px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.stat.accent { border-color: var(--accent-line); background: var(--accent-soft); }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- compare (before/after) ---------- */

.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare-grid .cell { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.compare-grid .cell img { width: 100%; height: auto; }
.chip {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  padding: 4px 9px; border-radius: 999px; font: 600 12px/1.2 var(--font-sans);
  background: rgba(0, 0, 0, .62); color: #fff; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.chip.right { left: auto; right: 10px; }
.chip.metric { top: auto; bottom: 10px; font-weight: 500; font-variant-numeric: tabular-nums; }
.chip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

.compare { position: relative; overflow: hidden; border-radius: 10px; background: #000; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.compare img { width: 100%; height: auto; pointer-events: none; }
.compare .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); pointer-events: none; }
.compare .handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; transform: translate(-50%, -50%);
  border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316181d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 7-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E") center / 18px no-repeat;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.compare input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare:focus-within .handle::after { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
table.results { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
table.results caption { caption-side: top; text-align: left; padding: 14px 16px 4px; font-weight: 600; color: var(--ink); }
table.results caption small { display: block; font-weight: 400; color: var(--ink-3); font-size: 13px; }
table.results th, table.results td { padding: 9px 12px; text-align: center; white-space: nowrap; }
table.results th:first-child, table.results td:first-child { text-align: left; padding-left: 16px; }
table.results thead th { font-size: 13px; font-weight: 600; color: var(--ink-3); border-bottom: 1px solid var(--line-strong); }
table.results thead tr.group th { font-size: 13.5px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
table.results tbody tr + tr td { border-top: 1px solid var(--line); }
table.results tbody tr.divider td { border-top: 1px solid var(--line-strong); }
table.results tr.ours td { background: var(--accent-soft); font-weight: 600; }
table.results tr.ours td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.results tr.ref td { color: var(--ink-3); font-style: italic; }
table.results td.best { font-weight: 700; color: var(--ink); }
table.results td.second { text-decoration: underline; text-underline-offset: 3px; }
table.results .sub td:first-child { padding-left: 32px; color: var(--ink-2); }
table.results .yes { color: var(--ink); }
table.results .no { color: var(--ink-3); }
table.results .bl { border-left: 1px solid var(--line); }
.tables-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .tables-2 { grid-template-columns: 1fr; } }
.table-note { font-size: 13.5px; color: var(--ink-3); margin-top: 12px !important; text-align: center; }

/* ---------- chart ---------- */

.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; font-family: var(--font-sans); }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis line, .chart .axis path { stroke: var(--line-strong); stroke-width: 1; }
.chart .tick text { fill: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .axis-title { fill: var(--ink-2); font-size: 13px; font-weight: 500; }
.chart .ref-line { stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .label { fill: var(--ink-2); font-size: 12.5px; }
.chart .label.strong { fill: var(--ink); font-weight: 600; font-size: 13.5px; }
.chart .label.muted { fill: var(--ink-3); font-size: 11.5px; }
.chart .pt { stroke: var(--surface); stroke-width: 2; cursor: default; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; opacity: 0; transition: opacity .12s ease;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: var(--shadow); padding: 8px 10px; font-size: 13px; line-height: 1.45; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px));
}
.chart-tip.on { opacity: 1; }
.chart-tip b { display: block; font-weight: 600; }
.chart-tip span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.chart-legend i.dash { width: 18px; height: 0; border-radius: 0; border-top: 2px dashed currentColor; }

/* ---------- versus (O-SCD -> O-SCD++) ---------- */

.versus { display: grid; grid-template-columns: 120px 1fr 28px 1fr; gap: 10px 12px; align-items: stretch; }
.versus .head { font-weight: 700; font-size: 14px; letter-spacing: .02em; padding: 0 4px 2px; }
.versus .head.old { color: var(--oscd); }
.versus .head.new { color: var(--oscdpp); }
.versus .step { font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; align-self: center; }
.versus .step small { display: block; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 14px; color: var(--ink); }
.versus .box { border-radius: 10px; padding: 12px 14px; font-size: 15px; line-height: 1.5; border: 1px solid; }
.versus .box.old { background: color-mix(in srgb, var(--oscd) 8%, var(--surface)); border-color: color-mix(in srgb, var(--oscd) 30%, var(--line)); color: var(--ink-2); }
.versus .box.new { background: color-mix(in srgb, var(--oscdpp) 8%, var(--surface)); border-color: color-mix(in srgb, var(--oscdpp) 32%, var(--line)); color: var(--ink); }
.versus .arrow { display: grid; place-items: center; color: var(--ink-3); }
.versus .arrow svg { width: 18px; height: 18px; }
.versus .gap { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 4px 0; }
.versus .num { font-family: var(--font-serif); font-size: 22px; font-weight: 600; color: var(--ink); }
.versus .box.old .num { color: var(--ink-2); }
@media (max-width: 680px) {
  .versus { grid-template-columns: 1fr 1fr; }
  .versus .step { grid-column: 1 / -1; margin-top: 6px; }
  .versus .arrow, .versus .spacer { display: none; }
}

/* ---------- grids of images ---------- */

.img-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.img-grid .colhead { font-size: 12.5px; font-weight: 600; color: var(--ink-3); text-align: center; padding-bottom: 2px; }
.img-grid img { width: 100%; height: auto; border-radius: 6px; background: #000; }
.img-grid .rowhead { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 8px; }
.img-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.img-grid .cell { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.img-grid .cell img { border-radius: 0; }
@media (max-width: 640px) { .img-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .img-grid.cols-3 { grid-template-columns: 1fr; } }

/* ---------- related / series cards ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.pcard {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); text-decoration: none; transition: border-color .15s ease, transform .15s ease;
}
a.pcard:hover { border-color: var(--line-strong); transform: translateY(-1px); text-decoration: none; }
.pcard .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }
.pcard .meta .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral-mark); }
.pcard .meta .dot.oscd { background: var(--oscd); }
.pcard .meta .dot.oscdpp { background: var(--oscdpp); }
.pcard .t { font-family: var(--font-serif); font-size: 18px; font-weight: 600; line-height: 1.3; }
.pcard .d { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.pcard.current { border-color: var(--accent-line); background: var(--accent-soft); }
.pcard .here { font-size: 12px; font-weight: 600; color: var(--accent); margin-top: auto; }

/* ---------- bibtex ---------- */

.bib { position: relative; }
.bib pre {
  margin: 0; padding: 18px 92px 18px 20px; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  font: 13.5px/1.6 var(--font-mono); color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink-2); font: 500 13px/1 var(--font-sans); cursor: pointer;
}
.copy-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.copy-btn svg { width: 14px; height: 14px; }

/* ---------- acknowledgements / footer ---------- */

.logos { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; margin-top: 18px; }
.logos img { width: 100%; max-width: 760px; margin: 0 auto; }
.ack { color: var(--ink-2); font-size: 15px; text-align: center; }
footer.site {
  border-top: 1px solid var(--line); padding: 28px 0 40px; margin-top: 24px;
  color: var(--ink-3); font-size: 13.5px; text-align: center;
}
footer.site a { color: var(--ink-2); }

/* ---------- placeholder page ---------- */

.soon { min-height: calc(100vh - 53px); display: grid; place-items: center; text-align: center; padding: 48px 0 64px; }
.soon .mark { width: 72px; height: 72px; margin: 0 auto 22px; }
.soon h1 { font-family: var(--font-serif); font-size: clamp(40px, 8vw, 72px); font-weight: 600; margin: 0; letter-spacing: -.02em; }
.soon h1 span { color: var(--accent); }
.soon p { color: var(--ink-2); font-size: 18px; max-width: 560px; margin: 14px auto 0; text-wrap: pretty; }

@media print {
  .series-bar, .video-ctrl, .copy-btn, .tabs { display: none !important; }
  [role="tabpanel"][hidden] { display: block; }
  body { background: #fff; }
}
