/* Layout: one 1040px figure column, prose held to ~720px inside it; figures numbered like a paper. */
:root {
  --ink: #1d2126; --mute: #5a6069; --faint: #8b9098; --line: #e7e7e3; --bg: #ffffff; --soft: #f7f7f4;
  --link: #2a66c4;
  --ours: #d9711c; --ours-soft: #fdf5ec; --ours-line: #f0dcc4;
  --cons: #3366b0; --aggr: #8b5a2b;
  --safe: #2e8b57; --bad: #c8423b; --edge: #e0a526;
  --serif: "Castoro", Georgia, serif;
  --sans: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.62 var(--sans); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
img, video { max-width: 100%; display: block; }
svg { display: block; }
.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.prose > p, .prose > ul { max-width: 720px; margin-left: auto; margin-right: auto; }
.ours { color: var(--ours); font-weight: 600; }
.mono { font-family: var(--mono); font-size: .9em; }
i.m { font-family: var(--serif); font-size: 1.06em; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 44px 0 6px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.16; margin: 0 auto 18px; max-width: 900px; text-wrap: balance; }
.authors { font-size: 17.5px; margin: 0 auto 4px; max-width: 900px; }
.authors span { white-space: nowrap; margin: 0 9px; display: inline-block; }
.authors a { color: var(--ink); }
.authors a:hover { color: var(--link); }
.affils { color: var(--mute); font-size: 16px; margin: 0 0 22px; }
.affils a { color: var(--mute); }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: #2f3237; color: #fff; border-radius: 999px; padding: 8px 18px; font-size: 15px; font-weight: 500; }
.btn:hover { background: #17191c; text-decoration: none; }
.btn.disabled { background: #b8b8b5; cursor: default; }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn small { font-weight: 400; opacity: .75; font-size: 12.5px; }

.topnav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(255,255,255,.95); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line); margin-top: 28px; }
.topnav .container { display: flex; justify-content: center; gap: 4px 24px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.topnav a { color: var(--mute); }
.topnav a:hover { color: var(--ink); text-decoration: none; }

/* ---------- sections & type ---------- */
section { padding: 52px 0 0; scroll-margin-top: 44px; }
section.first { padding-top: 26px; }
h2 { font-family: var(--serif); font-weight: 400; font-size: 31px; text-align: center; margin: 0 0 16px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
h3 .n { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff;
  font-size: 12px; align-items: center; justify-content: center; margin-right: 8px; vertical-align: 1px; }
h3 .n.o { background: var(--ours); }
.lead { color: var(--mute); text-align: center; max-width: 760px; margin: 0 auto 26px; text-wrap: pretty; }
.prose p { color: #2b2f35; text-wrap: pretty; }
.caption { color: var(--mute); font-size: 13.5px; margin: 8px auto 0; max-width: 900px; text-align: center; line-height: 1.5; }
.caption.left { text-align: left; }

/* ---------- figures (paper style) ---------- */
figure { margin: 0; }
.fig { margin: 0 0 40px; }
.fig > figcaption { font-size: 13.5px; line-height: 1.55; color: var(--mute); margin: 12px 0 0; text-align: left; }
.fig > figcaption b:first-child { color: var(--ink); }
.fig-tools { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13.5px; margin-bottom: 10px; }
.panel-title { font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: start; }
.two > * { min-width: 0; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 22px; } }
.two img { width: 100%; height: auto; }
.fig > img { width: 100%; height: auto; }
figure.wide { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- player ---------- */
.player .cols { display: grid; grid-template-columns: repeat(3, 1fr); font-size: 13px; font-weight: 600; text-align: center; margin-bottom: 5px; color: var(--mute); letter-spacing: .02em; }
.player .cols .o { color: var(--ours); }
.player .cols.two { grid-template-columns: 1fr 1fr; max-width: 760px; margin-left: auto; margin-right: auto; display: grid; gap: 0; }
.player .cols.two span:first-child { text-align: left; padding-left: 4px; }
.player .cols.two span:last-child { text-align: right; padding-right: 4px; }
.player .stage { position: relative; background: #000; border-radius: 4px; overflow: hidden; line-height: 0; }
.player .stage.wipe { max-width: 760px; margin: 0 auto; }
.player video { position: absolute; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.player canvas { width: 100%; height: auto; display: block; touch-action: pan-y; }
.player .stage.wipe canvas { cursor: ew-resize; }
.player .meta { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; justify-content: space-between; margin: 10px 0 0; font-size: 14.5px; }
.player .meta .name { font-weight: 600; }
.player .meta .name small { color: var(--mute); font-weight: 400; margin-left: 6px; font-size: 13px; }
.player .meta .nums { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--mute); font-size: 14px; }
.player .meta .nums b { color: var(--ink); font-variant-numeric: tabular-nums; }
.player .meta .nums .sp { color: var(--ours); }
.player .meta .nums a { font-size: 13px; }
.ptools { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.chk { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--mute); white-space: nowrap; }
.chk input { accent-color: var(--ours); margin: 0; }
.chips { display: flex; gap: 16px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: thin; }
.chip-group { display: flex; flex-direction: column; gap: 4px; }
.chip-group > span { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.chip-row { display: flex; gap: 6px; }
.chip { flex: none; width: 96px; border: 0; border-radius: 6px; padding: 0; background: none; cursor: pointer; text-align: left; font: inherit; opacity: .62; transition: opacity .15s; }
.chip img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; outline: 2px solid transparent; outline-offset: 1px; }
.chip span { display: block; font-size: 11px; line-height: 1.25; padding: 4px 1px 0; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip span b { color: var(--ours); font-weight: 600; }
.chip.on { opacity: 1; }
.chip.on img { outline-color: var(--ours); }
.chip:hover { opacity: 1; }

.numbers { display: grid; grid-template-columns: repeat(3, 1fr); margin: 6px auto 0; max-width: 900px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.numbers div { padding: 16px 18px; text-align: center; }
.numbers div + div { border-left: 1px solid var(--line); }
.numbers b { display: block; font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.numbers span { font-size: 13px; color: var(--mute); line-height: 1.4; display: block; margin-top: 3px; }
@media (max-width: 700px) { .numbers { grid-template-columns: 1fr; } .numbers div + div { border-left: 0; border-top: 1px solid var(--line); } }

/* ---------- video ---------- */
.video-wrap { max-width: 900px; margin: 0 auto; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); line-height: 0; background: #fff; }
.video-wrap video { width: 100%; }

/* ---------- method ---------- */
.ideas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin: 4px 0 44px; }
.ideas > div { min-width: 0; }
.ideas p { margin: 0; font-size: 14.5px; color: #33383e; line-height: 1.58; }
@media (max-width: 820px) { .ideas { grid-template-columns: 1fr; gap: 18px; } }
.prps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.prps-row > div { min-width: 0; }
.prps-row img { width: 100%; aspect-ratio: 1280/560; object-fit: cover; border-radius: 4px; }
.prps-row .pmeta { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 12.5px; color: var(--mute); }
.prps-row .pmeta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.prps-row svg { width: 120px; height: auto; flex: none; }
@media (max-width: 640px) { .prps-row { grid-template-columns: 1fr; } }

/* ---------- interactive controls ---------- */
.seg { display: inline-flex; border: 1px solid #d4d4cf; border-radius: 999px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: #fff; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.seg.sm button { padding: 3px 10px; font-size: 12.5px; }
.seg button + button { border-left: 1px solid #d4d4cf; }
.seg button.on { background: var(--ink); color: #fff; }
.pill { border: 1px solid #d4d4cf; background: #fff; border-radius: 999px; padding: 4px 13px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.pill.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.slider { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; }
.slider input { accent-color: var(--ours); width: 150px; }
.slider output { font-variant-numeric: tabular-nums; min-width: 34px; font-weight: 600; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 12px; }
.readout { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13.5px; color: var(--mute); margin-top: 8px; align-items: center; }
.readout b { color: var(--ink); font-variant-numeric: tabular-nums; }
.verdict { display: inline-block; font-weight: 700; font-size: 11.5px; letter-spacing: .06em; padding: 3px 9px; border-radius: 4px; color: #fff; background: #9aa0a8; }
.verdict.SAFE { background: var(--safe); }
.verdict.BAD { background: var(--bad); }
.verdict.REJECT { background: #7d4a46; }
.bad { color: var(--bad); font-weight: 600; }

.try { background: var(--soft); border-radius: 10px; padding: 16px 18px 14px; }
.try-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; color: var(--mute); }
.try-tag { font: 700 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--ours); border-radius: 4px; padding: 5px 7px; }
.try .plot { background: #fff; border-radius: 6px; }

/* LOD */
.lod-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: center; }
.lod-grid > * { min-width: 0; }
@media (max-width: 760px) { .lod-grid { grid-template-columns: 1fr; } }
.lod-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lod-imgs figure { position: relative; }
.lod-imgs img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; }
.lod-imgs figcaption { position: absolute; left: 6px; top: 6px; font-size: 11.5px; background: rgba(255,255,255,.92); padding: 1px 7px; border-radius: 3px; font-variant-numeric: tabular-nums; }

/* code tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; font: inherit; font-size: 13.5px; padding: 7px 12px; cursor: pointer; color: var(--mute); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ours); font-weight: 600; }
.code pre { margin: 0; padding: 10px 0; font: 12.5px/1.55 var(--mono); overflow-x: auto; background: #fbfbf9; border-bottom: 1px solid var(--line); }
.code pre span { display: block; padding: 0 14px; white-space: pre; }
.code pre .d { background: #fde9e7; color: #8d2a24; }
.code pre .a { background: #e7f4eb; color: #1d5e35; }
.code pre .c { color: var(--faint); }
.code .why { font-size: 13.5px; color: #33383e; margin: 8px 0 0; }

/* reports table */
.tbl-wrap { overflow-x: auto; }
table.rep { border-collapse: collapse; width: 100%; font-size: 14px; }
table.rep th { text-align: left; font-weight: 600; font-size: 12px; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; padding: 6px 10px; border-bottom: 1px solid #d9d9d4; }
table.rep td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
table.rep td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.rep td.sp { color: var(--ours); font-weight: 600; }
table.rep img { width: 64px; aspect-ratio: 16/9; object-fit: cover; border-radius: 3px; }
table.rep td a + a { margin-left: 12px; }
table.rep tr.grp td { padding-top: 14px; font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; border-bottom: 0; }

details.more { margin: 0 0 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
details.more summary { cursor: pointer; padding: 12px 2px; font-weight: 600; font-size: 15px; }
details.more summary span { color: var(--mute); font-weight: 400; font-size: 13.5px; margin-left: 6px; }
details.more .inner { padding: 0 0 18px; }
details.more .inner h4 { margin: 18px 0 6px; font-size: 14px; }
details.more img { width: 100%; height: auto; }
table.abl { border-collapse: collapse; font-size: 13.5px; margin: 0 auto; }
table.abl td, table.abl th { padding: 3px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.abl th { font-weight: 600; color: var(--mute); }
table.abl td.v { font-variant-numeric: tabular-nums; text-align: right; }
table.abl tr.best td { font-weight: 700; }

pre.bib { background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; font: 13px/1.5 var(--mono); overflow-x: auto; margin: 0; }
.bib-wrap { position: relative; max-width: 860px; margin: 0 auto; }
.bib-wrap .pill { position: absolute; right: 10px; top: 10px; }

footer.site { margin-top: 56px; padding: 22px 0 34px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; text-align: center; }

/* svg plots */
svg text { font-family: var(--sans); }
.plot .ax { stroke: #b9bcc1; stroke-width: 1; }
.plot .grid { stroke: #efefec; stroke-width: 1; }
.plot .tick { font-size: 11px; fill: var(--mute); }
.plot .lbl { font-size: 12px; fill: var(--ink); }

@media (max-width: 760px) {
  figure.wide svg { min-width: 760px; }
  .hero h1 { font-size: 28px; }
  .hero h1 br { display: none; }
  h2 { font-size: 26px; }
  section { padding-top: 40px; }
  .prose p { text-align: left; }
}

/* PRPS hypercube */
.cube-grid { display: grid; grid-template-columns: 320px 1fr; gap: 26px; align-items: center; }
.cube-grid > * { min-width: 0; }
@media (max-width: 800px) { .cube-grid { grid-template-columns: 1fr; } #cube-svg { max-width: 340px; margin: 0 auto; } }
#cube-svg { touch-action: none; cursor: grab; user-select: none; }
#cube-svg.drag { cursor: grabbing; }
.cube-view { position: relative; background: #000; border-radius: 4px; overflow: hidden; aspect-ratio: 16 / 9; touch-action: none; cursor: ew-resize; user-select: none; }
.cube-view canvas, .cube-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cube-view img[hidden] { display: none; }
.split-lab { position: absolute; top: 8px; transform: translateX(-50%); font-size: 11.5px; font-weight: 600; background: rgba(255,255,255,.92); color: var(--ink); padding: 1px 7px; border-radius: 3px; white-space: nowrap; pointer-events: none; }
.split-lab.o { color: var(--ours); }
.split-lab[hidden] { display: none; }
.cube-rows { display: grid; gap: 2px; margin-top: 14px; border-top: 1px solid var(--line); }
.cube-row { display: grid; grid-template-columns: 30px minmax(120px, 1fr) 44px 170px minmax(0, 1fr); align-items: center; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.cube-row i { font-family: var(--serif); font-size: 15px; color: var(--ink); }
.cube-row input { width: 100%; accent-color: var(--ours); margin: 0; }
.cube-row output { font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
.cube-row .u { font-family: var(--mono); font-size: 12px; color: var(--ink); white-space: nowrap; }
.cube-row .n { color: var(--mute); }
@media (max-width: 700px) { .cube-row { grid-template-columns: 26px 1fr 40px; } .cube-row .u, .cube-row .n { grid-column: 2 / -1; } }
.cube-status { font-size: 12.5px; color: var(--faint); }

/* search tree */
#tree-svg { touch-action: pan-y; }
.tree-detail { display: grid; grid-template-columns: 260px 1fr; gap: 20px; margin-top: 10px; align-items: start; }
.tree-detail > * { min-width: 0; }
@media (max-width: 760px) { .tree-detail { grid-template-columns: 1fr; } }
.tree-info { font-size: 13.5px; color: var(--mute); line-height: 1.5; }
.tree-info b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tree-info .big { font-family: var(--serif); font-size: 26px; color: var(--ours); line-height: 1.1; display: block; margin-bottom: 4px; }
.lineage { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.lineage button { border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 1px 6px; font: inherit; font-size: 12px; cursor: pointer; color: var(--ink); font-variant-numeric: tabular-nums; }
.lineage button.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.lineage span { color: var(--faint); font-size: 12px; align-self: center; }
#tree-diff { min-height: 120px; max-height: 260px; overflow: auto; }

/* round 5 */
.icon-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #d4d4cf; background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; color: var(--ink); }
.icon-btn svg { width: 14px; height: 14px; fill: currentColor; }
.icon-btn:hover { background: var(--soft); }
.player .meta { flex-wrap: nowrap; }
.player .meta .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.player .meta .nums { flex-wrap: nowrap; white-space: nowrap; flex: none; }
.player .meta .ptools { flex: none; }
@media (max-width: 700px) { .player .meta { flex-wrap: wrap; } .player .meta .nums { flex-wrap: wrap; white-space: normal; } }
.chip span { text-overflow: clip; }
h3.sub { font-family: var(--serif); font-weight: 400; font-size: 22px; text-align: center; margin: 8px 0 14px; }
.narrow-fig { max-width: 560px; margin-left: auto; margin-right: auto; }
.cube-left { min-width: 0; }
.cube-btns { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 2px; }
button.ghost { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 12.5px; color: var(--faint); cursor: pointer; border-bottom: 1px dotted #c3c6cb; }
button.ghost:hover { color: var(--ink); border-bottom-color: var(--ink); }
.lod-imgs { cursor: ew-resize; touch-action: pan-y; user-select: none; }
.lod-imgs img { pointer-events: none; }

/* credits */
.credits { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 8px; font-size: 14px; line-height: 1.55; color: #33383e; }
.credits h3 { font-size: 15px; margin: 0 0 6px; }
.credits ul { margin: 0 0 16px; padding-left: 18px; }
.credits li { margin-bottom: 5px; }
.credits .note { font-size: 13px; color: var(--mute); margin: 0; }
table.rep td .by { display: block; font-size: 12px; color: var(--faint); }
@media (max-width: 820px) { .credits { grid-template-columns: 1fr; gap: 6px; } }
