/* Interaction pass: navigation 30, player 35, notices 75, native dialog top layer. */
:root { --control-line: rgba(238, 216, 174, .34); }
html { scrollbar-gutter: stable; }
section[id] { scroll-margin-top: 92px; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid #f4d89c; outline-offset: 5px; }
button { transition: background .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease, transform .25s var(--ease); }
button:not(:disabled):active { scale: .98; }
[hidden] { display: none !important; }
body.modal-open { overflow: hidden; }

.topbar { gap: 16px; min-height: 72px; }
.topbar.is-scrolled { background: linear-gradient(180deg, #120d08ef, #120d08bb 58%, transparent); }

/* The cover, scroll and reading sections share one continuous backdrop. */
main {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse 58rem 60rem at 52% 0%, #35281a, transparent),
    radial-gradient(ellipse 43rem 84rem at 8% 42%, #33241980, transparent),
    radial-gradient(ellipse 48rem 68rem at 91% 73%, #44271d54, transparent),
    linear-gradient(180deg, #1c150e, #15100b 61%, #1b130c);
}

@media (prefers-reduced-motion: no-preference) {
  body:not(.motion-reduced) main::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    background: radial-gradient(ellipse at 78% 34%, #b78c4212, transparent 61%), radial-gradient(ellipse at 18% 92%, #9c632b10, transparent 60%);
    content: '';
    pointer-events: none;
  }
}

main > :is(.listening-stage, .lyric-reading, .journey, .archive, .closing) { background: transparent; }
.listening-stage::before, .lyric-reading::after { content: none; }
.stage__duality { border-top: 0; }
.chapter-nav { display: flex; gap: 3px; margin-left: auto; padding: 4px; border: 1px solid rgba(239, 211, 160, .19); border-radius: 999px; background: rgba(14, 10, 6, .64); backdrop-filter: blur(12px); }
.chapter-nav a { position: relative; display: grid; min-width: 54px; min-height: 40px; padding: 0 12px; place-items: center; border-radius: 999px; text-decoration: none; font-size: 12px; color: #c5b89f; transition: color .25s ease, background .25s ease; }
.chapter-nav a:hover { color: #fff0cc; background: rgba(233, 194, 121, .08); }
.chapter-nav a[aria-current] { color: #fff0c7; background: rgba(210, 167, 91, .18); box-shadow: inset 0 0 0 1px rgba(243, 214, 161, .19); }
.topbar__title { margin-left: 4px; white-space: nowrap; }
.hero__copy { padding-bottom: 24px; }
.hero__note { max-width: 27em; color: #d1bea0; }
.hero__jump { min-height: 48px; background: rgba(119, 42, 28, .65); border-color: rgba(241, 210, 155, .5); }
.hero__jump span { display: inline-block; margin-left: 18px; transition: transform .3s var(--ease); }
.hero__jump:hover span { transform: translate(3px, -3px); }
.hero__credit { padding-bottom: 8px; }

.stage__shell { transition: border-color .6s ease, box-shadow .6s ease; }
.stage__shell:focus-within { border-color: rgba(239, 211, 160, .46); }
.stage__seals { width: 160px; }
.stage__seal-grid button { min-width: 24px; min-height: 32px; }
.stage__open { min-width: 122px; }
.stage__open[aria-pressed="true"] { background: rgba(85, 48, 27, .8); }
.manuscript-trigger { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 2px; background: transparent; cursor: zoom-in !important; }
.stage__manuscript { margin: 14px 0 0; }
.stage__manuscript .stage__handwriting { width: auto; max-width: 100%; height: min(49svh, 440px); margin: 0 auto; }
.manuscript-trigger__hint { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 40px; margin: 12px auto 0; color: #ddc79e; font-size: 11px; letter-spacing: .12em; opacity: .76; transition: opacity .25s ease, color .25s ease; }
.manuscript-trigger__hint span { font-size: 19px; font-family: sans-serif; }
.manuscript-trigger:hover .manuscript-trigger__hint, .manuscript-trigger:focus-visible .manuscript-trigger__hint { opacity: 1; color: #fff0c9; }
.sheet__handwriting { transition: filter .5s ease; }
.manuscript-trigger:hover .sheet__handwriting { filter: sepia(.28) brightness(1.12); }
.scene__sheet--tall { background: radial-gradient(ellipse at 50% 45%, rgba(158, 112, 57, .14), transparent 70%), #17110a; }
.journey__heading, .scene__copy, .lyric-reading__heading { text-wrap: pretty; }
.scene__copy h3, .journey__heading h2, .archive h2 { text-wrap: balance; }
.scene__copy p { max-width: 33em; }
.lyric-reading__cards article { transition: background .3s ease, border-color .3s ease; }
.lyric-reading__cards article:hover { background-color: rgba(222, 180, 102, .05); border-color: rgba(235, 207, 153, .36); }
.archive-card { overflow: hidden; transition: transform .4s var(--ease), border-color .3s ease, box-shadow .4s ease; }
.archive-card:hover, .archive-card:focus-visible { border-color: rgba(244, 213, 156, .62); box-shadow: 0 16px 40px rgba(13, 8, 3, .36); }
.archive-card--one { background-image: linear-gradient(100deg, rgba(31, 19, 10, .8), rgba(31, 19, 10, .1)), url('./assets/scene-landscape.png'); background-size: cover; background-position: center; }
.closing { padding-bottom: max(160px, calc(110px + env(safe-area-inset-bottom, 0px))); }

.audio-dock { border-color: var(--control-line); box-shadow: 0 12px 42px rgba(9, 5, 2, .6), inset 0 1px rgba(255, 238, 205, .06); }
.audio-dock__play { width: 42px; height: 42px; flex-basis: 42px; transition: background .25s ease, transform .25s ease, box-shadow .25s ease; }
.audio-dock__play:hover { background: #bb4a34; box-shadow: 0 0 0 4px rgba(202, 83, 57, .12); }
.audio-dock__labels { color: #e7d1ab; }
.audio-dock__labels span:last-child { color: #bba98c; white-space: nowrap; }
.audio-dock__motion { min-height: 42px; color: #e3cea9; }
.audio-dock.is-buffering .audio-dock__play { opacity: .6; }
input[type='range'] { min-height: 25px; }
.player-notice { position: fixed; z-index: 75; right: 18px; bottom: 104px; left: 18px; width: fit-content; max-width: min(440px, calc(100% - 36px)); margin: 0 auto; padding: 13px 20px; border: 1px solid var(--control-line); border-radius: 8px; background: #291d11; box-shadow: 0 12px 40px rgba(10, 5, 2, .4); color: #f2dfb8; font-size: 12px; line-height: 1.7; }

.ink-modal { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; border: 0; color: var(--paper); background: transparent; }
.ink-modal::backdrop { background: rgba(10, 6, 3, .65); }
.ink-modal__card { max-height: calc(100dvh - 40px); overflow: auto; overscroll-behavior: contain; }
.ink-modal__close { width: 44px; height: 44px; }
.ink-modal.is-manuscript .ink-modal__card { display: flex; flex-direction: column; width: min(100%, 720px); min-height: 0; padding: 26px 24px 22px; background: #18120b; }
.ink-modal.is-manuscript h2 { flex-shrink: 0; font-size: 26px; }
.ink-modal.is-manuscript .eyebrow { margin-bottom: 6px; }
.ink-modal.is-manuscript .ink-modal__line { display: none; }
.manuscript-view { min-height: 0; height: min(62dvh, 680px); overflow: auto; overscroll-behavior: contain; margin: 20px 0 16px; padding: 16px; border: 1px solid rgba(230, 205, 158, .16); background: #090806; scrollbar-color: #8b6d40 #17110b; }
.manuscript-view img { display: block; width: 100%; max-width: none; height: auto; mix-blend-mode: screen; }
.manuscript-controls { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; align-items: center; gap: 16px; margin-bottom: 12px; }
.manuscript-controls label { display: grid; gap: 3px; color: #d9c6a3; font-size: 11px; }
.manuscript-controls output { font-variant-numeric: tabular-nums; }
.manuscript-controls button { min-height: 44px; padding: 0 16px; border: 1px solid var(--control-line); border-radius: 999px; background: rgba(125, 48, 30, .45); color: #f5dfb5; font-size: 12px; }
.ink-modal.is-manuscript #modalDescription { font-size: 11px; }

@media (min-width: 740px) { .stage__seals { width: 160px; } .stage__seal-grid { gap: 8px; } .stage__seal-grid button { min-width: 24px; min-height: 32px; } }
@media (max-width: 739px) { .topbar { gap: 8px; padding-right: 12px; padding-left: 12px; } .topbar__title { display: none; } .chapter-nav { margin: 0 auto; gap: 0; } .chapter-nav a { min-width: 46px; min-height: 40px; padding: 0 9px; font-size: 11px; } .topbar__sound { min-width: 39px; } .hero { padding-right: 28px; } .hero__copy { padding-bottom: 42px; } .hero__compass { display: none; } .hero__credit { width: auto; font-size: 9px; } .stage__shell { padding: 30px 24px; } .stage__manuscript { margin-top: 22px; } .scene__sheet--tall { padding: 24px; } .manuscript-controls { gap: 10px; } }
@media (max-width: 360px) { .chapter-nav a { min-width: 41px; padding: 0 7px; } .topbar { gap: 5px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body.motion-reduced .scene__sheet { opacity: 1; transform: none; }

.manuscript-list { width: min(100%, 1000px); margin: 0 auto; }
.lyric-entry { padding: 40px 0 80px; text-align: center; }
.lyric-entry + .lyric-entry { padding-top: 100px; }
.lyric-position { margin: 0 0 18px; color: #c8af82; font-size: 11px; letter-spacing: .16em; font-variant-numeric: tabular-nums; }
.has-handwriting .lyric-position { margin-top: 0; margin-bottom: 12px; }
.lyric-credit { margin: 16px 0 0; color: #d7c6aa; font-size: 12px; letter-spacing: .1em; }
.lyric-entry[data-layout='landscape'] .lyric-manuscripts__sheet { width: min(100%, 900px); }
.lyric-entry[data-layout='balanced'] .lyric-manuscripts__sheet { width: min(100%, 620px); }
.stage__manuscript[data-layout='landscape'] .stage__handwriting { width: 100%; height: auto; max-height: 49svh; object-fit: contain; }
.manuscript-paging { display: flex; justify-content: space-between; gap: 20px; margin-top: 4px; }
.manuscript-paging button { min-height: 44px; padding: 0 18px; border: 1px solid var(--control-line); border-radius: 999px; background: transparent; color: #f1dab0; font-size: 12px; }
.manuscript-paging button:disabled { opacity: .3; }
.ink-modal.is-manuscript .lyric-position { margin: 7px 0 0; }
.ink-modal.is-manuscript .lyric-credit { margin: 7px 0 0; font-size: 11px; }
@media (max-width: 739px) { .lyric-entry { padding-top: 16px; } .lyric-entry + .lyric-entry { padding-top: 70px; } .lyric-manuscripts__sheet { padding-right: 12px; padding-left: 12px; } }

/* Restore the illustrated long-scroll composition alongside the manuscript collection. */
.scene__sheet .lyric-entry { padding: 18px 0; }
.scene__sheet .lyric-manuscripts__sheet { width: 100%; padding: 0 12px; }
.scene__sheet .lyric-position { margin-bottom: 10px; }
.audio-dock__locate { min-height: 28px; padding: 0 5px 0 0; background: transparent; color: #ead1a4; text-align: left; font-size: inherit; letter-spacing: inherit; }
.audio-dock__locate:hover { color: #fff4d5; }
.manuscript-view { touch-action: none; user-select: none; cursor: grab; padding: 0; }
.manuscript-view.is-panning { cursor: grabbing; }
.manuscript-view img { -webkit-user-drag: none; pointer-events: none; }
.manuscript-gesture-hint { flex-shrink: 0; margin: -3px 0 12px !important; color: #cbb58f !important; font-size: 10px !important; line-height: 1.5 !important; }
.lyric-entry { transition: box-shadow .35s ease; }
.lyric-entry.is-current > .lyric-position { color: #fff0bc; }
.lyric-entry.is-located { box-shadow: inset 2px 0 rgba(239, 208, 146, .65); }
