/* UniFlow project page. Light, editorial layout: a reading column with wide figures and a
   sticky section list on the left. Tokens first, then base, then components. */

@font-face { font-family: "Source Serif 4"; src: url("../fonts/SourceSerif4-latin-roman.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/SourceSerif4-latin-ext-roman.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/SourceSerif4-greek-roman.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/SourceSerif4-latin-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/SourceSerif4-latin-ext-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/SourceSerif4-greek-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap;
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono-latin-var.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f6f6ef; --panel: #fbfbf7; --panel-2: #f0efe7; --stage: #ebeae2;
  --line: #e2e0d6; --line-2: #cfcdc2;
  --text: #171716; --text-2: #3e3e3a; --muted: #77766f;
  --accent: #4b3cb4; --accent-soft: rgba(75,60,180,.08); --accent-line: rgba(75,60,180,.35);
  --rgb: #c05a22; --geo: #167e62; --uni: #4b3cb4;
  --d-uni: #5646c2; --d-base: #a8a79f; --d-base-2: #c9c8c0; --d-img: #c8642c; --d-pm: #1c8a6c;
  --ok: #2c8a3c; --bad: #b8433a; --ok-text: #2a7a35; --bad-text: #a8392f;
  --grid: #e8e6dc; --axis: #c9c7bc;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: var(--serif);
  --w-text: 740px; --w-fig: 1080px; --top: 56px;
  --ease: cubic-bezier(.2,.7,.2,1);
  /* the name runs from the RGB stream's orange through UniFlow violet to the geometry stream's teal */
  --uni-grad: linear-gradient(90deg, #c95c26 0%, #5a46c6 52%, #12866a 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 18px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--serif); font-size: 18px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; }
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(75,60,180,.18); }
sup { font-size: .62em; line-height: 0; position: relative; top: -.5em; vertical-align: baseline; }
sub { font-size: .7em; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 300; background: var(--panel); border: 1px solid var(--line-2); padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }
.note { font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.tnum { font-variant-numeric: tabular-nums; }
.minihead { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }

/* reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- top bar ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 90; height: var(--top); background: rgba(246,246,239,.92);
  backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { height: 100%; max-width: 1440px; margin: 0 auto; padding: 0 32px; display: flex; align-items: center; gap: 16px; }
.brand { font-weight: 700; font-size: 19px; color: var(--accent); text-decoration: none; letter-spacing: -.005em; }
.brand, .titleblock h1 .name { background: var(--uni-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.topbar-title { color: var(--muted); font-size: 15px; padding-left: 16px; border-left: 1px solid var(--line-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(3px); transition: opacity .3s, transform .3s; }
.topbar.scrolled .topbar-title { opacity: 1; transform: none; }
.toplinks { margin-left: auto; display: flex; gap: 22px; align-items: center; font-size: 15.5px; flex: none; }
.toplinks a, .toplinks > span { color: var(--text-2); text-decoration: none; display: inline-flex; gap: 7px; align-items: center; transition: color .2s; }
.toplinks a:hover { color: var(--accent); }
.toplinks .ext { width: 13px; height: 13px; margin-left: -3px; opacity: .55; transition: opacity .2s; }
.toplinks a:hover .ext { opacity: 1; }
.topbar .menu { display: none; flex: none; width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--line-2); place-items: center; color: var(--text-2); }
.topbar .menu svg { width: 18px; height: 18px; }
.topbar .progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--uni-grad); }

/* ---------- hero video ---------- */
.hero { margin-top: var(--top); }
.theater { position: relative; width: 100%; height: min(calc(100svh - var(--top)), 56.25vw); background: #0d0d0c; overflow: hidden; }
.theater video { width: 100%; height: 100%; object-fit: cover; }
.theater:fullscreen video, .theater:-webkit-full-screen video { object-fit: contain; }
.theater .controls { position: absolute; right: 18px; bottom: 18px; display: flex; gap: 8px; opacity: 0; transition: opacity .25s; z-index: 2; }
.theater:hover .controls, .theater:focus-within .controls, .theater.paused .controls { opacity: 1; }
.theater .bigplay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: opacity .3s; }
.theater.paused .bigplay { opacity: 1; pointer-events: auto; }
.bigplay span { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); color: #fff; backdrop-filter: blur(8px); transition: transform .3s var(--ease); }
.bigplay:hover span { transform: scale(1.06); }
.bigplay svg { width: 28px; height: 28px; margin-left: 4px; }
.theater .tbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.18); }
.theater .tbar i { display: block; height: 100%; width: 0; background: var(--accent); }
.theater .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #ddd; }
.scroll-cue { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255,255,255,.85); text-shadow: 0 1px 8px rgba(0,0,0,.6); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.scroll-cue i { width: 1px; height: 30px; background: linear-gradient(rgba(255,255,255,.9), transparent); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@media (prefers-reduced-motion: reduce) { .scroll-cue i { animation: none; } }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; background: rgba(12,12,12,.55);
  border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(8px); transition: background .2s; }
.iconbtn:hover { background: rgba(12,12,12,.75); }
.iconbtn svg { width: 16px; height: 16px; }

/* ---------- title ---------- */
.titleblock { max-width: 1000px; margin: 0 auto; padding: 76px 24px 48px; text-align: center; }
.titleblock h1 { font-size: clamp(32px, 4.1vw, 54px); line-height: 1.12; font-weight: 700; letter-spacing: -.012em; margin: 0 0 20px; }
.titleblock .subtitle { font-size: clamp(18px, 1.65vw, 22px); line-height: 1.5; color: var(--text-2); max-width: 700px; margin: 0 auto 30px; text-wrap: balance; }
.titleblock .authors { font-size: 18.5px; margin: 0 0 8px; line-height: 1.8; }
.titleblock .authors a { text-decoration: none; transition: color .2s; }
.titleblock .authors a, .titleblock .authors > span:not(.sep) { white-space: nowrap; }   /* never split a name */
.titleblock .authors a:hover { color: var(--accent); }
.titleblock .authors sup { color: var(--accent); margin-left: 1px; }
.titleblock .authors .sep { color: var(--muted); margin: 0 .45em 0 .05em; }
.titleblock .affils { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; color: var(--muted); font-size: 15.5px; margin: 0 0 4px; }
.titleblock .affils sup { color: var(--accent); }
.titleblock .venue { color: var(--muted); font-size: 15.5px; font-style: italic; margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pillbtn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2);
  background: #fffffa; color: var(--text); text-decoration: none; font-size: 16px; transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--ease); }
.pillbtn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.pillbtn svg { width: 16px; height: 16px; }

/* ---------- page grid: section list + content ---------- */
.page { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 44px; max-width: 1440px; margin: 0 auto; padding: 0 32px; }
.toc { position: sticky; top: calc(var(--top) + 36px); align-self: start; max-height: calc(100vh - var(--top) - 60px); overflow: auto; padding: 4px 0 20px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc > ul { border-left: 1px solid var(--line-2); }
.toc a { display: block; margin-left: -1px; padding: 6px 0 6px 16px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none;
  font-size: 15px; line-height: 1.3; transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--text); border-left-color: var(--accent); }
.toc ul ul a { padding: 4px 0 4px 28px; font-size: 13.5px; }
.content { min-width: 0; padding-bottom: 30px; }

/* ---------- sections, text, figures ---------- */
.sec { padding: 46px 0 22px; }
.text { max-width: var(--w-text); margin: 0 auto; }
.text h2 { font-size: clamp(28px, 2.5vw, 35px); line-height: 1.2; font-weight: 650; letter-spacing: -.008em; margin: 0 0 18px; }
.text h3 { font-size: 23px; line-height: 1.25; font-weight: 620; margin: 36px 0 10px; }
.text p { margin: 0 0 16px; color: var(--text-2); }
.text p strong, .text p b { color: var(--text); }
.text p a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted) !important; margin: 0 0 10px !important; }
.fig { margin: 26px auto 10px; max-width: 900px; }
.fig.wide { max-width: var(--w-fig); }
.fig figcaption { max-width: var(--w-text); margin: 12px auto 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.fig figcaption b { color: var(--text-2); font-weight: 650; }

/* overview: a TL;DR beside its picture. The statement is the focal point (key idea underlined in the name's gradient,
   the two pixel triples in the geometry teal and RGB orange); the picture is the RGB frame stacked over its own pointmap,
   two layers of one pixel grid, with one pixel pinned through both. No fills or boxes. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tldr { --ins-label: #6b6a63; --ins-rgb: #a84f1e; --ins-geo: #12735a;
  max-width: var(--w-fig); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  grid-template-areas: "copy vis" "go vis"; column-gap: 60px; align-items: center; }
.tldr-copy { grid-area: copy; align-self: end; }
.tldr-label { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: .16em; color: var(--accent); white-space: nowrap; }
.tldr-label::before { content: ""; width: 30px; height: 2px; border-radius: 1px; background: var(--uni-grad); }
.tldr-text { margin: 0; font-size: clamp(19px, .78rem + .86vw, 25px); line-height: 1.44; font-weight: 380; letter-spacing: -.006em;
  color: var(--text); text-wrap: pretty; }
.tldr-key { font-weight: 560; }
.tldr-key { font-style: normal; background: var(--uni-grad) left bottom / 100% 2px no-repeat; padding-bottom: .04em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.tldr-text var { font-style: italic; }
.tldr-geo, .tldr-nb { white-space: nowrap; }
.tldr-geo { color: var(--ins-geo); }
.tldr-text sub { font-size: .72em; line-height: 0; }
.tldr-go { grid-area: go; align-self: start; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.tldr-go a { padding: 6px 0; margin: -6px 0; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); text-decoration: none; text-underline-offset: 4px; }
.tldr-go a::after { content: "\00a0\2193"; content: "\00a0\2193" / ""; }
.tldr-go a:hover { text-decoration: underline; }
/* the layer stack */
.ins-vis { grid-area: vis; margin: 0; padding: 26px 0 30px; }
.ins-stage { position: relative; }
.ins-stack { display: block; width: 100%; height: auto; overflow: visible; }
.ins-shadow { fill: rgba(44, 40, 24, .3); filter: url(#ins-blur); transform: translate(0, 10px); }
.ins-edge { fill: none; stroke: rgba(23, 23, 22, .16); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ins-guides line { stroke: #a9a79c; stroke-width: 1; stroke-dasharray: 2 4; }
.ins-pin { stroke: var(--text); stroke-width: 1.5; }
.ins-dot { fill: #fff; stroke: var(--text); stroke-width: 1.6; }
.ins-vl { position: absolute; transform: translate(0, 10px); font-family: var(--mono); font-size: 11.5px; line-height: 20px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ins-label); white-space: nowrap; pointer-events: none; }
.ins-vl.rgb { transform: translate(0, calc(-100% - 6px)); }
.ins-vl b { margin-left: 6px; font-family: var(--serif); font-size: 16px; font-style: italic; font-weight: 500; letter-spacing: 0; text-transform: none; }
.ins-vl.rgb b { color: var(--ins-rgb); } .ins-vl.geo b { color: var(--ins-geo); }
.ins-vl.pin { transform: translate(calc(-100% - 10px), -50%); }
@media (max-width: 960px) {   /* stacked: statement, picture, links */
  .tldr { max-width: var(--w-text); grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "vis" "go"; }
  .ins-vis { width: 100%; max-width: 500px; padding: 34px 0 38px; }
  .tldr-go { margin-top: 0; }
}
@media (max-width: 560px) {
  .tldr-go { display: grid; grid-template-columns: repeat(2, max-content); gap: 0 28px; }
  .tldr-go a { padding: 8px 0; margin: 0; }
}

/* generic panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.chartpanel { padding: 22px 24px 16px; }

/* segmented controls, chips */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 14px; border-radius: 999px; font-size: 14.5px; color: var(--muted); transition: background .2s, color .2s; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 0 0 1px var(--line-2); }
.seg.sm button { height: 27px; padding: 0 11px; font-size: 13.5px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 29px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; color: var(--text-2);
  border: 1px solid var(--line-2); background: #fff; transition: .2s; }
.chip-btn:hover { border-color: var(--accent-line); }
.chip-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.tablebtn { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 4px 10px; transition: .2s; }
.tablebtn:hover, .tablebtn[aria-pressed="true"] { color: var(--text); border-color: var(--text-2); }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; font-family: var(--serif); }
.chart .tick { font-size: 12.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .lab { font-size: 13.5px; fill: var(--text-2); }
.chart .lab-strong { font-size: 13.5px; fill: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axisline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .hit { fill: transparent; }
.chart .mark { transition: opacity .2s; }
.chart.dim .mark:not(.hl) { opacity: .3; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-title { font-weight: 650; font-size: 17px; margin: 0; }
.chart-sub { font-size: 14px; color: var(--muted); margin: 2px 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--text-2); margin: 0 0 4px; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.legend .sw.line { height: 3px; width: 18px; border-radius: 2px; }
.legend .sw.dot { width: 10px; height: 10px; border-radius: 50%; }
.dotplot .rowlab { font-size: 14px; fill: var(--text-2); }
.dotplot .rowlab.hl { fill: var(--text); font-weight: 600; }
.dotplot .span { stroke: #d6d4ca; stroke-width: 2; stroke-linecap: round; }
.dotplot .row-hit { fill: transparent; }
.tip { position: fixed; z-index: 200; pointer-events: none; min-width: 150px; max-width: 300px; padding: 10px 12px; border-radius: 6px;
  background: #fffffb; border: 1px solid var(--line-2); box-shadow: 0 12px 30px -12px rgba(0,0,0,.25); font-size: 14px; color: var(--text-2);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.tip.on { opacity: 1; transform: none; }
.tip .t-title { color: var(--text); font-weight: 650; margin-bottom: 6px; }
.tip .t-row { display: grid; grid-template-columns: 14px auto 1fr; gap: 8px; align-items: center; line-height: 1.7; }
.tip .t-row b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.tip .key { width: 12px; height: 3px; border-radius: 2px; }
.datatable { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.datatable th, .datatable td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.datatable th:first-child, .datatable td:first-child { text-align: left; white-space: normal; }
.datatable thead th { font-weight: 650; color: var(--text-2); font-size: 13.5px; }
.datatable td { color: var(--text-2); }
.datatable td.best { color: var(--text); font-weight: 700; }
.datatable tr.ours td { color: var(--text); }
.table-wrap { overflow-x: auto; }

/* ---------- method ---------- */
.arch { padding: 18px; overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.arch svg { min-width: 860px; width: 100%; height: auto; }
.arch .node { cursor: help; }
.arch .node rect, .arch .node path.box { transition: stroke .2s, fill .2s; }
.arch .node:hover rect.b, .arch .node:focus rect.b { stroke: var(--text-2); }
.arch .flow { stroke-dasharray: 3 7; animation: flow 1.4s linear infinite; }
.arch.paused .flow { animation-play-state: paused; }
@keyframes flow { to { stroke-dashoffset: -20; } }
@media (prefers-reduced-motion: reduce) { .arch .flow { animation: none; } }
.arch-hint { display: none; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 8px 0 0; text-align: right; }
@media (max-width: 900px) { .arch-hint { display: block; } }
.points { max-width: var(--w-fig); margin: 30px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.point .num { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--accent); }
.point h3 { font-size: 19.5px; line-height: 1.3; margin: 6px 0 8px; font-weight: 650; }
.point p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--text-2); }

/* pointmap explorer */
.pmx-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--stage); border: 1px solid var(--line);
  cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.pmx-stage.is3d { cursor: grab; }
.pmx-stage.is3d:active { cursor: grabbing; }
.pmx-stage canvas.gl { position: absolute; inset: 0; width: 100%; height: 100%; }
.pmx-stage .pmx-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: opacity .5s var(--ease); }
.pmx-stage .pmx-poster.gone { opacity: 0; }
.pmx-div { position: absolute; top: 0; bottom: 0; left: 50%; width: 44px; margin-left: -22px; display: grid; place-items: center; z-index: 3; cursor: ew-resize; }
.pmx-div::before { content: ""; position: absolute; top: 0; bottom: 0; left: 21px; width: 2px; background: #fff; box-shadow: 0 0 10px rgba(0,0,0,.35); }
.pmx-div span { position: relative; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #222; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.pmx-div svg { width: 17px; height: 17px; }
.pmx-div:focus-visible { outline-offset: -4px; }
.pmx-stage .tag { position: absolute; top: 12px; z-index: 2; padding: 3px 9px; border-radius: 999px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(255,255,250,.88); border: 1px solid var(--line-2); color: var(--text); pointer-events: none; }
.pmx-stage .tag.l { left: 12px; } .pmx-stage .tag.r { right: 12px; }
.pmx-stage .readout { position: absolute; left: 12px; bottom: 14px; z-index: 2; font-family: var(--mono); font-size: 12px; color: var(--text); padding: 6px 10px;
  border-radius: 6px; background: rgba(255,255,250,.9); border: 1px solid var(--line-2); pointer-events: none; font-variant-numeric: tabular-nums; }
.pmx-stage .readout span { color: var(--muted); }
.pmx-stage .pmx-play { position: absolute; right: 12px; bottom: 14px; z-index: 4; }
.pmx-stage .tbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.08); z-index: 4; pointer-events: none; }
.pmx-stage .tbar i { display: block; height: 100%; width: 0; background: var(--accent); }
.pmx-stage .pm4d-fallback { position: absolute; inset: 0; overflow: hidden; }
.pmx-stage .pm4d-fallback video { width: 100%; height: auto; }
.pmx-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 14px; }
.thumbs { display: flex; gap: 8px; margin-left: auto; }
.thumbs button { position: relative; width: 112px; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; border: 1px solid var(--line-2); opacity: .7; transition: .2s; background: #000; }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button span { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 6px 3px; font-size: 11px; line-height: 1.15; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.thumbs button:hover { opacity: .95; }
.thumbs button[aria-pressed="true"] { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
@media (hover: none) { .pmx-stage .readout { display: none; } }

/* ---------- media frames, badges ---------- */
.vframe { position: relative; border-radius: 6px; overflow: hidden; background: #111; border: 1px solid var(--line); }
.vframe video, .vframe img.poster { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 7px; border-radius: 999px; font-family: var(--serif); font-size: 13px;
  font-weight: 600; color: #fff; white-space: nowrap; }
.badge svg { width: 14px; height: 14px; }
.badge.ok { background: rgba(30,120,40,.9); }
.badge.bad { background: rgba(170,45,38,.9); }
.badge.pop { opacity: 0; transform: scale(.85) translateY(4px); transition: opacity .25s, transform .35s cubic-bezier(.2,1.4,.4,1); }
.badge.pop.on { opacity: 1; transform: none; }
.vframe.ended video { filter: saturate(.85) brightness(.85); transition: filter .4s; }
.vframe .ring { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; transition: box-shadow .35s; }
.vframe.ended.ok .ring { box-shadow: inset 0 0 0 2px rgba(60,160,70,.9); }
.vframe.ended.bad .ring { box-shadow: inset 0 0 0 2px rgba(200,70,60,.85); }
.spinner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .2s; }
.loading .spinner { opacity: 1; }
.spinner i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- LBM rollout explorer ---------- */
.explorer { padding: 20px; }
.ex-top { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ex-top .group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ex-top .lbl { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.taskrail { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 12px; margin: 0 -4px 6px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.tchip { flex: none; width: 146px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line-2); background: #fff; text-align: left;
  scroll-snap-align: start; transition: border-color .2s, transform .2s var(--ease), opacity .2s; opacity: .75; }
.tchip:hover { opacity: 1; transform: translateY(-2px); }
.tchip[aria-pressed="true"] { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tchip .th { aspect-ratio: 4/3; background: #111; position: relative; }
.tchip .th img { width: 100%; height: 100%; object-fit: cover; }
.tchip .th em { position: absolute; left: 6px; top: 6px; font-style: normal; font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px; background: rgba(255,255,250,.9); color: var(--text-2); }
.tchip .nm { padding: 7px 9px 9px; font-size: 13px; line-height: 1.3; color: var(--text); min-height: 50px; }
.ex-stage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ex-cell .vframe { aspect-ratio: 4/3; }
.ex-cell .cap { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 7px; font-size: 14.5px; font-weight: 650; }
.ex-cell .cap .k { display: inline-flex; align-items: center; gap: 8px; }
.ex-cell .cap .k i { width: 9px; height: 9px; border-radius: 50%; }
.ex-cell .cap small { font-weight: 400; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ex-cell .badge { left: 10px; bottom: 10px; }
.ex-cell .srbar { margin-top: 8px; }
.srbar { display: grid; grid-template-columns: 1fr 46px; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.srbar .tr { position: relative; height: 6px; background: #e9e7de; border-radius: 4px; overflow: hidden; }
.srbar .tr i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; transition: width .6s var(--ease); }
.srbar b { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.ex-cell.ours .vframe { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
.ex-bottom { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-top: 14px; }
.ex-bottom .iconbtn, .rw-pair .ctrl .iconbtn { color: var(--text); background: #fff; border-color: var(--line-2); backdrop-filter: none; }
.ex-bottom .iconbtn:hover, .rw-pair .ctrl .iconbtn:hover { background: var(--panel-2); }
.scrub { position: relative; height: 26px; cursor: pointer; touch-action: none; }
.scrub .rail { position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 3px; background: #e2e0d6; }
.scrub .fill { position: absolute; left: 0; top: 11px; height: 4px; border-radius: 3px; background: var(--accent); width: 0; }
.scrub .knob { position: absolute; top: 6px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; border: 1px solid var(--line-2); box-shadow: 0 1px 4px rgba(0,0,0,.25); left: 0; }
.scrub .endmark { position: absolute; top: 5px; width: 2px; height: 16px; margin-left: -1px; border-radius: 1px; opacity: .9; }
.time { font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
.ex-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.ex-foot .note { margin: 0; }
@media (max-width: 1000px) { .ex-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .explorer { padding: 12px; } .ex-stage { gap: 8px; } .ex-cell .cap { font-size: 13px; } .tchip { width: 124px; } }

/* domain-shift wall: one featured tile, twelve small */
.wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; gap: 10px; }
.wall > * { min-width: 0; }
.wall .wt { position: relative; display: block; width: 100%; text-align: left; border-radius: 6px; overflow: hidden; aspect-ratio: 4/3; background: #111; border: 1px solid var(--line); cursor: pointer; }
.wall .wt.big { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.wall .wt video, .wall .wt img { width: 100%; height: 100%; object-fit: cover; }
.wall .wt .wcap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 11px 9px; font-size: 13.5px; line-height: 1.3; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.78)); display: flex; justify-content: space-between; align-items: end; gap: 8px; }
.wall .wt.big .wcap { font-size: 16px; padding: 40px 14px 12px; }
.wall .wt .wcap b { font-weight: 600; }
.wall .wt .wcap .badge { position: static; font-size: 11.5px; padding: 3px 8px 3px 5px; }
.wall .wt .wcap .badge svg { width: 12px; height: 12px; }
@media (max-width: 760px) { .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .wall .wt .wcap { font-size: 12px; padding: 22px 8px 7px; } }

/* ---------- Shift Lab ---------- */
.shiftlab { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); overflow: hidden; }
.sl-stage { position: relative; aspect-ratio: 4/3; background: #111; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.sl-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sl-stage .top { clip-path: inset(0 0 0 50%); }
.sl-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 44px; margin-left: -22px; cursor: ew-resize; display: grid; place-items: center; z-index: 3; }
.sl-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 21px; width: 2px; background: #fff; box-shadow: 0 0 12px rgba(0,0,0,.4); }
.sl-handle span { position: relative; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #222; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.sl-handle svg { width: 17px; height: 17px; }
.sl-handle:focus-visible { outline-offset: -4px; }
.sl-stage .lbl { position: absolute; top: 12px; z-index: 2; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.sl-stage .lbl.l { left: 12px; align-items: flex-start; } .sl-stage .lbl.r { right: 12px; align-items: flex-end; }
.sl-stage .lbl .nm { padding: 3px 9px; border-radius: 999px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(255,255,250,.88); color: var(--text); }
.sl-stage .badge { position: static; }
.sl-side { padding: 22px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sl-foot { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 22px 24px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.sl-foot .note { margin: 0; font-size: 15px; }
.sl-side select { width: 100%; height: 40px; border-radius: 6px; padding: 0 36px 0 12px; background: #fff; color: var(--text); border: 1px solid var(--line-2);
  font: inherit; font-size: 15px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2377766f' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
.axis-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.axis-tabs button { text-align: left; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; transition: .2s; }
.axis-tabs button b { display: block; font-size: 15px; font-weight: 650; color: var(--text); }
.axis-tabs button span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.axis-tabs button:hover { border-color: var(--accent-line); }
.axis-tabs button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.sl-meta { font-size: 14.5px; color: var(--text-2); margin: 0; }
.sl-bars .chart-title { margin-bottom: 4px; }
@media (max-width: 980px) { .shiftlab { grid-template-columns: minmax(0, 1fr); } .sl-side { border-left: 0; border-top: 1px solid var(--line); } .sl-foot { grid-template-columns: minmax(0, 1fr); gap: 12px; } }

/* ---------- Real world ---------- */
.rw-feature { overflow: hidden; }
.rw-feature-head { padding: 18px 20px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 6px 24px; flex-wrap: wrap; }
.rw-feature-head .minihead { margin: 0; }
.rw-feature-head .note { margin: 0; font-size: 15px; max-width: 560px; }
.rw-pair { padding: 14px 20px 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-content: start; }
.rw-pair .vframe { aspect-ratio: 16/9; }
.rw-pair .rw-cell.ours .vframe { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
.rw-pair .cap { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; font-size: 14.5px; font-weight: 650; gap: 8px; }
.rw-pair .cap .k { display: inline-flex; align-items: center; gap: 8px; }
.rw-pair .cap .k i { width: 9px; height: 9px; border-radius: 50%; }
.rw-pair .cap small { font-weight: 400; }
.rw-pair .badge { left: 10px; bottom: 10px; }
.rw-pair .outcome { margin-top: 7px; font-size: 14.5px; color: var(--text-2); min-height: 20px; }
.rw-pair .ctrl { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-top: 2px; }
.rw-reel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.reel-tile { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #111; }
.reel-tile video { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.reel-tile:hover video { transform: scale(1.03); }
.reel-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 11px 8px; display: flex; justify-content: space-between; align-items: end; gap: 8px;
  font-size: 13.5px; line-height: 1.25; text-align: left; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.78)); }
.reel-cap b { font-weight: 600; }
.reel-cap .ok { display: none; }
@media (max-width: 900px) { .rw-reel { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rw-pair { grid-template-columns: minmax(0, 1fr); padding: 12px; } .rw-feature-head { padding: 14px 12px 0; } .reel-cap { font-size: 12px; padding: 18px 8px 6px; } }

/* ---------- ablations ---------- */
.abl { max-width: var(--w-fig); margin: 24px auto 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.abl .card { padding: 22px 22px 18px; }
.abl .card h3 { font-size: 19px; margin: 0 0 6px; font-weight: 650; }
.abl .card > p { margin: 0 0 16px; color: var(--text-2); font-size: 15.5px; line-height: 1.55; }
.abl .foot { margin-top: 12px; }
@media (max-width: 900px) { .abl { grid-template-columns: minmax(0, 1fr); } }

/* ---------- bibtex, footer ---------- */
.bib { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; overflow-x: auto; }
.bib pre { margin: 0; padding-right: 76px; font-family: var(--mono); font-size: 13.5px; line-height: 1.75; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.bib .copy { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--line-2); background: #fff; font-size: 14px; color: var(--text-2); }
.bib .copy:hover { border-color: var(--accent); color: var(--accent); }
.bib .copy svg { width: 14px; height: 14px; }
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 34px 0 54px; margin-top: 30px; }
.footer-in { max-width: 1440px; margin: 0 auto; padding: 0 32px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer a { color: var(--text-2); }

/* ---------- lightbox ---------- */
dialog.lb { width: min(1100px, 94vw); max-width: none; padding: 0; border: 1px solid var(--line-2); border-radius: 10px; background: #fffffb; color: var(--text); overflow: hidden; }
dialog.lb::backdrop { background: rgba(20,20,18,.6); backdrop-filter: blur(4px); }
.lb video { width: 100%; aspect-ratio: 16/9; background: #000; }
.lb .lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; }
.lb .lb-bar .t { font-size: 15px; font-weight: 650; } .lb .lb-bar .t span { color: var(--muted); font-weight: 400; margin-left: 8px; }
.lb .lb-bar .g { display: flex; gap: 8px; }
.lb .iconbtn { color: var(--text); background: #fff; border-color: var(--line-2); backdrop-filter: none; }
.lb .iconbtn:hover { background: var(--panel-2); }

/* ---------- responsive layout ---------- */
@media (max-width: 1180px) {
  .page { grid-template-columns: minmax(0, 1fr); padding: 0 24px; }
  .toc { display: none; }
  .toc.open { display: block; position: fixed; top: var(--top); left: 0; right: 0; z-index: 85; max-height: 70vh; padding: 14px 24px 18px;
    background: rgba(246,246,239,.98); border-bottom: 1px solid var(--line); box-shadow: 0 16px 30px -18px rgba(0,0,0,.3); }
  .topbar .menu { display: inline-grid; }
}
@media (max-width: 900px) { .points { grid-template-columns: minmax(0, 1fr); gap: 20px; } .thumbs { margin-left: 0; } }
@media (max-width: 720px) {
  body { font-size: 17px; }
  .topbar-in { padding: 0 16px; gap: 10px; }
  .topbar-title { display: none; }
  .toplinks { gap: 14px; font-size: 14.5px; }
  .toplinks .ext { display: none; }
  .page { padding: 0 16px; }
  .titleblock { padding: 48px 18px 34px; }
  .titleblock .authors { font-size: 16.5px; }
  .thumbs button { width: calc((100vw - 32px - 24px) / 4); }
  .theater .controls { opacity: 1; }
  .scroll-cue { display: none; }
}
