/* The Wizard Verse - bedtime stories */
:root {
  --green: #173325;
  --green-deep: #0e2118;
  --green-soft: #21422f;
  --ivory: #f3e8cf;
  --ivory-dim: #d9ccb0;
  --gold: #d8b664;
  --gold-bright: #f0d48a;
  --wine: #7d1a28;
  --wine-deep: #5a0f1b;
  --ink: #1d1a14;
  --head: "IM Fell English", Georgia, serif;
  --head-sc: "IM Fell English SC", Georgia, serif;
  --read: "Literata", Georgia, serif;
  --ui: "Hanken Grotesk", system-ui, sans-serif;
  --frame: 0 0 0 1px var(--gold), 0 0 0 7px var(--wine), 0 0 0 8px var(--gold);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
/* the computer scroll glide (Lenis, started in auth.js) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
section[id] { scroll-margin-top: 70px; }
html { background: var(--green-deep); }
body {
  min-height: 100vh;
  background: var(--green-deep);
  color: var(--ivory);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; }

/* faint woven texture over every green surface */
.woven {
  background-color: var(--green);
  background-repeat: no-repeat, repeat;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(240,212,138,.08), transparent 60%),
    url(img/grain.png);
}

/* ---------- the two doors ---------- */
.doors { position: fixed; inset: 0; z-index: 50; perspective: 2200px; }
/* first visit: the doors are on screen from the very first frame (the script only adds the click) */
html.doors-first { overflow: hidden; }
html.doors-first .doors[hidden]:not(.gone) { display: block !important; }
.door {
  position: absolute; top: 0; width: 50%; height: 100%; overflow: hidden;
  background: #1d2c1a;
  transition: transform 2.4s cubic-bezier(.65,.02,.25,1), filter 2.4s ease;
  backface-visibility: hidden; cursor: pointer;
}
/* each door holds the whole cover at full screen width and shows its own half */
.door .art { position: absolute; top: 0; height: 100%; width: 200%; }
.art-wide, .art-tall > img, .art-tall > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-tall { display: none; position: absolute; inset: 0; container-type: size; }
.art-tall > * { --t: min(5.5cqw, 42px); --c: calc(var(--t) * 2.5); }
@media (max-aspect-ratio: 4/5) {
  .art-wide { display: none; }
  .art-tall { display: block; }
}
/* in-between shapes (iPad upright, narrow windows): the book sits in the middle at its own shape, like a book on a dark table */
@media (min-aspect-ratio: 3/5) and (max-aspect-ratio: 4/5) {
  .art-tall { left: 50%; right: auto; width: auto; height: 100%; aspect-ratio: 56 / 100; transform: translateX(-50%); box-shadow: 0 0 60px rgba(0,0,0,.6); }
}
/* the stacked (tall-screen) cover: picture inside, border drawn round the screen's own shape */
.art-tall > img, .art-tall > canvas { inset: calc(var(--t) - 1px); width: calc(100% - 2 * var(--t) + 2px); height: calc(100% - 2 * var(--t) + 2px); }
.art-tall .fr, .art-tall .cn { position: absolute; display: block; }
.art-tall .fr.t, .art-tall .fr.b { left: 0; right: 0; height: var(--t); background: url(img/cover/band-h-m.svg) repeat-x 0 0 / auto 100%; }
.art-tall .fr.t { top: 0; }
.art-tall .fr.b { bottom: 0; transform: scaleY(-1); }
.art-tall .fr.l, .art-tall .fr.r { top: 0; bottom: 0; width: var(--t); background: url(img/cover/band-v-m.svg) repeat-y 0 0 / 100% auto; }
.art-tall .fr.l { left: 0; }
.art-tall .fr.r { right: 0; transform: scaleX(-1); }
.art-tall .cn { width: var(--c); height: var(--c); background: url(img/cover/corner.svg) 0 0 / 100% 100%; }
/* only the medallion and the border show from the corner piece; its strips fade into the bands, so no square
   edge cuts across the picture (the bands repeat as mirrored pairs, so their joins are seamless too) */
.art-tall .cn {
  --m: radial-gradient(ellipse 43% 43% at 52% 52%, #000 97%, transparent 100%),
    linear-gradient(to right, #000 70%, transparent 100%) 0 0 / 100% 40% no-repeat,
    linear-gradient(to bottom, #000 70%, transparent 100%) 0 0 / 40% 100% no-repeat;
  -webkit-mask: var(--m); mask: var(--m);
}
.art-tall .cn.tl { top: 0; left: 0; }
.art-tall .cn.tr { top: 0; right: 0; transform: scaleX(-1); }
.art-tall .cn.bl { bottom: 0; left: 0; transform: scaleY(-1); }
.art-tall .cn.br { bottom: 0; right: 0; transform: scale(-1); }
.door.left { left: 0; transform-origin: left center; }
.door.right { right: 0; transform-origin: right center; }
.door.left .art { left: 0; }
.door.right .art { right: 0; }
.door::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 140px rgba(0,0,0,.4); }
.doors.open .left { transform: rotateY(-100deg); filter: brightness(.5); }
.doors.open .right { transform: rotateY(100deg); filter: brightness(.5); }
.doors.gone { display: none; }
/* the living cover (cover-live.js): laid exactly over both doors while they are shut */
.live { position: absolute; inset: 0; z-index: 1; pointer-events: none; transition: opacity .35s ease; }
.live .art { position: absolute; inset: 0; }
.live canvas { opacity: 0; transition: opacity .6s ease; }
.live canvas.on { opacity: 1; }
.live::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 140px rgba(0,0,0,.4); }
.live.fade { opacity: 0; }
.open-btn {
  position: absolute; left: 50%; bottom: 8vh; transform: translateX(-50%); z-index: 2;
  font-family: var(--head-sc); font-size: clamp(19px, 2.2vw, 28px); letter-spacing: .08em;
  color: var(--ivory); background: var(--wine); border: 2px solid var(--gold);
  padding: .55em 1.8em; border-radius: 40px; cursor: pointer; white-space: nowrap;
  animation: glow 2.6s ease-in-out infinite; transition: opacity .6s ease;
}
.open-btn:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 4px; }
.doors.open .open-btn { opacity: 0; pointer-events: none; }
@keyframes glow {
  0%,100% { box-shadow: 0 0 0 6px rgba(216,182,100,.15), 0 10px 40px rgba(0,0,0,.5); }
  50% { box-shadow: 0 0 0 13px rgba(216,182,100,.3), 0 10px 40px rgba(0,0,0,.5); }
}
.spark-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- page frame ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.band { height: 10px; background: var(--wine); border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }

header.top { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(216,182,100,.45); }
header.top .page { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { font-family: var(--head); font-size: 27px; text-decoration: none; color: var(--ivory); white-space: nowrap; }
.brand span { color: var(--gold); }
nav.links { display: flex; gap: 26px; margin-left: auto; align-items: center; }
nav.links a { text-decoration: none; font-size: 15px; color: var(--ivory-dim); letter-spacing: .02em; }
nav.links a:hover { color: var(--gold-bright); }
.btn {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: .5em; cursor: pointer; text-decoration: none;
  font-family: var(--ui); font-weight: 700; font-size: 16px; letter-spacing: .01em;
  border-radius: 999px; padding: .75em 1.5em; border: 2px solid var(--gold);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; }
.btn.wine { background: var(--wine); color: var(--ivory); }
.btn.wine:hover { background: #941f30; }
.btn.gold { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--wine-deep); border-color: #f6e2a8; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.btn.small { padding: .5em 1.15em; font-size: 15px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero .page { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 72px; position: relative; z-index: 1; }
.eyebrow { font-family: var(--head-sc); color: var(--gold); letter-spacing: .14em; font-size: 16px; }
.hero h1 { font-family: var(--head); font-weight: 400; font-size: clamp(44px, 5.6vw, 76px); line-height: 1.02; margin: 10px 0 18px; color: var(--ivory); text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.hero h1 em { color: var(--gold-bright); font-style: italic; }
.hero p.lead { font-size: 19px; color: var(--ivory-dim); max-width: 30em; }
.name-card {
  margin-top: 28px; padding: 20px 22px; border-radius: 14px;
  background: rgba(14,33,24,.65); border: 1px solid rgba(216,182,100,.5);
}
.name-card label { display: block; font-family: var(--head); font-size: 21px; color: var(--ivory); margin-bottom: 10px; }
.name-row { display: flex; gap: 10px; flex-wrap: wrap; }
.name-row input {
  flex: 1 1 180px; min-width: 0; padding: .7em 1em; border-radius: 999px;
  background: var(--ivory); color: var(--ink); border: 2px solid var(--gold); font-size: 17px;
}
.name-row input:focus { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
.name-card .err-msg:empty { display: none; }
.name2-row { margin-top: 10px; }
.add-name2 { display: block; margin-top: 10px; font-size: 14px; text-underline-offset: 3px; }
.name-card .err-msg { color: #ffb4a8; font-size: 15px; margin-top: 8px; }
.hello { display: flex; align-items: center; gap: 16px; }
.hello-play {
  flex: none; width: 58px; height: 58px; border-radius: 50%; border: 2px solid #f6e2a8; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--wine-deep);
  display: grid; place-items: center; box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.hello-play svg { width: 26px; height: 26px; fill: currentColor; }
.hello-play:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; }
.hello .i-play, .hello.paused .i-pause { display: none; }
.hello:not(.paused) .i-pause, .hello.paused .i-play { display: block; }
.hello-main { flex: 1; min-width: 0; }
.hello-line { font-family: var(--head); font-size: clamp(17px, 2.3vh, 21px); color: var(--ivory); }
.hello-line b { color: var(--gold-bright); font-weight: 400; font-style: italic; }
.hello-bar { height: 5px; border-radius: 3px; background: rgba(240,212,138,.2); margin: 10px 0; overflow: hidden; }
.hello-bar span { display: block; height: 100%; width: 0; background: var(--gold-bright); transition: width .25s linear; }
.hello-acts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; }
.hello-acts a { color: var(--gold-bright); }
.hero-copy:has(.hello:not([hidden])) .hero-sample { display: none; }
@media (max-width: 600px) {
  .hello { gap: 12px; }
  .hello-play { width: 46px; height: 46px; }
  .hello-play svg { width: 20px; height: 20px; }
  .hello-line { font-size: 16px; }
  .hello-bar { margin: 7px 0; }
  .hello-acts { font-size: 14px; flex-wrap: nowrap; gap: 14px; white-space: nowrap; }
}
.linkish { background: none; border: 0; padding: 0; color: var(--ivory-dim); text-decoration: underline; font: inherit; cursor: pointer; }
.hint { font-size: 14px; color: var(--ivory-dim); margin-top: 10px; opacity: .85; }
.hero-art { position: relative; border-radius: 6px; box-shadow: var(--frame), 0 30px 70px rgba(0,0,0,.55); }
.hero-art img { border-radius: 6px; width: 100%; height: auto; aspect-ratio: 1786/999; object-fit: cover; }
.twinkles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* ---------- section heads ---------- */
section.block { padding: 84px 0; }
.sec-head { text-align: center; margin-bottom: 44px; }
.sec-head h2 { font-family: var(--head); font-weight: 400; font-size: clamp(34px, 4vw, 52px); line-height: 1.1; margin-top: 6px; }
.sec-head p { color: var(--ivory-dim); margin: 12px auto 0; max-width: 36em; }
.flourish { display: block; margin: 14px auto 0; width: 180px; height: 18px; color: var(--gold); }

/* ---------- the seven stories ---------- */
.shelf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px; }
.book {
  position: relative; display: flex; flex-direction: column; text-decoration: none;
  background: var(--wine-deep); border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--gold), 0 14px 34px rgba(0,0,0,.45);
  transition: transform .25s ease, box-shadow .25s ease;
}
.book:hover { transform: translateY(-4px); box-shadow: 0 0 0 2px var(--gold-bright), 0 22px 44px rgba(0,0,0,.55); }
.book:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 4px; }
.book img { aspect-ratio: 3/2; object-fit: cover; width: 100%; }
.book .meta { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.book .day { font-family: var(--head-sc); color: var(--gold); letter-spacing: .12em; font-size: 14px; }
.book h3 { font-family: var(--head); font-weight: 400; font-size: 23px; line-height: 1.15; color: var(--ivory); }
.book .tag { font-size: 14.5px; color: var(--ivory-dim); }
.book .mins { margin-top: auto; padding-top: 8px; font-size: 13px; color: var(--gold); }
.book .ribbon {
  position: absolute; top: 12px; left: 12px; font-family: var(--ui); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--gold); color: var(--wine-deep); padding: 4px 10px; border-radius: 999px;
}
.book.tonight { box-shadow: 0 0 0 2px var(--gold-bright), 0 0 40px rgba(240,212,138,.25), 0 14px 34px rgba(0,0,0,.45); }
.book.feature { grid-column: span 2; grid-row: span 2; }
.book.feature img { flex: 1 1 auto; height: 0; min-height: 260px; aspect-ratio: auto; }
.book.feature .meta { flex: 0 0 auto; }
.book.feature h3 { font-size: 34px; }
.book.feature .tag { font-size: 16.5px; }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; counter-reset: s; }
.step { text-align: center; padding: 30px 24px; border-radius: 14px; border: 1px solid rgba(216,182,100,.4); background: rgba(14,33,24,.5); }
.step::before {
  counter-increment: s; content: counter(s);
  display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%;
  font-family: var(--head); font-size: 28px; color: var(--wine-deep);
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold)); box-shadow: 0 0 0 4px rgba(216,182,100,.2);
}
.step h3 { font-family: var(--head); font-weight: 400; font-size: 26px; margin-bottom: 6px; }
.step p { color: var(--ivory-dim); }

/* ---------- gift + waitlist ---------- */
.gift { background: linear-gradient(180deg, var(--wine-deep), #430b15); border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
.gift .page { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.gift h2 { font-family: var(--head); font-weight: 400; font-size: clamp(32px, 3.6vw, 48px); line-height: 1.1; margin: 6px 0 14px; }
.gift p { color: var(--ivory-dim); }
.gift img { border-radius: 6px; box-shadow: 0 0 0 1px var(--gold), 0 24px 60px rgba(0,0,0,.5); }

.waitlist { max-width: 640px; margin: 0 auto; text-align: center; padding: 40px 32px; border-radius: 18px; background: rgba(14,33,24,.7); box-shadow: var(--frame), 0 30px 70px rgba(0,0,0,.45); }
.waitlist form { display: grid; gap: 12px; margin-top: 22px; text-align: left; }
.waitlist label { font-size: 14px; color: var(--ivory-dim); }
.waitlist input[type=email], .waitlist input[type=text] {
  width: 100%; padding: .75em 1em; border-radius: 10px; border: 2px solid var(--gold); background: var(--ivory); color: var(--ink); font-size: 17px;
}
.waitlist input:focus { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
.waitlist .btn { justify-content: center; margin-top: 6px; }
.small-print { font-size: 13px; color: var(--ivory-dim); opacity: .8; margin-top: 8px; text-align: center; }
.done-msg { font-family: var(--head); font-size: 26px; color: var(--gold-bright); padding: 20px 0 4px; text-align: center; }
.err-msg { color: #ffb3b3; font-size: 14px; text-align: center; }
.hp { position: absolute; left: -5000px; }

footer.foot { border-top: 1px solid rgba(216,182,100,.4); padding: 34px 0 44px; color: var(--ivory-dim); font-size: 14px; }
footer.foot .page { display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap; }
footer.foot a { color: var(--gold); text-decoration: none; }


/* ---------- framed first screen (the tapestry border from the homepage design) ---------- */
.hero-frame {
  --fb: 22px; --medal: 66px; --pad: 58px;
  position: relative; height: 100vh; height: 100dvh; min-height: 560px; padding: var(--fb);
  display: flex;
  background-color: var(--wine);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46'%3E%3Cg fill='%23e2c06e'%3E%3Cpath d='M9 4l1.2 3.3L13.5 8.5l-3.3 1.2L9 13l-1.2-3.3L4.5 8.5l3.3-1.2z'/%3E%3Cpath d='M33 27l.9 2.4 2.4.9-2.4.9-.9 2.4-.9-2.4-2.4-.9 2.4-.9z'/%3E%3Ccircle cx='27' cy='9' r='1'/%3E%3Ccircle cx='11' cy='34' r='1.1'/%3E%3Ccircle cx='41' cy='42' r='.8'/%3E%3C/g%3E%3C/svg%3E");
  /* Denver 17 Oct: no gold trim on the outer edge, so the red border runs off the screen edge as one piece */
}
.tap-inner {
  position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden;
  border: 2px solid var(--gold); border-radius: 3px;
  box-shadow: 0 0 0 4px var(--wine), 0 0 0 5px rgba(216,182,100,.75);
  background-color: #0a291c;
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(240,212,138,.07), transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(0,0,0,.35), transparent 60%),
    url(img/grain.png);
}
.medal { position: absolute; z-index: 3; width: var(--medal); height: var(--medal); filter: drop-shadow(0 2px 4px rgba(0,0,0,.45)); pointer-events: none; }
.medal.tl { left: calc(var(--fb) / 2 - var(--medal) / 2 + 6px); top: calc(var(--fb) / 2 - var(--medal) / 2 + 6px); }
.medal.tr { right: calc(var(--fb) / 2 - var(--medal) / 2 + 6px); top: calc(var(--fb) / 2 - var(--medal) / 2 + 6px); }
.medal.bl { left: calc(var(--fb) / 2 - var(--medal) / 2 + 6px); bottom: calc(var(--fb) / 2 - var(--medal) / 2 + 6px); }
.medal.br { right: calc(var(--fb) / 2 - var(--medal) / 2 + 6px); bottom: calc(var(--fb) / 2 - var(--medal) / 2 + 6px); }
.medal.bc { left: 50%; transform: translateX(-50%); bottom: calc(var(--fb) / 2 - var(--medal) * .35 / 2); width: calc(var(--medal) * .6); height: calc(var(--medal) * .6); }

.in-head { position: relative; z-index: 2; display: flex; align-items: center; gap: 24px; padding: clamp(8px, 1.4vh, 14px) var(--pad) clamp(8px, 1.2vh, 12px); border-bottom: 1px solid rgba(216,182,100,.35); }
.in-head .brand { font-size: clamp(24px, 2.2vw, 32px); }

.hero-main {
  position: relative; z-index: 2; flex: 1; min-height: 0; min-width: 0;
  display: grid; grid-template-columns: 1fr 1.08fr; gap: clamp(24px, 3.5vw, 56px); align-items: center;
  padding: clamp(8px, 1.6vh, 26px) var(--pad);
}
.hero-copy h1 { font-family: var(--head); font-weight: 400; font-size: clamp(34px, min(5vw, 6.8vh), 80px); line-height: 1.02; margin: 6px 0 12px; text-shadow: 0 2px 30px rgba(0,0,0,.4); }
.hero-copy h1 em { color: var(--gold-bright); }
.hero-copy .lead { font-size: clamp(15px, min(1.3vw, 2.1vh), 19px); color: var(--ivory-dim); max-width: 31em; }
.lead-short, .lbl-short { display: none; }
.hero-copy .name-card { margin-top: clamp(10px, 2vh, 24px); padding: clamp(12px, 1.8vh, 20px) 20px; }
.hero-copy .name-card label { font-size: clamp(17px, 2.3vh, 21px); margin-bottom: clamp(6px, 1vh, 10px); }
.hero-frame .hero-art { box-shadow: var(--frame), 0 24px 60px rgba(0,0,0,.55); border-radius: 6px; align-self: center; }
.hero-frame .hero-art img { width: 100%; max-height: min(46vh, 520px); object-fit: cover; border-radius: 6px; }

.hero-books {
  position: relative; z-index: 2; display: grid; grid-template-columns: repeat(7, auto); justify-content: center; gap: clamp(6px, .9vw, 14px); align-items: end; min-width: 0;
  padding: clamp(6px, 1vh, 10px) var(--pad) clamp(16px, 3vh, 34px); border-top: 1px solid rgba(216,182,100,.35);
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.18));
}
.hb { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; }
.hb-day { font-family: var(--head); font-size: clamp(14px, min(1.3vw, 2.2vh), 19px); color: var(--ivory); white-space: nowrap; }
.hb-day::before, .hb-day::after { content: "\2726"; color: var(--gold); font-size: .6em; margin: 0 .55em; vertical-align: .25em; opacity: .85; }
@media (max-height: 900px) and (min-width: 601px) { .hero-copy .hint { display: none; } }
.hb img { height: clamp(90px, 22vh, 250px); width: auto; max-width: 100%; object-fit: contain; border-radius: 3px; box-shadow: 0 10px 24px rgba(0,0,0,.5); transition: transform .25s ease, box-shadow .25s ease; }
.hb:hover img { transform: translateY(-5px) rotate(-1deg); box-shadow: 0 18px 34px rgba(0,0,0,.6); }
.hb:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 4px; border-radius: 4px; }
.hb.tonight .hb-day { color: var(--gold-bright); font-family: var(--head-sc); letter-spacing: .08em; }
.hb.tonight img { box-shadow: 0 0 0 2px var(--gold-bright), 0 0 28px rgba(240,212,138,.45), 0 10px 24px rgba(0,0,0,.5); }


/* slim bar once the first screen has gone */
header.top.slim { position: fixed; left: 0; right: 0; top: 0; transform: translateY(-105%); transition: transform .35s ease; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
header.top.slim.show { transform: none; }

@media (max-width: 980px) {
  .hero-frame { --pad: 34px; }
  .hero-main { grid-template-columns: 1fr; }
  .hero-frame .hero-art { display: none; }
}
@media (max-width: 600px) {
  .hero-frame { --fb: 10px; --medal: 34px; --pad: 18px; }
  .medal.tl, .medal.tr { top: 2px; } .medal.tl, .medal.bl { left: 2px; } .medal.tr, .medal.br { right: 2px; } .medal.bl, .medal.br { bottom: 2px; }
  .medal.bc { display: none; }
  .in-head { padding: 10px var(--pad) 9px 30px; gap: 10px; }
  .in-head .brand { font-size: 20px; }
  .hero-main { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 12px var(--pad) 8px; }
  .hero-frame .hero-art { display: block; order: -1; width: 100%; }
  .hero-frame .hero-art img { max-height: 25dvh; aspect-ratio: 16/9; }
  .hero-copy .eyebrow { display: none; }
  .hero-copy h1 { font-size: clamp(30px, 9vw, 38px); margin: 0 0 6px; }
  .lead-long, .lbl-long, .hero-copy .hint { display: none; }
  .lead-short, .lbl-short { display: inline; }
  .hero-copy .lead { font-size: 15px; }
  .hero-copy .name-card { margin-top: 12px; padding: 12px; }
  .hero-copy .name-card label { font-size: 16px; margin-bottom: 8px; }
  .hero-copy .name-row { flex-direction: row; flex-wrap: nowrap; }
  .hero-copy .name-row input { flex: 1 1 auto; width: auto; padding: .6em .9em; font-size: 16px; }
  .hero-copy .name-row .btn { width: auto; flex: 0 0 auto; padding: .6em 1.1em; }
  .hero-books {
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    padding: 8px var(--pad) 14px; align-items: flex-end;
  }
  .hero-books::-webkit-scrollbar { display: none; }
  .hb { flex: 0 0 auto; scroll-snap-align: start; gap: 4px; }
  .hb-day { font-size: 13px; }
  .hb img { height: clamp(96px, 17dvh, 140px); }
}

/* ---------- story reader ---------- */
.reader-top { position: relative; }
.reader-top .art { max-width: min(1100px, calc(46vh * 1.5 + 40px)); margin: 28px auto 0; padding: 0 20px; }
.reader-top .art img { width: 100%; border-radius: 6px; box-shadow: var(--frame), 0 30px 70px rgba(0,0,0,.5); }
.reader-head { text-align: center; padding: 26px 20px 4px; }
.reader-head h1 { font-family: var(--head); font-weight: 400; font-size: clamp(38px, 5vw, 62px); line-height: 1.05; margin-top: 6px; }
.reader-head .by { color: var(--ivory-dim); margin-top: 10px; }
.listen {
  max-width: 680px; margin: 22px auto 0; display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 14px 18px; border-radius: 999px; border: 1px dashed rgba(216,182,100,.6); color: var(--ivory-dim); font-size: 15px;
}
.paper {
  max-width: 720px; margin: 34px auto 0; padding: 56px clamp(22px, 6vw, 70px) 64px; border-radius: 6px;
  background: #f4ead2; color: #2a2419;
  background-image: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.45), transparent 70%), radial-gradient(ellipse at 50% 120%, rgba(120,80,30,.18), transparent 60%);
  box-shadow: var(--frame), 0 30px 80px rgba(0,0,0,.55);
  font-family: var(--read); font-size: clamp(18px, 2.1vw, 21px); line-height: 1.75;
}
.paper p + p { margin-top: 1em; }
.paper p:first-child::first-letter { font-family: var(--head); float: left; font-size: 3.6em; line-height: .82; padding: 6px 10px 0 0; color: var(--wine); }
.paper .name { color: var(--wine); font-weight: 600; }
.paper .the-end { text-align: center; font-family: var(--head); font-size: 28px; color: var(--wine); margin-top: 1.6em; }
.paper .fade { position: relative; max-height: 30em; overflow: hidden; }
.paper .fade::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12em; background: linear-gradient(180deg, rgba(244,234,210,0), #f4ead2 85%); }
.locked { text-align: center; margin-top: 10px; font-family: var(--ui); }
.locked h3 { font-family: var(--head); font-weight: 400; font-size: 28px; color: var(--wine); }
.locked p { font-size: 16px; margin: 6px 0 16px; color: #4a3f2e; }
.next-nav { max-width: 720px; margin: 30px auto 0; padding: 0 20px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.next-nav a { color: var(--gold); text-decoration: none; font-family: var(--head); font-size: 20px; }

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .hero .page { grid-template-columns: 1fr; padding-top: 40px; gap: 34px; }
  .shelf { grid-template-columns: repeat(2, 1fr); }
  .book.feature { grid-row: auto; }
  .book.feature img { height: auto; min-height: 0; aspect-ratio: 3/2; flex: none; }
  .gift .page { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  nav.links a.hide-sm { display: none; }
  header.top .page { gap: 12px; height: 60px; }
  .brand { font-size: 22px; }
  .steps { grid-template-columns: 1fr; }
  section.block { padding: 60px 0; }
  .waitlist { padding: 30px 20px; }
  .paper, .listen { margin-left: 16px; margin-right: 16px; }
  .listen { border-radius: 16px; }
}
@media (max-width: 520px) {
  .page { padding: 0 16px; }
  .shelf { grid-template-columns: 1fr; gap: 20px; }
  .book.feature { grid-column: auto; grid-row: auto; }
  .book.feature h3 { font-size: 27px; }
  nav.links { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.swipe-hint { display: none; }

/* ---------- phones: most visitors arrive from Instagram / TikTok ---------- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  header.top .page { height: 56px; gap: 10px; }
  .brand { font-size: 21px; }
  nav.links a:not(.btn) { display: none; }
  nav.links .btn.small { padding: .45em 1em; font-size: 14px; }

  .hero .page { display: flex; flex-direction: column-reverse; gap: 22px; padding-top: 18px; padding-bottom: 40px; }
  .hero-art { margin: 0 2px; }
  .eyebrow { font-size: 13px; letter-spacing: .1em; }
  .hero h1 { font-size: 42px; margin: 6px 0 12px; }
  .hero p.lead { font-size: 16.5px; }
  .name-card { margin-top: 20px; padding: 16px; }
  .name-card label { font-size: 19px; }
  .name-row { flex-direction: column; }
  .name-row input, .name-row .btn { width: 100%; justify-content: center; flex: none; }
  .hint { font-size: 13px; }
  .twinkles { opacity: .45; }

  section.block { padding: 48px 0; }
  .sec-head { margin-bottom: 26px; }
  .sec-head h2 { font-size: 32px; }
  .sec-head p { font-size: 15px; }

  /* the seven stories become a swipeable row */
  .shelf {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -16px; padding: 4px 16px 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .shelf::-webkit-scrollbar { display: none; }
  .book, .book.feature { flex: 0 0 82%; scroll-snap-align: center; }
  .book.feature img { height: auto; min-height: 0; aspect-ratio: 3/2; flex: none; }
  .book.feature h3, .book h3 { font-size: 25px; }
  .book.feature .tag, .book .tag { font-size: 15px; }
  .swipe-hint { display: block; text-align: center; font-size: 13px; color: var(--gold); margin-top: 2px; }

  .steps { gap: 12px; }
  .step { padding: 20px 18px; text-align: left; display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; align-items: start; }
  .step::before { width: 40px; height: 40px; font-size: 21px; margin: 2px 0 0; grid-row: span 2; }
  .step h3 { font-size: 22px; margin-bottom: 2px; }
  .step p { font-size: 15px; }

  .gift .page { gap: 24px; }
  .gift img { order: -1; }
  .gift h2 { font-size: 32px; }

  .waitlist { padding: 26px 18px; }

  .reader-top .art { margin-top: 14px; padding: 0 22px; }
  .reader-head { padding: 26px 18px 4px; }
  .reader-head h1 { font-size: 38px; }
  .reader-head .by { font-size: 15px; }
  .listen { font-size: 14px; text-align: center; margin: 18px 14px 0; }
  .paper { margin: 24px 22px 0; padding: 32px 18px 44px; font-size: 18.5px; line-height: 1.7; }
  .next-nav { flex-direction: column; gap: 10px; }
  .next-nav a { font-size: 18px; }
  footer.foot .page { flex-direction: column; gap: 8px; }
}

/* ---------- plans and free trial ---------- */
.plan-box { max-width: 760px; margin: 0 auto; padding: clamp(22px, 4vw, 40px); border-radius: 18px; background: rgba(10,30,21,.75); box-shadow: var(--frame), 0 30px 70px rgba(0,0,0,.45); }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 20px 18px 16px; border-radius: 14px; cursor: pointer;
  border: 2px solid rgba(216,182,100,.35); background: rgba(255,255,255,.03); transition: border-color .2s, background .2s, transform .2s; }
.plan-card:hover { transform: translateY(-1px); }
.plan-card.on { border-color: var(--gold-bright); background: rgba(240,212,138,.08); box-shadow: 0 0 0 4px rgba(240,212,138,.12); }
.plan-card input { position: absolute; opacity: 0; pointer-events: none; }
.plan-card:focus-within { outline: 3px solid var(--gold-bright); outline-offset: 3px; }
.plan-badge { position: absolute; top: -11px; right: 14px; background: var(--gold); color: var(--wine-deep); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.plan-name { font-family: var(--head-sc); color: var(--gold); letter-spacing: .1em; font-size: 15px; }
/* prices in the clean UI face with modern figures: the storybook face's old-style 5 and 9 read badly */
.plan-price { font-family: var(--ui); font-weight: 700; font-size: 32px; line-height: 1.1; color: var(--ivory); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; }
.plan-price small { font-family: var(--ui); font-weight: 400; font-size: 15px; color: var(--ivory-dim); }
.plan-note { font-size: 14px; color: var(--ivory-dim); }

.timeline { list-style: none; margin: 26px 0 8px; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--gold-bright), rgba(216,182,100,.25)); }
.timeline li { position: relative; padding: 0 0 16px 40px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--green-deep); border: 2px solid var(--gold); }
.timeline li:first-child::before { background: var(--gold-bright); box-shadow: 0 0 14px rgba(240,212,138,.6); }
.timeline b { display: block; font-family: var(--head); font-size: 20px; font-weight: 400; color: var(--ivory); }
.timeline span { color: var(--ivory-dim); font-size: 15.5px; }
.timeline em { font-style: normal; color: var(--gold-bright); }

.plan-fields { display: grid; gap: 8px; margin-top: 8px; }
.plan-fields > label { font-size: 15px; color: var(--ivory); }
.plan-fields small { color: var(--ivory-dim); font-size: 13px; }
.plan-fields input[type=text], .plan-fields input[type=email] { width: 100%; padding: .75em 1em; border-radius: 10px; border: 2px solid var(--gold); background: var(--ivory); color: var(--ink); font-size: 17px; }
.plan-fields input[type=text]:focus, .plan-fields input[type=email]:focus { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; font-size: 13.5px; color: var(--ivory-dim); line-height: 1.5; cursor: pointer; }
.consent input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--gold); }

.plan-go { text-align: center; margin-top: 22px; }
.today { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-bottom: 10px; }
.today span { font-family: var(--head-sc); color: var(--gold); letter-spacing: .12em; }
.today b { font-family: var(--ui); font-weight: 700; font-size: 40px; color: var(--gold-bright); line-height: 1; font-variant-numeric: lining-nums; }
.btn.big { font-size: 18px; padding: .9em 2.2em; width: min(100%, 420px); justify-content: center; }
.trust { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 13.5px; color: var(--ivory-dim); }
.trust li::before { content: "\2713"; color: var(--gold); margin-right: 6px; }
.inapp-tip { margin-top: 12px; font-size: 13px; color: var(--gold); }

.included, .faq { max-width: 760px; margin: 40px auto 0; }
.included h3, .faq h3 { font-family: var(--head); font-weight: 400; font-size: 28px; text-align: center; margin-bottom: 14px; }
.included ul { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.included li { padding-left: 30px; position: relative; color: var(--ivory-dim); }
.included li::before { content: "\2726"; position: absolute; left: 4px; color: var(--gold); }
.faq details { border-bottom: 1px solid rgba(216,182,100,.3); padding: 14px 4px; }
.faq summary { cursor: pointer; font-family: var(--head); font-size: 20px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-family: var(--ui); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--ivory-dim); margin-top: 8px; font-size: 15.5px; }
@media (max-width: 600px) {
  .plan-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .plan-card { padding: 16px 12px 12px; }
  .plan-price { font-size: 24px; }
  .plan-price small { white-space: nowrap; }  /* "a year" moves down as one piece only on the tiniest phones */
  .plan-price small { font-size: 13.5px; }
  .plan-note { font-size: 12.5px; }
  .included ul { grid-template-columns: 1fr; }
  .today b { font-size: 34px; }
}

/* ---------- my account ---------- */
.acct { padding-top: 40px; }
.acct-card { background: rgba(10,30,21,.72); border: 1px solid rgba(216,182,100,.4); border-radius: 16px; padding: 26px; }
.acct-card.narrow { max-width: 480px; margin: 20px auto; }
.acct-card.center { text-align: center; max-width: 480px; margin: 40px auto; }
.acct-card h1 { font-family: var(--head); font-weight: 400; font-size: 40px; margin: 4px 0 8px; }
.acct-card h2 { font-family: var(--head); font-weight: 400; font-size: 28px; margin: 2px 0 8px; }
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.muted { color: var(--ivory-dim); }
.stack { display: grid; gap: 10px; margin-top: 18px; }
.stack label { font-size: 14px; color: var(--ivory-dim); }
.stack input { width: 100%; padding: .75em 1em; border-radius: 10px; border: 2px solid var(--gold); background: var(--ivory); color: var(--ink); font-size: 17px; }
.code-input { font-size: 28px !important; letter-spacing: .4em; text-align: center; font-family: var(--ui); }
.stack .btn { justify-content: center; }
.small-print.left { text-align: left; }
.small-print a { color: var(--gold); }
.welcome-banner { text-align: center; padding: 30px 20px 34px; margin-bottom: 22px; border-radius: 18px; background: radial-gradient(ellipse at 50% 0%, rgba(240,212,138,.18), transparent 70%), rgba(10,30,21,.6); box-shadow: var(--frame); }
.welcome-banner h1 { font-family: var(--head); font-weight: 400; font-size: clamp(32px, 5vw, 50px); margin: 6px 0; }
.welcome-banner p { color: var(--ivory-dim); }
.acct-card .btn.big { margin-top: 14px; width: 100%; }
.kids { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 14px; }
.kids li { display: flex; align-items: center; border: 2px solid rgba(216,182,100,.45); border-radius: 999px; overflow: hidden; }
.kids li.on { border-color: var(--gold-bright); background: rgba(240,212,138,.12); }
.kid { background: none; border: 0; color: var(--ivory); font-family: var(--head); font-size: 20px; padding: 6px 6px 6px 16px; cursor: pointer; }
.kid-x { background: none; border: 0; color: var(--ivory-dim); font-size: 20px; padding: 4px 12px 6px 6px; cursor: pointer; }
.kid-x:hover { color: #ffb3b3; }
.kid-add { display: flex; gap: 8px; }
.kid-add input { flex: 1; min-width: 0; padding: .6em .9em; border-radius: 999px; border: 2px solid var(--gold); background: var(--ivory); color: var(--ink); font-size: 16px; }
.btn.ghost { background: transparent; color: var(--ivory); border-color: rgba(216,182,100,.6); margin-top: 8px; }
.timeline.small { margin: 16px 0 14px; }
.timeline.small b { font-size: 17px; }
.timeline.small span { font-size: 14px; }
@media (max-width: 760px) { .acct-grid { grid-template-columns: 1fr; } .acct { padding-top: 20px; } .acct-card { padding: 20px; } }

/* ---------- Darius's player ---------- */
.player { max-width: 720px; margin: 22px auto 0; display: flex; align-items: center; gap: 20px; padding: 14px 16px; border-radius: 18px;
  background: rgba(10,30,21,.8); box-shadow: var(--frame), 0 18px 40px rgba(0,0,0,.4); }
.play, .dark-play { flex: none; width: 64px; height: 64px; border-radius: 50%; border: 2px solid #f6e2a8; cursor: pointer; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold)); box-shadow: 0 0 0 6px rgba(216,182,100,.18), 0 8px 24px rgba(0,0,0,.4); }
.play svg, .dark-play svg { width: 30px; height: 30px; fill: var(--wine-deep); }
.i-pause { display: none; }
body.playing .i-play { display: none; } body.playing .i-pause { display: block; }
.p-mid { flex: 1; min-width: 0; }
.p-label { font-family: var(--head); font-size: 19px; line-height: 1.25; color: var(--ivory); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.p-seek { position: relative; padding: 9px 0; margin: -1px 0 -5px; cursor: pointer; touch-action: none; outline: none; }
.p-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; }
.p-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width .3s linear; }
.p-knob { position: absolute; top: 50%; left: 7px; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(240,212,138,.22); transition: left .3s linear, transform .15s; pointer-events: none; }
.p-seek.drag .p-bar span, .p-seek.drag .p-knob { transition: none; }
.p-seek.drag .p-knob, .p-seek:focus-visible .p-knob { transform: scale(1.3); }
.p-time { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ivory-dim); }
.p-jump { display: flex; gap: 6px; }
.p-mini { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--ivory-dim);
  border-radius: 999px; padding: 4px 6px; font: 500 12.5px var(--ui); cursor: pointer; white-space: nowrap; }
.p-mini svg { width: 14px; height: 14px; fill: var(--gold); }
.p-mini:hover { color: var(--ivory); }
.p-side { display: flex; flex-direction: column; gap: 6px; }
.p-btn { background: transparent; border: 1px solid rgba(216,182,100,.55); color: var(--ivory); border-radius: 999px; padding: 6px 12px; font: 500 13px var(--ui); cursor: pointer; white-space: nowrap; }
.p-btn:hover { border-color: var(--gold-bright); }
.kid-pick { max-width: 720px; margin: 14px auto 0; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; color: var(--ivory-dim); font-size: 14px; }
.kid-pick button { background: none; border: 2px solid rgba(216,182,100,.45); color: var(--ivory); border-radius: 999px; padding: 4px 14px; font-family: var(--head); font-size: 18px; cursor: pointer; }
.kid-pick button.on { border-color: var(--gold-bright); background: rgba(240,212,138,.14); }
.kid-pick .kid-tip { flex-basis: 100%; text-align: center; font-size: 13px; color: var(--ivory-dim); opacity: .8; }
.dark { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.dark-play { opacity: .35; width: 84px; height: 84px; }
.dark-note { color: rgba(255,255,255,.22); font-size: 13px; }
@media (max-width: 600px) {
  .player { margin: 18px 22px 0; flex-wrap: wrap; gap: 12px 18px; }
  .p-side { flex-direction: row; width: 100%; }
  .p-btn { flex: 1; }
  .p-label { font-size: 17px; }
}

/* ---------- privacy and terms ---------- */
.legal { max-width: 760px; padding-top: 44px; }
.legal h1 { font-family: var(--head); font-weight: 400; font-size: clamp(36px, 5vw, 52px); margin: 6px 0 4px; }
.legal h2 { font-family: var(--head); font-weight: 400; font-size: 26px; margin: 30px 0 8px; color: var(--gold-bright); }
.legal p, .legal li { color: var(--ivory-dim); }
.legal ul { padding-left: 20px; display: grid; gap: 8px; }
.legal a { color: var(--gold); }

/* free sample link under the name box */
.hero-sample { display: inline-flex; align-items: center; gap: 12px; margin-top: 14px; text-decoration: none; color: var(--ivory); }
.hero-sample b { display: block; font-family: var(--head); font-weight: 400; font-size: 19px; }
.hero-sample small { display: block; font-size: 13px; color: var(--ivory-dim); }
.hs-play { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--gold); background: rgba(240,212,138,.12); animation: glow 2.6s ease-in-out infinite; }
.hs-play svg { width: 18px; height: 18px; fill: var(--gold-bright); margin-left: 2px; }
.hero-sample:hover b { color: var(--gold-bright); }
@media (max-width: 600px) {
  .hero-sample { margin-top: 8px; gap: 10px; } .hero-sample b { font-size: 16px; } .hero-sample small { display: none; } .hs-play { width: 30px; height: 30px; } .hs-play svg { width: 14px; height: 14px; }
  /* make room for the sample link on short phones */
  body:has(.hero-sample:not([hidden])) .hero-frame .hero-art img { max-height: 20dvh; }
  body:has(.hero-sample:not([hidden])) .hero-copy .name-card { margin-top: 8px; }
}


/* phones: a clear way back (Instagram's browser hides the back button) */
.crumb { display: none; }
@media (max-width: 720px) {
  .crumb { display: inline-block; margin: 12px 16px 0; color: var(--gold); text-decoration: none; font-size: 15px; }
  .acct .crumb { margin: 0 0 10px; }
  .reader-top .art { margin-top: 10px; }
}

/* story page: hold the space for the picture, title and text while they load (no jumping) */
.reader-top .art img { aspect-ratio: 3 / 2; background: #0e2118; }
.reader-head .eyebrow:empty, .reader-head .by:empty { min-height: 1.6em; }
.reader-head h1:empty { min-height: 1.1em; }
.paper:empty { min-height: 70vh; }
.locked h2 { font-family: var(--head); font-weight: 400; font-size: 28px; color: var(--wine); }

/* ---------- cosy sounds under Darius ---------- */
.player { flex-wrap: wrap; }
.cosy { flex: 1 1 100%; margin: 2px 0 -4px; border-top: 1px solid rgba(216,182,100,.2); }
.cosy-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: none; border: 0; cursor: pointer;
  padding: 12px 2px 8px; color: var(--ivory-dim); font: 500 14px var(--ui); letter-spacing: .02em; }
.ct-l, .ct-r { display: inline-flex; align-items: center; gap: 8px; }
.ct-r b { font-family: var(--head); font-weight: 400; font-size: 17px; color: var(--gold-bright); letter-spacing: 0; }
.cosy-toggle:hover .ct-l { color: var(--ivory); }
.cosy-ico, .cosy-chev { width: 16px; height: 16px; fill: var(--gold); }
.cosy-chev { transition: transform .35s ease; }
.cosy.open .cosy-chev { transform: rotate(180deg); }
.cosy-wrap { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .4s ease, opacity .3s ease; }
.cosy.open .cosy-wrap { grid-template-rows: 1fr; opacity: 1; }
.cosy-panel { min-height: 0; overflow: hidden; }
.cosy-panel > :first-child { margin-top: 6px; }
.cosy-panel > :last-child { margin-bottom: 10px; }
.cosy-label { font-family: var(--head); font-size: 18px; color: var(--ivory); }
.cosy-label span { display: block; font-family: var(--ui); font-size: 13px; color: var(--ivory-dim); margin-top: 0; }
.cosy-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cosy-chips button { background: transparent; border: 1px solid rgba(216,182,100,.45); color: var(--ivory); border-radius: 999px; padding: 7px 13px; font: 500 14px var(--ui); cursor: pointer; }
.cosy-chips button[aria-checked="true"] { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--wine-deep); border-color: #f6e2a8; }
.cosy-chips button:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
.cosy-tip { font-size: 13px; color: var(--ivory-dim); margin-top: 10px; opacity: .85; }
@media (max-width: 600px) { .cosy-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; } .cosy-chips button { flex: none; } }

/* ---------- the offer on the first screen (plans on) ---------- */
.offer { margin-top: clamp(12px, 2vh, 24px); display: flex; align-items: center; gap: 18px; flex-wrap: nowrap; }
.offer .btn.big { width: auto; flex: none; font-size: clamp(16px, 2.1vh, 19px); padding: .75em 1.6em; }
.offer-note { font-size: clamp(14px, 1.8vh, 16px); color: var(--ivory-dim); max-width: 17em; line-height: 1.4; }
.offer-note b { color: var(--gold-bright); font-weight: 700; }
.btn.ghost { background: transparent; color: var(--gold-bright); border-color: rgba(216,182,100,.7); }
.btn.ghost:hover { background: rgba(240,212,138,.1); }
.hero-copy .name-card.sample { background: rgba(0,0,0,.14); border-style: dashed; margin-top: clamp(10px, 1.8vh, 20px); padding: clamp(10px, 1.4vh, 14px) 16px; max-width: 34em; }
.hero-copy .name-card.sample label { font-family: var(--ui); font-size: 14px; color: var(--ivory-dim); margin-bottom: 8px; }
.name-card.sample .name-row input, .name-card.sample .name-row .btn { padding-top: .5em; padding-bottom: .5em; font-size: 15px; }
.name-card.sample .hint { display: none; }
.hb { position: relative; }
.hb-free { position: absolute; top: clamp(26px, 3.4vh, 36px); right: -6px; z-index: 1; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--wine-deep); font: 700 12px var(--ui); letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; box-shadow: 0 3px 10px rgba(0,0,0,.4); }
@media (max-width: 600px) {
  .offer { margin-top: 10px; gap: 12px; flex-wrap: nowrap; }
  .offer .btn.big { font-size: 15px; padding: .65em 1.15em; }
  .offer-note { font-size: 13px; line-height: 1.35; }
  body:has(.offer:not([hidden])) .hero-frame .hero-art img { max-height: 17dvh; }
  body:has(.offer:not([hidden])) .hero-main { gap: 8px; }
  .hero-copy .name-card.sample { margin-top: 10px; padding: 9px 10px; }
  .hero-copy .name-card.sample label { font-size: 13px; margin-bottom: 6px; }
  .name-card.sample .name-row input, .name-card.sample .name-row .btn { font-size: 15px; padding: .45em .9em; }
  .hb-free { top: 22px; right: -2px; font-size: 10px; padding: 2px 7px; }
}

/* ---------- premium touch: how everything answers a tap ---------- */
html { -webkit-tap-highlight-color: transparent; }
a, button, summary, label, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
::selection { background: rgba(240,212,138,.35); }
section[id] { scroll-margin-top: 64px; }
.btn, .p-btn, .cosy-chips button, .play, .dark-play, .hello-play, .book, .plan-card, .hb img, .faq summary, .next-nav a, nav.links a, .crumb, footer.foot a {
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease, filter .2s ease, opacity .2s ease;
}
/* phones have no hover, so stop hover lifts sticking after a tap */
@media (hover: none) {
  .hb:hover img, .book:hover, .plan-card:hover, .btn:hover { transform: none; }
}
.btn:active, .p-btn:active, .cosy-chips button:active { transform: scale(.96); filter: brightness(1.08); }
.btn.gold:active { box-shadow: 0 2px 10px rgba(0,0,0,.35), 0 0 0 6px rgba(240,212,138,.2); }
.play:active, .dark-play:active, .hello-play:active { transform: scale(.92); }
.hb:active img { transform: scale(.95); box-shadow: 0 0 0 2px var(--gold-bright), 0 6px 16px rgba(0,0,0,.5); }
.book:active, .plan-card:active { transform: scale(.98); }
.faq summary:active, .next-nav a:active, nav.links a:active, .crumb:active, footer.foot a:active { opacity: .65; }

/* a slow gold glint across the main button, so the eye finds it */
.btn.glint { position: relative; overflow: hidden; isolation: isolate; }
.btn.glint::after {
  content: ""; position: absolute; inset: -2px; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,250,230,.75) 50%, transparent 65%);
  transform: translateX(-120%); animation: glint 5.5s ease-in-out 1.2s infinite;
}
@keyframes glint { 0%, 70% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }

/* the play button breathes softly while Darius reads */
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 6px rgba(240,212,138,.12), 0 8px 24px rgba(0,0,0,.4); } 50% { box-shadow: 0 0 0 14px rgba(240,212,138,.06), 0 8px 30px rgba(240,212,138,.25); } }
body.playing .play { animation: breathe 4s ease-in-out infinite; }
/* while Darius gets ready (a few seconds on a child's first play): a slow gold ring turns round the play button */
.play { position: relative; }
body.getting-ready .play::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid transparent;
  border-top-color: var(--gold-bright); animation: spin 1.1s linear infinite; }
@media (prefers-reduced-motion: reduce) { body.getting-ready .play::after { animation-duration: 3s; } }

/* FAQ answers glide open instead of jumping */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq details::details-content { height: 0; overflow: hidden; transition: height .32s ease, content-visibility .32s allow-discrete; }
  .faq details[open]::details-content { height: auto; }
}
.faq summary::after { transition: transform .25s ease; }
.faq details[open] summary::after { transform: rotate(180deg); }

/* comfortable thumb-sized targets on phones */
@media (max-width: 600px) {
  .faq summary { min-height: 44px; align-items: center; font-size: 18px; }
  .p-btn { min-height: 44px; font-size: 14px; }
  .cosy-chips button { min-height: 40px; }
  /* "15s", "Start again" and the bar look the same but catch a sleepy thumb from further away */
  .p-mini { position: relative; font-size: 13.5px; }
  .p-mini::after { content: ""; position: absolute; inset: -11px -4px; }
  .p-seek { padding: 15px 0; margin: -7px 0 -11px; }
  .crumb { padding: 8px 0; }
  .next-nav a { display: inline-flex; align-items: center; min-height: 44px; }
  footer.foot a { display: inline-block; padding: 8px 0; }
  .name-card.sample .name-row input { font-size: 16px; } /* 16px stops iPhone zooming in on tap */
}

/* ---------- the phone dock: the offer stays one thumb away ---------- */
.dock { display: none; }
@media (max-width: 600px) {
  .dock {
    display: flex; align-items: center; gap: 12px; position: fixed; left: 10px; right: 10px; z-index: 30;
    bottom: max(10px, env(safe-area-inset-bottom)); padding: 10px 10px 10px 16px; border-radius: 18px;
    background: rgba(13,30,22,.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    box-shadow: 0 0 0 1px rgba(216,182,100,.55), 0 14px 40px rgba(0,0,0,.55);
    transform: translateY(140%); opacity: 0; transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .3s ease; pointer-events: none;
  }
  .dock[hidden] { display: none; }
  .dock.show { transform: none; opacity: 1; pointer-events: auto; }
  .dock-note { flex: 1; font-size: 13px; line-height: 1.3; color: var(--ivory-dim); }
  .dock-note b { display: block; color: var(--ivory); font-family: var(--head); font-weight: 400; font-size: 17px; }
  .dock .btn { flex: none; padding: .7em 1.2em; font-size: 15px; }
  /* the back-to-top arrow rises to sit just above the dock while it's up */
  body .to-top { transition: opacity .4s cubic-bezier(.25,.1,.25,1), transform .4s cubic-bezier(.25,.1,.25,1), bottom .45s cubic-bezier(.2,.8,.2,1); }
  body:has(.dock.show) .to-top { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 84px); }
  body:has(.dock:not([hidden])) footer.foot { padding-bottom: 96px; }
}


/* ---------- volume: Darius and the cosy sounds, each on its own slider ---------- */
.mixer { margin-top: 14px; display: grid; gap: 12px; max-width: 520px; }
.mix, .mix-note { display: grid; grid-template-columns: 104px 1fr; align-items: center; gap: 12px; margin: 0; }
.mix[hidden], .mix-note[hidden] { display: none; }
.mix-name { font-family: var(--head); font-size: 17px; color: var(--ivory); }
.mix-note { font-size: 14px; color: var(--ivory-dim); }
.mix-track { display: grid; gap: 4px; }
.mix-steps { display: flex; justify-content: space-between; font-size: 12px; color: var(--ivory-dim); }
.mixer input[type=range] {
  --fill: 100%; -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0;
}
.mixer input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--gold) var(--fill), rgba(255,255,255,.14) var(--fill)); }
.mixer input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--gold) var(--fill), rgba(255,255,255,.14) var(--fill)); }
.mixer input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold)); border: 2px solid #f6e2a8;
  box-shadow: 0 2px 8px rgba(0,0,0,.45); transition: transform .15s ease;
}
.mixer input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--gold-bright); border: 2px solid #f6e2a8; }
.mixer input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }
.mixer input[type=range]:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 4px; border-radius: 8px; }
@media (max-width: 600px) { .mix, .mix-note { grid-template-columns: 92px 1fr; } .mix-name { font-size: 16px; } }

/* ---------- phones: give the first screen room to breathe (it may scroll a little) ---------- */
.spin { display: inline-block; width: 1.05em; height: 1.05em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; vertical-align: -.18em; }
@keyframes spin { to { transform: rotate(360deg); } }
.name-row .btn.busy { justify-content: center; }
@media (max-width: 600px) {
  .hero-frame { height: auto; min-height: 100dvh; overflow-x: clip; }
  .in-head { padding-top: 14px; padding-bottom: 13px; }
  .hero-main { justify-content: flex-start; gap: 22px; padding: 22px var(--pad) 26px; }
  .hero-frame .hero-art img { max-height: none; }
  body:has(.offer:not([hidden])) .hero-frame .hero-art img, body:has(.hero-sample:not([hidden])) .hero-frame .hero-art img { max-height: none; }
  body:has(.offer:not([hidden])) .hero-main { gap: 22px; }
  .hero-copy h1 { font-size: clamp(32px, 9.4vw, 40px); line-height: 1.08; margin: 0 0 12px; }
  .hero-copy .lead { font-size: 16px; line-height: 1.55; }
  .hero-copy .name-card { margin-top: 22px; padding: 18px 16px; }
  .hero-copy .name-card label { font-size: 18px; margin-bottom: 12px; }
  .hero-copy .name-row { gap: 10px; }
  .hero-copy .name-row input { min-width: 0; }
.hero-main > .hero-copy { min-width: 0; max-width: 100%; }
.hero-copy .name-row input { flex-basis: 0; }
  .hero-copy .name-row .btn { min-width: 92px; justify-content: center; }
  .offer { margin-top: 20px; }
  .hero-copy .name-card.sample { margin-top: 20px; padding: 14px; }
  .hero-books { gap: 14px; padding: 18px var(--pad) 26px; }
  .hb { gap: 8px; }
  .hb img { height: clamp(120px, 20dvh, 160px); }
  .hello { padding: 16px; }
  .hello-acts { flex-wrap: wrap; white-space: normal; gap: 8px 16px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- account page: profile header, side menu, settings rows ---------- */
.profile { display: flex; align-items: center; gap: 18px; padding: 8px 0 24px; border-bottom: 1px solid rgba(216,182,100,.3); margin-bottom: 26px; }
.avatar { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-family: var(--head); font-size: 32px; color: var(--wine-deep); background: linear-gradient(180deg, var(--gold-bright), var(--gold)); box-shadow: 0 0 0 3px var(--green-deep), 0 0 0 4px rgba(216,182,100,.6); }
.profile-main { flex: 1; min-width: 0; }
.profile h1 { font-family: var(--head); font-weight: 400; font-size: clamp(30px, 4vw, 42px); margin: 0; line-height: 1.1; }
.profile-email { color: var(--ivory-dim); margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { flex: none; font: 700 13px var(--ui); letter-spacing: .03em; padding: 6px 12px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.pill:empty { display: none; }
.pill.ok { color: #bfe3c6; border-color: rgba(150,210,160,.55); background: rgba(90,160,110,.15); }
.pill.off { color: var(--ivory-dim); border-color: rgba(216,182,100,.4); }
.pill.warn { color: #ffc9bd; border-color: rgba(255,150,130,.6); background: rgba(160,50,40,.2); }
.acct-layout { display: grid; grid-template-columns: 200px 1fr; gap: 36px; align-items: start; }
.acct-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.acct-nav a { color: var(--ivory-dim); text-decoration: none; padding: 10px 14px; border-radius: 10px; border-left: 3px solid transparent; font-size: 16px; }
.acct-nav a:hover { color: var(--ivory); background: rgba(240,212,138,.06); }
.acct-nav a.on { color: var(--gold-bright); background: rgba(240,212,138,.09); border-left-color: var(--gold-bright); }
.acct-body { display: grid; gap: 22px; min-width: 0; }
.acct-sec { background: rgba(10,30,21,.72); border: 1px solid rgba(216,182,100,.35); border-radius: 16px; padding: 24px 26px; scroll-margin-top: 84px; }
.sec-title { font-family: var(--head); font-weight: 400; font-size: 26px; margin: 0 0 6px; }
.sec-sub { margin: 0 0 6px; }
.row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid rgba(216,182,100,.18); }
.sec-title + .row { margin-top: 10px; }
.row-label { color: var(--gold); font-family: var(--head-sc); letter-spacing: .06em; font-size: 15px; padding-top: 2px; }
.row-value > b { font-family: var(--head); font-weight: 400; font-size: 21px; color: var(--ivory); display: block; overflow-wrap: anywhere; }
.row-value p { margin: 4px 0 0; }
.row-value a { color: var(--gold-bright); }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-top: 14px; border-top: 1px solid rgba(216,182,100,.18); }
.row-actions .small-print { margin: 0; flex: 1 1 220px; }
.tonight-sec { background: radial-gradient(ellipse at 0% 0%, rgba(240,212,138,.14), transparent 60%), rgba(10,30,21,.72); }
.tonight-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.tonight-row h2 { font-family: var(--head); font-weight: 400; font-size: 30px; margin: 2px 0 4px; }
.tonight-row p { margin: 0; }
.tonight-row .btn { flex: none; padding: .8em 1.8em; font-size: 17px; }
.kids li.empty { border: none; color: var(--ivory-dim); font-size: 15px; }
@media (max-width: 760px) {
  .profile { gap: 14px; padding-bottom: 18px; margin-bottom: 0; flex-wrap: wrap; }
  .avatar { width: 52px; height: 52px; font-size: 26px; }
  .profile-main { flex: 1 1 calc(100% - 66px); }
  .profile-email { white-space: normal; overflow-wrap: anywhere; }
  .pill { order: 3; margin-left: 66px; }
  .acct-layout { grid-template-columns: 1fr; gap: 16px; }
  .acct-nav { position: sticky; top: 0; z-index: 5; flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 4px; margin: 0 -16px; padding: 10px 16px; background: rgba(14,33,24,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(216,182,100,.25); }
  .acct-nav::-webkit-scrollbar { display: none; }
  .acct-nav a { flex: none; border-left: none; border-bottom: 2px solid transparent; border-radius: 8px; padding: 8px 12px; font-size: 15px; }
  .acct-nav a.on { border-bottom-color: var(--gold-bright); }
  .acct-sec { padding: 20px 18px; scroll-margin-top: 64px; }
  .row { grid-template-columns: 1fr; gap: 4px; padding: 14px 0; }
  .tonight-row { flex-direction: column; align-items: stretch; }
  .tonight-row .btn { width: 100%; justify-content: center; }
  .row-actions .btn { width: 100%; justify-content: center; }
}

/* first screen: grow taller instead of squashing when the window is short (no overlaps) */
.hero-frame { height: auto; min-height: 100vh; min-height: 100dvh; }
.hero-main { padding-top: clamp(14px, 2.4vh, 30px); padding-bottom: clamp(18px, 3vh, 34px); }
.hero-books { padding-top: clamp(12px, 1.8vh, 18px); }
.hb img { height: clamp(150px, 22vh, 250px); }
html { overflow-x: clip; } /* the corner medals poke a few pixels past the edge; never let that make the page scroll sideways */

/* gift question form */
.gift-form { margin-top: 18px; display: grid; gap: 12px; max-width: 560px; padding: 18px; border-radius: 14px; background: rgba(0,0,0,.2); border: 1px solid rgba(216,182,100,.45); }
.gift-form[hidden] { display: none; }
.gf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gift-form label { display: grid; gap: 6px; font-size: 15px; color: var(--ivory); }
.gift-form small { color: var(--ivory-dim); }
.gift-form input, .gift-form textarea { width: 100%; padding: .65em .9em; border-radius: 10px; border: 2px solid var(--gold); background: var(--ivory); color: var(--ink); font: 16px var(--ui); }
.gift-form textarea { resize: vertical; }
.gift-form .btn { justify-self: start; }
.gift-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gf-msg { margin: 0; font-size: 15px; } .gf-msg:empty { display: none; } .gf-msg.err { color: #ffb4a8; }
.gf-done { margin: 0; font-size: 17px; color: var(--gold-bright); }
@media (max-width: 600px) { .gf-row { grid-template-columns: 1fr; } .gift-form .btn { justify-self: stretch; justify-content: center; } }

/* ---------- gifts ---------- */
.gift-code-input { font: 700 22px var(--ui) !important; letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.stack small { color: var(--ivory-dim); opacity: .8; }
.gift-ok { margin: 0; padding: 12px 14px; border-radius: 10px; background: rgba(90,160,110,.15); border: 1px solid rgba(150,210,160,.5); color: #d9f0dd; }
.gift-thanks { text-align: center; color: var(--gold-bright); font-size: 17px; margin: 0 0 18px; }
.gift-cert { max-width: 620px; margin: 0 auto; text-align: center; padding: clamp(28px, 5vw, 48px) clamp(20px, 5vw, 44px); border-radius: 10px; background: radial-gradient(ellipse at 50% 0%, rgba(240,212,138,.16), transparent 65%), #0e2118; box-shadow: var(--frame), 0 24px 60px rgba(0,0,0,.5); }
.gift-cert h1 { font-family: var(--head); font-weight: 400; font-size: clamp(30px, 5vw, 46px); line-height: 1.1; margin: 8px 0 12px; color: var(--ivory); }
.gift-cert h1 em { color: var(--gold-bright); }
.gc-for { font-size: 18px; color: var(--ivory); margin: 0; }
.gc-for:empty { display: none; }
.gc-msg { font-family: var(--head); font-style: italic; font-size: 20px; color: var(--ivory-dim); margin: 16px auto 0; max-width: 28em; }
.gc-code { margin: 24px auto; padding: 16px; border: 2px dashed var(--gold); border-radius: 12px; max-width: 360px; }
.gc-code span { display: block; font-family: var(--head-sc); letter-spacing: .14em; color: var(--gold); font-size: 14px; }
.gc-code b { display: block; font: 700 clamp(24px, 5vw, 32px) var(--ui); letter-spacing: .1em; color: var(--gold-bright); margin-top: 4px; }
.gc-how { font-size: 15px; color: var(--ivory-dim); margin: 0; line-height: 1.6; }
@media print {
  .no-print, header.top, footer.foot, .band, .crumb, #g-redeem, .dock { display: none !important; }
  body, html { background: #fff !important; }
  .gift-cert { box-shadow: none; border: 3px double #b8933f; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* buying a gift on the homepage */
.gift-buy { margin-top: 20px; display: grid; gap: 12px; max-width: 560px; }
.gift-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gift-opt { position: relative; display: block; cursor: pointer; padding: 14px 16px; border-radius: 14px; border: 2px solid rgba(216,182,100,.45); background: rgba(0,0,0,.18); }
.gift-opt input { position: absolute; opacity: 0; }
.gift-opt b { display: block; font-family: var(--head); font-weight: 400; font-size: 22px; color: var(--ivory); }
.gift-opt span { color: var(--gold-bright); font-weight: 700; font-size: 18px; }
.gift-opt small { display: block; color: var(--ivory-dim); font-size: 13px; margin-top: 2px; }
.gift-opt:has(input:checked) { border-color: var(--gold-bright); background: rgba(240,212,138,.12); box-shadow: 0 0 0 1px var(--gold-bright); }
.gift-opt:has(input:focus-visible) { outline: 3px solid var(--gold-bright); outline-offset: 2px; }
.gift-buy .gf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gift-buy label { display: grid; gap: 6px; font-size: 15px; color: var(--ivory); }
.gift-buy label small { color: var(--ivory-dim); }
.gift-buy input, .gift-buy textarea { width: 100%; padding: .65em .9em; border-radius: 10px; border: 2px solid var(--gold); background: var(--ivory); color: var(--ink); font: 16px var(--ui); }
.gift-buy .btn { justify-self: start; }
.gift-links { font-size: 15px; color: var(--ivory-dim); margin: 6px 0 0; }
.gift-links a, .gift-links button { color: var(--gold-bright); background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 600px) { .gift-opts, .gift-buy .gf-row { grid-template-columns: 1fr; } .gift-buy .btn { justify-self: stretch; justify-content: center; } }
.gift-buy label, .gift-form label { display: block; }
.gift-buy label input, .gift-buy label textarea, .gift-form label input, .gift-form label textarea { margin-top: 6px; }

/* ---------- polish pass: calmer, neater first screen ---------- */
.offer-note { max-width: none; line-height: 1.5; }
.hero-copy .name-card.sample { border: 1px solid rgba(216,182,100,.28); border-style: solid; background: linear-gradient(180deg, rgba(240,212,138,.06), rgba(0,0,0,.12)); border-radius: 16px; }
.hero-copy .name-card.sample label { display: flex; align-items: center; gap: 8px; color: var(--ivory); font-size: 14.5px; }
.hero-copy .name-card.sample label::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6v12l9-6z' fill='%23431018'/%3E%3C/svg%3E") center/12px no-repeat; }
.hero-copy .name-row { align-items: stretch; }
.hero-copy .name-row input, .hero-copy .name-row .btn { height: 50px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; }
.hero-copy .name-row .btn { display: inline-flex; align-items: center; }
.hero-copy .name-card.sample .name-row input, .hero-copy .name-card.sample .name-row .btn { height: 46px; padding-top: 0; padding-bottom: 0; }
.in-head .brand { letter-spacing: .005em; }
.hero-copy h1 { letter-spacing: -.005em; }
@media (max-width: 600px) {
  .hero-copy .name-card.sample .name-row input, .hero-copy .name-card.sample .name-row .btn { height: 48px; }
  .offer-note { font-size: 13.5px; }
}
.hero-copy .name-row { align-items: center; } .hero-copy .name-row input, .hero-copy .name-row .btn { margin: 0; }
/* phones: the main button full width, prices in one calm line underneath */
@media (max-width: 600px) {
  .offer { flex-direction: column; align-items: stretch; gap: 10px; flex-wrap: nowrap; }
  .offer .btn.big { width: 100%; justify-content: center; font-size: 17px; padding: .85em 1em; }
  .offer-note { text-align: center; font-size: 13.5px; color: var(--ivory-dim); }
  .offer-note b { color: var(--gold-bright); }
}

/* ---------- phone polish 2 ---------- */
.gift-links { display: grid; gap: 6px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a[hidden] { display: none; }
@media (max-width: 600px) {
  .gift-opts { grid-template-columns: 1fr 1fr; gap: 10px; }
  .gift-opt { padding: 12px; text-align: center; }
  .gift-opt b { font-size: 19px; }
  .gift-opt small { font-size: 12px; }
  .gift-links { text-align: center; }
  .foot-links { gap: 2px 18px; }
  footer.foot { padding-top: 28px; }
  footer.foot .page { gap: 10px; }
  body:has(.dock:not([hidden])) footer.foot { padding-bottom: 104px; }
}
.gift-buy .gift-opt input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: 0; border: 0; opacity: 0; }

/* a missed "I'd like the stories straight away" tick: glow the box so it's obvious what to do */
.consent { border-radius: 10px; transition: background .3s, box-shadow .3s; }
.consent.need { background: rgba(216,182,100,.12); box-shadow: 0 0 0 2px var(--gold); padding: 10px; animation: nudge .4s ease 2; }
.consent.need input { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
@keyframes nudge { 0%,100% { transform: none; } 30% { transform: translateX(-5px); } 70% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .consent.need { animation: none; } }
/* tick boxes in the house style (gold outline, gold when ticked) */
.consent input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border: 2px solid var(--gold); border-radius: 6px; background: rgba(0,0,0,.25); display: grid; place-content: center; cursor: pointer; margin-top: 1px; }
.consent input[type=checkbox]::after { content: ""; width: 11px; height: 6px; border: solid var(--wine); border-width: 0 0 3px 3px; transform: rotate(-45deg) translate(1px,-1px); opacity: 0; }
.consent input[type=checkbox]:checked { background: var(--gold); }
.consent input[type=checkbox]:checked::after { opacity: 1; }
.consent input[type=checkbox]:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

/* the invitation under "The End" of the free story */
.locked.after { margin-top: 28px; padding-top: 26px; border-top: 1px solid rgba(125,26,40,.25); }
/* tablets upright (iPad etc.): show the bedtime picture above the words instead of leaving the space empty */
@media (min-width: 601px) and (max-width: 980px) and (min-height: 700px) {
  .hero-frame .hero-art { display: block; order: -1; width: 100%; max-width: 640px; justify-self: start; }
  .hero-frame .hero-art img { max-height: 30vh; aspect-ratio: 16/9; }
  .hero-main { gap: 22px; }
}
/* phones turned sideways / short wide windows: picture on the right instead of an empty half */
@media (min-width: 640px) and (max-width: 980px) and (max-height: 699px) and (min-aspect-ratio: 4/3) {
  .hero-main { grid-template-columns: 1.15fr 1fr; align-items: start; }
  .hero-frame .hero-art { display: block; align-self: start; margin-top: 8px; }
  .hero-frame .hero-art img { max-height: 62vh; aspect-ratio: 4/5; }
}
.hero-copy .offer .btn { max-width: 100%; white-space: normal; text-wrap: balance; text-align: center; justify-content: center; gap: .4em; }

.back-note { margin: 10px auto 0; max-width: 420px; padding: 10px 14px; border-radius: 10px; background: rgba(216,182,100,.12); border: 1px solid rgba(216,182,100,.45); color: var(--ivory); font-size: 14.5px; text-align: center; }
/* the smallest phones (iPhone SE, 320px): let the name box shrink, and fit the header */
.name-row input { min-width: 0; }
@media (max-width: 360px) {
  .in-head .brand, header.top .brand { font-size: 16px; }
  .in-head .brand .tm, header.top .brand .tm { display: none; }
  .in-head { padding-left: 14px !important; padding-right: 12px !important; gap: 6px !important; }
  .in-head .links { gap: 7px; }
  .in-head .links a.btn.small, header.top .links a.btn.small { padding: .45em .7em !important; font-size: 12.5px !important; }
  .hero-copy .name-row .btn { padding: .6em .8em; }
}

#plan-email-wrap { margin-bottom: 12px; } #plan-email-wrap label { display: block; margin-bottom: 6px; }
/* phones: the swipeable book row fades softly at both edges. Fixed (no scripting), so iPhones always draw it;
   the extra end padding means the first and last books sit clear of the fade once you reach them */
@media (max-width: 600px) {
  .hero-books { padding-left: 56px; padding-right: 56px; scroll-padding-inline: 56px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%); }
  /* the row glides with momentum after a flick and settles softly with a book in the middle */
  .hero-books { justify-content: flex-start; scroll-snap-type: x mandatory; scroll-padding-inline: 0; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    padding-left: calc(50% - 60px); padding-right: calc(50% - 60px); }
  .hero-books .hb { scroll-snap-align: center; scroll-snap-stop: normal; }
  .hero-books.alive .hb { --near: 1; transform: scale(calc(.9 + .1 * var(--near))); opacity: calc(.62 + .38 * var(--near));
    transform-origin: 50% 100%; will-change: transform, opacity; }
}
/* phones: give the first screen room to breathe. Centre the headline block to match the centred button and price,
   break the headline as a phrase ("Bedtime stories, / read by Darius"), and open up the space under the picture */
@media (max-width: 600px) {
  .hero-copy { text-align: center; }
  .hero-copy h1 { margin: 14px 0 10px; line-height: 1.1; text-wrap: balance; }
  .hero-copy .lead { margin-left: auto; margin-right: auto; max-width: 30ch; text-wrap: balance; }
  .hero-copy .name-card { text-align: left; }
}
.ph-br { display: none; } @media (max-width: 600px) { .ph-br { display: inline; } }


/* members' hero: "Tonight: <title>" under the play button */
.tonight-title { margin: 10px 0 0; color: var(--ivory-dim); font-size: 15px; }
.tonight-title::first-line { color: var(--ivory-dim); }
.hero-copy .offer:has(.tonight-title) { flex-direction: column; align-items: flex-start; }
@media (max-width: 600px) { .hero-copy .offer:has(.tonight-title) { align-items: stretch; } .tonight-title { text-align: center; } }
/* desktop headline: don't leave "Darius" alone on the second line */
.hero-copy h1 { text-wrap: balance; }
.hero-copy .offer:has(.tonight-title) { gap: 0; } .tonight-title { margin-top: 12px; }

/* ---------- library ---------- */
.lib { padding-top: 26px; padding-bottom: 70px; max-width: 1100px; }
.lib .sec-head h1 { font-family: var(--head); font-weight: 400; font-size: clamp(34px, 5vw, 54px); line-height: 1.1; margin: 6px 0 0; }
.lib-sec { margin-top: 54px; }
.lib-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 22px; border-bottom: 1px solid rgba(216,182,100,.3); }
.lib-head h2 { font-family: var(--head); font-weight: 400; font-size: 30px; margin: 0; color: var(--ivory); }
.lib-head span { color: var(--ivory-dim); font-size: 15px; }

/* tonight: the feature card */
.lib-tonight { display: grid; grid-template-columns: 1.15fr 1fr; margin-top: 34px; border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--ivory);
  border: 1px solid var(--gold); background: linear-gradient(135deg, #5a0f1b, #3d0a13); box-shadow: 0 0 0 4px rgba(216,182,100,.12), 0 24px 60px rgba(0,0,0,.45); }
.lib-tonight img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; display: block; }
.lt-body { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 34px 36px; }
.lt-eye { font-family: var(--head-sc); letter-spacing: .1em; color: var(--gold-bright); font-size: 15px; }
.lt-title { font-family: var(--head); font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; }
.lt-blurb { color: var(--ivory-dim); font-size: 16px; line-height: 1.55; }
.lt-play { align-self: flex-start; margin-top: 8px; }
.lt-mins { color: var(--gold); font-size: 14px; }
.lib-tonight:hover .lt-play { filter: brightness(1.06); }

/* the week: seven covers in a row */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 16px; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--ivory); }
.wk-day { font-family: var(--head); font-size: 17px; white-space: nowrap; }
.wk.on .wk-day { color: var(--gold-bright); font-family: var(--head-sc); letter-spacing: .08em; }
.wk-cover { position: relative; display: block; width: 100%; }
.wk-cover img { width: 100%; height: auto; display: block; border-radius: 4px; box-shadow: 0 10px 24px rgba(0,0,0,.5); transition: transform .25s ease; }
.wk:hover .wk-cover img { transform: translateY(-5px); }
.wk.on .wk-cover img { box-shadow: 0 0 0 2px var(--gold-bright), 0 0 26px rgba(240,212,138,.45), 0 10px 24px rgba(0,0,0,.5); }
.wk-free { position: absolute; top: -8px; right: -6px; z-index: 1; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--wine-deep);
  font: 700 11px var(--ui); letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; box-shadow: 0 3px 10px rgba(0,0,0,.4); }
.wk-mins { color: var(--ivory-dim); font-size: 13px; }

/* new stories: a list */
.lib-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.li { display: flex; gap: 16px; align-items: center; padding: 12px; border-radius: 14px; text-decoration: none; color: var(--ivory);
  border: 1px solid rgba(216,182,100,.3); background: rgba(14,33,24,.5); transition: border-color .2s; }
.li:hover { border-color: var(--gold); }
.li img { width: 150px; height: 100px; object-fit: cover; border-radius: 8px; flex: none; }
.li-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.li-eye { font-size: 13px; color: var(--ivory-dim); } .li-eye b { color: var(--gold-bright); }
.li-title { font-family: var(--head); font-size: 22px; line-height: 1.2; }
.li-blurb { font-size: 14px; color: var(--ivory-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.li-mins { font-size: 13px; color: var(--gold); }

@media (max-width: 900px) {
  .lib-tonight { grid-template-columns: 1fr; } .lib-tonight img { min-height: 0; aspect-ratio: 3/2; } .lt-body { padding: 22px 22px 26px; }
  .week { grid-template-columns: repeat(4, 1fr); row-gap: 26px; }
  .lib-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .lib-sec { margin-top: 40px; } .lib-head h2 { font-size: 25px; } .lib-head span { font-size: 13px; }
  .lt-play { align-self: stretch; justify-content: center; }
  /* the week glides with momentum, settles softly with a book in the middle and loops (loopRow in app.js) */
  .week { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px;
    padding: 10px calc(50% - 64px) 6px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%); }
  .week::-webkit-scrollbar { display: none; }
  .wk { flex: 0 0 128px; scroll-snap-align: center; scroll-snap-stop: normal; }
  .week.alive .wk { --near: 1; transform: scale(calc(.9 + .1 * var(--near))); opacity: calc(.62 + .38 * var(--near));
    transform-origin: 50% 100%; will-change: transform, opacity; }
  .li img { width: 104px; height: 72px; } .li-title { font-size: 19px; }
}

/* homepage: the newest story, above the seven */
.new-story { display: flex; align-items: center; gap: 16px; max-width: 640px; margin: 0 auto 26px; padding: 12px; border-radius: 14px; text-decoration: none; color: var(--ivory);
  border: 1px solid var(--gold); background: rgba(14,33,24,.6); box-shadow: 0 0 0 4px rgba(216,182,100,.12); }
.new-story[hidden] { display: none; }
.new-story img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; flex: none; }
.new-story > span { display: flex; flex-direction: column; gap: 2px; }
.ns-tag { font: 700 12px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-bright); }
.new-story b { font-family: var(--head); font-weight: 400; font-size: 22px; line-height: 1.2; }
.ns-more { font-size: 14px; color: var(--ivory-dim); }
.ns-lib { text-decoration: underline; }
@media (max-width: 600px) { .shelf.lib-shelf .book h3 { font-size: 19px; } .shelf.lib-shelf .book .tag { display: none; } .shelf.lib-shelf .book .meta { padding: 10px 12px 12px; } }
.wk-cover { aspect-ratio: 420 / 568; position: relative; } .wk-cover img { position: absolute; bottom: 0; left: 50%; height: 97%; width: auto; max-width: none; translate: -50% 0; }

/* library: padlocks for visitors on the members-only stories */
.wk-lock { display: none; }
.lib-visitor .wk-lock { display: grid; place-items: center; position: absolute; top: -8px; right: -6px; z-index: 1; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(14,33,24,.92); border: 1px solid var(--gold); font-size: 12px; box-shadow: 0 3px 10px rgba(0,0,0,.4); }

/* homepage books: padlocks for visitors on the members-only stories */
.hb-lock { display: none; }
.visitor .hb-lock { display: grid; place-items: center; position: absolute; top: clamp(26px, 3.4vh, 36px); right: -6px; z-index: 1; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(14,33,24,.92); border: 1px solid var(--gold); font-size: 12px; box-shadow: 0 3px 10px rgba(0,0,0,.4); }
@media (max-width: 600px) { .visitor .hb-lock { top: 22px; right: -2px; width: 22px; height: 22px; font-size: 10px; } }

/* visitors: members-only stories stay in full colour (they should look tempting, not "not for you"); a small gold
   padlock says members, and tapping one goes to the free-trial sign-up */
.visitor .book.locked-book .meta::after { content: "\1F512  Members only"; font: 600 13px var(--ui); color: var(--gold); margin-top: 6px; }
.story-locked .locked { margin-top: 0; }
.lock-badge { display: inline-block; font: 700 12px var(--ui) !important; letter-spacing: .08em; text-transform: uppercase; color: var(--wine) !important;
  background: rgba(125,26,40,.08); border: 1px solid rgba(125,26,40,.3); padding: 4px 12px; border-radius: 999px; margin: 0 0 10px !important; }
.story-locked #art { filter: grayscale(.4) brightness(.8); }

/* Denver 17 Oct: the first screen has NO tapestry border on phones and tablets (cleaner), but KEEPS it on computers.
   To change, edit the width below or remove "no-border" from <section class="hero-frame no-border"> in stories/index.html. */
@media (max-width: 900px) {
  .hero-frame.no-border { padding: 0; background: none; box-shadow: none; }
  .hero-frame.no-border .medal { display: none; }
  .hero-frame.no-border .tap-inner { border: 0; border-radius: 0; box-shadow: none; }
}
.brand .tm { font-family: var(--ui); font-size: .38em; font-weight: 500; vertical-align: super; margin-left: .15em; color: var(--ivory-dim); letter-spacing: 0; line-height: 0; }

/* every page: the footer sits at the bottom of the screen on short pages (sign in, gift, 404), never halfway up */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body > * { flex-shrink: 0; }
body > main { flex: 1 0 auto; width: 100%; }
/* sign-in (and the brief "opening your account" card): sit in the middle of the screen, not near the top */
main.acct:has(> #v-signin:not([hidden])), main.acct:has(> #v-loading:not([hidden])) { display: flex; flex-direction: column; }
main.acct > #v-signin, main.acct > #v-loading { margin-top: auto; margin-bottom: auto; width: 100%; }

/* ---------- the story page: hidden until "Read along" is tapped, then slides open ---------- */
.p-read { margin-top: 0; }
.p-read .cosy-toggle { padding-top: 12px; }
.p-read.open .cosy-chev { transform: rotate(180deg); }
.scroll { position: relative; max-width: 720px; margin: 34px auto 0; transition: margin .6s ease; }
.scroll-inner { position: relative; overflow: hidden; border-radius: 6px; box-shadow: var(--frame), 0 30px 80px rgba(0,0,0,.55);
  transition: max-height .9s cubic-bezier(.45,.05,.25,1), opacity .6s ease; }
.scroll .paper { margin: 0; max-width: none; box-shadow: none; }
.scroll.is-scroll:not(.open) { margin-top: 0; }
.scroll.is-scroll:not(.open) .scroll-inner { max-height: 0; opacity: 0; }
.scroll-close { display: none; margin: 18px auto 0; background: none; border: 0; cursor: pointer; color: var(--gold); font: 500 14px var(--ui); letter-spacing: .02em; align-items: center; gap: 6px; }
.scroll-close svg { width: 16px; height: 16px; fill: currentColor; }
.scroll-close:hover { color: var(--gold-bright); }
.scroll.open .scroll-close { display: flex; }
#paper-after:empty { display: none; }
#paper-after { max-width: 720px; margin: 40px auto 0; position: relative; }
#paper-after > .locked { margin: 0; padding: 30px 24px; border-top: 0; border-radius: 6px; background: #f4ead2; color: #2a2419; box-shadow: var(--frame), 0 24px 60px rgba(0,0,0,.5); }
#paper-after .share-line { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid rgba(216,182,100,.25); font-size: 14.5px; }
.share-free { background: none; border: 0; padding: 6px 2px; font: inherit; font-weight: 600; color: var(--wine); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tone-night .share-free { color: var(--gold-bright); }
/* Night page: the invite goes dark with it, so nothing bright flashes up in a dark bedroom */
.tone-night #paper-after > .locked { background: #10241a; color: #e6d9bb; }
.tone-night #paper-after > .locked h3, .tone-night #paper-after > .locked h2 { color: var(--gold); }
.tone-night #paper-after > .locked p { color: #d8ccae; }
@media (max-width: 600px) { .scroll, #paper-after { margin-left: 22px; margin-right: 22px; } }
@media (prefers-reduced-motion: reduce) { .scroll-inner, .cosy-wrap { transition: none; } }
/* the big first letter is for the story's opening line only, never the members-only note */
.paper .locked p::first-letter { font: inherit; float: none; padding: 0; color: inherit; line-height: inherit; }
/* night page: the story in soft cream on deep green, kinder at bedtime than bright paper */
.page-tone { display: none; position: absolute; top: 16px; right: 16px; z-index: 2; gap: 2px; padding: 3px; border-radius: 999px;
  background: rgba(125,26,40,.08); border: 1px solid rgba(125,26,40,.22); }
.scroll.is-scroll.open .page-tone { display: flex; }
.page-tone button { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; color: #6b5a40;
  border-radius: 999px; padding: 4px 11px; font: 500 12.5px var(--ui); cursor: pointer; transition: background .25s, color .25s; }
.page-tone svg { width: 13px; height: 13px; fill: currentColor; }
.page-tone button[aria-checked="true"] { background: var(--wine); color: #f6e9cc; }
.page-tone button:focus { outline: none; }
.page-tone button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.scroll.is-scroll.night .page-tone { background: rgba(240,212,138,.06); border-color: rgba(216,182,100,.3); }
.scroll.is-scroll.night .page-tone button { color: var(--ivory-dim); }
.scroll.is-scroll.night .page-tone button[aria-checked="true"] { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--wine-deep); }
.scroll.is-scroll .paper { padding-top: 72px; }
.scroll .paper { transition: background-color .4s ease, color .4s ease; }
.scroll.is-scroll.night .paper { background-color: #10241a; color: #e6d9bb;
  background-image: radial-gradient(ellipse at 50% 30%, rgba(240,212,138,.06), transparent 70%); }
.scroll.is-scroll.night .paper p:first-child::first-letter,
.scroll.is-scroll.night .paper .name,
.scroll.is-scroll.night .paper .the-end { color: var(--gold-bright); }
/* phones up to the big iPhones: a touch smaller so the name, the button and the menu always share one line */
@media (max-width: 430px) {
  header .brand { font-size: 16.5px; min-width: 0; white-space: nowrap; }
  header .brand .tm { display: none; }
  header.top .page, header .page { gap: 6px; padding-left: 14px; padding-right: 12px; }
  nav.links { gap: 7px; }
  nav.links .btn.small { padding: .45em .75em; font-size: 12.5px; }
  .menu-btn { width: 38px; height: 38px; }
}

/* ---------- phone menu: one calm header (name, main button, menu) that never changes as you scroll ---------- */
.menu-btn { display: none; }
@media (max-width: 600px) {
  .menu-btn { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; flex: none;
    width: 42px; height: 42px; margin-left: 2px; border-radius: 50%; background: rgba(10,26,17,.35);
    border: 1px solid rgba(216,182,100,.55); cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .menu-btn i { display: block; width: 16px; height: 1.5px; border-radius: 2px; background: var(--gold-bright); }
  .menu-btn i:nth-child(2) { width: 11px; margin-left: 5px; }
  .menu-btn:active { transform: scale(.94); }
  .menu-btn:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
}
.menu-open, .menu-open body { overflow: hidden; }
/* the phone menu: a quiet panel that slides in from the right as one piece, the page dimmed on the left.
   Premium here means restraint: one smooth movement, small precise type, hairlines, gold only for small labels. */
.wv-menu { position: fixed; inset: 0; z-index: 1000; overflow: hidden; }
.wv-menu::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .4s cubic-bezier(.25,.1,.25,1); }
.wv-menu.open::before { opacity: 1; }
.wv-menu-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 330px; max-width: 86vw; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #17352a 0%, #10271d 100%); border-left: 1px solid rgba(216,182,100,.18); font-family: var(--ui);
  padding-bottom: env(safe-area-inset-bottom); transform: translateX(100%); transition: transform .4s cubic-bezier(.25,.1,.25,1); }
.wv-menu.open .wv-menu-panel { transform: none; }
.wv-menu-panel:focus { outline: none; }
.wv-menu-top { flex: none; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: env(safe-area-inset-top) 20px 0 24px;
  box-sizing: content-box; }
.wv-menu-top .brand { font-size: 18px; text-decoration: none; }
.wv-menu-close { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: none;
  border: 1px solid rgba(255,255,255,.12); color: var(--ivory-dim); transition: border-color .3s, color .3s; }
.wv-menu-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.wv-menu-close:active { color: var(--ivory); border-color: rgba(216,182,100,.4); }
.wv-menu-close:focus { outline: none; }
.wv-menu-close:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.wv-menu-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0 16px; }
.wv-menu-label { margin: 0; padding: 18px 24px 8px; font: 600 11px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
/* tonight's story: a card with its picture and a play button */
.wv-menu-tonight { display: flex; align-items: center; gap: 11px; margin: 12px 12px 6px; padding: 9px; border-radius: 12px; text-decoration: none;
  background: rgba(216,182,100,.09); border: 1px solid rgba(216,182,100,.28); transition: background .3s; }
.wv-menu-tonight:active { background: rgba(216,182,100,.15); }
.wv-menu-tonight img { flex: none; width: 56px; height: 56px; border-radius: 4px; object-fit: cover; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.wv-mt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wv-mt-text small { font: 700 10.5px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.wv-mt-text b { font: 700 15px/1.25 var(--ui); color: var(--ivory); }
.wv-mt-text em { font: 400 12.5px var(--ui); font-style: normal; color: var(--ivory-dim); }
.wv-mt-play { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold)); box-shadow: 0 0 0 4px rgba(216,182,100,.15); }
.wv-mt-play svg { width: 17px; height: 17px; fill: var(--wine-deep); margin-left: 2px; }
.wv-menu-tonight + .wv-menu-label { margin-top: 12px; }
@media (max-width: 360px) { .wv-menu-tonight img { width: 48px; height: 48px; } .wv-mt-play { width: 32px; height: 32px; } .wv-mt-text b { font-size: 14px; } }
.wv-menu-list { display: flex; flex-direction: column; }
/* fine gold hairlines that fade out at both ends, between the rows and under the header / over the buttons */
.wv-menu-list a, .wv-menu-top, .wv-menu-foot { position: relative; }
.wv-menu-list a:not(:last-child)::after, .wv-menu-top::after, .wv-menu-foot::before { content: ""; position: absolute; left: 24px; right: 24px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, rgba(216,182,100,0), rgba(216,182,100,.38) 22%, rgba(240,212,138,.5) 50%, rgba(216,182,100,.38) 78%, rgba(216,182,100,0)); }
.wv-menu-list a:not(:last-child)::after, .wv-menu-top::after { bottom: 0; }
.wv-menu-foot::before { top: 0; }
.wv-menu-top::after, .wv-menu-foot::before { left: 0; right: 0; }
.wv-menu-list a { display: block; padding: 16px 24px; font: 500 16px var(--ui); letter-spacing: -.01em; color: var(--ivory-dim); text-decoration: none;
  transition: color .3s, background .3s; }
.wv-menu-list a:active, .wv-menu-tonight:active b { color: var(--gold-bright); }
.wv-menu-list a:active { background: rgba(216,182,100,.05); }
.wv-menu-foot { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 20px 24px; }
.wv-menu-foot .btn, .wv-menu-foot .btn-line { display: flex; justify-content: center; align-items: center; width: 100%; min-height: 44px; padding: 0 20px;
  font-size: 14px; box-sizing: border-box; }
.wv-menu-foot .btn.gold { border-width: 1px; box-shadow: none; font-weight: 600; }
.btn-line { border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: none; color: var(--ivory); font: 500 14px var(--ui);
  text-decoration: none; cursor: pointer; transition: border-color .3s, color .3s; }
.btn-line:active { border-color: rgba(216,182,100,.45); color: var(--gold-bright); }
.wv-menu-signout:disabled { opacity: .6; }
@media (prefers-reduced-motion: reduce) { .wv-menu::before, .wv-menu-panel { transition: none; } }


/* nothing decorative (medallions on the frame edge, sparkles) may ever push the page sideways */
html, body { overflow-x: clip; }

/* keyboard focus in the brand gold, never the browser blue */
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

/* back to the top: a small, quiet button that appears once you're a good way down the page */
.to-top { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 60; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--gold-bright);
  background: rgba(16,39,29,.88); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(216,182,100,.4); box-shadow: 0 10px 28px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .4s cubic-bezier(.25,.1,.25,1), transform .4s cubic-bezier(.25,.1,.25,1); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.to-top:active { transform: scale(.94); }
.to-top:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
.menu-open .to-top { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* computers: the week's books rise gently into place one after another as the page opens */
@media (min-width: 601px) {
  .hero-books.await .hb { opacity: 0; transform: translateY(26px); }
  .hero-books.await.arrive .hb { opacity: 1; transform: none;
    transition: opacity .9s ease, transform 1.2s cubic-bezier(.16,1,.3,1); transition-delay: calc(var(--i, 0) * 90ms); }
}

/* sections drift up softly as they come into view (auth.js adds .rise only to parts still below the screen) */
.rise { opacity: 0; transform: translateY(34px); }
.rise.risen { opacity: 1; transform: none;
  transition: opacity 1s ease, transform 1.3s cubic-bezier(.16,1,.3,1); transition-delay: calc(var(--rise-i, 0) * 110ms); }
@media (prefers-reduced-motion: reduce) { .rise { opacity: 1; transform: none; } }

/* ---------- overnight polish (19 Oct) ---------- */
/* phones: every cosy sound visible at once (no hidden chips off the edge) */
@media (max-width: 600px) {
  .cosy-chips { flex-wrap: wrap; overflow-x: visible; }
  /* bigger targets for a sleepy thumb, and the total time never wraps */
  .p-mini { min-height: 40px; padding: 0 10px; font-size: 13.5px; }
}
#p-total { white-space: nowrap; }
/* "1 year" in the old-style serif read like "ı year": the plan figures use the clean UI font */
.gift-opt b { font-family: var(--ui); font-weight: 600; font-variant-numeric: lining-nums; letter-spacing: -.01em; }
/* error messages that sit next to the field they're about */
.field-err { color: #ff9b8f; font: 500 13.5px var(--ui); margin: 6px 0 0; }
.field-err:empty { display: none; }
/* tablets (iPad portrait and small laptops): seven equal books, padlocks pinned to the covers, picture full width */
@media (min-width: 601px) and (max-width: 1024px) {
  .hero-books { grid-template-columns: repeat(7, minmax(0, 1fr)); justify-content: stretch; }
  .hero-books .hb img { width: 100%; height: auto; max-height: none; aspect-ratio: 420 / 551; object-fit: cover; }
  .hero-frame .hero-art { width: 100%; justify-self: stretch; }
  .hero-frame .hero-art img { max-height: none; }
  .visitor .hb-lock, .hb-free { top: auto; bottom: 8px; right: 6px; }
}
.need-name { margin: 8px 8px 30px; padding: 26px 18px 24px; }
.need-name h1 { font-size: clamp(25px, 6.2vw, 40px); line-height: 1.15; text-wrap: balance; }
.need-name p { font-size: 15px; }
.need-name-form { max-width: 380px; margin: 18px auto 0; }
.welcome-banner + .need-name { margin-top: -6px; }

/* tonight: make it obvious this is tonight's story */
.lt-label { display: flex; align-items: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.lt-label h2 { font-family: var(--head); font-weight: 400; font-size: clamp(26px, 3vw, 34px); color: var(--gold-bright); margin: 0; }
.lt-date { color: var(--ivory-dim); font-size: 15px; margin-left: auto; }
.lt-moon { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset -7px -2px 0 0 var(--gold-bright); transform: rotate(-20deg); flex: none; }
.lt-label + .lib-tonight { margin-top: 14px; }
.lt-art { position: relative; display: block; min-height: 100%; }
.lt-art img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; display: block; }
.lt-ribbon { position: absolute; top: 18px; left: -6px; background: var(--wine); color: var(--ivory); border: 1px solid var(--gold); border-left: 0;
  font-family: var(--head-sc); letter-spacing: .14em; font-size: 15px; padding: 6px 16px 6px 20px; box-shadow: 0 6px 14px rgba(0,0,0,.45); }
.lt-eye { font-size: 16px; }
@media (max-width: 760px) { .lt-art img { min-height: 0; aspect-ratio: 3/2; } .lt-date { margin-left: 0; width: 100%; font-size: 14px; } .lt-label { gap: 10px; margin-top: 22px; } }

/* previous / next story: like the foot of a book chapter, one each side of a gold rule */
.next-nav:has(.nn) { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-direction: row; max-width: 720px; margin: 40px auto 0; padding: 18px 20px 0; border-top: 1px solid rgba(216,182,100,.4); }
.next-nav a.nn { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--head); font-size: 21px; color: var(--gold); transition: color .3s; }
.next-nav a.nn:hover { color: var(--gold-bright); }
@media (max-width: 600px) { .next-nav:has(.nn) { margin-top: 30px; } .next-nav a.nn { font-size: 19px; } }
