/* The Weight of Heaven · listening app
   One stylesheet, mobile first. Breakpoints: 700px (tablet), 1100px (desktop). */

:root {
  --bg: #0F1014;
  --surface: #17181D;
  --surface-2: #1F2026;
  --surface-3: #24252B;
  --line: #2A2B31;
  --line-strong: #3A3A40;
  --text: #F3EFE7;
  --text-2: #C9C5BC;
  --muted: #A7A39A;
  --faint: #8A867E;
  --gold: #D9B25F;
  --gold-hover: #E8C878;
  --on-gold: #1A1508;
  --danger: #E08A7A;
  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --col: 920px;
  --gutter: 20px;
  --bar-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 700px) { :root { --gutter: 40px; --bar-h: 84px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-hover); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: calc(var(--col) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.serif { font-family: var(--serif); font-weight: 400; }
h1, h2, h3 { margin: 0; font-weight: 400; }
.h-display { font-family: var(--serif); font-size: clamp(36px, 6vw, 60px); line-height: 1.05; text-wrap: balance; }
.h-title { font-family: var(--serif); font-size: clamp(30px, 4vw, 48px); line-height: 1.08; text-wrap: balance; }
.h-section { font-size: 20px; font-weight: 600; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- buttons ---------- */
.btn { height: 56px; padding: 0 28px; border-radius: 28px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-hover); color: var(--on-gold); }
.btn-line { border-color: var(--line-strong); color: var(--text); font-weight: 500; background: none; }
.btn-line:hover { border-color: #5A5A62; color: var(--text); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.pill { height: 40px; padding: 0 18px; border-radius: 20px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; background: var(--gold); color: var(--on-gold); white-space: nowrap; }
.pill:hover { background: var(--gold-hover); color: var(--on-gold); }
.chip { height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line-strong); background: none; color: var(--text); font-size: 14px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.chip:hover { border-color: #5A5A62; color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: none; background: none; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- covers ---------- */
.cover { border-radius: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.5); aspect-ratio: 2 / 3; object-fit: cover; width: 100%; background: #16171B; }
.cover-blank { border-radius: 6px; aspect-ratio: 2 / 3; width: 100%; background: #16171B; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-family: var(--serif); color: #6E6B66; font-size: clamp(22px, 4vw, 34px); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(15,16,20,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid #1A1B20; }
.topbar .wrap { height: 64px; display: flex; align-items: center; gap: 8px; }
.brand { font-family: var(--serif); font-size: 21px; white-space: nowrap; }
.nav { display: none; gap: 28px; height: 64px; margin-left: 32px; }
.nav a { height: 64px; display: flex; align-items: center; font-size: 15px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); border-color: var(--gold); }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.only-mobile { display: inline-flex; }
.only-wide { display: none !important; }
@media (min-width: 700px) {
  .topbar .wrap { height: 72px; }
  .nav { display: flex; height: 72px; }
  .nav a { height: 72px; }
  .only-mobile { display: none !important; }
  .only-wide { display: inline-flex !important; }
}
.avatar-btn { background: var(--surface); }

/* ---------- main / pages ---------- */
main { padding-bottom: calc(var(--bar-h) + 32px + var(--safe-b)); min-height: 60vh; }
.page { padding-top: 28px; }
@media (min-width: 700px) { .page { padding-top: 48px; } }

/* library hero */
.hero { display: grid; gap: 24px; justify-items: center; text-align: center; }
.hero .cover-wrap { width: min(220px, 60vw); }
.hero .meta { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.hero .actions { display: flex; gap: 12px; width: 100%; }
.hero .actions .btn-gold { flex: 1; }
@media (min-width: 700px) {
  .hero { grid-template-columns: 240px 1fr; justify-items: start; text-align: left; align-items: center; gap: 48px; }
  .hero .cover-wrap { width: 240px; }
  .hero .meta { align-items: flex-start; }
  .hero .actions { width: auto; }
  .hero .actions .btn-gold { flex: none; min-width: 200px; }
}

/* series grid */
.series { margin-top: 40px; }
.series-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px 14px; }
@media (min-width: 700px) { .series-grid { grid-template-columns: repeat(8, 1fr); gap: 28px 16px; } }
.book-tile { display: flex; flex-direction: column; gap: 8px; }
.book-tile .t { font-size: 13px; font-weight: 500; line-height: 1.25; }
.book-tile .d { font-size: 12px; color: var(--faint); }
.book-tile .d.gold { color: var(--gold); }
.book-tile.locked .t { color: var(--muted); }

/* book page */
.book-layout { display: grid; gap: 28px; }
.book-side { display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; }
.book-side .cover-wrap { width: min(220px, 60vw); }
.book-side .actions { display: flex; gap: 12px; }
@media (min-width: 900px) {
  .book-layout { grid-template-columns: 300px 1fr; gap: 56px; align-items: start; }
  .book-side { align-items: flex-start; text-align: left; position: sticky; top: 104px; }
  .book-side .cover-wrap { width: 300px; }
}
.chapters { display: flex; flex-direction: column; }
.ch-row { display: flex; align-items: center; gap: 16px; height: 60px; border-bottom: 1px solid var(--surface-2); background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%; padding: 0 4px; }
.ch-row:hover { background: rgba(255,255,255,.02); }
.ch-row .n { width: 26px; text-align: right; color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; }
.ch-row .name { flex: 1; font-weight: 500; }
.ch-row .len { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ch-row .prog { font-size: 12px; color: var(--gold); }
.ch-row.current .name { color: var(--gold); }
.ch-row svg { color: var(--gold); flex-shrink: 0; }

/* cards */
.card { border-radius: 20px; background: var(--surface); padding: 22px; }
.card-gold { border: 2px solid var(--gold); }
.card-line { border: 1px solid var(--line); background: none; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.check { display: flex; gap: 10px; color: var(--text-2); font-size: 15px; }
.check svg { color: var(--gold); flex-shrink: 0; margin-top: 2px; }

/* offer */
.offer-layout { display: grid; gap: 32px; }
@media (min-width: 900px) { .offer-layout { grid-template-columns: 1fr 420px; gap: 48px; align-items: center; } }
.fan { position: relative; width: 260px; height: 220px; margin: 12px auto 0; }
.fan > * { position: absolute; left: 80px; top: 30px; width: 100px; height: 150px; border-radius: 5px; transform-origin: 50% 100%; box-shadow: 0 10px 24px rgba(0,0,0,.5); }
.fan .blank { background: #16171C; border: 1px solid #3B3528; display: flex; align-items: center; justify-content: center; font-family: var(--serif); color: #5E5645; font-size: 26px; }
.fan img { object-fit: cover; }
@media (min-width: 900px) { .fan { margin: 24px 0 0; } }
.price { font-family: var(--serif); font-size: 52px; line-height: 1; color: var(--gold); }
.strike { text-decoration: line-through; color: var(--faint); }
.tag { height: 26px; padding: 0 10px; border-radius: 13px; background: var(--gold); color: var(--on-gold); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.input { height: 56px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 16px; font-size: 16px; width: 100%; }
.input:focus { outline: none; border-color: var(--gold); }
.input.error { border-color: var(--danger); }
.err { font-size: 13px; color: var(--danger); min-height: 18px; }

/* list rows */
.row { min-height: 56px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--surface-2); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; padding: 0; font-size: 16px; }
.row .grow { flex: 1; }
.row .v { font-size: 14px; color: var(--muted); }
.section-label { margin: 32px 0 4px; }
.switch { position: relative; width: 46px; height: 26px; border-radius: 13px; background: var(--line); border: none; flex-shrink: 0; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 10px; background: var(--faint); transition: left .15s, background .15s; }
.switch[aria-checked="true"] { background: var(--gold); }
.switch[aria-checked="true"]::after { left: 23px; background: var(--on-gold); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--bar-h) + 24px + var(--safe-b)); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100vw - 40px); }

/* ---------- seek bar ---------- */
.seek { position: relative; padding: 12px 0; cursor: pointer; touch-action: none; }
.seek .track { position: relative; height: 8px; border-radius: 4px; background: var(--line); transition: height .15s ease, border-radius .15s ease; }
.seek .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: var(--text); }
.seek .thumb { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 9px; background: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.5); transform: translate(-50%, -50%) scale(0); transition: transform .15s ease; }
.seek:hover .track, .seek.dragging .track, .seek:focus-visible .track { height: 12px; border-radius: 6px; }
.seek:hover .thumb, .seek.dragging .thumb, .seek:focus-visible .thumb { transform: translate(-50%, -50%) scale(1); }
.seek.sm .track { height: 5px; border-radius: 3px; }
.seek.sm:hover .track, .seek.sm.dragging .track { height: 9px; border-radius: 5px; }
.seek:focus-visible { outline: none; }
@media (hover: none) { .seek .thumb { transform: translate(-50%, -50%) scale(1); width: 14px; height: 14px; } }
.times { display: flex; justify-content: space-between; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- player bar (sticky, Spotify-style) ---------- */
.playerbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #16171C; border-top: 1px solid var(--surface-3); padding-bottom: var(--safe-b); }
.playerbar .wrap { height: var(--bar-h); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.pb-now { display: flex; align-items: center; gap: 12px; min-width: 0; background: none; border: none; padding: 0; text-align: left; }
.pb-now img { width: 40px; height: 60px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.pb-now .txt { min-width: 0; }
.pb-now .t1 { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-now .t2 { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-center { display: contents; }
.pb-ctrls { display: flex; align-items: center; gap: 4px; }
.pb-ctrls .extra { display: none; }
.pb-seek { display: none; }
.pb-right { display: none; }
.pb-mobile-progress { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--line); }
.pb-mobile-progress i { display: block; height: 100%; background: var(--gold); width: 0; }
@media (min-width: 700px) {
  .playerbar .wrap { grid-template-columns: 220px 1fr 220px; gap: 24px; }
  .pb-center { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
  .pb-ctrls { gap: 8px; }
  .pb-ctrls .extra { display: inline-flex; }
  .pb-seek { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; width: 100%; max-width: 560px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
  .pb-seek span:last-child { text-align: right; }
  .pb-seek .seek { padding: 8px 0; }
  .pb-right { display: flex; justify-content: flex-end; gap: 8px; }
  .pb-right .chip { height: 36px; padding: 0 12px; font-size: 13px; }
  .pb-mobile-progress { display: none; }
}
@media (min-width: 700px) and (max-width: 1099px) { .playerbar .wrap { grid-template-columns: 200px 1fr 120px; } .pb-right .sleep-chip { display: none; } }
.ctl { width: 44px; height: 44px; border-radius: 22px; border: none; background: none; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.ctl:hover { background: var(--surface-2); color: var(--text); }
.ctl[disabled] { opacity: .35; pointer-events: none; }
.play { width: 44px; height: 44px; border-radius: 22px; border: none; background: var(--gold); color: var(--on-gold); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .15s, transform .1s; }
.play:hover { background: var(--gold-hover); }
.play.lg { width: 76px; height: 76px; border-radius: 38px; box-shadow: 0 10px 28px rgba(217,178,95,.22); }
.play.loading svg { opacity: .35; }

/* ---------- full player ---------- */
.np { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; display: flex; flex-direction: column; will-change: transform; }
.np-top { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; flex-shrink: 0; }
.np-body { flex: 1; width: 100%; max-width: calc(var(--col) + var(--gutter) * 2); margin: 0 auto; padding: 8px 24px calc(28px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; }
.np-cover { width: min(250px, 58vw, 30vh); }
.np-info { width: 100%; max-width: 520px; display: flex; flex-direction: column; }
.np-info h1 { font-family: var(--serif); font-size: clamp(28px, 4vw, 48px); line-height: 1.05; margin-top: 8px; }
.np-caption { margin-top: 20px; min-height: 76px; display: flex; align-items: center; justify-content: center; }
.np-caption p { margin: 0; padding: 10px 16px; border-radius: 8px; background: rgba(0,0,0,.88); color: #fff; font-size: 16px; line-height: 1.45; text-align: center; max-width: 100%; }
.np-caption .none { background: none; color: var(--faint); font-size: 14px; padding: 0; }
.np-seek { margin-top: 20px; }
.np-ctrls { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; }
.np-ctrls .ctl { width: 52px; height: 52px; border-radius: 26px; }
.np-extras { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--surface-2); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.np-extras .grow { flex: 1; }
@media (min-width: 900px) {
  .np-body { flex-direction: row; align-items: center; justify-content: center; gap: 56px; padding-top: 24px; }
  .np-cover { width: 320px; }
  .np-caption { margin-top: 28px; min-height: 90px; }
  .np-caption p { font-size: 19px; padding: 12px 18px; }
  .np-seek { margin-top: 28px; }
}
@media (max-width: 899px) { .np-info { margin-top: 20px; } }

/* sheet / menu */
.overlay { position: fixed; inset: 0; z-index: 55; background: var(--bg); overflow-y: auto; padding: 16px 20px calc(28px + var(--safe-b)); }
.menu-list a, .menu-list button { display: flex; align-items: center; min-height: 64px; border-bottom: 1px solid var(--surface-2); font-family: var(--serif); font-size: 28px; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; padding: 0; }
.menu-list .sub { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.menu-children { margin-left: 8px; padding-left: 16px; border-left: 1px solid var(--line-strong); }
.menu-children a { min-height: 54px; font-size: 20px; border-bottom: none; }

/* welcome */
.welcome { min-height: calc(100vh - 64px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 20px; padding: 24px; max-width: 480px; margin: 0 auto; }
.welcome .cover-wrap { width: 200px; }

/* download */
.dl-layout { display: grid; gap: 28px; justify-items: center; text-align: center; }
.dl-layout .cover-wrap { width: min(240px, 62vw); }
@media (min-width: 900px) { .dl-layout { grid-template-columns: 320px 420px; justify-content: center; justify-items: start; text-align: left; gap: 56px; align-items: center; } .dl-layout .cover-wrap { width: 320px; } }
.dl-list { border-top: 1px solid var(--surface-2); margin-top: 8px; width: 100%; }
.dl-list a { display: flex; justify-content: space-between; height: 48px; align-items: center; border-bottom: 1px solid var(--surface-2); font-size: 15px; }

/* banners */
.demo-note { font-size: 12px; color: var(--faint); text-align: center; padding: 8px 16px; background: #131418; border-bottom: 1px solid #1A1B20; }

/* cookie card */
.consent { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 70; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 18px 14px; box-shadow: 0 12px 32px rgba(0,0,0,.5); max-width: 420px; margin: 0 auto; }
.consent .btns { display: flex; gap: 10px; margin-top: 14px; }
.consent .btns .btn { flex: 1; height: 48px; font-size: 15px; font-weight: 500; }
.consent a { font-size: 12px; color: var(--faint); text-decoration: underline; display: block; text-align: center; margin-top: 10px; }

/* landing */
.l-hero { padding: 32px 0 56px; background: linear-gradient(180deg, var(--bg) 0%, #16140F 60%, var(--bg) 100%); }
.l-hero .wrap { display: grid; gap: 24px; justify-items: center; text-align: center; }
.l-hero .cover-wrap { width: min(240px, 62vw); }
.l-hero .actions { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; }
@media (min-width: 900px) {
  .l-hero { padding: 72px 0 88px; }
  .l-hero .wrap { grid-template-columns: 280px 1fr; justify-items: start; text-align: left; gap: 56px; align-items: center; }
  .l-hero .cover-wrap { width: 280px; }
  .l-hero .actions { flex-direction: row; max-width: none; }
}
.l-story { display: grid; gap: 32px; padding: 24px 0 56px; }
.l-story p { margin: 0; font-size: 18px; line-height: 1.65; color: #E4DFD6; }
.l-story .txt { display: flex; flex-direction: column; gap: 16px; }
.l-quote { margin: 0; padding: 6px 0 6px 20px; border-left: 2px solid var(--text); display: flex; flex-direction: column; gap: 12px; }
.l-quote blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(24px, 3vw, 32px); line-height: 1.28; }
@media (min-width: 900px) { .l-story { grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding: 40px 0 72px; } }
.rail { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px calc(50% - 85px) 8px; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); }
.rail::-webkit-scrollbar { display: none; }
.rail .book-tile { flex: 0 0 170px; scroll-snap-align: center; }
.rail .book-tile .t { font-family: var(--serif); font-size: 19px; font-weight: 400; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rail .book-tile { animation: grow linear both; animation-timeline: view(inline); }
    @keyframes grow { 0% { transform: scale(.8); opacity: .55; } 50% { transform: scale(1); opacity: 1; } 100% { transform: scale(.8); opacity: .55; } }
  }
}
@media (min-width: 900px) { .rail { display: grid; grid-template-columns: repeat(8, 1fr); overflow: visible; padding: 12px 0 0; margin: 0; gap: 16px; } .rail .book-tile { animation: none !important; } .rail .book-tile .t { font-size: 16px; } }
.l-own { margin: 48px 0 0; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 900px) { .l-own { flex-direction: row; align-items: center; justify-content: space-between; padding: 36px 44px; } }
.l-close { text-align: center; padding: 64px 0 40px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.foot { border-top: 1px solid #1A1B20; padding: 28px 0 calc(28px + var(--safe-b)); font-size: 13px; color: var(--faint); }
.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot nav { display: flex; gap: 20px; }

/* sign in */
.auth { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth .box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.or { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--faint); }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.l-copy { display: flex; flex-direction: column; gap: 20px; align-items: center; width: 100%; }
@media (min-width: 900px) { .l-copy { align-items: flex-start; } }

/* Full player fits one screen on shorter phones */
@media (max-width: 899px) and (max-height: 900px) {
  .np-top { height: 52px; }
  .np-body { padding-top: 0; padding-bottom: calc(16px + var(--safe-b)); }
  .np-cover { width: min(250px, 58vw, 25vh); }
  .np-info { margin-top: 14px; }
  .np-caption { margin-top: 10px; min-height: 68px; }
  .np-seek { margin-top: 10px; }
  .np-ctrls { margin-top: 8px; }
  .np-extras { margin-top: 14px; padding-top: 14px; }
}
.nav a { white-space: nowrap; }

/* ---------- motion ---------- */
html, body { overflow-x: clip; }
#view { outline: none; }
.topbar { transition: box-shadow .25s ease, background-color .25s ease; }
.topbar.scrolled { box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 10px 30px rgba(0,0,0,.35); }
.btn, .chip, .pill, .ctl, .play, .icon-btn, .book-tile, .ch-row, .row, .pb-now { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* Play and pause live in the same button and trade places */
.play { position: relative; }
.play .ic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.play .ic svg { display: block; }
.play .ic-pause { opacity: 0; }
.play.loading::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--gold); animation: wh-spin .8s linear infinite; }
.play.loading .ic { opacity: .45 !important; }
@keyframes wh-spin { to { transform: rotate(360deg); } }

/* Covers lift a touch under the pointer on desktop */
@media (hover: hover) {
  .book-tile .cover, .hero .cover-wrap .cover { transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; }
  .book-tile:hover .cover, .hero .cover-wrap:hover .cover { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(0,0,0,.55); }
}

/* The full player on phones is a sheet: a sliver of the page shows above it, and it has a grab handle */
.np-top { position: relative; }
.np-grab { display: none; }
@media (max-width: 699px) {
  .np { top: calc(10px + env(safe-area-inset-top, 0px)); border-radius: 16px 16px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.5); }
  .np-grab { display: block; position: absolute; left: 50%; top: 6px; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: rgba(243,239,231,.28); }
  .np-top, .np-cover { touch-action: none; cursor: grab; }
  body.np-open { background: #000; }
}

/* Moving between the landing, sign-in and app pages crossfades instead of flashing */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }

/* ---------- canvas parity ---------- */
/* The top bar lets the cover glow show through */
.topbar { background: rgba(15,16,20,.72); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); border-bottom-color: rgba(255,255,255,.04); }
.topbar.scrolled { background: rgba(15,16,20,.88); }

/* Soft, heavily blurred cover wash behind the book, fading into the page */
#view { position: relative; isolation: isolate; }
.glow { position: absolute; left: 0; right: 0; top: -72px; height: 680px; z-index: -1; overflow: hidden; pointer-events: none; }
.glow img { position: absolute; left: -10%; top: -10%; width: 120%; height: 120%; max-width: none; object-fit: cover; filter: blur(90px) saturate(1.25); opacity: .34; }
.glow::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,16,20,.15) 0%, rgba(15,16,20,.6) 60%, var(--bg) 100%); }
.np { isolation: isolate; }
.np .glow { top: 0; height: 100%; }

/* Player bar: a floating card that stays inside the page column */
.playerbar { left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); padding-bottom: 0; border: 1px solid #2E2F36; border-radius: 14px; background: rgba(30,31,37,.94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 16px 40px rgba(0,0,0,.45); overflow: hidden; }
.playerbar .wrap { max-width: none; padding: 0 10px 0 10px; height: 64px; }
.pb-mobile-progress { top: auto; bottom: 0; }
.pb-now img { width: 32px; height: 48px; border-radius: 2px; }
main { padding-bottom: calc(64px + 40px + var(--safe-b)); }
.toast { bottom: calc(64px + 28px + var(--safe-b)); }
@media (min-width: 700px) {
  .playerbar { left: max(var(--gutter), calc((100vw - var(--col)) / 2)); right: max(var(--gutter), calc((100vw - var(--col)) / 2)); bottom: 16px; border-radius: 16px; }
  .playerbar .wrap { height: 80px; padding: 0 20px 0 14px; grid-template-columns: 200px 1fr 170px; gap: 16px; }
  .pb-now img { width: 40px; height: 60px; border-radius: 3px; }
  main { padding-bottom: calc(80px + 56px); }
  .toast { bottom: calc(80px + 32px); }
}

/* Series tiles read like the design: title, then "Releases …" */
.book-tile .d { line-height: 1.3; }

/* Cookie card: light, so it stands apart from the dark player bar */
.consent { background: #F3EFE7; color: #17181D; border-color: #F3EFE7; box-shadow: 0 16px 44px rgba(0,0,0,.6); }
.consent .muted { color: #55524C; }
.consent a { color: #55524C; }
.consent .btns .btn[data-v="no"] { border-color: #C9C3B6; color: #17181D; background: none; }
.consent .btns .btn[data-v="yes"] { background: #17181D; color: #F3EFE7; border-color: #17181D; }

/* Full player: book title up top, author under the chapter, controls that never wrap, gold Own the Series */
.np-extras { flex-wrap: nowrap; }
.np-extras .chip { flex-shrink: 0; }
.np-own { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 600; }
.np-own:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: var(--on-gold); }
@media (max-width: 699px) { .np-extras { flex-wrap: wrap; } }
@media (min-width: 900px) {
  .np-body { gap: 48px; }
  .np-cover { width: 300px; flex-shrink: 0; }
  .np-info { max-width: 572px; }
}
/* On tablet and desktop the full player opens under the top bar, like a page, so the navigation stays in reach */
@media (min-width: 700px) { .np { top: 72px; } }
@media (max-width: 699px) {
  .topbar .brand { font-size: 19px; margin-left: 2px; }
  .topbar .pill { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 17px; }
  .playerbar { left: var(--gutter); right: var(--gutter); }
}

/* Full player tools. Desktop: one row of pills. Phone: four equal icon buttons, then Own the Series across the width */
.np-extras .tool .ico { display: inline-flex; align-items: center; }
.np-extras .tool .spd { font-variant-numeric: tabular-nums; }
.np-extras [data-a=speed] .lbl { display: none; }
@media (max-width: 699px) {
  .np-extras { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding-top: 12px; margin-top: 16px; }
  .np-extras .grow { display: none; }
  .np-extras .tool { flex-direction: column; justify-content: center; gap: 4px; height: 60px; padding: 0; border: none; border-radius: 14px; background: none; color: var(--text-2); font-size: 12px; font-weight: 500; }
  .np-extras .tool .ico { height: 24px; }
  .np-extras .tool .ico svg { width: 22px; height: 22px; }
  .np-extras .tool .spd { font-size: 17px; font-weight: 600; color: var(--text); }
  .np-extras [data-a=speed] .lbl { display: inline; }
  .np-extras .tool:hover { background: var(--surface-2); color: var(--text); }
  .np-extras .tool.on { background: rgba(217,178,95,.12); color: var(--gold); border: none; }
  .np-extras .tool .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .np-extras .np-own { grid-column: 1 / -1; justify-content: center; height: 52px; border-radius: 26px; margin-top: 8px; font-size: 15px; }
}

/* Phone player: the cover takes only the height left over, so every control always fits on screen */
@media (max-width: 699px) {
  .np { overflow: hidden; }
  .np-body { flex: 1 1 auto; min-height: 0; padding-top: 0; }
  .np-cover { flex: 1 1 0; min-height: 120px; max-height: min(375px, 90vw); width: 100%; position: relative; margin-bottom: 4px; }
  .np-cover .cover { position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: 0 auto; height: 100%; width: auto; max-width: 100%; aspect-ratio: 2 / 3; }
  .np-info { flex-shrink: 0; margin-top: 14px; }
}
@media (max-width: 699px) and (max-height: 700px) { .np-caption { min-height: 56px; } .np-caption p { font-size: 14px; } }

/* One background everywhere: the D1 cover glow, never the old flat gradient */
.l-hero { background: none; }
.page-glow { top: 0; }
.welcome { position: relative; }

/* Navigation as on the desktop player (D4): title left, tabs centred, Own the Series and account right */
@media (min-width: 1000px) {
  .topbar .wrap { position: relative; }
  .topbar .nav { position: absolute; left: 50%; top: 0; transform: translateX(-50%); margin-left: 0; }
}
