:root {
  color-scheme: dark;
  --ink: #101a20;
  --paper: #f5efe4;
  --gold: #e2bc86;
  --muted: #bfc6c3;
  --line: rgba(231, 222, 203, .21);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --gutter: clamp(24px, 4.3vw, 76px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { background: var(--ink); color: var(--paper); font: 14px var(--sans); }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
#experience { position: relative; isolation: isolate; width: 100%; height: 100%; }
#stage, #stage canvas, .scrim, #markers, #chapter-fade { position: absolute; inset: 0; width: 100%; height: 100%; }
#stage { background: radial-gradient(ellipse at 74% 46%, #927963 0%, #485457 39%, #172a30 77%); }
#stage canvas { display: block; touch-action: none; }
[data-mode=explore] #stage canvas { cursor: grab; }
[data-mode=explore] #stage canvas:active { cursor: grabbing; }
.scrim { pointer-events: none; background: linear-gradient(90deg, #101b21 1%, rgba(14,26,32,.91) 16%, rgba(14,26,32,.64) 31%, rgba(14,26,32,.12) 58%, transparent 77%), linear-gradient(0deg, #10191f 1%, rgba(12,22,27,.83) 12%, transparent 35%), linear-gradient(180deg, rgba(11,20,26,.68), transparent 20%); }
[data-mode=explore] .scrim { background: linear-gradient(0deg, rgba(12,22,27,.78), transparent 18%), linear-gradient(180deg, rgba(11,20,26,.7), transparent 20%); }
#chapter-fade { z-index: 2; background: #101a20; opacity: 0; pointer-events: none; }
.masthead { position: absolute; z-index: 4; inset: 0 0 auto; height: 81px; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: rgba(13,23,29,.47); }
.wordmark { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand { display: block; font: 26px/.95 var(--serif); letter-spacing: .12em; }
.brand-sub { display: block; margin-top: 6px; color: #ceccc0; font-size: 8px; letter-spacing: .16em; font-weight: 600; }
.seal { position: relative; flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--gold); border: 1px solid #c4a377a0; border-radius: 50%; }
.seal::before { content: ''; position: absolute; width: 15px; top: 12px; height: 1px; border-left: 4px solid; border-right: 4px solid; opacity: .85; }
.seal::after { content: ''; position: absolute; bottom: 7px; width: 17px; border-bottom: 1px solid; }
.seal i { display: block; width: 12px; height: 20px; background: currentColor; clip-path: polygon(50% 0, 69% 21%, 69% 34%, 80% 34%, 80% 54%, 90% 54%, 100% 100%, 0 100%, 10% 54%, 20% 54%, 20% 34%, 31% 34%, 31% 21%); }
.mode-label { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; color: #ede2ce; text-transform: uppercase; letter-spacing: .18em; font-size: 10px; white-space: nowrap; }
.mode-label span { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 9px #ebc88b86; }
.mode-label b { font-weight: 600; }
.header-actions, .view-actions { display: flex; align-items: center; gap: 12px; }
.text-button, .outline-button { background: transparent; border: 1px solid transparent; white-space: nowrap; }
.text-button { padding: 10px 9px; color: #e2ded2; }
.text-button:hover { color: var(--gold); }
.notes-short { display: none; }
.info-icon { display: inline-grid; width: 15px; height: 15px; border: 1px solid currentColor; place-items: center; border-radius: 50%; font: italic 11px/1 Georgia, serif; margin-left: 4px; }
.outline-button { display: inline-flex; justify-content: center; align-items: center; gap: 11px; min-height: 41px; padding: 0 15px; border-color: #dbc29965; background: #15212774; font-size: 12px; font-weight: 600; letter-spacing: .015em; }
.outline-button:hover { background: #394143; border-color: var(--gold); }
.outline-button span { color: var(--gold); font-size: 17px; line-height: 1; }
#story { position: absolute; z-index: 3; left: var(--gutter); top: 47%; width: min(49vw, 690px); transform: translateY(-50%); pointer-events: none; }
.kicker { display: flex; align-items: center; gap: 11px; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .19em; }
.kicker span { height: 1px; width: 25px; flex-shrink: 0; background: var(--gold); }
.kicker p { margin: 0; }
.kicker b { margin: 0 4px; }
h1, h2 { margin: 0; font: 400 60px/.93 var(--serif); }
h1 { font-size: clamp(62px, 7.45vw, 142px); margin: 22px 0 26px; letter-spacing: -.027em; }
h1 em, h2 em { color: #e7c396; font-weight: 400; }
#caption { max-width: 345px; min-height: 3.35em; margin: 0; color: #dddcd3; font-size: clamp(14px, 1.22vw, 18px); line-height: 1.62; }
#loading { position: absolute; z-index: 5; left: 50%; bottom: 145px; transform: translateX(-50%); max-width: 90vw; padding: 10px 16px; background: var(--ink); border: 1px solid var(--line); color: var(--muted); text-align: center; }
#transport { position: absolute; z-index: 3; left: var(--gutter); right: var(--gutter); bottom: 29px; }
.times { display: flex; justify-content: space-between; align-items: center; font-size: 10px; font-variant-numeric: tabular-nums; color: #e1ddd2; }
.film-label { color: #d7c8b3; font-size: 9px; letter-spacing: .19em; font-weight: 600; }
#scrub { display: block; width: 100%; height: 18px; margin: 3px 0 5px; appearance: none; --progress: 0%; background: transparent; cursor: pointer; touch-action: none; }
#scrub::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--gold) var(--progress), rgba(238,222,196,.35) var(--progress)); }
#scrub::-webkit-slider-thumb { appearance: none; width: 9px; height: 9px; margin-top: -3.5px; background: var(--gold); border-radius: 50%; box-shadow: 0 0 10px #e4b678a0; }
.transport-controls { display: grid; grid-template-columns: 47px 1fr 61px; gap: clamp(13px, 2.8vw, 39px); align-items: center; }
.play-button { display: grid; place-items: center; padding: 0; width: 43px; height: 43px; border: 1px solid #ead0aa6e; background: #18252b; border-radius: 50%; }
.play-button:hover { border-color: var(--gold); background: #313d41; }
.play-icon { width: 10px; height: 13px; border-inline: 3px solid var(--gold); }
[data-paused=true] .play-icon { width: 0; height: 0; border: solid transparent; border-width: 6px 0 6px 10px; border-left-color: var(--gold); margin-left: 2px; }
#chapters { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(8px, 1.65vw, 25px); }
.chapter { display: flex; gap: 8px; align-items: baseline; text-align: left; color: #c8cbc4; background: transparent; padding: 9px 0; border: 0; font-size: 12px; white-space: nowrap; }
.chapter span { color: #b0ad9f; font-size: 9px; letter-spacing: .08em; }
.chapter[aria-current=true], .chapter:hover { color: #ffdfaf; }
.chapter[aria-current=true] span { color: var(--gold); }
.chapter-count { justify-self: end; align-items: center; display: flex; gap: 7px; color: #b5b7af; font-size: 10px; }
.chapter-count b { color: var(--gold); }
.chapter-count span { width: 14px; height: 1px; background: #ab9a7c; transform: rotate(-28deg); }
#explore-panel { position: absolute; z-index: 3; top: 108px; left: var(--gutter); width: min(335px, calc(100% - 2 * var(--gutter))); background: #111c22e8; border: 1px solid var(--line); box-shadow: 0 18px 50px #07101255; padding: 23px 23px 20px; }
#explore-panel h2 { font-size: 44px; margin: 12px 0 17px; }
#part-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.part-button { min-height: 35px; padding: 5px 8px; text-align: left; background: #31414840; border: 1px solid var(--line); color: #e8e2d7; font-size: 11px; }
.part-button[aria-pressed=true], .part-button:hover { color: #f6d8a9; border-color: #b89564; background: #6d563837; }
#part-detail { min-height: 61px; }
#part-detail h3 { margin: 16px 0 3px; color: var(--gold); font: 26px/1 var(--serif); }
#part-detail p { margin: 11px 0 0; color: #d8d8ce; font-size: 13px; line-height: 1.5; }
#part-detail h3 + p { margin-top: 4px; }
#markers { z-index: 2; pointer-events: none; }
.marker { position: absolute; display: grid; place-items: center; width: 27px; height: 27px; transform: translate(-50%, -50%); border: 1px solid #f4d8a5; border-radius: 50%; background: #142128d4; color: #ffe1b2; box-shadow: 0 0 0 4px #f9dba82b; font: 17px/1 var(--sans); pointer-events: auto; }
.marker:hover, .marker[aria-pressed=true] { background: var(--gold); color: #151c20; }
#explore-controls { position: absolute; bottom: 25px; left: var(--gutter); right: var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none; }
.explore-hint { display: flex; flex-wrap: wrap; gap: 4px 18px; color: #e0ddd2; font-size: 11px; }
.view-actions { pointer-events: auto; gap: 6px; }
.square { min-width: 41px; padding: 0; font-size: 19px; }
dialog { width: min(550px, calc(100vw - 30px)); max-height: calc(100% - 30px); padding: clamp(23px, 5vw, 40px); color: var(--paper); background: #152128; border: 1px solid #a994726e; box-shadow: 0 24px 90px #060c10; }
dialog::backdrop { background: #091115b8; backdrop-filter: blur(5px); }
dialog h2 { margin: 15px 0 19px; font-size: clamp(42px, 7vw, 61px); }
dialog > p { color: #dedbd1; font-size: 14px; line-height: 1.55; }
.close-button { position: absolute; top: 10px; right: 12px; width: 35px; height: 35px; border: 0; background: transparent; color: var(--gold); font-size: 25px; }
.source-list { display: grid; margin-top: 21px; }
.source-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; color: var(--paper); border-top: 1px solid var(--line); text-decoration: none; font-size: 13px; }
.source-list a:hover, .source-list a span { color: var(--gold); }
.source-list a span { white-space: nowrap; font-size: 10px; }
@media (max-width: 760px) {
  .masthead { height: 63px; }
  .header-actions { gap: 5px; }
  .mode-label { display: none; }
  .text-button { font-size: 11px; padding: 8px 5px; }
  #story { top: auto; bottom: 142px; transform: none; width: calc(100% - 2 * var(--gutter)); }
  h1 { font-size: clamp(52px, 10vw, 79px); margin: 13px 0 13px; }
  #caption { font-size: 14px; }
  .scrim { background: linear-gradient(0deg, #10191f 1%, #0e1a20d9 16%, #0e1a208c 36%, transparent 63%), linear-gradient(180deg, #0b141a82, transparent 22%); }
  #transport { bottom: 20px; }
  .transport-controls { grid-template-columns: 34px 1fr; gap: 11px; }
  .play-button { width: 34px; height: 34px; }
  .chapter { font-size: 10px; gap: 3px; white-space: normal; }
  .chapter-count { display: none; }
  #chapters { gap: 5px; }
  #explore-panel { top: auto; bottom: 75px; padding: 13px 16px; }
  #explore-panel h2 { font-size: 34px; margin: 7px 0 10px; }
  #part-detail { min-height: 18px; }
  #part-detail h3 { font-size: 21px; margin-top: 9px; }
  #part-detail p { font-size: 12px; margin-top: 8px; }
  #explore-controls { bottom: 17px; }
}
@media (max-width: 430px) {
  .notes-wide { display: none; }
  .notes-short { display: inline; }
}
@media (max-width: 410px) {
  :root { --gutter: 16px; }
  .wordmark { gap: 7px; }
  .brand-sub { display: none; }
  .seal { width: 30px; height: 30px; flex-basis: 30px; }
  .seal::after { bottom: 4px; }
  .seal::before { top: 9px; }
  .brand { font-size: 23px; }
  .outline-button { padding-inline: 10px; min-height: 36px; }
  .square { min-width: 34px; }
  .info-icon { display: none; }
}
@media (max-height: 610px) and (min-width: 761px) {
  .masthead { height: 64px; }
  #story { top: 46%; }
  h1 { font-size: clamp(48px, 8.5vh, 74px); margin: 12px 0 12px; }
  #transport { bottom: 15px; }
  #explore-panel { top: 79px; padding: 15px; }
}
@media (max-height: 490px) and (orientation: landscape) {
  .masthead { height: 52px; }
  #story { top: 46%; bottom: auto; width: 48vw; transform: translateY(-50%); }
  h1 { font-size: clamp(37px, 11vh, 54px); margin: 8px 0; }
  #caption { font-size: 12px; line-height: 1.45; }
  .scrim { background: linear-gradient(90deg, #101b21 1%, #0e1a20d9 19%, #0e1a2040 59%, transparent 77%), linear-gradient(0deg, #10191f, #0e1a20b0 14%, transparent 38%); }
  #transport { bottom: 10px; }
  #explore-panel { top: 62px; bottom: auto; max-height: calc(100% - 124px); overflow: auto; width: 290px; }
  #explore-controls { bottom: 8px; }
}
@media (max-width: 360px) {
  .masthead { gap: 6px; }
  .header-actions { gap: 4px; }
  .header-actions .outline-button { gap: 6px; padding-inline: 8px; }
  .brand { font-size: 21px; letter-spacing: .09em; }
  .seal { width: 28px; height: 28px; flex-basis: 28px; }
}
