/* Colorcast page. Deliberately skips theme.css: this one page takes its colors from whatever palette is chosen.
   Logo, fonts and contour lines stay PNR. Sizes and role colors are set from the script. */
:root {
  --font-display: 'Orbitron', sans-serif; --font-mono: 'JetBrains Mono', ui-monospace, monospace; --font-body: 'Public Sans', system-ui, sans-serif;
  --r-bg: #04080C; --r-surface: #091017; --r-text: #EEF4F6; --r-muted: #9AA6AF; --r-accent: #2F7BE0; --r-secondary: #22B6C9; --r-pop: #5EE6C0; --r-tint: #22B6C9; --r-on-accent: #04080C; --r-border: #2A3238;
  --ink: #EEF4F6; --ink-soft: #C4CCD0; --paper: #000; --strip-l: 460px; --strip-w: 84px; --shade: .45; --halo: #2F7BE0; --vision: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: #04080C; scrollbar-color: color-mix(in oklab, var(--r-text) 34%, transparent) transparent; accent-color: var(--r-accent); caret-color: var(--r-accent); }
body { position: relative; margin: 0; color: var(--ink); font-family: var(--font-body); font-variant-numeric: tabular-nums; overflow-x: clip; -webkit-font-smoothing: antialiased; }
::selection { background: var(--r-accent); color: var(--r-on-accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.defs { position: absolute; }

#washWrap { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
#wash { position: absolute; top: 0; left: 0; width: 100%; will-change: transform; opacity: 0; transition: opacity .8s ease; }
#wash.ready { opacity: 1; }
body.sim #washWrap, body.sim .sec, body.sim #dock { filter: var(--vision); }
.sec { position: relative; z-index: 1; color: var(--ink); transition: color .9s ease var(--ink-delay, 0s); }
.soft { color: var(--ink-soft); }

/* ---------- Header ---------- */
.bar { display: flex; align-items: center; gap: 14px; height: 72px; padding: 0 28px; position: relative; z-index: 3; font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.brand { display: inline-flex; align-items: baseline; gap: 6px; color: inherit; text-decoration: none; }
.brand b { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .02em; text-transform: none; }
.brand span { font-size: 11px; letter-spacing: .28em; color: var(--ink-soft); text-transform: none; }
.bar-title { padding-left: 14px; border-left: 1px solid color-mix(in oklab, var(--ink) 30%, transparent); color: var(--ink-soft); }
.bar nav { margin-left: auto; display: flex; gap: 22px; }
.bar nav a { color: var(--ink-soft); text-decoration: none; padding: 6px 0; transition: color .15s; }
.bar nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.bar nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

/* ---------- Fan deck ---------- */
#hero { display: flex; flex-direction: column; overflow-x: clip; }
#stage { position: relative; isolation: isolate; flex: 1 0 auto; min-height: calc(var(--strip-l) * 1.28); touch-action: pan-y; overscroll-behavior-x: contain; user-select: none; -webkit-user-select: none; cursor: grab; outline-offset: -6px; }
#stage.dragging { cursor: grabbing; }
#fan { position: absolute; left: 50%; bottom: calc(var(--strip-l) * .17 + 6px); width: 0; height: 0; }
.halo { position: absolute; left: calc(var(--strip-l) * -.75); bottom: calc(var(--strip-l) * -.2); width: calc(var(--strip-l) * 1.5); height: calc(var(--strip-l) * 1.2); border-radius: 50%; background-color: var(--halo); filter: blur(90px); opacity: .22; transition: background-color .7s ease; pointer-events: none; }
.strip { position: absolute; left: calc(var(--strip-w) / -2); bottom: -28px; width: var(--strip-w); height: var(--strip-l); transform-origin: 50% calc(100% - 28px); will-change: transform; }
.strip-body { position: absolute; inset: 0; display: flex; flex-direction: column; border-radius: 7px; overflow: hidden; box-shadow: 0 0 0 .5px rgba(0,0,0,.35), 0 2px 18px rgba(0,0,0,var(--shade)); cursor: pointer; }
/* Paper: light catches one edge, the other falls away into the next card. */
.strip-body::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,0) 14%, rgba(0,0,0,0) 72%, rgba(0,0,0,.16)); }
.band { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding-top: 9px; font-family: var(--font-mono); font-size: clamp(9px, calc(var(--strip-w) * .118), 12px); letter-spacing: .02em; box-shadow: inset 0 -.5px 0 rgba(0,0,0,.14); }
.band span { opacity: 0; transition: opacity .2s; }
.strip.focus .band span { opacity: 1; }
.band:last-child { flex: 1.25; }
.cap { flex: 0 0 8%; }   /* each strip's strongest color, so the rim of the fan reads as a color wheel */

/* Hue dial: the hub of the fan. */
#dial { position: absolute; left: calc(var(--strip-l) * -.17); bottom: calc(var(--strip-l) * -.17); width: calc(var(--strip-l) * .34); height: calc(var(--strip-l) * .34); border-radius: 50%; z-index: 1100; cursor: grab; touch-action: pan-y; background: var(--r-bg); box-shadow: 0 0 0 1px color-mix(in oklab, var(--r-text) 22%, transparent), 0 6px 26px rgba(0,0,0,.45); transition: background-color .9s ease, transform .2s cubic-bezier(.25,1,.5,1); }
#dial:hover { transform: scale(1.03); }
#dial.turning { cursor: grabbing; transform: scale(1.1); }
#dialRing { position: absolute; inset: 5px; border-radius: 50%; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 15px), #000 calc(100% - 14.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 15px), #000 calc(100% - 14.5px)); }
#dialHandle { position: absolute; inset: 0; pointer-events: none; }
#dialHandle i { position: absolute; left: 50%; top: 2px; width: 21px; height: 21px; margin-left: -10.5px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.6), inset 0 0 0 1px rgba(0,0,0,.2); }
#dialCenter { position: absolute; left: calc(var(--strip-l) * -.17 + 27px); bottom: calc(var(--strip-l) * -.17 + 27px); width: calc(var(--strip-l) * .34 - 54px); height: calc(var(--strip-l) * .34 - 54px); padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; z-index: 1101; background-size: cover; background-position: center; box-shadow: 0 0 0 1px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.2); transition: background-color .4s ease, transform .15s ease; }
#dialCenter:hover { transform: scale(1.06); }
#dialCenter.has-photo svg { opacity: 0; }
#dial:focus-visible, #dialCenter:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Under the fan ---------- */
.read { position: relative; z-index: 1200; text-align: center; padding: 8px 20px 22px; }
.deck-meta { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; min-height: 1.3em; }
.read h1, .pal-side h2, .poster-name { overflow-wrap: anywhere; }
.read h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 600; letter-spacing: -.012em; margin: 2px 0 0; line-height: 1.2; min-height: 1.2em; }
.deck-note { margin: 3px 0 0; font-size: 13px; min-height: 1.3em; }
.deck-tabs { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 14px 0 12px; font-size: 13px; }
.deck-sets { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 4px; }
/* Collections: one joined control, the chosen one filled */
.deck-sets { gap: 0; border: 1px solid color-mix(in oklab, var(--ink) 30%, transparent); border-radius: 3px; overflow: hidden; }
.deck-sets button { min-height: 38px !important; padding: 0 16px !important; border-radius: 0 !important; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.deck-sets button + button { border-left: 1px solid color-mix(in oklab, var(--ink) 30%, transparent) !important; }
.deck-sets button[aria-pressed="true"] { background: var(--ink) !important; color: var(--paper) !important; text-decoration: none !important; font-weight: 600; }
.deck-sets button:hover:not(:disabled):not([aria-pressed="true"]) { background: color-mix(in oklab, var(--ink) 12%, transparent); }
.deck-tabs button { min-height: 32px; padding: 0 9px; border: 0; background: none; color: var(--ink-soft); border-radius: 3px; transition: color .15s; }
.deck-tabs button:hover:not(:disabled) { color: var(--ink); }
.deck-tabs button[aria-pressed="true"] { color: var(--ink); font-weight: 650; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.deck-tabs button:disabled { opacity: .45; }
.deck-tabs em { font-style: normal; font-family: var(--font-mono); font-size: 11px; opacity: .8; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.btn { min-height: 40px; padding: 0 15px; border: 1px solid color-mix(in oklab, var(--ink) 34%, transparent); border-radius: 3px; background: transparent; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; gap: 9px; transition: background .18s, color .18s, border-color .18s, transform .18s; }
.btn:hover:not(:disabled) { border-color: var(--ink); background: color-mix(in oklab, var(--ink) 12%, transparent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; }
.btn.grow { flex: 1; cursor: pointer; }
.btn.icon { width: 40px; padding: 0; flex: none; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
/* Buttons that sit on a role surface rather than on the wash. */
.btn.dark, .btn.solid { --ink: var(--r-text); --paper: var(--r-bg); color: var(--r-text); }
.btn.dark.primary { background: var(--r-accent); color: var(--r-on-accent); border-color: var(--r-accent); }
.btn.dark.primary:hover { background: var(--r-accent); filter: brightness(1.1); }

/* ---------- Popovers ---------- */
.popover { position: absolute; left: 50%; bottom: calc(100% + 10px); translate: -50% 0; width: min(340px, calc(100vw - 32px)); padding: 14px; border: 1px solid var(--r-border); border-radius: 6px; background: var(--r-surface); color: var(--r-text); box-shadow: 0 24px 60px rgba(0,0,0,.55); text-align: left; }
#picker canvas { display: block; width: 100%; height: 170px; border-radius: 3px; cursor: crosshair; touch-action: none; background: #080B0E; }
.field { position: relative; }
#pickDot { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #000; pointer-events: none; }
#pickHue { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 14px; margin: 14px 0; border-radius: 3px; cursor: pointer; }
#pickHue::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 22px; border-radius: 3px; background: #fff; border: 1px solid #000; }
#pickHue::-moz-range-thumb { width: 12px; height: 22px; border-radius: 3px; background: #fff; border: 1px solid #000; }
.pick-row { display: flex; gap: 8px; align-items: stretch; }
#pickSwatch { width: 40px; border-radius: 3px; box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--r-text) 24%, transparent); flex: none; }
#pickHex { width: 100%; min-width: 0; height: 40px; padding: 0 10px; background: var(--r-bg); border: 1px solid var(--r-border); border-radius: 3px; font-family: var(--font-mono); font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
#pickHex[aria-invalid="true"] { border-color: var(--r-bad); }
#photoGrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-bottom: 10px; }
#photoGrid button { padding: 0; border: 0; border-radius: 3px; overflow: hidden; aspect-ratio: 1; background: var(--r-bg); }
#photoGrid img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
#photoGrid button:hover img { transform: scale(1.08); }
.word-form { display: flex; gap: 8px; }
.word-form input { flex: 1; min-width: 0; min-height: 40px; padding: 0 11px; border: 1px solid var(--r-border); border-radius: 3px; background: var(--r-bg); color: var(--r-text); font: inherit; font-size: 15px; }
.word-form input:focus { outline: 0; border-color: var(--r-text); }
.word-form input::placeholder { color: var(--r-muted); opacity: 1; }
.word-sw { display: flex; gap: 2px; height: 0; margin-top: 0; overflow: hidden; border-radius: 3px; transition: height .2s ease, margin .2s ease; }
.word-sw:not(:empty) { height: 22px; margin-top: 10px; }
.word-sw i { flex: 1; }
.word-read { margin: 8px 0 0; min-height: 0; font-size: 12px; line-height: 1.45; color: var(--r-muted); text-align: left; }
.word-read:empty { display: none; }
.word-ideas { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.word-ideas button { min-height: 30px; padding: 0 9px; border: 1px solid var(--r-border); border-radius: 3px; background: transparent; color: var(--r-text); font-size: 12.5px; }
.word-ideas button:hover { background: var(--r-bg); border-color: var(--r-muted); }
.word-ideas button:focus-visible { outline: 2px solid var(--r-text); outline-offset: 1px; }
.pop-note { margin: 9px 0 0; font-size: 12px; color: var(--r-muted); }
.pop-note.err { color: var(--r-bad); }
body.dropping #stage::after { content: ''; position: absolute; inset: 12px; border: 2px dashed var(--ink); border-radius: 12px; pointer-events: none; z-index: 2000; }

/* ---------- Selected palette ---------- */
#palette { padding: 56px 24px 64px; }
.pal-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.pills { padding-top: 14px; }
.pill { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; height: 92px; margin-top: -24px; padding: 15px 34px 0; border-radius: 46px; box-shadow: 0 14px 30px -10px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.14); font-family: var(--font-mono); font-size: 13px; transition: background .7s ease, color .7s ease; }
.pill.in { animation: pillIn .7s cubic-bezier(.2,.9,.25,1.1) both; animation-delay: calc(var(--i) * 70ms + 120ms); }
@keyframes pillIn { from { opacity: 0; transform: translateY(-34px) scale(.96); } }
.pill .job { margin-left: auto; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding-top: 4px; white-space: nowrap; }
.pill button { background: none; border: 0; padding: 2px 4px; border-radius: 2px; font-family: inherit; font-size: inherit; letter-spacing: .05em; }
.pill .lock { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.pill .lock[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 3px; }
.pill button:hover { text-decoration: underline; text-underline-offset: 3px; }
.pill .tune { margin-left: 2px; }
@media (pointer: coarse) { .pill button { min-height: 34px; padding: 6px 8px; } .pill { padding-top: 9px; } }
.pal-grid { position: relative; }
.tuner { position: absolute; z-index: 60; display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--r-border); border-radius: 10px; background: var(--r-surface); color: var(--r-text); box-shadow: 0 22px 44px -16px rgba(0,0,0,.6); }
.tn-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 38px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--r-muted); }
.tn-row b { font-family: var(--font-mono); font-weight: 500; font-size: 12px; text-align: right; color: var(--r-text); }
.tn-row input { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; margin: 6px 0; border-radius: 8px; background: var(--track, var(--r-bg)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--r-text) 18%, transparent); cursor: pointer; }
.tn-row input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 22px; border: 2px solid #fff; border-radius: 3px; background: transparent; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000; }
.tn-row input::-moz-range-thumb { width: 8px; height: 18px; border: 2px solid #fff; border-radius: 3px; background: transparent; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000; }
.tn-row input:focus-visible { outline: 2px solid var(--r-text); outline-offset: 2px; }
.tn-foot { display: flex; align-items: center; gap: 10px; margin-top: 2px; font-family: var(--font-mono); font-size: 12.5px; }
.tn-foot i { width: 22px; height: 22px; border-radius: 3px; box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--r-text) 25%, transparent); }
.tn-foot span { flex: 1; }
.tn-foot button { min-height: 32px; padding: 0 10px; border: 1px solid var(--r-border); border-radius: 3px; background: transparent; color: var(--r-text); font: inherit; }
.tn-foot button:hover { background: var(--r-bg); }
.tn-foot button:focus-visible { outline: 2px solid var(--r-text); outline-offset: 1px; }
.pill :focus-visible { outline-color: currentColor; }
.pal-side h2 { font-size: clamp(30px, 4vw, 48px); font-weight: 650; letter-spacing: -.02em; line-height: 1.08; margin: 0 0 12px; }
.pal-why { margin: 0; font-size: 15px; line-height: 1.55; max-width: 52ch; }
.pal-for { margin: 6px 0 0; font-size: 15px; line-height: 1.55; max-width: 52ch; font-weight: 550; }
.pal-side h3 { margin: 26px 0 10px; font-size: 14px; font-weight: 650; }
.arr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.arr-tile { position: relative; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 5px; overflow: hidden; box-shadow: 0 0 0 1px color-mix(in oklab, var(--ink) 26%, transparent); transition: transform .15s ease, box-shadow .15s ease; }
.arr-tile:hover { transform: translateY(-2px); }
.arr-tile[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px color-mix(in oklab, var(--ink) 24%, transparent); }
.arr-tile > i { position: absolute; display: block; }
.a-bar { top: 0; left: 0; right: 0; height: 20%; }
.a-bar i { position: absolute; right: 8%; top: 30%; height: 40%; aspect-ratio: 1; border-radius: 50%; }
.a-line { left: 10%; top: 34%; width: 56%; height: 6%; border-radius: 2px; }
.a-line.s { top: 47%; width: 38%; }
.a-btn { left: 10%; bottom: 13%; width: 34%; height: 15%; border-radius: 2px; }
.a-chip { left: 48%; bottom: 13%; width: 18%; height: 15%; border-radius: 2px; }
.side-actions { justify-content: flex-start; }

/* ---------- Panels: role colors, not the wash ---------- */
.panel { background: var(--r-bg); color: var(--r-text); border: 1px solid var(--r-border); border-radius: 10px; padding: 20px; min-width: 0; box-shadow: 0 26px 50px -24px color-mix(in oklab, var(--r-shadow, #000) 50%, transparent); }
.recolor .panel, .recolor #dock, .recolor .poster { transition: background-color .8s ease, color .8s ease, border-color .8s ease; }
.panel h3 { margin: 0 0 14px; font-size: 15px; font-weight: 650; }
.note { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--r-muted); max-width: 60ch; }
.group-head { max-width: 1180px; margin: 0 auto 20px; color: var(--ink); transition: color .9s ease var(--ink-delay, 0s); }
.group-head h2 { margin: 0; font-size: clamp(28px, 3.6vw, 44px); font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.group-head p { margin: 8px 0 0; font-size: 15px; line-height: 1.55; max-width: 62ch; color: var(--ink-soft); text-wrap: pretty; }
/* Chapter headings grow as the page gets bolder. */
#wall .group-head h2, .mock-group > .group-head h2 { font-size: clamp(40px, 7vw, 108px); line-height: .98; letter-spacing: -.035em; max-width: 14ch; }
#bench .group-head h2 { font-size: clamp(44px, 9vw, 140px); line-height: .96; letter-spacing: -.04em; max-width: 12ch; }
#wall .group-head p, .mock-group > .group-head p { margin-top: 16px; font-size: 16px; }
.group-head.tight { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }

/* ---------- Routing matrix ---------- */
.matrix-wrap { max-width: 1180px; margin: 64px auto 0; }
.matrix { --n: 6; }
.mx-row { display: grid; grid-template-columns: minmax(84px, 130px) repeat(var(--n), minmax(30px, 1fr)) minmax(150px, 200px); align-items: center; min-height: 42px; border-top: 1px solid var(--r-border); }
.mx-head { border-top: 0; padding-bottom: 8px; }
.mx-job { font-size: 13px; font-weight: 550; }
.mx-col { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.mx-col i { width: min(100%, 34px); height: 24px; border-radius: 3px; box-shadow: 0 0 0 1px var(--r-border); }
.mx-col em { font: 500 10px var(--font-mono); font-style: normal; color: var(--r-muted); }
.mx-pt { height: 42px; width: 100%; padding: 0; border: 0; display: grid; place-items: center; background: linear-gradient(var(--r-border), var(--r-border)) center / 1px 100% no-repeat; }
.mx-pt i { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--r-border); transition: transform .15s ease, background-color .15s ease; }
.mx-pt:hover i { transform: scale(1.8); background: var(--r-muted); }
.mx-pt[aria-pressed="true"] i { width: 22px; height: 22px; box-shadow: 0 0 0 2px var(--r-bg), 0 0 0 3.5px var(--r-text); }
.mx-pt[aria-pressed="true"]:hover i { transform: none; }
.mx-pt:focus-visible { outline: 2px solid var(--r-text); outline-offset: -2px; border-radius: 3px; }
.mx-read { padding-left: 16px; font: 500 12px var(--font-mono); white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.mx-read small { font-family: var(--font-body); font-size: 12px; color: var(--r-muted); font-weight: 400; }
.mx-read.low { color: var(--r-bad); }
.panel .btn { --ink: var(--r-text); --paper: var(--r-bg); }


/* ---------- Bench ---------- */
#bench { padding: 40px 24px 40px; }
.bench-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: stretch; }
.bench-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel.grow { flex: 1; display: flex; flex-direction: column; }
.panel.grow .export-code { flex: 1; }
.contrast { --n: 6; display: grid; gap: 2px; }
.ct-row { display: grid; grid-template-columns: 22px repeat(var(--n), minmax(0, 1fr)); gap: 2px; }
.ct-h { display: grid; place-items: center; min-height: 22px; }
.ct-h i { display: block; width: 14px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px var(--r-border); }
.ct-c { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; border-radius: 3px; font: 600 12px/1.2 var(--font-mono); box-shadow: inset 0 0 0 1px var(--r-border); }
.ct-c small { font-size: 9px; font-weight: 500; letter-spacing: .04em; }
.ct-c.fail b { text-decoration: line-through; opacity: .75; }
.ct-c.same { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--r-border) 5px 6px); }
.sc-row { display: grid; grid-template-columns: 58px repeat(11, minmax(0, 1fr)); gap: 2px; margin-bottom: 2px; align-items: stretch; }
.sc-head span { font: 500 10px var(--font-mono); color: var(--r-muted); text-align: center; padding-bottom: 4px; }
.sc-name { font: 500 11px var(--font-mono); color: var(--r-muted); align-self: center; }
.sc-c { position: relative; height: 36px; padding: 0; border: 0; border-radius: 2px; transition: transform .12s ease; }
.sc-c:hover { transform: scaleY(1.14); z-index: 1; }
.sc-c.base::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: currentColor; }
.sc-c.copied { box-shadow: inset 0 0 0 2px currentColor; }
.sc-c:focus-visible { outline: 2px solid var(--r-text); outline-offset: 1px; z-index: 2; }
.segs { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 6px; background: var(--r-surface); }
.segs button { flex: 1 1 auto; min-height: 34px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--r-muted); font-size: 13px; white-space: nowrap; }
.segs button:hover { color: var(--r-text); }
.segs button[aria-pressed="true"] { background: var(--r-bg); color: var(--r-text); font-weight: 600; box-shadow: 0 0 0 1px var(--r-border); }
.segs button:focus-visible { outline: 2px solid var(--r-text); outline-offset: 1px; }
.export-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.export-head h3 { margin: 0; }
.export-code { margin: 0 0 12px; padding: 14px; height: 268px; overflow: auto; border-radius: 6px; background: var(--r-surface); font: 12.5px/1.6 var(--font-mono); white-space: pre; tab-size: 2; }

/* ---------- Poster ---------- */
#poster { padding: 24px 24px 40px; }
/* The finale: no card, the palette standing on its own chapter as strips, like the deck it came from. */
.poster { max-width: 1180px; margin: 0 auto; }
.poster-name { display: inline-block; font-weight: 800; line-height: 1; letter-spacing: -.035em; white-space: nowrap; margin-bottom: .14em; color: var(--ink); transition: color .9s ease var(--ink-delay, 0s); }
.poster-bands { display: flex; gap: 8px; height: clamp(340px, 60vh, 640px); }
.poster-bands > div { outline: 1px solid color-mix(in oklab, var(--ink) 22%, transparent); outline-offset: -1px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 5px; min-width: 0; padding: 14px 14px 16px; border-radius: 7px; box-shadow: 0 22px 40px -20px color-mix(in oklab, var(--r-shadow, #000) 55%, transparent); font: 500 13px var(--font-mono); overflow: hidden; }
.poster-bands span { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.poster-bands b { font-weight: 500; white-space: nowrap; }
@media (max-width: 640px) {
  .poster-bands { gap: 5px; }
  .poster-bands > div { padding: 10px 4px; align-items: center; }
  .poster-bands span, .poster-bands b { writing-mode: vertical-rl; transform: rotate(180deg); }
}
.poster-actions { justify-content: center; align-items: center; margin-top: 22px; font-size: 13px; }

#end { padding: 32px 24px 96px; text-align: center; }
#end p { max-width: 60ch; margin: 0 auto; font-size: 14px; line-height: 1.6; }
#end a { color: inherit; }

/* ---------- Dock: the deck stays in reach all the way down the page ---------- */
#dock { position: fixed; left: 50%; bottom: 14px; z-index: 50; display: flex; align-items: center; gap: 4px; max-width: calc(100vw - 16px); height: 54px; padding: 0 8px; border-radius: 10px; background: var(--r-bg); color: var(--r-text); border: 1px solid var(--r-border); box-shadow: 0 18px 44px -10px rgba(0,0,0,.6); transform: translate(-50%, calc(100% + 26px)); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
#dock.show { transform: translate(-50%, 0); }
#dockFan { position: relative; flex: none; width: 96px; height: 54px; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
#dockFan.dragging { cursor: grabbing; }
#dockFan i { position: absolute; left: 50%; bottom: -7px; width: 13px; height: 52px; margin-left: -6.5px; border-radius: 2px; transform-origin: 50% calc(100% - 3px); box-shadow: 0 0 0 .5px rgba(0,0,0,.45); will-change: transform; }
.d-btn { flex: none; min-width: 36px; height: 38px; padding: 0 8px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: inherit; font-size: 12.5px; }
.d-btn:hover:not(:disabled) { background: var(--r-surface); }
.d-btn:disabled { opacity: .4; }
.d-btn.text { white-space: nowrap; color: var(--r-muted); }
.d-btn.d-vision { color: var(--r-text); box-shadow: inset 0 0 0 1px var(--r-border); }
.d-btn.d-vision::after { content: ''; width: 9px; height: 9px; margin-left: 6px; background: linear-gradient(45deg, transparent 42%, currentColor 42% 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, currentColor 42% 58%, transparent 58%); }
.d-btn.d-vision { display: inline-flex; align-items: center; }
.d-btn.d-vision[hidden] { display: none; }
.d-vision .dv-short { display: none; }
@media (max-width: 640px) {
  .d-vision .dv-long { display: none; }
  .d-vision .dv-short { display: inline; }
  /* Room for the chip: Light and Dark is still one tap away in the palette section. */
  #dock.has-vision #dockFlip { display: none; }
}
.d-btn.text:hover:not(:disabled) { color: var(--r-text); }
#dock :focus-visible { outline: 2px solid var(--r-text); outline-offset: -1px; }
.d-read { width: 148px; padding: 0 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.d-read b { font-weight: 600; }


/* ---------- On the wall ---------- */
#wall { padding: clamp(48px, 7vw, 96px) 24px clamp(110px, 12vw, 180px); }
.wall-frame { position: relative; width: 100vw; margin: 22px calc(50% - 50vw) 0; background: #000; }
#wallCanvas { display: block; width: 100%; height: min(80svh, 58vw); min-height: 360px; }
/* The only control: what's on the wall. It sits on the dark room, so it is drawn for the room and not the palette. */
.wall-switch { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: rgba(0, 0, 0, .58); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.wall-switch button { min-height: 34px; padding: 0 16px; border: 0; border-radius: 6px; background: transparent; color: rgba(255, 255, 255, .78); font: inherit; font-size: 13px; cursor: pointer; }
.wall-switch button:hover { color: #fff; }
.wall-switch button[aria-pressed="true"] { background: #fff; color: #000; }
.wall-switch button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 860px) {
  #wallCanvas { height: min(46svh, 92vw); min-height: 300px; }
}
@media (max-width: 1040px) { .bench-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .pal-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .bar { height: 60px; padding: 0 16px; } .bar nav { display: none; }
  #palette, #wall, #bench, #poster, #end { padding-left: 16px; padding-right: 16px; }
  .deck-sets { flex-wrap: nowrap; max-width: 100%; }
  .deck-sets button { flex: 1 1 auto; padding: 0 10px !important; font-size: 11px; letter-spacing: .04em; }
  .panel { padding: 14px; }
  .mx-row { grid-template-columns: 78px repeat(var(--n), minmax(30px, 1fr)); }
  .mx-read { grid-column: 1 / -1; padding: 0 0 8px; white-space: normal; }
  .mx-read:empty { display: none; }
  .mx-head .mx-read { display: none; }
  .d-read { display: none; }
}
@media (max-width: 520px) { .read .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 340px; margin-inline: auto; } .read .actions .btn { padding-inline: 8px; } }
@media (max-width: 420px) { .pill { padding-left: 24px; padding-right: 24px; } .arr { gap: 6px; } .sc-row { grid-template-columns: 46px repeat(11, minmax(0, 1fr)); } .sc-head span { font-size: 8.5px; } .d-btn.text { padding: 0 6px; } #dockFan { width: 80px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}


/* ---------- Fan arrows, for a mouse ---------- */
.stage-arrow { position: absolute; z-index: 1300; bottom: calc(var(--strip-l) * .17 + 6px); width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid color-mix(in oklab, var(--ink) 34%, transparent); background: color-mix(in oklab, var(--paper) 22%, transparent); color: var(--ink); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: .55; transition: opacity .2s, background-color .2s, border-color .2s; }
#stage:hover .stage-arrow, .stage-arrow:focus-visible { opacity: 1; }
.stage-arrow:hover { background: color-mix(in oklab, var(--ink) 16%, transparent); border-color: var(--ink); }
.stage-arrow.prev { left: max(14px, calc(50% - var(--strip-l) * 1.02)); }
.stage-arrow.next { right: max(14px, calc(50% - var(--strip-l) * 1.02)); }
@media (pointer: coarse) { .stage-arrow { display: none; } }

/* ---------- Sections after the redesign: apps first, so headings are smaller than before ---------- */
.mock-group > .group-head h2 { font-size: clamp(30px, 4.6vw, 64px) !important; max-width: 18ch !important; line-height: 1.02 !important; }
.mock-group > .group-head p { margin-top: 10px !important; }
#wall .group-head h2 { font-size: clamp(34px, 5.4vw, 80px) !important; }
@media (max-width: 860px) { .deck-sets { flex-wrap: wrap !important; } .deck-sets button { flex: 1 1 auto; } .stage-arrow { display: none; } }
