:root {
  --bg: #0b0b0d;
  --fg: #f4f1ea;
  --muted: rgba(244, 241, 234, 0.62);
  --accent: #f2c46d;
  --dialogue: #ffe3a6;
  --panel: rgba(18, 18, 22, 0.92);
  --line: rgba(255, 255, 255, 0.14);
  --fade: 1.1s;
  font-family: ui-serif, Georgia, "Iowan Old Style", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.play svg { fill: currentColor; stroke: none; }

#backdrop {
  position: fixed; inset: -40px; background-size: cover; background-position: center;
  filter: blur(40px) brightness(0.45) saturate(1.2); transition: background-image var(--fade);
}

/* 9:16 stage: full screen on phones, a centred phone-shaped frame on wider screens. */
#app {
  position: relative; height: 100dvh; width: min(100vw, calc(100dvh * 9 / 16));
  margin: 0 auto; overflow: hidden; background: #000;
}
@media (min-aspect-ratio: 10/16) {
  #app { box-shadow: 0 0 80px rgba(0, 0, 0, 0.6); }
}

#stage, #stage .layer { position: absolute; inset: 0; width: 100%; height: 100%; }
#stage .layer { object-fit: cover; opacity: 0; transition: opacity var(--fade) ease; will-change: opacity, transform; }
#stage .layer.on { opacity: 1; animation: drift var(--hold, 10s) ease-out forwards; }
@keyframes drift { from { transform: scale(1.0); } to { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { #stage .layer.on { animation: none; } }

#top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 12px 28px;
  background: linear-gradient(rgba(0, 0, 0, 0.55), transparent);
}
#top .titles { flex: 1; min-width: 0; text-align: center; }
#book-title { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; }
#chapter-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.icon:active { background: rgba(255, 255, 255, 0.1); }
#btn-captions[aria-pressed="false"] { opacity: 0.45; }

#captions {
  position: absolute; left: 0; right: 0; bottom: 150px; padding: 0 22px; text-align: center;
  pointer-events: none; transition: opacity 0.3s;
}
#captions.off { opacity: 0; }
#speaker {
  font: 600 11px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); min-height: 14px; margin-bottom: 6px;
}
#line {
  margin: 0; font-size: clamp(19px, 5.4vw, 24px); line-height: 1.35; min-height: 2.7em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 0, 0, 0.7);
}
#line .w { color: rgba(244, 241, 234, 0.55); transition: color 0.12s; }
#line .w.said { color: var(--fg); }
#line .w.now { color: var(--fg); text-decoration: underline 2px var(--accent); text-underline-offset: 5px; }
#line.dialogue .w.said, #line.dialogue .w.now { color: var(--dialogue); }

#controls {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82) 45%);
  font-family: ui-sans-serif, system-ui, sans-serif;
}
#seek { width: 100%; accent-color: var(--accent); margin: 0; height: 22px; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.buttons { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.play { width: 64px; height: 64px; border-radius: 50%; background: var(--fg); color: #111; display: grid; place-items: center; }
.play svg { width: 28px; height: 28px; }
.play .i-pause, .playing .play .i-play { display: none; }
.playing .play .i-pause { display: block; }
.text { width: 44px; height: 44px; font-size: 14px; font-weight: 600; }

#start {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  background: #000; z-index: 5; transition: opacity 0.5s;
}
#start.gone { opacity: 0; pointer-events: none; }
#cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.start-body {
  position: relative; padding: 32px 24px max(32px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9) 35%); text-align: center;
}
.start-body h1 { font-size: 30px; line-height: 1.15; margin: 0 0 6px; }
.start-body p { margin: 0 0 24px; color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; }
.primary {
  display: block; width: 100%; padding: 16px; border-radius: 999px; background: var(--fg); color: #111;
  font: 600 17px ui-sans-serif, system-ui, sans-serif;
}
.ghost { margin-top: 12px; color: var(--muted); font: 14px ui-sans-serif, system-ui, sans-serif; padding: 8px; }

#drawer {
  position: absolute; inset: 0; z-index: 6; background: var(--panel); backdrop-filter: blur(12px);
  padding: max(12px, env(safe-area-inset-top)) 0 0; display: flex; flex-direction: column;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
#drawer[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 20px; }
.drawer-head h2 { font-size: 18px; margin: 0; }
#chapter-list { list-style: none; margin: 8px 0 0; padding: 0; overflow-y: auto; }
#chapter-list button {
  width: 100%; display: flex; gap: 14px; align-items: baseline; text-align: left;
  padding: 14px 20px; border-top: 1px solid var(--line);
}
#chapter-list .n { color: var(--muted); font-variant-numeric: tabular-nums; width: 2ch; }
#chapter-list .t { flex: 1; }
#chapter-list .d { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
#chapter-list .current .t { color: var(--accent); }

#chapter-list .locked .t, #chapter-list .locked .n { color: var(--muted); }
#chapter-list .locked .d svg { width: 16px; height: 16px; vertical-align: -3px; }

/* Paywall: over the last image of the free chapter. */
#paywall {
  position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.75) 45%, #000 70%);
  font-family: ui-sans-serif, system-ui, sans-serif; animation: pw-in 0.4s ease-out;
}
#paywall[hidden], .pw-step[hidden] { display: none; }
.paywalled #captions, .paywalled #controls { visibility: hidden; }
@keyframes pw-in { from { opacity: 0; } to { opacity: 1; } }
.pw-body { padding: 24px 24px max(24px, env(safe-area-inset-bottom)); text-align: center; }
.pw-body h2 { font: 30px/1.15 ui-serif, Georgia, serif; margin: 0 0 10px; }
.pw-body p { margin: 0 0 20px; color: var(--muted); line-height: 1.45; }
.pw-kicker { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent) !important; margin-bottom: 10px !important; }
.pw-plan {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; text-align: left;
  padding: 16px 18px; margin-bottom: 16px; border: 1px solid var(--accent); border-radius: 16px;
  background: rgba(242, 196, 109, 0.08);
}
.pw-price strong { font-size: 20px; }
.pw-price span { color: var(--muted); font-size: 14px; }
.pw-fine { font-size: 12px; margin: 12px 0 0 !important; }
.primary:disabled { opacity: 0.6; }

#legal { margin: 16px 0 0 !important; font-size: 12px; }
#legal a { color: var(--muted); }

/* Ad-measurement consent (EEA/UK/CH only); never blocks playback. */
#consent {
  position: absolute; z-index: 8; left: 12px; right: 12px; top: max(12px, env(safe-area-inset-top));
  padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(12px); font: 14px/1.45 ui-sans-serif, system-ui, sans-serif;
}
#consent[hidden] { display: none; }
#consent p { margin: 0 0 12px; color: var(--muted); }
#consent a { color: var(--fg); }
#consent .consent-title { margin-bottom: 4px; color: var(--fg); font-weight: 600; }
.consent-actions { display: flex; gap: 8px; }
.consent-btn { flex: 1; padding: 10px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; }
.consent-btn.primary-sm { background: var(--fg); color: #111; border-color: var(--fg); }

/* Headreel: mobile-first cinematic storefront and listening experience. */
:root { --accent:#ed4b2f; --dialogue:#fff0d5; --bg:#0c0c0c; --fg:#faf8f5; font-family:Arial,Helvetica,sans-serif; }
[hidden] { display:none !important; }
button:focus-visible,a:focus-visible,input:focus-visible { outline:3px solid #ffb29d; outline-offset:4px; }
.primary { background:var(--accent); color:white; border-radius:9px; font-weight:750; min-height:54px; transition:background .2s,transform .2s; }
.primary:hover { background:#ff6041; }
.primary:active { transform:scale(.985); }
#start { position:fixed; display:block; overflow:auto; z-index:5; background:#0c0c0c; transition:none; }
#start.gone { display:none; }
.site-nav { height:76px; display:flex; align-items:center; justify-content:space-between; padding:0 6%; position:absolute; left:0;right:0;top:0; z-index:2; border-bottom:1px solid #ffffff1c; }
.wordmark { color:white; text-decoration:none; font-size:25px; font-weight:950; letter-spacing:-1.6px; display:inline-flex;align-items:center; }
.wordmark span { font-weight:400; } .wordmark i { width:7px;height:7px;background:var(--accent);margin:10px 0 0 4px; }
.nav-note { font-size:10px; letter-spacing:2px; color:#bbb; }
.nav-cta { font-size:12px; font-weight:bold; border:1px solid #ffffff55; padding:11px 18px; border-radius:6px; background:#14141455; }
.hero { position:relative; min-height:720px; height:min(92dvh,950px); overflow:hidden; }
#cover { opacity:1; object-position:center 35%; }
.hero-shade { position:absolute;inset:0;background:linear-gradient(90deg,#080808ee 0%,#08080890 43%,#08080820 75%),linear-gradient(0deg,#0c0c0c,transparent 35%); }
.hero-copy { position:relative; padding:195px 6% 110px; max-width:820px; }
.eyebrow { font-size:10px;letter-spacing:2.3px;font-weight:700; color:#ddd; }
.live-dot { display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--accent);margin-right:6px; }
.hero h1 { font-size:clamp(48px,6.3vw,88px); line-height:1.02;letter-spacing:-4px;margin:24px 0; font-weight:850; }
.hero h1 em { color:#ff674b;font-style:normal; }
.hero-description { color:#c9c5c3; font-size:17px; line-height:1.7; }
.hero-copy .primary { width:auto;padding:18px 34px; margin-top:32px; }
.hero-note { font-size:11px;color:#aaa; margin-top:15px; }
.hero-caption { position:absolute;right:6%;bottom:100px;display:grid;gap:10px; text-align:right; }
.hero-caption span { font-size:10px;color:#b8b1aa;letter-spacing:1px; }.hero-caption strong { font:24px Georgia,serif; }
.discovery { max-width:1280px;margin:0 auto;padding:32px 6% 0; }
.section-heading { display:flex;justify-content:space-between;align-items:center;margin-bottom:28px; }
.section-heading h2 { font-size:28px;letter-spacing:-.8px;margin:12px 0; }.section-heading .eyebrow { color:#b5a29a; }
.chapter-badge { font-size:10px;letter-spacing:2px;color:#777; }
.story-card { display:grid;grid-template-columns:42% 1fr;gap:48px; align-items:center; }
.story-art { position:relative;height:400px; overflow:hidden; border-radius:12px;background:#171717; }
.story-art img { width:100%;height:100%;object-fit:cover;object-position:center 25%; }
.original-tag { position:absolute;left:18px;top:18px;font-size:9px;font-weight:bold;letter-spacing:1.5px;background:#111a;padding:9px;border-radius:3px; }
.round-play { position:absolute;bottom:20px;right:20px;background:#fff;color:#111;width:52px;height:52px;border-radius:50%;font-size:20px; }
.tags { display:flex;gap:8px;flex-wrap:wrap; }.tags span { font-size:10px;color:#c8c1bc;border:1px solid #ffffff22;padding:6px 9px;border-radius:4px; }
.story-copy h2 { font:38px/1.1 Georgia,serif; margin:22px 0; }.story-copy>p { color:#a9a5a2;font-size:14px;line-height:1.8; }
.story-features { display:grid;gap:12px;font-size:12px;color:#ddd;margin:24px 0; }.story-copy .primary { max-width:340px;font-size:14px; }
.feature-grid { display:grid;grid-template-columns:repeat(3,1fr);gap:48px;padding:65px 0;border-bottom:1px solid #ffffff20; }.feature-grid span { font-size:10px;color:#ed735c;letter-spacing:2px; }.feature-grid h3 {font-size:19px;font-weight:500;margin:16px 0 10px;}.feature-grid p { font-size:13px;line-height:1.7;color:#93908d;max-width:280px; }
.site-footer {padding:38px 0;display:flex;align-items:center;gap:24px;flex-wrap:wrap;}.site-footer .wordmark {font-size:20px;}.site-footer p,.site-footer small {font-size:11px;color:#777;}.site-footer .ghost {font-size:11px;margin:0;padding:0;}.site-footer small {margin-left:auto;}
#scene-video {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;z-index:1;pointer-events:none;}#scene-video.on {opacity:1;}
#top,#captions,#controls {z-index:2;}#top {background:linear-gradient(#000b,transparent);padding-top:max(18px,env(safe-area-inset-top));}#btn-home {font-size:32px;}#chapter-title {margin-top:6px;font-size:12px;}
#captions {bottom:165px;background:linear-gradient(transparent,#0005);padding:30px 24px 12px;}#speaker {font-size:12px;color:#ffae93;letter-spacing:2px;}#line {font-family:Georgia,serif;line-height:1.45;}#controls {padding-bottom:max(22px,env(safe-area-inset-bottom));}.play {background:var(--accent);color:white;}
#paywall {background:linear-gradient(#0003,#0c0c0cf5 35%,#0c0c0c 65%);overflow:auto;} .pw-body {padding:28px 25px max(28px,env(safe-area-inset-bottom));}.pw-brand {font-weight:900;font-size:18px;letter-spacing:-.5px;margin-bottom:30px;}.pw-brand span {font-size:9px;letter-spacing:1px;color:#ff9178;margin-left:10px;border:1px solid #ed4b2f66;padding:5px;border-radius:4px;}.pw-body h2 {font-family:Arial,sans-serif;font-weight:800;font-size:34px;letter-spacing:-1.2px;}.pw-body p {font-size:14px;}.pw-kicker {font-size:10px!important;letter-spacing:1px;color:#ff9178!important;}.benefits {list-style:none;text-align:left;padding:8px 0 14px;margin:0;}.benefits li {font-size:13px;color:#ddd;padding:8px 0;}.benefits li:before {content:'✓';color:#ff7558;margin-right:12px;}.pw-plan {border-radius:9px;background:#ed4b2f0c;padding:20px 14px;}.pw-plan>span:first-child {font-size:13px;font-weight:600;}.pw-price strong {font-size:24px;}.pw-price span {font-size:11px;}.pw-fine {font-size:11px!important;line-height:1.6!important;}.checkout-summary {display:flex;align-items:center;justify-content:space-between;padding:22px 0;border-top:1px solid #ffffff22;border-bottom:1px solid #ffffff22;margin:28px 0 15px;font-size:13px;}.checkout-detail {font-size:11px!important;margin-bottom:28px!important;}.error-icon {width:54px;height:54px;border:1px solid #ff684c;color:#ff684c;border-radius:50%;display:grid;place-items:center;margin:0 auto 24px;font-size:28px;}[data-step="error"] .primary {margin-top:24px;}
#consent {position:fixed;left:auto;right:20px;top:auto;bottom:20px;width:min(400px,calc(100vw - 40px));background:#1b1b1b;z-index:20;font-size:12px;box-shadow:0 10px 60px #0008;}#player-status {position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:#333;padding:15px;z-index:30;max-width:90vw;font-size:13px;}
@media(max-width:650px){.site-nav{height:66px;padding:0 22px;}.wordmark{font-size:23px;}.nav-note{display:none;}.nav-cta{padding:9px 12px;}.hero{height:85dvh;min-height:650px;max-height:850px;}#cover{object-position:60% 25%;}.hero-shade{background:linear-gradient(0deg,#0c0c0c 0%,#0c0c0cdd 24%,#0c0c0c20 80%,#0c0c0c77);} .hero-copy{position:absolute;bottom:0;padding:0 24px 55px;width:100%;}.hero h1{font-size:52px;letter-spacing:-2.7px;margin:18px 0;}.hero-description{font-size:14px;line-height:1.7;}.hero-copy .primary{width:100%;margin-top:25px;padding:17px;font-size:15px;}.hero-note{text-align:center;font-size:10px;}.hero-caption{display:none;}.discovery{padding:14px 24px 0;}.section-heading h2{font-size:23px;}.chapter-badge{display:none;}.story-card{display:block;}.story-art{height:320px;}.story-copy{padding-top:22px;}.story-copy h2{font-size:32px;margin:18px 0 12px;}.story-copy .primary{max-width:none;}.feature-grid{grid-template-columns:1fr;gap:24px;padding:42px 0;}.feature-grid p{max-width:none;margin-bottom:0;}.site-footer{gap:14px;padding:28px 0;}.site-footer>p:first-of-type{width:100%;margin:0;}.site-footer small{margin-left:0;}.pw-body h2{font-size:31px;}}
@media(max-height:700px){.pw-body{padding-top:18px;padding-bottom:16px;}.pw-brand{margin-bottom:18px;}.pw-body h2{font-size:27px;}.benefits li{padding:5px 0;}.pw-body p{margin-bottom:12px;}.pw-plan{padding:14px;}.pw-body .primary{min-height:48px;padding:13px;}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;}}
.landing #top,.landing #controls,.landing #captions {visibility:hidden;}
#start .site-footer #legal {margin:0!important;}
.mobile-nav{display:none;}
#chapter-list {padding:8px 16px;}#chapter-list li {margin-bottom:10px;}#chapter-list button{padding:22px 16px;border:0;border-radius:10px;background:#ffffff09;align-items:center;min-height:76px;}#chapter-list .current button{background:#c53211;}#chapter-list .current .t{color:white;}#chapter-list .n{width:2ch;}#chapter-list .t{font-weight:600;font-size:14px;line-height:1.4;}#drawer{background:#0c0c0cf2;}.drawer-head{padding:12px 16px 18px 24px;}
#paywall{backdrop-filter:blur(12px);background:linear-gradient(#0c0c0c80,#0c0c0cf5);justify-content:center;}.pw-body{max-height:100%;overflow:auto;}
@media(max-width:650px){.mobile-nav{position:fixed;z-index:7;bottom:0;left:0;right:0;display:flex;justify-content:space-around;background:#0c0c0cf5;border-top:1px solid #ffffff18;padding:10px 12px max(10px,env(safe-area-inset-bottom));}.mobile-nav button{display:grid;justify-items:center;gap:6px;font-size:10px;color:#aaa;min-width:70px;}.mobile-nav button:first-child{color:#ed4b2f;}.mobile-nav svg{width:23px;height:23px;}.site-footer{padding-bottom:110px;} .hero{min-height:540px;height:72dvh;}.hero-copy{padding-bottom:32px;}.hero h1{font-size:48px;}.hero-copy .primary{width:190px;margin:22px auto 0;}.hero-note{text-align:center;}.hero-copy{text-align:center;}.hero-description{font-size:12px;}.hero .eyebrow{font-size:9px;}.site-nav{background:linear-gradient(#0008,transparent);border:0;} .hero-shade{background:linear-gradient(0deg,#0c0c0c 0%,#0c0c0cb0 35%,#0c0c0c05 100%);}.hero h1{background:#1113;text-shadow:0 2px 30px #000;}.hero h1 em{color:white;}#consent{bottom:90px;}}
/* Home page shelves: one per category (catalog.json), one card per story. */
.shelf + .shelf { margin-top:72px; }
.shelf .story-card + .story-card { margin-top:48px; }
.section-heading .badge { display:inline-block; vertical-align:middle; margin-left:12px; font:600 11px/1 Arial,sans-serif; letter-spacing:1px; color:#ff9178; border:1px solid #ed4b2f66; padding:5px 7px; border-radius:4px; }
