:root {
  color-scheme: light;
  --paper: #f6f5ee;
  --ink: #253d34;
  --muted: #57675c;
  --line: #d7ddd1;
  --accent: #315d46;
  --soft: #e8edde;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; accent-color: var(--accent); }
button, a, input, [role="slider"], [role="tabpanel"] { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid #98602c; outline-offset: 5px; }
[hidden] { display: none !important; }
.skip { position: fixed; left: 20px; top: -100px; padding: 12px; background: white; z-index: 10; }
.skip:focus { top: 12px; }
.masthead, main, footer { width: min(1080px, calc(100% - 96px)); margin-inline: auto; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 36px; }
.wordmark { font-weight: 750; letter-spacing: -.04em; font-size: 26px; text-decoration: none; }
.wordmark span { display: block; font-size: 12px; font-weight: 400; letter-spacing: .12em; margin-top: 5px; color: var(--muted); }
.motion-option, .failure-option { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
input[type="checkbox"] { width: 17px; height: 17px; flex: 0 0 auto; }
.intro { padding: 44px 0 26px; }
.eyebrow { font-size: 11px; letter-spacing: .19em; color: var(--muted); }
h1 { font-size: clamp(34px, 5.6vw, 72px); font-weight: 650; letter-spacing: -.05em; margin: 0 0 12px; line-height: 1.2; }
.intro > p:last-child { margin: 0; max-width: 580px; color: var(--muted); font-size: 16px; line-height: 1.9; }
.study { border-top: 1px solid var(--line); padding: 38px 0 44px; display: grid; grid-template-columns: 1fr 1.65fr; gap: 60px; }
.number { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); }
h2 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin: 14px 0 10px; }
.annotation p { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 0; }
.experiment { padding-top: 4px; min-width: 0; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); position: relative; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #eeefe5; isolation: isolate; }
.tab-indicator { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 6px; background: var(--accent); transform: translateX(0%); transition: transform 190ms cubic-bezier(.2, .8, .2, 1); pointer-events: none; z-index: -1; }
.tabs button { border: 0; padding: 12px 4px; background: transparent; color: var(--muted); font-size: 14px; border-radius: 5px; }
.tabs button[aria-selected="true"] { color: #fff; }
.reading { min-height: 112px; padding: 23px 0 8px; }
h3 { font-size: 18px; font-weight: 550; margin: 0 0 10px; line-height: 1.6; }
.reading p { font-size: 14px; color: var(--muted); line-height: 1.9; margin: 0; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.8; margin: 18px 0 0; }
.range-heading { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; margin-bottom: 10px; }
output { font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; min-height: 30px; margin: 0 0 15px; }
.save-actions { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.primary, .secondary { min-height: 40px; border-radius: 6px; padding: 8px 22px; font-size: 14px; }
.primary { background: var(--accent); border: 1px solid var(--accent); color: white; }
.primary:active, .secondary:active { filter: brightness(.9); }
.secondary { color: var(--ink); border: 1px solid var(--line); background: var(--paper); }
.result { background: var(--soft); padding: 14px 18px; margin-top: 20px; border-left: 2px solid var(--accent); min-height: 90px; }
.result[data-state="failed"] { border-color: #975235; background: #f2e7db; }
#save-status, #drag-status { font-size: 14px; line-height: 1.7; margin: 0; }
.confirmed { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
#retry { margin-top: 12px; }
.unit { color: var(--muted); font-size: 12px; }
.drag-track { --value: 35; position: relative; height: 76px; border: 1px solid var(--line); background: #eeefe5; border-radius: 8px; touch-action: none; user-select: none; cursor: ew-resize; margin-bottom: 16px; }
.rail { position: absolute; height: 2px; inset: calc(50% - 1px) 22px auto; background: #c3cebd; }
.thumb { position: absolute; width: 28px; height: 38px; top: 18px; left: calc(8px + (100% - 44px) * var(--value) / 100); background: var(--accent); border-radius: 5px; transition: left 140ms ease-out; }
.thumb::after { content: ""; position: absolute; width: 2px; height: 12px; background: #dce7d5; left: 13px; top: 13px; }
.drag-track[data-dragging="true"] .thumb { transition: none; background: #467555; }
footer { border-top: 1px solid var(--line); padding: 25px 0 35px; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--muted); }
.motion-off *, .motion-off *::before, .motion-off *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 700px) {
  .masthead, main, footer { width: calc(100% - 40px); }
  .masthead { align-items: flex-start; padding-top: 25px; gap: 12px; }
  .wordmark { font-size: 23px; white-space: nowrap; }
  .motion-option { font-size: 11px; padding-top: 3px; gap: 4px; }
  .intro { padding: 40px 0 24px; }
  .intro > p:last-child { font-size: 14px; }
  .study { grid-template-columns: 1fr; gap: 25px; padding: 28px 0 34px; }
  h2 { margin: 10px 0 7px; }
  .reading { min-height: 128px; }
  footer { flex-direction: column; }
}

/* The motion piece shares the existing paper, ink, type, and control system. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.theatre { --stage-ink: #d4ee82; aspect-ratio: 2.28; background: #142c24; position: relative; overflow: hidden; isolation: isolate; color: var(--stage-ink); }
#motion-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-meta { position: absolute; inset: auto 24px 20px; display: flex; align-items: center; gap: 18px; color: #e0e8d6; font-size: 12px; font-variant-numeric: tabular-nums; }
#scene-label { min-width: 72px; }
.stage-progress { flex: 1; height: 2px; background: #3d5345; }
#stage-progress-fill { display: block; height: 100%; background: var(--stage-ink); width: 20%; position: relative; }
#stage-progress-fill::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--stage-ink); position: absolute; right: -4px; top: -3px; }
.showcase-controls { display: grid; grid-template-columns: auto 1fr auto; gap: 30px; padding: 25px 0 0; align-items: start; }
.transport { display: flex; gap: 10px; }
.transport button { min-width: 74px; min-height: 44px; padding: 8px 16px; }
.seek-control { min-width: 0; }
.seek-control label { font-size: 12px; display: block; margin-bottom: 0; }
.seek-control input { margin: 0; accent-color: #315d46; cursor: ew-resize; }
.scene-buttons { display: flex; gap: 8px; }
.scene-buttons button { color: var(--ink); border: 1px solid #8c9a8d; background: transparent; border-radius: 4px; font-size: 13px; padding: 10px 14px; min-height: 44px; }
.scene-buttons button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: white; }
.studies-intro { border-top: 1px solid var(--line); margin-top: 42px; padding: 35px 0 20px; }
.studies-intro h2 { font-size: clamp(28px, 3.7vw, 44px); font-weight: 650; letter-spacing: -.045em; margin: 0 0 10px; }
.studies-intro p { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 0; }

@media (max-width: 900px) {
  .showcase-controls { grid-template-columns: auto 1fr; gap: 16px 24px; }
}
@media (max-width: 700px) {
  .theatre { aspect-ratio: 1.18; }
  .stage-meta { inset: auto 14px 17px; gap: 12px; font-size: 10px; }
  #scene-label { min-width: 55px; }
  .showcase-controls { padding-top: 18px; gap: 14px; }
  .transport { gap: 6px; }
  .transport button { min-width: 58px; padding: 8px 10px; font-size: 13px; }
  .scene-buttons { display: grid; grid-template-columns: repeat(4, 1fr); }
  .studies-intro { margin-top: 30px; padding-top: 28px; }
}
.transport button:disabled { opacity: .5; cursor: default; }

.wire-study { border-top: 1px solid var(--line); margin-top: 42px; padding-top: 35px; }
.wire-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.wire-heading h2 { font-size: clamp(28px, 3.7vw, 44px); font-weight: 650; letter-spacing: -.045em; margin: 0 0 10px; }
.wire-heading p { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 0; }
.theme-buttons { display: flex; border: 1px solid #8c9a8d; border-radius: 24px; padding: 3px; flex-shrink: 0; }
.theme-buttons button { border: 0; color: var(--ink); background: transparent; border-radius: 20px; min-width: 64px; min-height: 38px; font-size: 14px; }
.theme-buttons button[aria-pressed="true"] { background: var(--ink); color: white; }
.wire-stage { height: 430px; position: relative; overflow: hidden; background: #e9eade; color: #354a3b; }
.wire-stage[data-theme="night"] { background: #182c2d; color: #dce7c6; }
#wire-canvas { display: block; width: 100%; height: 100%; position: relative; z-index: 1; }
.wire-meta { position: absolute; inset: auto 24px 20px; display: flex; justify-content: space-between; gap: 20px; font-size: 12px; z-index: 2; }
.wire-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; font-size: 16px; padding-top: 18px; }
.wire-notes p { margin: 0; line-height: 1.8; }
.wire-notes p + p { border-left: 1px solid var(--line); padding-left: 24px; }
.wire-fallback { display: none; position: absolute; inset: 24% 30%; border: 1px solid currentColor; border-radius: 50%; }
.wire-stage.canvas-unavailable .wire-fallback { display: block; }
.wire-stage.canvas-unavailable[data-theme="night"] .wire-fallback { border: 0; background: currentColor; }
.wire-stage.canvas-unavailable[data-theme="night"] .wire-fallback span { position: absolute; inset: -1px -1px 10% 35%; background: #182c2d; border-radius: 50%; }
@media (max-width: 700px) {
  .wire-study { margin-top: 30px; padding-top: 28px; }
  .wire-heading { display: block; }
  .theme-buttons { width: fit-content; margin-top: 18px; }
  .theme-buttons button { min-width: 70px; }
  .wire-stage { height: 320px; }
  .wire-meta { inset: auto 14px 16px; font-size: 10px; }
  .wire-notes { grid-template-columns: 1fr; gap: 8px; font-size: 14px; }
  .wire-notes p + p { border-left: 0; padding-left: 0; }
}

/* Continuous copy is the artwork: type, reading rhythm, then spatial turn. */
.pair-label { position: absolute; top: 26px; left: 28px; font-size: 12px; letter-spacing: .05em; color: #b6ccbd; }
.fallback-text { position: absolute; inset: 30% 5% auto; text-align: center; font-size: clamp(26px, 5.5vw, 72px); letter-spacing: .02em; color: #e4f2bd; margin: 0; }
.text-context { display: flex; align-items: baseline; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
#context-index { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.text-context p { margin: 0; font-size: 16px; line-height: 1.8; }
.showcase-controls > #playback-note { font-size: 12px; line-height: 1.7; color: var(--muted); max-width: 250px; margin: 0; }
.text-navigation { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 30px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.text-navigation button { text-align: left; border: 0; border-radius: 0; padding: 20px 24px; background: transparent; position: relative; }
.text-navigation button + button { border-left: 1px solid var(--line); }
.text-navigation button:first-child { padding-left: 0; }
.text-navigation button span { display: block; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.text-navigation button strong { display: block; font-size: 20px; font-weight: 550; letter-spacing: -.02em; }
.text-navigation button small { display: block; font-size: 12px; color: var(--muted); margin-top: 9px; }
.text-navigation button[aria-pressed="true"] { background: transparent; color: var(--ink); }
.text-navigation button[aria-pressed="true"]::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 3px; background: var(--accent); }
.supporting { border-top: 1px solid var(--line); margin-top: 48px; }
.supporting > summary { cursor: pointer; font-size: 14px; padding: 22px 0; color: var(--muted); }
.supporting .wire-study { margin-top: 0; border-top: 0; }
@media (max-width: 900px) {
  .showcase-controls > #playback-note { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 700px) {
  .intro h1 { font-size: clamp(31px, 7.5vw, 48px); }
  .theatre { aspect-ratio: 1.45; }
  .pair-label { top: 18px; left: 16px; font-size: 10px; }
  #scene-label { font-size: 9px; min-width: 0; }
  .stage-meta { gap: 10px; }
  .text-context { gap: 14px; padding: 18px 0; align-items: flex-start; min-height: 92px; }
  .text-context p { font-size: 14px; }
  .text-navigation { margin-top: 22px; }
  .text-navigation button { padding: 16px 10px; }
  .text-navigation button strong { font-size: 14px; line-height: 1.7; }
  .text-navigation button small { font-size: 10px; line-height: 1.7; margin-top: 5px; }
  .text-navigation button span { margin-bottom: 8px; }
  .supporting { margin-top: 32px; }
}

/* The artwork is the primary screen; supporting utilities keep their own tone. */
.showcase-page {
  --paper: #081614; --ink: #e3e9dd; --muted: #91a79c;
  --line: #294039; --accent: #ed7858; --soft: #172923;
  color-scheme: dark; background: #081614; color: var(--ink);
}
.showcase-page::before { content: ""; position: absolute; inset: 0 0 auto; height: 1000px; pointer-events: none; background: radial-gradient(ellipse at 55% 45%, rgba(49,91,77,.12), transparent 62%); }
.showcase-page .masthead, .showcase-page main, .showcase-page footer { width: min(1440px, calc(100% - 112px)); }
.showcase-page .masthead { padding-top: 27px; position: relative; }
.showcase-page .wordmark { font-size: 25px; font-weight: 450; letter-spacing: -.035em; }
.header-actions { display: flex; align-items: center; gap: 25px; }
.header-actions > a { border-left: 1px solid var(--line); padding-left: 25px; font-size: 12px; text-decoration: none; }
.showcase-page .intro { padding: 31px 0 0; position: relative; z-index: 2; }
.showcase-page h1 { font-size: clamp(24px, 2.5vw, 34px); line-height: 1.5; font-weight: 450; letter-spacing: .015em; margin: 0 0 4px; }
.showcase-page .intro > p:last-child { font-size: 12px; letter-spacing: .03em; }
.showcase-page .showcase { position: relative; }
.showcase-page .theatre { height: clamp(470px, 65svh, 780px); aspect-ratio: auto; background: transparent; margin-top: -12px; overflow: hidden; }
.showcase-page .pair-label { display: none; }
.showcase-page .stage-meta { inset: auto 0 10px; font-size: 10px; color: var(--muted); justify-content: space-between; letter-spacing: .03em; }
.showcase-page .stage-progress { display: none; }
.showcase-page .showcase-controls { grid-template-columns: auto 1fr; padding-top: 9px; gap: 38px; align-items: center; }
.showcase-page .seek-control label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.showcase-page .showcase-controls > #playback-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.showcase-page .transport { gap: 24px; align-items: center; }
.showcase-page #play { background: none; border: 0; color: var(--accent); min-width: 80px; min-height: 44px; padding: 8px 0 8px 43px; font-size: 12px; position: relative; text-align: left; }
.showcase-page #play::before { content: ""; position: absolute; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); top: 7px; left: 0; }
.showcase-page #play::after { content: ""; position: absolute; top: 16px; left: 12px; border: 6px solid transparent; border-left: 8px solid #081614; border-right: 0; }
.showcase-page #play[aria-pressed="true"]::after { top: 16px; left: 10px; width: 10px; height: 12px; border: 0; border-left: 3px solid #081614; border-right: 3px solid #081614; }
.showcase-page #replay { min-width: 32px; background: transparent; border: 0; padding: 8px 0; color: var(--muted); font-size: 12px; }
.showcase-page #replay:hover { color: var(--ink); }
.showcase-page #scene-seek { appearance: none; -webkit-appearance: none; background: transparent; height: 38px; margin: 0; cursor: ew-resize; }
.showcase-page #scene-seek::-webkit-slider-runnable-track { height: 2px; background: #355048; }
.showcase-page #scene-seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; height: 10px; width: 10px; border-radius: 50%; background: var(--accent); margin-top: -4px; }
.showcase-page #scene-seek::-moz-range-track { height: 2px; background: #355048; }
.showcase-page #scene-seek::-moz-range-thumb { height: 10px; width: 10px; border: 0; border-radius: 50%; background: var(--accent); }
.showcase-page .text-navigation { margin-top: 17px; border-top: 0; gap: 24px; }
.showcase-page .text-navigation button, .showcase-page .text-navigation button:first-child { padding: 14px 0 16px; display: flex; align-items: baseline; gap: 14px; }
.showcase-page .text-navigation button + button { border-left: 0; }
.showcase-page .text-navigation button span { margin: 0; }
.showcase-page .text-navigation button strong { font-size: 13px; font-weight: 450; }
.showcase-page .text-navigation button small { display: none; }
.showcase-page .text-navigation button[aria-pressed="true"] { color: var(--ink); }
.showcase-page .text-navigation button[aria-pressed="true"] span { color: var(--accent); }
.showcase-page .text-navigation button[aria-pressed="true"]::before { top: auto; bottom: -1px; height: 2px; width: 150px; max-width: 100%; background: var(--accent); }
.showcase-page .text-context { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 60px; padding: 42px 0 30px; border-bottom: 0; }
.showcase-page .text-context h2 { font-size: clamp(28px, 3.5vw, 50px); line-height: 1.4; font-weight: 450; margin: 0; letter-spacing: -.025em; }
.showcase-page .text-context p { color: var(--muted); font-size: 14px; line-height: 1.9; max-width: 450px; }
.showcase-page .supporting { margin-top: 12px; }
.showcase-page .supporting[open] { --paper: #f6f5ee; --ink: #253d34; --muted: #57675c; --line: #d7ddd1; --accent: #315d46; --soft: #e8edde; color-scheme: light; color: var(--ink); background: var(--paper); padding: 0 28px; }
.showcase-page :focus-visible { outline-color: #e3e9bd; }
.showcase-page .supporting :focus-visible { outline-color: #98602c; }
@media (max-width: 700px) {
  .showcase-page .masthead, .showcase-page main, .showcase-page footer { width: calc(100% - 36px); }
  .showcase-page .masthead { padding-top: 23px; gap: 12px; }
  .showcase-page .wordmark { font-size: 23px; }
  .header-actions { gap: 12px; }
  .header-actions > a { padding-left: 12px; font-size: 10px; }
  .showcase-page .motion-option { font-size: 10px; }
  .showcase-page .motion-option input { width: 14px; height: 14px; }
  .showcase-page .intro { padding-top: 28px; }
  .showcase-page .intro h1 { font-size: 25px; }
  .showcase-page .intro > p:last-child { font-size: 11px; }
  .showcase-page .theatre { height: clamp(370px, 53svh, 570px); margin-top: 0; }
  .showcase-page .stage-meta { font-size: 9px; }
  .showcase-page .showcase-controls { gap: 22px; padding-top: 3px; }
  .showcase-page .transport { gap: 14px; }
  .showcase-page .text-navigation { gap: 12px; margin-top: 12px; }
  .showcase-page .text-navigation button, .showcase-page .text-navigation button:first-child { display: block; padding: 13px 0 15px; }
  .showcase-page .text-navigation button span { margin-bottom: 7px; font-size: 10px; }
  .showcase-page .text-navigation button strong { font-size: 11px; white-space: nowrap; }
  .showcase-page .text-context { grid-template-columns: 1fr; padding: 29px 0 20px; gap: 14px; min-height: 0; }
  .showcase-page .text-context h2 { font-size: 29px; }
  .showcase-page .text-context p { font-size: 13px; }
  .showcase-page .supporting[open] { padding: 0 16px; }
}
.showcase-page .theatre { height: clamp(540px, 68svh, 800px); }
@media (max-width: 700px) { .showcase-page .theatre { height: clamp(360px, 53svh, 570px); } }
.showcase-page .intro h1, .showcase-page .text-context h2 { font-family: "Songti SC", "STSong", serif; font-weight: 400; }
