/* A paper theater: typography and ink carry the story. */
.motion-wrap [hidden] { display: none !important; }
.motion-top { max-width: 1280px; border-bottom: 1px solid var(--line); position: static; }
.motion-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.motion-brand img { border-radius: 6px; }
.back-link { color: var(--mute); text-decoration: none; font-size: 13px; margin-left: auto; }
.back-link:hover { color: var(--red); }
.motion-wrap { max-width: 1236px; margin: auto; padding: 0 30px 32px; }
.motion-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 47px 0 35px; }
.motion-intro .kicker { margin: 0 0 15px; animation: none; font-size: 11px; letter-spacing: .16em; }
.motion-intro h1 { margin: 0; font: 900 clamp(35px, 4.3vw, 58px)/1.2 var(--serif); letter-spacing: -.045em; }
.motion-intro h1 em { font-style: normal; color: var(--red); }
.motion-lede { margin: 0 0 4px; font: 600 17px/1.8 var(--serif); }
.motion-lede span { display: block; margin-top: 10px; color: var(--mute); font: 400 12px/1.8 var(--sans); }
.group-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.group-choice { display: flex; align-items: center; gap: 16px; padding: 19px 23px; text-decoration: none; position: relative; transition: background .2s; }
.group-choice + .group-choice { border-left: 1px solid var(--line); }
.group-choice[aria-current="true"] { background: rgba(255, 252, 245, .7); }
.group-choice[aria-current="true"]::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 3px; background: var(--red); }
.group-choice:hover { background: rgba(255, 252, 245, .5); }
.group-number { font: 600 35px/1 var(--serif); color: var(--mute); }
.group-choice[aria-current="true"] .group-number { color: var(--red); }
.group-choice b { display: block; font: 900 22px/1.3 var(--serif); }
.group-choice small { display: block; margin-top: 5px; font-size: 11px; color: var(--mute); }
.group-range { margin-left: auto; color: var(--mute); font-size: 11px; white-space: nowrap; text-align: right; }
.group-range i { font: 500 11px/1.6 var(--mono); font-style: normal; }
.motion-player { margin-top: 26px; border: 1px solid #bbae96; background: #faf5eb; box-shadow: 0 12px 30px -25px #3a362f88; }
.theater-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 22px; background: var(--ink); color: var(--paper); font: 500 12px/1.6 var(--sans); }
.theater-heading > span:first-child { font-family: var(--serif); letter-spacing: .08em; }
.fiction-label { color: #cfc2ab; margin-left: auto; font-size: 10px; }
#sceneCount { font: 500 11px/1 var(--mono); color: #e3b3a0; }
.stage-shell { position: relative; width: 100%; aspect-ratio: 2.12; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 50% 50%, #fffdf6 0, #f2eadb 90%); }
.stage-shell::after { content: ''; position: absolute; inset: 13px; border: 1px solid #c5b79b55; pointer-events: none; z-index: 0; }
.scene-heading { position: absolute; left: 18%; right: 18%; top: 24px; z-index: 4; text-align: center; pointer-events: none; }
.scene-heading p { margin: 0 0 7px; font: 500 10px/1.6 var(--sans); color: var(--mute); }
.scene-heading h2 { margin: 0; font: 900 clamp(19px, 2.3vw, 28px)/1.4 var(--serif); letter-spacing: -.04em; }
.scene-art { position: absolute; inset: 52px 0 35px; z-index: 1; }
.scene-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.scene-art text { font-family: var(--sans); fill: #504b42; font-weight: 500; text-anchor: middle; }
.scene-art .viz-serif { font-family: var(--serif); font-weight: 600; }
.scene-art .viz-small { font-size: 19px; fill: #72685b; }
.scene-art .viz-label { font-size: 25px; }
.scene-art .viz-main { font-size: 31px; font-family: var(--serif); font-weight: 600; fill: var(--ink); }
.scene-art .viz-main.viz-tight { font-size: 26px; }
.scene-art .viz-red { fill: var(--red); }
.scene-art .route { fill: none; stroke: var(--red); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.scene-art .route-muted { stroke: #a79b86; stroke-dasharray: 9 9; stroke-width: 3; }
.scene-art .flow-line { stroke-dasharray: 9 8; animation: route-flow 5s linear infinite; animation-play-state: paused; }
.running .scene-art .flow-line { animation-play-state: running; }
/* Plays once when a scene is inserted; never again on resume. */
.scene-art .ink-enter { animation: ink-reveal .5s ease-out both; }
.scene-art .map-paper { fill: #e9e1cf; stroke: #d8cdb7; stroke-width: 1.5; }
.scene-art .map-river { fill: #cadbd6; stroke: #9eb9b0; stroke-width: 1; }
.scene-art .map-water { fill: none; stroke: #96b1a8; stroke-width: 1.5; opacity: .65; }
.scene-art .faded { opacity: .34; }
.scene-art .resource-dot { fill: #b23b25; stroke: #faf5eb; stroke-width: 2; }
.scene-art [data-mover] { transform-box: view-box; }
.scene-note { position: absolute; bottom: 18px; left: 19%; right: 19%; text-align: center; z-index: 4; color: var(--red); font: 600 clamp(12px, 1.4vw, 16px)/1.6 var(--serif); letter-spacing: -.025em; }
.actor { position: absolute; z-index: 3; width: 15.5%; max-width: 176px; aspect-ratio: 1/2; bottom: 43px; transform-origin: bottom center; pointer-events: none; }
.actor-left { left: 2.2%; }
.actor-right { right: 2.2%; }
.actor-sprite { position: absolute; inset: 0; }
.actor-sprite img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: bottom center; }
.actor-name { position: absolute; bottom: -13px; left: 5px; right: 5px; text-align: center; color: var(--mute); font: 500 10px/1.5 var(--sans); letter-spacing: .1em; }
.actor.is-speaking .actor-name { color: var(--red); }
.running .actor.is-speaking { animation: actor-gesture 3.2s ease-in-out infinite; }
.dialogue-band { position: relative; display: flex; align-items: flex-start; gap: 20px; padding: 23px 35px; min-height: 108px; border-top: 1px solid var(--line); background: #fffbf3; }
.speaker-tag { flex-shrink: 0; display: inline-block; min-width: 61px; padding-top: 3px; color: var(--red); font: 600 15px/1.8 var(--serif); }
#dialogueText { margin: 0; padding-right: 35px; color: var(--ink); max-width: 44em; font: 500 clamp(16px, 1.6vw, 19px)/1.8 var(--sans); }
.dialogue-index { position: absolute; right: 24px; top: 28px; color: #b9ad98; font: 500 11px var(--mono); }
.transport { display: flex; align-items: center; gap: 19px; padding: 18px 24px 7px; border-top: 1px solid var(--line); }
.transport button { border: 0; cursor: pointer; }
.play-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; min-width: 98px; padding: 8px 17px; background: var(--red); color: #fff6e8; font-size: 13px; }
.play-button:hover { background: var(--red-2); }
.transport-icon { min-width: 40px; min-height: 44px; padding: 4px; background: none; font-size: 22px; }
.transport-icon:disabled { opacity: .25; cursor: default; }
.replay-button { display: flex; gap: 6px; align-items: center; min-height: 44px; background: none; white-space: nowrap; font-size: 13px; }
.replay-button:first-letter { font-size: 22px; }
.timeline { flex: 1; min-width: 0; padding-top: 12px; }
.timeline input { display: block; width: 100%; height: 24px; margin: 0; cursor: pointer; accent-color: var(--red); }
.time-label { display: flex; justify-content: space-between; color: var(--mute); font: 500 10px/1.5 var(--mono); }
.playback-hint { margin: 0; padding: 9px 24px 17px; color: var(--mute); font-size: 11px; }
.end-panel { padding: 26px 30px; border-top: 1px solid var(--line); background: var(--paper-2); }
.end-panel[hidden] { display: none; }
.end-panel .kicker { margin: 0 0 9px; font-size: 10px; }
.end-panel h3 { margin: 0 0 20px; font: 600 24px/1.6 var(--serif); }
.end-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.end-actions a, .end-actions button { display: inline-block; padding: 10px 15px; font-size: 13px; text-decoration: none; cursor: pointer; }
.end-actions a { color: var(--paper); background: var(--ink); border: 1px solid var(--ink); }
.end-actions button { background: transparent; border: 1px solid var(--ink); }
.lesson-links { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 18px; font-size: 12px; }
.lesson-links a { text-decoration-color: #b8aa92; text-underline-offset: 4px; }
.scene-navigation { padding: 29px 0 0; }
.section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 25px; margin-bottom: 14px; }
.section-label h2 { margin: 0; flex-shrink: 0; font: 600 17px/1.5 var(--serif); }
.section-label p { margin: 0; max-width: 48em; font-size: 11px; color: var(--mute); text-align: right; }
.scene-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.scene-list li { min-width: 0; }
.scene-button { width: 100%; min-height: 78px; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 5px 9px; align-items: baseline; padding: 15px 14px; text-align: left; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; }
.scene-button > span { grid-row: span 2; color: var(--mute); font: 500 11px/1.6 var(--mono); }
.scene-button b { font: 500 12px/1.6 var(--sans); }
.scene-button small { color: var(--mute); font: 500 10px/1.5 var(--mono); }
.scene-button[aria-current="step"] { background: var(--ink); color: var(--paper); }
.scene-button[aria-current="step"] > span, .scene-button[aria-current="step"] small { color: #d9b09d; }
.scene-button:not([aria-current]):hover { background: #e9e1d0; }
.script-panel { margin-top: 25px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.script-panel > summary { display: flex; gap: 20px; justify-content: space-between; padding: 17px 0; font: 600 16px/1.7 var(--serif); cursor: pointer; }
.script-panel > summary::after { content: '+'; font: 400 22px var(--sans); }
.script-panel[open] > summary::after { content: '−'; }
.script-panel > summary span { margin-left: auto; color: var(--mute); font: 400 11px/1.8 var(--sans); }
.script-panel > p { font-size: 13px; }
.script-scene { padding: 23px 0; border-top: 1px solid var(--line); max-width: 52em; }
.script-scene h3 { margin: 0 0 14px; font: 600 19px/1.5 var(--serif); }
.script-scene p { font-size: 14px; line-height: 1.9; margin: 9px 0; }
.script-scene strong { display: inline-block; min-width: 5em; color: var(--red); font-size: 12px; }
.script-jump { margin-top: 10px; padding: 8px 12px; background: transparent; border: 1px solid var(--line); cursor: pointer; font-size: 12px; }
.interpretation-note { max-width: 60em; margin: 23px 0 0; font-size: 11px; line-height: 1.9; color: var(--mute); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.motion-fallback { padding: 20px; border: 1px solid var(--red); }
.text-edition { max-width: 850px; margin: 45px auto; padding: 0 25px; }
.text-edition h1 { font: 900 clamp(36px, 6vw, 60px)/1.3 var(--serif); }
.text-edition > nav { display: flex; gap: 28px; margin: 30px 0; }
.text-edition > section { margin-top: 50px; border-top: 1px solid var(--ink); }
.text-edition > section > section { padding: 20px 0 25px; border-top: 1px solid var(--line); }
.text-edition h2, .text-edition h3 { font-family: var(--serif); }
.text-edition h3 { margin-top: 0; }
.text-edition .kicker { font-size: 11px; margin: 10px 0; }
.text-edition strong { color: var(--red); }
.text-edition section section > a { font-size: 12px; }
.text-takeaway { color: var(--mute); font-size: 13px; }
@keyframes route-flow { to { stroke-dashoffset: -170; } }
@keyframes ink-reveal { from { opacity: .3; } to { opacity: 1; } }
@keyframes actor-gesture { 50% { transform: translateY(-2px) rotate(.4deg); } }
@media (max-width: 900px) {
  .group-choice { padding: 17px 14px; gap: 10px; }
  .group-range { display: none; }
  .group-number { font-size: 28px; }
  .group-choice b { font-size: 20px; }
  .scene-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-label { display: block; }
  .section-label p { margin-top: 7px; text-align: left; }
}
@media (max-width: 640px) {
  .motion-top { padding: 14px 16px; }
  .motion-brand { gap: 9px; }
  .motion-brand img { width: 27px; height: 27px; }
  .motion-brand .brand-t { font-size: 12px; }
  .back-link { font-size: 10px; }
  .motion-wrap { padding: 0 14px 20px; }
  .motion-intro { display: block; padding: 29px 2px 25px; }
  .motion-intro .kicker { font-size: 9px; }
  .motion-intro h1 { font-size: 39px; }
  .motion-lede { margin-top: 19px; font-size: 14px; line-height: 1.7; }
  .motion-lede br { display: none; }
  .motion-lede span { font-size: 10px; margin-top: 7px; }
  .group-choice { display: block; padding: 14px 10px 15px; }
  .group-number { display: block; font-size: 21px; margin-bottom: 8px; }
  .group-choice b { font-size: 19px; }
  .group-choice small { font-size: 9px; margin-top: 5px; line-height: 1.6; }
  .motion-player { margin-top: 19px; }
  .theater-heading { padding: 10px 12px; gap: 8px; }
  .theater-heading > span:first-child { font-size: 11px; }
  .fiction-label { font-size: 8px; }
  #sceneCount { font-size: 9px; }
  .stage-shell { aspect-ratio: auto; height: 370px; }
  .stage-shell::after { inset: 8px; }
  .scene-heading { top: 18px; left: 10%; right: 10%; }
  .scene-heading p { font-size: 8px; margin-bottom: 6px; }
  .scene-heading h2 { font-size: 20px; }
  .scene-art { inset: 63px -3px 105px; }
  .scene-art .viz-small { font-size: 23px; }
  .scene-art .viz-small.viz-place { font-size: 27px; }
  .actor { width: 18%; max-width: 70px; bottom: 40px; }
  .actor-left { left: 0; }
  .actor-right { right: 0; }
  .actor-name { font-size: 8px; bottom: -8px; }
  .scene-note { left: 8%; right: 8%; bottom: 12px; font-size: 11px; }
  .dialogue-band { display: block; min-height: 129px; padding: 13px 18px 19px; }
  .speaker-tag { font-size: 12px; padding: 0; margin-bottom: 5px; }
  #dialogueText { padding: 0 5px 0 0; font-size: 16px; line-height: 1.7; }
  .dialogue-index { top: 17px; right: 17px; font-size: 9px; }
  .transport { flex-wrap: wrap; gap: 3px 10px; padding: 13px 13px 4px; }
  .play-button { min-width: 75px; min-height: 42px; padding: 7px 11px; font-size: 12px; }
  .transport-icon { min-width: 30px; }
  .replay-button { min-width: 28px; padding: 0 3px; font-size: 22px; }
  .replay-button span { display: none; }
  .timeline { padding-top: 12px; }
  .playback-hint { font-size: 10px; padding: 9px 13px 13px; }
  .scene-navigation { padding-top: 24px; }
  .section-label h2 { font-size: 16px; }
  .section-label p { font-size: 10px; line-height: 1.8; }
  .scene-button { padding: 12px 10px; grid-template-columns: 21px minmax(0, 1fr); gap: 4px; min-height: 81px; }
  .scene-button b { font-size: 11px; }
  .scene-button small { font-size: 9px; }
  .script-panel > summary { font-size: 14px; gap: 12px; }
  .script-panel > summary span { font-size: 9px; }
  .end-panel { padding: 21px 18px; }
  .end-panel h3 { font-size: 20px; }
  .end-actions { gap: 10px; }
  .end-actions a, .end-actions button { font-size: 11px; padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .running .actor, .scene-art .flow-line, .scene-art .ink-enter { animation: none !important; }
}
@media print {
  .text-edition a[href^="/motion/#"], .top, .site-footer { display: none; }
  .text-edition { max-width: none; margin: 0; }
  .text-edition section section { break-inside: avoid; }
}
