:root {
  color-scheme: dark;
  --cream: #f5e7c5;
  --paper: #fff3d8;
  --gold: #d7a547;
  --aqua: #75d7cf;
  --ink: #06191d;
  --line: rgba(245, 231, 197, .27);
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body { margin: 0; color: var(--cream); background: var(--ink); font-family: "Helvetica Neue", Arial, sans-serif; }
button, a { color: inherit; font: inherit; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 12px 16px; color: var(--ink); background: var(--paper); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.scroll-runner { position: relative; height: 850vh; }
.atlas-stage { position: sticky; top: 0; height: 100svh; min-height: 620px; overflow: hidden; isolation: isolate; background: var(--ink); }
.scene-stack, .road-scene, .road-scene img, .scene-vignette, .signal-grid, .paper-grain { position: absolute; inset: 0; }
.road-scene { margin: 0; opacity: var(--scene-opacity, 0); will-change: transform, opacity; transform: scale(var(--scene-scale, 1.11)) translate3d(var(--scene-x, 0), var(--scene-y, 0), 0); transform-origin: center; }
.road-scene.cinema-only { display: none; }
.road-scene:first-child { --scene-opacity: 1; }
.road-scene img { width: 100%; height: 100%; object-fit: cover; object-position: var(--scene-position, 50% 50%); filter: saturate(.82) contrast(1.06) brightness(.77); }
.road-scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(2, 14, 17, .74), rgba(2, 14, 17, .27) 42%, rgba(2, 14, 17, .06) 70%, rgba(2, 14, 17, .3)); }
.scene-vignette { z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(0, 0, 0, .2), transparent 25%, transparent 69%, rgba(0, 0, 0, .7)); }
.signal-grid { z-index: 3; opacity: .28; pointer-events: none; background-image: linear-gradient(rgba(117, 215, 207, .1) 1px, transparent 1px), linear-gradient(90deg, rgba(117, 215, 207, .08) 1px, transparent 1px); background-size: 8vw 8vw; mask-image: linear-gradient(90deg, transparent 22%, #000 76%, transparent); transform: perspective(900px) rotateX(63deg) translateY(49%); transform-origin: bottom; }
.paper-grain { z-index: 4; opacity: .12; pointer-events: none; mix-blend-mode: soft-light; background: url("./assets/generated/atlas-radio-texture-v1.jpg") center/cover; filter: grayscale(1) contrast(1.5); }

.cinema-caption, .cinema-exit { position: absolute; z-index: 18; opacity: 0; pointer-events: none; transition: opacity .45s ease; }
.cinema-caption { top: clamp(28px, 5vh, 60px); left: clamp(24px, 5vw, 80px); text-shadow: 0 4px 24px rgba(0, 0, 0, .8); }
.cinema-promo { margin-top: 13px; transition: opacity .42s ease, transform .42s ease; }
.cinema-promo.is-changing { opacity: 0; transform: translateY(5px); }
.cinema-promo small { display: block; margin-bottom: 7px; color: var(--aqua); font-size: 8px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.cinema-promo strong { display: block; max-width: min(560px, 60vw); color: var(--paper); font: italic 400 clamp(26px, 3vw, 48px)/1 Georgia, serif; letter-spacing: -.03em; text-wrap: balance; }
.cinema-promo a { display: inline-block; margin-top: 10px; color: var(--cream); font-size: 8px; font-weight: 800; letter-spacing: .13em; text-decoration: none; text-transform: uppercase; }
.cinema-promo a[hidden] { display: none; }
.cinema-station-ident { display: block; width: min(470px, 42vw); }
.cinema-ident-artwork { display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 7px rgba(0, 0, 0, .58)); }
.cinema-exit { top: clamp(25px, 5vh, 56px); right: clamp(22px, 4vw, 66px); padding: 11px 15px; border: 1px solid rgba(245, 231, 197, .42); border-radius: 999px; color: var(--paper); background: rgba(3, 14, 17, .52); font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; backdrop-filter: blur(12px); }

.chapter-stack { position: absolute; z-index: 10; top: 46%; left: clamp(24px, 7vw, 132px); width: min(780px, 54vw); transform: translateY(-52%); }
.drive-chapter { position: absolute; top: 50%; left: 0; width: 100%; opacity: var(--chapter-opacity, 0); pointer-events: none; will-change: transform, opacity; transform: translate3d(0, calc(-50% + var(--chapter-y, 44px)), 0); }
.drive-chapter.is-active { pointer-events: auto; }
.drive-chapter:first-child { --chapter-opacity: 1; --chapter-y: 0px; }
.chapter-kicker { margin: 0 0 24px; color: var(--aqua); font-size: 10px; font-weight: 800; letter-spacing: .25em; text-transform: uppercase; }
.drive-chapter h1, .drive-chapter h2 { max-width: 900px; margin: 0; color: var(--paper); font: 400 clamp(50px, 5.8vw, 108px)/.92 Georgia, "Times New Roman", serif; letter-spacing: -.043em; text-wrap: balance; text-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.drive-chapter h1 em, .drive-chapter h2 em { color: #e0ad52; font-weight: 400; }
.drive-chapter > p:not(.chapter-kicker):not(.chapter-detail) { max-width: 640px; margin: 24px 0 0; color: rgba(255, 243, 216, .9); font: 400 clamp(16px, 1.25vw, 20px)/1.5 Georgia, serif; letter-spacing: -.012em; text-wrap: pretty; text-shadow: 0 3px 18px rgba(0, 0, 0, .8); }
.drive-chapter > p strong { color: var(--paper); font-weight: 700; }
.drive-chapter .chapter-detail { max-width: 570px; margin: 17px 0 0; padding: 10px 0 10px 16px; border-left: 2px solid rgba(117, 215, 207, .62); color: rgba(245, 231, 197, .72); font-size: clamp(10px, .8vw, 13px); line-height: 1.5; letter-spacing: .025em; }
.drive-chapter .chapter-sizzle { max-width: 600px; margin: 17px 0 0; color: #e7b75c; font: italic 600 clamp(15px, 1.2vw, 19px)/1.25 Georgia, "Times New Roman", serif; letter-spacing: -.015em; text-wrap: balance; text-shadow: 0 3px 18px rgba(0, 0, 0, .8); }
.broadcast-sequence { display: flex; align-items: center; gap: 12px; margin-top: 22px; color: var(--paper); font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.broadcast-sequence i { color: var(--aqua); font-style: normal; }
.place-stamp { display: inline-block; margin-top: 24px; padding-top: 11px; border-top: 1px solid rgba(245, 231, 197, .4); color: rgba(245, 231, 197, .75); font-size: 8px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.enter-atlas { display: inline-flex; align-items: center; gap: 18px; margin-top: 26px; padding: 15px 21px; border: 1px solid rgba(245, 231, 197, .56); background: rgba(4, 22, 25, .42); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-decoration: none; text-transform: uppercase; backdrop-filter: blur(9px); }
.enter-atlas span { color: var(--aqua); font-size: 16px; }

.journey-dial { position: absolute; z-index: 14; top: 50%; right: clamp(18px, 3.5vw, 60px); display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateY(-50%); }
.journey-dial button { position: relative; width: 34px; height: 34px; padding: 0; border: 0; color: rgba(245, 231, 197, .5); background: transparent; font-size: 7px; font-weight: 800; cursor: pointer; }
.journey-dial button::before { content: ""; position: absolute; top: 50%; left: 50%; width: 4px; height: 4px; border-radius: 50%; background: currentColor; transform: translate(-50%, -50%); transition: box-shadow .3s, transform .3s; }
.journey-dial button span { position: absolute; top: 50%; right: calc(100% + 8px); opacity: 0; transform: translateY(-50%); transition: opacity .25s; }
.journey-dial button:hover span, .journey-dial button:focus-visible span, .journey-dial button.is-active span { opacity: 1; }
.journey-dial button.is-active { color: var(--aqua); }
.journey-dial button.is-active::before { box-shadow: 0 0 0 6px rgba(117, 215, 207, .13), 0 0 18px var(--aqua); transform: translate(-50%, -50%) scale(1.3); }
.dial-line { position: absolute; z-index: -1; top: 17px; bottom: 17px; left: 50%; width: 1px; overflow: hidden; background: rgba(245, 231, 197, .18); transform: translateX(-50%); }
.dial-line i { display: block; width: 100%; height: var(--dial-progress, 0%); background: linear-gradient(var(--gold), var(--aqua)); }

.broadcast-deck { position: absolute; z-index: 20; right: clamp(22px, 4.5vw, 78px); bottom: clamp(20px, 4vh, 40px); left: clamp(22px, 4.5vw, 78px); display: grid; grid-template-columns: 54px 42px 62px 42px 42px minmax(220px, 1fr) minmax(190px, 28%); align-items: center; gap: 13px; min-height: 82px; padding: 10px 20px 10px 13px; border: 1px solid rgba(222, 174, 81, .5); border-radius: 8px; background: linear-gradient(180deg, rgba(37, 25, 18, .84), rgba(12, 18, 18, .91)); box-shadow: 0 18px 55px rgba(0, 0, 0, .38), inset 0 1px rgba(255, 239, 191, .15); backdrop-filter: blur(18px); }
.broadcast-deck::before { content: ""; position: absolute; inset: 4px; pointer-events: none; border: 1px solid rgba(215, 165, 71, .19); border-radius: 5px; }
.deck-brand { display: grid; width: 50px; height: 50px; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: #2b2118; background: radial-gradient(circle, #f4dfaa 0 44%, #a76c27 46% 51%, #2b2118 54% 60%, #c48b39 62%); font: 700 13px Georgia, serif; }
.deck-skip, .deck-play, .deck-cinema { position: relative; z-index: 1; display: grid; padding: 0; place-items: center; border: 1px solid rgba(245, 231, 197, .33); border-radius: 50%; background: rgba(250, 231, 181, .08); cursor: pointer; }
.deck-skip { width: 38px; height: 38px; font-size: 21px; letter-spacing: -.15em; }
.deck-cinema { width: 38px; height: 38px; color: rgba(245, 231, 197, .82); font-size: 18px; transition: color .25s, border-color .25s, background .25s; }
.deck-cinema:hover, .deck-cinema:focus-visible, .deck-cinema[aria-pressed="true"] { color: var(--aqua); border-color: rgba(117, 215, 207, .68); background: rgba(117, 215, 207, .12); }
.deck-play { width: 58px; height: 58px; overflow: hidden; border: 0; background: #1d130d; box-shadow: 0 5px 16px rgba(0, 0, 0, .5); }
.deck-play img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); }
.deck-copy { min-width: 0; padding-left: 6px; }
.deck-copy small, .deck-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-copy small { color: var(--aqua); font-size: 7px; font-weight: 800; letter-spacing: .18em; }
.deck-copy strong { margin-top: 7px; color: var(--paper); font: 400 clamp(16px, 1.45vw, 22px) Georgia, serif; }
.deck-preview { display: block; margin-top: 5px; overflow: hidden; color: rgba(245, 226, 184, .58); font-size: .52rem; letter-spacing: .14em; text-overflow: ellipsis; white-space: nowrap; }
.deck-time { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; color: rgba(245, 231, 197, .74); font: 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.deck-progress { height: 2px; overflow: hidden; background: rgba(245, 231, 197, .21); }
.deck-progress i { display: block; width: var(--audio-progress, 0%); height: 100%; background: var(--aqua); box-shadow: 0 0 8px var(--aqua); }

.scroll-cue { position: absolute; z-index: 12; bottom: 127px; left: 50%; display: flex; flex-direction: column; align-items: center; gap: 8px; color: rgba(245, 231, 197, .58); transform: translateX(-50%); transition: opacity .3s; }
.scroll-cue span { position: relative; width: 1px; height: 25px; overflow: hidden; background: rgba(245, 231, 197, .22); }
.scroll-cue span::after { content: ""; position: absolute; top: -100%; width: 100%; height: 70%; background: var(--aqua); animation: scrollSignal 2.2s ease-in-out infinite; }
.scroll-cue small { font-size: 7px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
@keyframes scrollSignal { 60%, 100% { transform: translateY(280%); } }
.scroll-runner.has-progress .scroll-cue { opacity: 0; }

.drive-toast { position: fixed; z-index: 50; right: 24px; bottom: 126px; max-width: 320px; padding: 13px 16px; border: 1px solid var(--line); color: var(--paper); background: rgba(3, 16, 19, .94); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.drive-toast.is-visible { opacity: 1; transform: translateY(0); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--aqua); outline-offset: 4px; }

body.cinema-active { overflow: hidden; }
body.cinema-active .atlas-stage { position: fixed; z-index: 200; inset: 0; width: 100vw; height: 100vh; min-height: 100vh; background: #02090a; }
body.cinema-active .scene-stack,
body.cinema-active .scene-vignette,
body.cinema-active .signal-grid,
body.cinema-active .paper-grain { position: fixed; inset: 0; width: 100vw; height: 100vh; }
body.cinema-active .road-scene { position: fixed; inset: 0; width: 100vw; height: 100vh; }
body.cinema-active .cinema-caption,
body.cinema-active .cinema-exit,
body.cinema-active .broadcast-deck { position: fixed; }
body.cinema-active .atlas-site-header, body.cinema-active .chapter-stack, body.cinema-active .journey-dial, body.cinema-active .scroll-cue { opacity: 0; pointer-events: none; }
body.cinema-active .cinema-caption, body.cinema-active .cinema-exit { opacity: 1; pointer-events: auto; }
body.cinema-active .signal-grid { display: none; }
body.cinema-active .paper-grain { opacity: .08; }
body.cinema-active .scene-vignette { background: linear-gradient(180deg, rgba(0, 0, 0, .34), transparent 25%, transparent 62%, rgba(0, 0, 0, .72)); }
body.cinema-active .road-scene { z-index: 0; opacity: 0 !important; transform-origin: center; }
body.cinema-active .road-scene.cinema-only { display: block; }
body.cinema-active .road-scene::after { background: linear-gradient(90deg, rgba(2, 14, 17, .18), transparent 46%, rgba(2, 14, 17, .13)); }
body.cinema-active .road-scene.cinema-current, body.cinema-active .road-scene.cinema-leaving { opacity: 1 !important; }
body.cinema-active .road-scene.cinema-current { z-index: 2; }
body.cinema-active .road-scene.cinema-leaving { z-index: 1; animation: cinemaLeave 1.5s ease both; }
body.cinema-active .road-scene.cinema-zoom { animation: cinemaFadeIn 1.2s ease both, cinemaZoomOut 10s ease-out both; }
body.cinema-active .road-scene.cinema-pan { animation: cinemaWipeIn 1.35s cubic-bezier(.22, .8, .22, 1) both, cinemaPan 10s ease-out both; }
body.cinema-active .road-scene.cinema-iris { animation: cinemaIrisIn 1.45s cubic-bezier(.2, .8, .2, 1) both, cinemaIrisTravel 10s ease-out both; }
body.cinema-active .road-scene.cinema-drift { animation: cinemaDiagonalIn 1.4s cubic-bezier(.2, .8, .2, 1) both, cinemaDrift 10s ease-out both; }
@keyframes cinemaFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cinemaLeave { from { opacity: 1; filter: brightness(1); } to { opacity: 0; filter: brightness(.72); } }
@keyframes cinemaWipeIn { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes cinemaIrisIn { from { clip-path: circle(0 at 72% 48%); } to { clip-path: circle(90% at 72% 48%); } }
@keyframes cinemaDiagonalIn { from { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); } to { clip-path: polygon(0 0, 125% 0, 100% 100%, -25% 100%); } }
@keyframes cinemaZoomOut { from { transform: scale(1.2) translate3d(-2%, 1%, 0); } to { transform: scale(1.045) translate3d(1%, -1%, 0); } }
@keyframes cinemaPan { from { transform: scale(1.13) translate3d(4%, 0, 0); } to { transform: scale(1.1) translate3d(-4%, -1%, 0); } }
@keyframes cinemaIrisTravel { from { transform: scale(1.16) translate3d(-2%, 1%, 0); } to { transform: scale(1.055) translate3d(2%, -1%, 0); } }
@keyframes cinemaDrift { from { transform: scale(1.12) translate3d(-3%, -1%, 0); } to { transform: scale(1.08) translate3d(3%, 1%, 0); } }

@media (max-width: 820px) {
  .scroll-runner { height: 760vh; }
  .atlas-stage { min-height: 560px; }
  .road-scene::after { background: linear-gradient(180deg, rgba(2, 14, 17, .18), rgba(2, 14, 17, .14) 32%, rgba(2, 14, 17, .54) 78%, rgba(2, 14, 17, .78)); }
  .signal-grid { opacity: .17; background-size: 70px 70px; }
  .chapter-stack { top: 39%; left: 24px; width: calc(100vw - 72px); }
  .chapter-kicker { margin-bottom: 15px; font-size: 7px; }
  .drive-chapter h1, .drive-chapter h2 { font-size: clamp(42px, 13vw, 62px); line-height: .92; }
  .drive-chapter > p:not(.chapter-kicker):not(.chapter-detail) { max-width: 96%; margin-top: 16px; font-size: 13.5px; line-height: 1.42; }
  .drive-chapter .chapter-detail { display: none; }
  .drive-chapter .chapter-sizzle { max-width: 88%; margin-top: 11px; font-size: 12px; line-height: 1.22; }
  .broadcast-sequence { flex-wrap: wrap; gap: 7px; margin-top: 15px; font-size: 6px; }
  .place-stamp { margin-top: 14px; font-size: 6px; }
  .enter-atlas { margin-top: 17px; padding: 12px 14px; font-size: 7px; }
  .journey-dial { right: 8px; gap: 2px; }
  .journey-dial button { width: 28px; height: 28px; }
  .broadcast-deck { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); left: 14px; grid-template-columns: 30px 48px 30px 30px minmax(0, 1fr); gap: 6px; min-height: 72px; padding: 8px 10px; }
  .deck-brand { display: none; }
  .deck-skip { width: 32px; height: 32px; font-size: 17px; }
  .deck-play { width: 48px; height: 48px; }
  .deck-cinema { width: 30px; height: 30px; font-size: 15px; }
  .deck-copy { grid-column: 5; grid-row: 1; }
  .deck-copy small { font-size: 5.5px; }
  .deck-copy strong { margin-top: 5px; font-size: 14px; }
  .deck-time { grid-column: 1 / -1; grid-row: 2; }
  .scroll-cue { bottom: 102px; }
  .drive-toast { right: 14px; bottom: 104px; left: 14px; }
  .cinema-caption { top: 24px; left: 20px; }
  .cinema-promo strong { max-width: 260px; font-size: 28px; }
  .cinema-station-ident { width: min(360px, 58vw); }
  .cinema-exit { top: 20px; right: 16px; }
}

@media (max-height: 700px) and (min-width: 821px) {
  .chapter-stack { top: 45%; }
  .drive-chapter h1, .drive-chapter h2 { font-size: clamp(46px, 5.6vw, 76px); }
  .drive-chapter > p:not(.chapter-kicker):not(.chapter-detail) { margin-top: 17px; font-size: 15px; }
  .drive-chapter .chapter-detail { margin-top: 10px; padding-block: 6px; }
  .broadcast-deck { bottom: 14px; }
  .scroll-cue { display: none; }
}

@media (min-width: 1800px) {
  .chapter-stack { left: clamp(130px, 8vw, 220px); width: min(980px, 46vw); }
  .drive-chapter h1, .drive-chapter h2 { max-width: 980px; font-size: clamp(86px, 5vw, 118px); }
  .drive-chapter > p:not(.chapter-kicker):not(.chapter-detail) { max-width: 720px; font-size: 22px; }
  .drive-chapter .chapter-detail { max-width: 650px; font-size: 14px; }
  .broadcast-deck { right: 7vw; left: 7vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .road-scene { transform: scale(1.04); }
  body.cinema-active .road-scene.cinema-current { animation: none; opacity: 1 !important; transform: scale(1.04); }
}
