:root {
  --ground: #e6e7ea;
  --plate: #f4f4f6;
  --ink: #1a1c20;
  --muted: #5a606a;
  --rule: rgba(26, 28, 32, 0.12);
  --focus: #e0a22e;
  --focus-ink: #1a1c20;
  --frame-bg: #2a2b2e;
  --panel: #232529;
  --panel-ink: #f3f3f1;
  --panel-muted: #a2a7af;
  --rail: rgba(255, 255, 255, 0.38);
  --chip: #26282d;
  --chip-ink: #fafaf8;
  --edge: rgba(26, 28, 32, 0.10);
  --button: #f6f6f7;
  --button-ink: #1a1c20;
  --serif: "STIX Two Text", "Times New Roman", Times, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #111215;
    --plate: #1a1c20;
    --ink: #e6e7e9;
    --muted: #959ba5;
    --rule: rgba(255, 255, 255, 0.10);
    --focus: #f2b440;
    --focus-ink: #111215;
    --frame-bg: #0b0c0e;
    --panel: #1e2024;
    --panel-ink: #f0f0ee;
    --panel-muted: #9aa0a9;
    --chip: #33363d;
    --chip-ink: #f6f6f4;
    --edge: rgba(255, 255, 255, 0.09);
    --button: #24272c;
    --button-ink: #e6e7e9;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #111215;
  --plate: #1a1c20;
  --ink: #e6e7e9;
  --muted: #959ba5;
  --rule: rgba(255, 255, 255, 0.10);
  --focus: #f2b440;
  --focus-ink: #111215;
  --frame-bg: #0b0c0e;
  --panel: #1e2024;
  --panel-ink: #f0f0ee;
  --panel-muted: #9aa0a9;
  --chip: #33363d;
  --chip-ink: #f6f6f4;
  --edge: rgba(255, 255, 255, 0.09);
  --button: #24272c;
  --button-ink: #e6e7e9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-snap-type: y proximity; }

.hero, #drag .plate, #gallery, #composition .plate, #exploration .plate { scroll-snap-align: start; scroll-margin-top: 56px; }
.hero { scroll-margin-top: 46px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--ground); }
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: color-mix(in srgb, var(--ground) 92%, transparent); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.bar-in {
  max-width: 1272px; margin: 0 auto; padding-block: 8px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; gap: 18px; align-items: baseline; overflow-x: auto; white-space: nowrap;
}
.bar .name { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 18px; }
.bar a { color: var(--muted); text-decoration: none; font-size: 13px; }
.bar a:hover, .bar a.on { color: var(--ink); }

.page {
  max-width: 1272px; margin: 0 auto; padding-block: 0 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 64px;
}
h1 { margin: 0; font-family: var(--serif); font-weight: 700; line-height: 1.1; text-wrap: balance; }
h1 em { font-style: italic; }
section { display: grid; gap: 18px; scroll-margin-top: 56px; }
.sec-head { display: grid; gap: 6px; max-width: 72ch; }
h2 { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 28px; line-height: 1.15; text-wrap: balance; }
.sec-head p { margin: 0; color: var(--muted); }
.plate { background: var(--plate); border: 1px solid var(--rule); border-radius: 8px; padding: 18px; display: grid; gap: 14px; min-width: 0; }
.plate-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
h3 { margin: 0; font-size: 17px; font-weight: 600; }
.meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.meta b { font-weight: 500; color: var(--ink); }
.note { margin: 0; color: var(--muted); font-size: 13.5px; }
.prompt { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 14px; line-height: 1.35; }
.prompt .chip { font-weight: 700; color: var(--chip-ink); background: var(--chip); border-radius: 3px; padding: 0 4px 1px; }
.frame { position: relative; aspect-ratio: 1; width: 100%; background: var(--frame-bg); border-radius: 4px; overflow: hidden; }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.readout {
  position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 3px; pointer-events: none;
  background: rgba(17, 18, 21, 0.72); color: #f3f3f1; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums;
}
.tile { aspect-ratio: 1; width: 100%; background: var(--frame-bg); border-radius: 2px; overflow: hidden; position: relative; }
.tile img { width: 100%; height: 100%; object-fit: cover; }

.hero { display: grid; gap: 14px; padding-block: 18px 8px; }
.hero-head { display: grid; gap: 2px; justify-items: center; text-align: center; }
.hero-head .kicker { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hero h1 { font-size: clamp(22px, 2.3vw, 30px); }

.hero-head .authors, .hero-head .affils { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; column-gap: 22px; }
.hero-head .authors { margin-top: 8px; font-size: 17px; }
.hero-head .authors a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.hero-head .authors a:hover { text-decoration-color: currentColor; }
.hero-head .affils { color: var(--muted); font-size: 14.5px; }
.hero-head sup { font-size: 0.68em; line-height: 0; margin-left: 1px; }
.hero-head .paper-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 17px 6px 14px; border-radius: 999px;
  background: var(--ink); color: var(--ground); text-decoration: none; font-size: 14px; font-weight: 500; line-height: 1.3;
}
.pill svg { width: 16px; height: 16px; flex: none; }
.pill:hover { background: color-mix(in srgb, var(--ink) 80%, var(--ground)); }
.pill[href=""] { pointer-events: none; }
.hero .lede { margin: 0 auto; color: var(--muted); font-size: 14.5px; max-width: 92ch; text-align: center; text-wrap: pretty; }

#abstract { justify-items: center; }
#abstract .sec-head { text-align: center; }
.abstract { margin: 0; max-width: 820px; font-size: 15.5px; line-height: 1.65; text-align: justify; }
@media (max-width: 560px) { .abstract { hyphens: auto; -webkit-hyphens: auto; } }
.bibtex {
  margin: 0; padding: 14px 16px; background: var(--plate); border: 1px solid var(--rule); border-radius: 8px;
  font-family: var(--mono); font-size: 13px; line-height: 1.5; overflow-x: auto;
}
.demo {
  --vtrack: 156px; --wheel: 140px;
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "stage stage" "left right";
  gap: 18px; max-width: 720px; width: 100%; margin: 0 auto; align-items: stretch;
}
.rail-left { grid-area: left; }
.rail-right { grid-area: right; }
.stage-col { grid-area: stage; display: grid; gap: 10px; align-content: start; }
.rail-left, .rail-right { display: flex; flex-direction: column; gap: 12px; }
.stage {
  position: relative; aspect-ratio: 1; width: 100%; border-radius: 6px; overflow: hidden; background: #2a2a2a;
  box-shadow: 0 0 0 1px var(--edge), 0 10px 30px -18px rgba(0, 0, 0, 0.5);
}
.stage canvas, .stage img.compare, .stage svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage img.compare { object-fit: cover; }
.stage svg { pointer-events: none; }
.stage .dim { transition: opacity 0.18s ease; opacity: 0; }
.stage .dim.on { opacity: 1; }
.links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 2; }
.links path { fill: none; }
.links .halo { stroke: rgba(10, 11, 13, 0.55); stroke-width: 4.5; }
.links .line { stroke: #fff; stroke-width: 1.6; }
.links circle { fill: #fff; stroke: rgba(10, 11, 13, 0.55); stroke-width: 1.5; }
.badge {
  position: absolute; left: 10px; top: 10px; padding: 3px 9px; border-radius: 999px;
  background: rgba(20, 21, 24, 0.78); color: #f3f3f1; font-size: 12px; font-weight: 500;
}
.badge.right { left: auto; right: 10px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
button.tb {
  font: 500 13px/1 var(--sans); padding: 8px 12px; border-radius: 7px; border: 1px solid var(--edge);
  background: var(--button); color: var(--button-ink); cursor: pointer;
}
button.tb:hover { border-color: var(--muted); }
button.tb:active, button.tb.held { background: var(--ink); color: var(--ground); }
.w { background: var(--panel); color: var(--panel-ink); border-radius: 10px; padding: 10px 14px 12px; box-shadow: 0 0 0 1px var(--edge); display: grid; gap: 8px; }
.w.hot { box-shadow: 0 0 0 2px var(--focus); }
.w-head { display: flex; align-items: baseline; gap: 6px; }
.w-head .obj { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 18px; line-height: 1; }
.w-head .attr { font-size: 13px; color: var(--panel-ink); }
.ends { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--panel-muted); }
.ends img { height: 36px; width: auto; filter: invert(1); opacity: 0.9; }
.track { position: relative; touch-action: none; cursor: pointer; outline: none; }
.track.h { height: 26px; margin: 0 9px; }
.track.v { width: 26px; height: var(--vtrack); }
.track .line { position: absolute; background: var(--rail); border-radius: 2px; }
.track.h .line { left: 0; right: 0; top: 12px; height: 2px; }
.track.v .line { top: 0; bottom: 0; left: 12px; width: 2px; }
.track.ripe .line { height: 4px; top: 11px; background: linear-gradient(90deg, #95b45a, #d9c445 55%, #b98a35 80%, #6e4a26); opacity: 0.9; }
.track .tick { position: absolute; background: var(--rail); }
.track.h .tick { width: 2px; height: 10px; top: 8px; left: var(--p); transform: translateX(-1px); }
.track.v .tick { height: 2px; width: 10px; left: 8px; top: var(--p); transform: translateY(-1px); }
.track .knob {
  position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 3px var(--panel), 0 1px 4px rgba(0, 0, 0, 0.6); transition: left 0.12s ease, top 0.12s ease;
}
.track.h .knob { top: 5px; left: var(--p); transform: translateX(-8px); }
.track.v .knob { left: 5px; top: var(--p); transform: translateY(-8px); }
.track:focus-visible .knob { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--focus); }
.vbox { display: flex; gap: 10px; align-items: stretch; }
.vlabels { position: relative; flex: 1; font-size: 11.5px; color: var(--panel-muted); }
.vlabels span { position: absolute; left: 0; top: var(--p); transform: translateY(-50%); white-space: nowrap; }
.vlabels span.on { color: var(--panel-ink); font-weight: 600; }
.wheel { position: relative; width: var(--wheel); height: var(--wheel); margin: 2px auto 0; touch-action: none; cursor: pointer; }
.wheel.dragging .needle { transition: none; }
.wheel .ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, hsl(0 62% 56%), hsl(60 62% 56%), hsl(120 62% 50%), hsl(180 62% 50%), hsl(240 62% 62%), hsl(300 62% 58%), hsl(360 62% 56%));
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 73%, #000 74% 98.5%, transparent 100%);
  mask: radial-gradient(circle closest-side, transparent 0 73%, #000 74% 98.5%, transparent 100%);
  opacity: 0.85;
}
.wheel .needle {
  position: absolute; left: 50%; top: 50%; width: 2px; height: calc(var(--wheel) * 0.257); margin-left: -1px; background: #fff;
  transform-origin: 50% 0; transform: rotate(calc(var(--a) + 180deg)); transition: transform 0.2s ease;
}
.wheel .hub { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; }
.wheel .dot {
  position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; padding: 0; margin: -12px 0 0 -12px; border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.35); background: var(--c);
  transform: rotate(var(--a)) translateY(calc(var(--wheel) * -0.43)) rotate(calc(-1 * var(--a))); cursor: pointer;
}
.wheel .dot[aria-checked="true"] { border: 3px solid #fff; box-shadow: 0 0 0 2px var(--panel); }
.wheel .dot:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tz-prompt { margin: 0 auto; font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.75; max-width: 78ch; text-align: center; }
.tz-prompt .chip {
  font: inherit; font-weight: 700; color: var(--chip-ink); background: var(--chip); border: 0; border-radius: 3px;
  padding: 0 5px 1px; cursor: pointer;
}
.tz-prompt .chip:hover, .tz-prompt .chip.hot { background: var(--focus); color: #1a1c20; }
.tz-prompt .chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.demo.compact { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage"; }
.demo.compact .rail-left, .demo.compact .rail-right { display: none; }
.stage { touch-action: manipulation; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.stage .tags { position: absolute; inset: 0; pointer-events: none; }
.tag {
  position: absolute; left: 0; top: 0; display: grid; gap: 6px; width: max-content;
  visibility: hidden; opacity: 0; transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}
.tag.on { visibility: visible; opacity: 1; pointer-events: auto; transition: opacity 0.18s ease; }
.tag .w {
  --vtrack: 96px; --wheel: 92px; padding: 7px 10px 9px; gap: 5px; border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 8px 20px -8px rgba(0, 0, 0, 0.7);
}
.tag .w.hot { box-shadow: 0 0 0 2px var(--focus), 0 8px 20px -8px rgba(0, 0, 0, 0.7); }
.tag .w-head .obj { font-size: 15px; }
.tag .w-head .attr { font-size: 12px; }
.tag .track.h { width: 124px; }
.tag .vlabels { min-width: 52px; }
.tag .ends { font-size: 11px; gap: 10px; }
.tag .ends img { height: 26px; }
.tag .wheel .dot { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.stage .hint { top: auto; bottom: 10px; }

.tb .short { display: none; }
.demo.compact .toolbar { flex-wrap: nowrap; gap: 6px; }
.demo.compact button.tb { flex: 1 1 auto; padding: 8px 6px; white-space: nowrap; }
.demo.compact .tb .long { display: none; }
.demo.compact .tb .short { display: inline; }
@media (prefers-reduced-motion: reduce) { .tag, .tag.on { transition: none; } }

@media (min-width: 1200px) {
  .hero { min-height: calc(100vh - 46px); align-content: center; padding-block: 14px 18px; }
  .demo {
    --fit: 290px;
    --stage: max(360px, min(640px, calc(100vh - var(--fit)), calc(100vw - 560px)));
    --vtrack: clamp(84px, calc((var(--stage) - 300px) / 2), 156px);
    --wheel: clamp(92px, calc((var(--stage) - 360px) / 2), 140px);
    grid-template-columns: 210px var(--stage) 220px; grid-template-areas: "left stage right";
    justify-content: center; max-width: none; gap: 20px;
  }
  .hero:has(.authors) .demo { --fit: 305px; }
  .rail-left { justify-content: space-between; }
  .rail-left, .rail-right { max-height: var(--stage); }
}
@media (prefers-reduced-motion: reduce) { .track .knob, .wheel .needle, .stage .dim { transition: none; } }

.scenes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.scene { display: grid; gap: 8px; align-content: start; min-width: 0; }
.ctl { touch-action: none; user-select: none; -webkit-user-select: none; }
.ctl img { pointer-events: none; -webkit-user-drag: none; }
.ctl:focus, .ctl:focus-visible { outline: none; }

.hz { cursor: ns-resize; }
.hz .hline { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid rgba(255, 255, 255, 0.92); box-shadow: 0 0 0 1px rgba(10, 11, 13, 0.25); pointer-events: none; }
.hz .ball {
  position: absolute; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 3px rgba(10, 11, 13, 0.35), 0 2px 8px rgba(0, 0, 0, 0.45); pointer-events: none;
}
.hz:focus-visible .ball { box-shadow: 0 0 0 3px var(--focus), 0 2px 8px rgba(0, 0, 0, 0.45); }

.hue { background: transparent; overflow: visible; }
.hue .lens { position: absolute; inset: 8%; border-radius: 50%; overflow: hidden; background: var(--frame-bg); box-shadow: 0 0 0 1px var(--edge); }
.hue { cursor: grab; }
.hue .lens img { position: absolute; max-width: none; }
.hue .hue-ring {
  position: absolute; inset: 1.5%; border-radius: 50%; cursor: grab;
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 88.5%, #000 89% 99%, transparent 100%);
  mask: radial-gradient(circle closest-side, transparent 0 88.5%, #000 89% 99%, transparent 100%);
}
.hue .hknob {
  position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(10, 11, 13, 0.4), 0 2px 6px rgba(0, 0, 0, 0.45); pointer-events: none;
}
.hue:focus-visible .hknob { box-shadow: 0 0 0 3px var(--focus); }
.hue .readout { left: auto; right: 2%; bottom: 2%; }

.p2 { cursor: crosshair; }
.p2 .range { position: absolute; border: 1.5px dashed rgba(255, 255, 255, 0.7); border-radius: 3px; pointer-events: none; }
.p2 .cursor {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(10, 11, 13, 0.45), inset 0 0 0 1px rgba(10, 11, 13, 0.3); pointer-events: none;
}
.p2 .cursor::before, .p2 .cursor::after { content: ""; position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(10, 11, 13, 0.3); }
.p2 .cursor::before { left: 50%; top: -9px; bottom: -9px; width: 2px; margin-left: -1px; }
.p2 .cursor::after { top: 50%; left: -9px; right: -9px; height: 2px; margin-top: -1px; }
.p2:focus-visible .cursor { border-color: var(--focus); }

.sk { cursor: ew-resize; }
.sk .mtrack { position: absolute; bottom: 10%; height: 0; border-top: 2px solid rgba(255, 255, 255, 0.92); box-shadow: 0 0 0 1px rgba(10, 11, 13, 0.25); pointer-events: none; }
.sk .mstop { position: absolute; bottom: calc(10% + 12px); transform: translateX(-50%); pointer-events: none; }
.sk .mstop img { width: 34px; background: #fff; border: 1px dashed #5a606a; border-radius: 2px; }
.sk .mstop.src { bottom: calc(10% - 4px); }
.sk .mstop i { display: block; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(10, 11, 13, 0.4); }
.sk .mknob {
  position: absolute; bottom: 10%; width: 22px; height: 22px; margin: 0 0 -12px -11px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 3px rgba(10, 11, 13, 0.35), 0 2px 8px rgba(0, 0, 0, 0.45); pointer-events: none;
}
.sk:focus-visible .mknob { box-shadow: 0 0 0 3px var(--focus), 0 2px 8px rgba(0, 0, 0, 0.45); }
.morph-side { display: flex; align-items: center; justify-content: center; gap: 18px; align-self: center; }
.morph-side figure { margin: 0; display: grid; gap: 6px; justify-items: center; width: min(40%, 180px); }
.morph-side img { width: 100%; background: #fff; border: 1px dashed var(--muted); border-radius: 3px; }
.morph-side figcaption { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.morph-arrow { color: var(--muted); font-size: 22px; }

.hint {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); padding: 3px 11px; border-radius: 999px;
  background: rgba(17, 18, 21, 0.74); color: #f3f3f1; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  pointer-events: none; transition: opacity 0.4s ease; z-index: 1;
}
.hint:empty { display: none; }
.hint.gone { opacity: 0; }
.hue .hint { top: 50%; }

.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.g-rows { display: grid; gap: 4px; }
.g-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) var(--input, 0px); gap: 4px; align-items: center; }
.g-row .tile { cursor: zoom-in; }
.g-axis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) var(--input, 0px); gap: 4px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: center; }
.input-glyph { display: grid; gap: 3px; justify-items: center; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.input-glyph img { width: 100%; border: 1px dashed var(--muted); border-radius: 2px; background: #fff; }

.hover-row { display: grid; grid-template-columns: minmax(0, 620px) minmax(0, 380px); gap: 28px; align-items: center; }
.side-frame { display: grid; gap: 8px; }
.grid-wrap { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); gap: 4px 6px; }
.grid-title-x { grid-column: 3; text-align: center; font-size: 13px; max-width: 520px; }
.grid-axis-x { grid-column: 3; max-width: 520px; display: grid; grid-template-columns: repeat(var(--nx), minmax(0, 1fr)); gap: 3px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: center; }
.grid-title-y { grid-row: 3; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: 13px; }
.grid-axis-y { grid-row: 3; display: grid; grid-template-rows: repeat(var(--ny), minmax(0, 1fr)); gap: 3px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); align-items: center; text-align: right; }
.cells { grid-row: 3; grid-column: 3; display: grid; grid-template-columns: repeat(var(--nx), minmax(0, 1fr)); gap: 3px; max-width: 520px; }
.cells .tile, .lattice .tile { cursor: pointer; }
.cells .tile.on, .lattice .tile.on { outline: 2px solid var(--focus); outline-offset: 1px; }
.hue-chip { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 2px; vertical-align: -0.05em; margin-right: 3px; }
.lattice { display: grid; gap: 3px; }
.lattice-row { display: grid; gap: 3px; }
.corner { display: flex; gap: 6px; align-items: center; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.corner img { width: 34px; border: 1px dashed var(--muted); border-radius: 2px; background: #fff; }
.corner .sw { width: 26px; height: 26px; border-radius: 3px; }
.corners { display: flex; justify-content: space-between; gap: 10px; }
.src-tile { display: grid; gap: 4px; justify-items: center; font-family: var(--mono); font-size: 11px; color: var(--muted); cursor: pointer; }
.src-tile .tile { width: 64px; }

.cmp-scroll { overflow-x: auto; }
.cmp-table { --t: minmax(64px, 1fr); --grid: 146px 64px repeat(7, var(--t)); display: grid; gap: 8px; min-width: 790px; }
.cmp-head, .cmp-row { display: grid; grid-template-columns: var(--grid); column-gap: 4px; }
.cmp-head span { font-size: 12px; text-align: center; color: var(--muted); align-self: end; }
.cmp-head .cmp-name { color: var(--ink); border-top: 3px solid var(--c, transparent); padding-top: 4px; line-height: 1.2; }
.cmp-group { font-variant: small-caps; letter-spacing: 0.04em; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--rule); padding-top: 8px; }
.cmp-row { grid-template-rows: auto auto; row-gap: 4px; }
.cmp-src { grid-row: 1 / 3; grid-column: 1; align-self: center; display: grid; gap: 4px; padding-right: 8px; }
.cmp-src b { font-size: 13px; font-weight: 600; line-height: 1.2; }
.cmp-lab { grid-column: 2; align-self: center; justify-self: end; padding-right: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp-lab.l1, .cmp-line.l1 { grid-row: 1; }
.cmp-lab.l2, .cmp-line.l2 { grid-row: 2; }
.cmp-line { grid-column: 3 / -1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cmp-row .tile { cursor: zoom-in; }

.cmp-inset { position: absolute; bottom: 4%; background: #fff; padding: 2px; border-radius: 2px; pointer-events: none; }
.cmp-inset.sw { left: 4%; }
.cmp-inset.se { right: 4%; }
.cmp-inset.pal { display: flex; width: 38%; height: 13%; }
.cmp-inset.pal i { flex: 1; }
.cmp-inset.sk { width: 32%; }
.cmp-inset.sk img { width: 100%; border: 1px dashed #5a606a; }
.cmp-note { aspect-ratio: 1; display: grid; place-items: center; text-align: center; font-size: 11px; color: var(--muted); border: 1px dashed var(--rule); border-radius: 2px; padding: 4px; }

.lightbox { position: fixed; inset: 0; z-index: 20; background: rgba(10, 11, 13, 0.86); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px; }
.lightbox figure { margin: 0; display: grid; gap: 10px; justify-items: center; max-width: min(92vw, 820px); }
.lightbox img { max-height: 78vh; width: auto; border-radius: 4px; }
.lightbox figcaption { color: #e6e7e9; font-family: var(--mono); font-size: 13px; text-align: center; }
.lightbox .lb-nav, .lightbox .lb-strength { display: flex; gap: 10px; }
.lightbox .lb-strength .btn[aria-pressed="true"] { background: #f3f3f1; color: #111215; border-color: #f3f3f1; }
.btn { border: 1px solid var(--rule); background: var(--ground); border-radius: 999px; padding: 4px 14px; font-size: 13px; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.lightbox .btn { background: rgba(255, 255, 255, 0.08); color: #e6e7e9; border-color: rgba(255, 255, 255, 0.2); }

footer { color: var(--muted); font-size: 13px; max-width: 72ch; display: grid; gap: 6px; border-top: 1px solid var(--rule); padding-top: 18px; }

@media (max-width: 980px) { .gallery { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .scenes, .hover-row { grid-template-columns: minmax(0, 1fr); }
  .plate { padding: 12px; }
  .tz-prompt { font-size: 16px; text-align: left; }
  .hero .lede { text-align: left; }
}
@media (max-width: 560px) { .demo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "left" "right"; } }
