:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --ink: #1b1d22;
  --muted: #5b616e;
  --line: #e3e4e8;
  --accent: #2459d6;
  --accent-soft: rgba(36, 89, 214, 0.16);
  --accent2: #e0672c;
  --chip: #eef1f8;
  --shadow: 0 1px 2px rgba(20, 22, 30, 0.06), 0 4px 16px rgba(20, 22, 30, 0.06);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #181b21;
    --ink: #e8eaef;
    --muted: #a1a7b4;
    --line: #2a2e37;
    --accent: #7ea2ff;
    --accent-soft: rgba(126, 162, 255, 0.2);
    --accent2: #ff8d55;
    --chip: #222734;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
section.wrap { padding-top: 56px; }
h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; line-height: 1.2; }
h2 { font-size: 1.75rem; margin: 0 0 16px; }
h3 { font-size: 1.15rem; margin: 20px 0 6px; }
p { margin: 0 0 12px; }
.lead { color: var(--muted); max-width: 820px; }
.small { color: var(--muted); font-size: 0.9rem; }

/* hero */
.hero { padding: 56px 0 12px; text-align: center; }
.venue {
  display: inline-block; margin: 0 0 18px; padding: 4px 12px; border-radius: 999px;
  background: var(--chip); color: var(--muted); font-size: 0.85rem; font-weight: 500;
}
.hero h1 { font-size: clamp(1.6rem, 3.6vw, 2.6rem); margin: 0 auto 20px; max-width: 980px; }
.brand { color: var(--accent); }
.authors { font-size: 1.1rem; font-weight: 500; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin-bottom: 4px; }
.affils { color: var(--muted); display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; margin-bottom: 2px; }
.notes { color: var(--muted); font-size: 0.85rem; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 0.95rem;
}
.btn:hover { text-decoration: none; opacity: 0.88; }
.btn svg { width: 18px; height: 18px; }
@media (max-width: 700px) { .br-wide { display: none; } }

/* teaser */
.teaser { padding-top: 28px !important; }
.teaser-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.teaser-strip figure { margin: 0; }
.teaser-strip video, .card video {
  width: 100%; aspect-ratio: 832 / 480; display: block; border-radius: 10px; background: #000; object-fit: cover;
}
.teaser-strip figcaption { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 6px; }
.tldr { margin-top: 22px; padding: 16px 20px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow); }
@media (max-width: 760px) { .teaser-strip { grid-template-columns: 1fr; } }

/* figures */
.paper-figure { margin: 28px 0 0; }
.paper-figure img { width: 100%; height: auto; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
figcaption { color: var(--muted); font-size: 0.92rem; margin-top: 10px; }

/* showcase */
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 0.9rem; margin: 8px 0 18px; }
.legend b { color: var(--ink); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 14px; box-shadow: var(--shadow); }
.card h3 { font-family: Inter, system-ui, sans-serif; font-size: 1rem; font-weight: 600; margin: 10px 2px 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 2px 8px; }
.chip { font-size: 0.78rem; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.chip.lens { color: var(--accent); font-weight: 600; }
.chip.sweep { background: var(--accent2); color: #fff; font-weight: 600; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 2px 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  font: inherit; font-size: 0.8rem; padding: 3px 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.inputs { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 8px; margin: 10px 2px 2px; }
.inputs figure { margin: 0; padding: 6px 6px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.inputs svg { width: 100%; height: auto; display: block; }
.inputs figcaption { margin: 2px 0 0; font-size: 0.72rem; text-align: center; color: var(--muted); }
.lens-wedge { fill: var(--chip); stroke: var(--muted); stroke-width: 0.8; stroke-dasharray: 2 2; }
.lens-axis { stroke: var(--muted); stroke-width: 0.8; stroke-dasharray: 1.5 2; }
.lens-arc { stroke: var(--ink); stroke-width: 1.4; }
.lens-cam { fill: var(--surface); stroke: var(--ink); stroke-width: 1.3; }
.lens-label { font: 600 10px Inter, system-ui, sans-serif; fill: var(--ink); }
.traj-line { stroke-width: 3; stroke-linecap: round; }
.traj-frustum { fill: none; stroke-width: 1; opacity: 0.85; stroke-linejoin: round; }
.traj-current { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.inputs { align-items: stretch; }
.inputs figure { display: flex; flex-direction: column; justify-content: space-between; }
.inputs.has-ref { grid-template-columns: 1.5fr 0.8fr 1.2fr; }
.card .inputs figure.ref video { border-radius: 5px; margin: auto 0; }
@media (max-width: 600px) {
  .inputs.has-ref { grid-template-columns: 0.8fr 1.2fr; }
  .inputs.has-ref figure.ref { grid-column: 1 / -1; }
}
.traj-dot { fill: var(--ink); }
.caption {
  font-size: 0.86rem; color: var(--muted); margin: 0 2px; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.caption.open { -webkit-line-clamp: unset; line-clamp: unset; display: block; }

/* method */
.diagram { margin: 8px 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.diagram svg { width: 100%; height: auto; display: block; }
.dg-h { font: 600 15px Inter, system-ui, sans-serif; fill: var(--ink); }
.dg-t { font: 13px Inter, system-ui, sans-serif; fill: var(--muted); }
.dg-s { font: 12.5px Inter, system-ui, sans-serif; fill: var(--muted); }
.stroke-ink { stroke: var(--ink); }
.fill-ink { fill: var(--ink); }
.stroke-muted { stroke: var(--muted); }
.stroke-accent { stroke: var(--accent); }
.stroke-accent-soft { stroke: var(--accent-soft); }
.fill-accent2 { fill: var(--accent2); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 40px; }
.cols > div { min-width: 0; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
.formula {
  font-family: "Source Serif 4", Georgia, serif; font-size: 1.05rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; overflow-x: auto; white-space: nowrap;
}

/* results */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); margin-bottom: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-weight: 600; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tr.ours td:first-child { font-weight: 600; color: var(--accent); }

/* bibtex */
.bib { position: relative; }
.bib pre {
  margin: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow-x: auto; font-size: 0.85rem; line-height: 1.5;
}
.copy {
  position: absolute; top: 10px; right: 10px; font: inherit; font-size: 0.8rem; padding: 4px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink);
}

.footer { padding: 48px 16px 40px; color: var(--muted); font-size: 0.88rem; text-align: center; }

/* paper figures and grouped results table */
.paper-figure.first { margin: 0 0 28px; }
.paper-figure.narrow img { max-width: 920px; display: block; margin: 0 auto; }
.paper-figure + .paper-figure { margin-top: 28px; }
th:nth-child(2), tr.group td:nth-child(2) { text-align: left; }
td[rowspan] { vertical-align: middle; font-weight: 600; border-right: 1px solid var(--line); }
tr.group td { border-top: 2px solid var(--line); }

/* camera + radial-map triplets */
.subhead { font-size: 1.2rem; margin: 26px 0 8px; }
.triplets { display: grid; gap: 20px; margin-top: 14px; }
.triplet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 14px; box-shadow: var(--shadow); }
.triplet h3 { font-family: Inter, system-ui, sans-serif; font-size: 1rem; font-weight: 600; margin: 0 2px 10px; }
.triplet-videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.triplet-videos figure { margin: 0; }
.triplet-videos video { width: 100%; aspect-ratio: 832 / 480; display: block; border-radius: 8px; background: #000; object-fit: cover; }
.triplet-videos figcaption { margin-top: 4px; font-size: 0.8rem; text-align: center; }
.triplet-prompt { margin-top: 10px; }
.triplet-prompt .src { color: var(--ink); font-weight: 600; }
@media (max-width: 700px) { .triplet-videos { grid-template-columns: 1fr; } }

/* radial-map gallery */
.rg { margin-top: 14px; }
.rg-player { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.rg-videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rg-videos figure { margin: 0; }
.rg-videos video { width: 100%; aspect-ratio: 832 / 480; display: block; border-radius: 8px; background: #000; object-fit: cover; }
.rg-videos figcaption { margin-top: 4px; font-size: 0.8rem; text-align: center; }
.rg-meta { margin-top: 10px; }
.rg-title { font-family: Inter, system-ui, sans-serif; font-size: 1.02rem; font-weight: 600; margin: 0 2px 6px; }
.rg-source { margin: 6px 2px 0; }
.rg-thumbs h4 { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.rg-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rg-thumb { font: inherit; text-align: left; padding: 0; border: 2px solid transparent; border-radius: 10px; background: var(--surface); cursor: pointer; overflow: hidden; box-shadow: var(--shadow); color: var(--ink); }
.rg-thumb img { width: 100%; aspect-ratio: 832 / 480; object-fit: cover; display: block; }
.rg-thumb span { display: block; font-size: 0.76rem; line-height: 1.3; padding: 6px 8px 8px; }
.rg-thumb[aria-pressed="true"] { border-color: var(--accent); }
.rg-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 700px) { .rg-videos { grid-template-columns: 1fr; } }

/* equirectangular views: show the whole re-projected frame (letterboxed), uncovered areas stay black */
.card video.erp { object-fit: contain; }


/* camera-control comparison (CRePE vs UCPE, recovered cameras) */
.cc { margin-top: 14px; }
.cc-player { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.cc-videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cc-videos figure { margin: 0; }
.cc-videos video { width: 100%; aspect-ratio: 832 / 480; display: block; border-radius: 8px; background: #000; object-fit: cover; }
.cc-videos figcaption { margin-top: 4px; font-size: 0.8rem; text-align: center; color: var(--ink); font-weight: 600; }
.cc-videos .cc-ref figcaption { color: var(--muted); font-weight: 400; }
.cc-videos.no-ref { grid-template-columns: repeat(2, 1fr); }
.cc-videos.no-ref .cc-ref { display: none; }
.cc-thumbs h4 { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.chip.zero { background: var(--accent); color: #fff; font-weight: 600; }
.sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; background: var(--muted); }
.sw.requested { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
.sw.crepe { background: var(--accent); }
.sw.ucpe { background: var(--accent2); }
.cc-transport { display: flex; align-items: center; gap: 10px; margin: 10px 2px 0; }
.cc-play { font: inherit; font-size: 0.8rem; padding: 3px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); cursor: pointer; min-width: 64px; }
.cc-scrub { flex: 1; min-width: 0; accent-color: var(--accent); }
.cc-frame { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.cc-plots { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; margin-top: 10px; }
.cc-plots figure { margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); min-width: 0; }
.cc-plots figcaption { margin: 4px 2px 0; font-size: 0.76rem; }
.cc-3d { display: flex; flex-direction: column; }
.cc-canvas { position: relative; flex: 1 1 auto; min-height: 300px; }
.cc-3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.cc-3d canvas:active { cursor: grabbing; }
.cc-pan svg { width: 100%; height: auto; display: block; }
.cc-grid { stroke: var(--line); stroke-width: 1; }
.cc-axis { stroke: var(--muted); stroke-width: 1; opacity: 0.6; }
.cc-tick { font: 10px Inter, system-ui, sans-serif; fill: var(--muted); }
.cc-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; }
.cc-line.requested { stroke: var(--muted); stroke-dasharray: 5 4; stroke-width: 1.8; }
.cc-line.crepe { stroke: var(--accent); }
.cc-line.ucpe { stroke: var(--accent2); }
.cc-dot.requested { fill: var(--muted); }
.cc-dot.crepe { fill: var(--accent); }
.cc-dot.ucpe { fill: var(--accent2); }
.cc-head { stroke: var(--ink); stroke-width: 1; opacity: 0.35; }
.cc-table { width: 100%; margin-top: 8px; font-size: 0.8rem; }
.cc-table th, .cc-table td { padding: 4px 6px; }
.cc-table td:first-child { white-space: nowrap; }
.cc-meta { margin-top: 10px; }
.cc-title { font-family: Inter, system-ui, sans-serif; font-size: 1.02rem; font-weight: 600; margin: 0 2px 6px; }
.cc-thumbs { margin-top: 4px; }
@media (max-width: 760px) {
  .cc-videos, .cc-plots { grid-template-columns: 1fr; }
  .cc-canvas { min-height: 260px; }
}

/* interactive CRePE explainer (static/js/crepe3d.js) */
.c3 { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.c3-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.c3-steps button { font-size: 0.85rem; padding: 5px 12px; }
.c3-tour { font: inherit; font-size: 0.8rem; padding: 4px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); cursor: pointer; }
.c3-canvas { position: relative; height: 460px; border-radius: 8px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.c3-canvas canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.c3-canvas canvas:active { cursor: grabbing; }
.c3-labels { position: absolute; inset: 0; pointer-events: none; }
.c3-label { position: absolute; transform: translate(-50%, -150%); font-size: 11px; line-height: 1.3; padding: 1px 6px; border-radius: 6px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); white-space: nowrap; }
.c3-label.a { color: var(--accent); font-weight: 600; }
.c3-label.q { color: var(--accent2); font-weight: 600; }
.c3-label.small { font-size: 10px; padding: 0 4px; transform: translate(-50%, -170%); }
.c3-caption { position: absolute; left: 12px; bottom: 10px; max-width: calc(100% - 24px); margin: 0; pointer-events: none;
  font-size: 0.92rem; font-weight: 500; color: var(--ink); padding: 4px 10px; border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); }
.c3-nogl { display: none; position: absolute; inset: 0; margin: 0; align-items: center; justify-content: center; color: var(--muted); }
.c3.no-webgl .c3-nogl { display: flex; }
.c3-panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.c3-panels figure { margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); transition: border-color 0.3s; min-width: 0; }
.c3-panels figure.on { border-color: var(--accent); }
.c3-panels canvas { width: 100%; aspect-ratio: 832 / 480; display: block; border-radius: 5px; }
.c3-key canvas { cursor: crosshair; }
.c3-panels figcaption { margin: 4px 2px 0; font-size: 0.76rem; text-align: center; }
.c3-controls { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 12px 2px 2px; font-size: 0.85rem; color: var(--muted); }
.c3-controls label, .c3-ctl { display: inline-flex; align-items: center; gap: 8px; }
.c3-controls input[type=range] { width: 120px; accent-color: var(--accent); }
.c3-controls .v { font-variant-numeric: tabular-nums; color: var(--ink); min-width: 34px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 28px; margin-top: 18px; }
.cols3 > div { min-width: 0; }
.cols3 h3 { margin-top: 6px; }
.cols3 .formula { font-size: 0.92rem; white-space: normal; }
.cols3 .formula { font-size: 0.85rem; }
@media (max-width: 820px) {
  .c3-canvas { height: 340px; }
  .c3-panels, .cols3 { grid-template-columns: 1fr; }
  .c3-steps { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .c3-steps button { border-left: 0 !important; border-top: 1px solid var(--line); }
  .c3-steps button:nth-child(-n+2) { border-top: 0; }
  .c3-steps button:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .c3-caption { font-size: 0.8rem; }
}

/* internal geometry (radial head output) */
.geo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 14px; }
.geo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 8px 10px; box-shadow: var(--shadow); min-width: 0; }
.geo-card video { width: 100%; aspect-ratio: 832 / 480; display: block; border-radius: 7px; background: #000; object-fit: cover; }
.geo-card video + video { margin-top: 6px; }
.geo-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; margin: 8px 2px 0; }
.geo-title { font-size: 0.86rem; font-weight: 600; }
.geo-scale { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; white-space: nowrap; margin-left: 4px; }
.geo-scale i { display: inline-block; width: 110px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #7a0403, #e4460a, #fbb938, #a4fc3c, #28bceb, #4662d7, #30123b); }
@media (max-width: 900px) { .geo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .geo-grid { grid-template-columns: 1fr; } }
