/* Legacy Read Aloud™ — brand board:
   #fe8b70 coral · #fcecdc cream · #000000 · #fef7a2 butter · #fe957b salmon · #278067 green · #003b9c blue
   Fonts: Quicksand · Life Savers · Andutione Handwritten */

@font-face { font-family: 'Life Savers'; src: url('/brand/fonts/LifeSavers-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Life Savers'; src: url('/brand/fonts/LifeSavers-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Life Savers'; src: url('/brand/fonts/LifeSavers-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }
/* Andutione Handwritten is a licensed font: drop AndutioneHandwritten.ttf/.otf into /brand/fonts to enable it. */
@font-face { font-family: 'Andutione Handwritten'; src: local('Andutione Handwritten'), local('AndutioneHandwritten'), url('/brand/fonts/AndutioneHandwritten.otf') format('opentype'), url('/brand/fonts/AndutioneHandwritten.ttf') format('truetype'); font-display: swap; }

:root {
  --coral: #fe8b70;
  --salmon: #fe957b;
  --cream: #fcecdc;
  --butter: #fef7a2;
  --green: #278067;
  --blue: #003b9c;
  --ink: #000000;
  --ink-soft: #3d2f2a;
  --paper: #fffaf4;
  --line: #f0d6c0;
  --shadow: 0 10px 30px rgba(120, 60, 30, .14);
  --shadow-sm: 0 3px 10px rgba(120, 60, 30, .12);
  --radius: 22px;
  --display: 'Life Savers', 'Quicksand', serif;
  --body: 'Quicksand', system-ui, sans-serif;
  --hand: 'Andutione Handwritten', 'Segoe Script', 'Bradley Hand', 'Comic Sans MS', cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body); font-weight: 500; color: var(--ink-soft);
  background: var(--cream);
  background-image: radial-gradient(circle at 10% 0%, #ffe3d6 0, transparent 40%), radial-gradient(circle at 100% 30%, #fff3c9 0, transparent 35%);
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; outline: none; }
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--display); color: var(--blue); font-weight: 700; line-height: 1.1; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.35rem; }
p { line-height: 1.6; }
.small { font-size: .85rem; }
.muted { color: #8a6f62; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.hand { font-family: var(--hand); }
.hidden { display: none !important; }

/* ---------- header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 22px; background: rgba(252, 236, 220, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.45rem; color: var(--blue); }
.brand-name sup { font-size: .5em; }
.site-nav { display: flex; gap: 6px; }
.site-nav a { text-decoration: none; font-weight: 700; color: var(--blue); padding: 8px 14px; border-radius: 999px; }
.site-nav a:hover, .site-nav a.active { background: #fff; box-shadow: var(--shadow-sm); }
.site-footer { text-align: center; padding: 34px 20px 40px; border-top: 1px solid var(--line); margin-top: 50px; }
.site-footer .tagline { font-family: var(--hand); font-size: 1.5rem; color: var(--green); margin: 0 0 6px; }
body.immersive .site-header, body.immersive .site-footer { display: none; }

/* ---------- buttons / inputs ---------- */
.btn {
  --bg: var(--coral); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1.05rem var(--body); color: var(--fg); background: var(--bg);
  border: 0; border-radius: 999px; padding: 13px 26px; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 0 #e2674b, var(--shadow-sm); transition: transform .12s, box-shadow .12s, background .2s;
}
.btn:hover { background: var(--salmon); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #e2674b; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.blue { --bg: var(--blue); box-shadow: 0 4px 0 #00276a, var(--shadow-sm); }
.btn.blue:hover { background: #0a4cbc; }
.btn.green { --bg: var(--green); box-shadow: 0 4px 0 #185743, var(--shadow-sm); }
.btn.green:hover { background: #2f9579; }
.btn.ghost { --bg: #fff; --fg: var(--blue); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover { background: var(--paper); }
.btn.small { padding: 8px 16px; font-size: .92rem; }
.btn.lg { padding: 16px 34px; font-size: 1.2rem; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: var(--blue); box-shadow: var(--shadow-sm); transition: background .15s, transform .1s;
}
.icon-btn:hover { background: var(--butter); }
.icon-btn[aria-pressed="true"] { background: var(--blue); color: #fff; }
.icon-btn svg { width: 22px; height: 22px; }
label.field { display: block; font-weight: 700; color: var(--blue); margin-bottom: 16px; }
label.field span.hint { display: block; font-weight: 500; color: #8a6f62; font-size: .88rem; margin-top: 2px; }
input[type=text], input[type=email], textarea, select {
  width: 100%; margin-top: 6px; font: 600 1.05rem var(--body); color: var(--ink-soft);
  padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: #fff; outline: none;
}
input[type=text]:focus, input[type=email]:focus, textarea:focus, select:focus { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(254, 139, 112, .2); }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--green); margin-top: 2px; flex: none; }

.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: .82rem; background: var(--butter); color: var(--ink-soft); }
.pill.green { background: #d9f0e8; color: var(--green); }
.pill.blue { background: #dfe8fb; color: var(--blue); }
.price-line { font-size: 1.1rem; margin: 10px 0 4px; }
.price-line strong { font-family: var(--display); color: var(--blue); font-size: 1.5rem; }
.order-summary { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 12px 16px; margin: 4px 0 16px; }
.order-summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-weight: 600; }
.order-summary .row.total { border-bottom: 0; font-family: var(--display); color: var(--blue); font-size: 1.25rem; }
.link-btn { background: none; border: 0; padding: 0 0 0 8px; font: 700 .9rem var(--body); color: var(--coral); text-decoration: underline; cursor: pointer; }
.link-btn:disabled { opacity: .5; cursor: wait; }
.pill.gold { background: linear-gradient(135deg, #fff1b8, #ecc65a); color: #4a3510; box-shadow: inset 0 0 0 1px rgba(160,110,30,.35); }

/* ---------- home ---------- */
.hero { padding: 26px 0 10px; }
.hero-banner { position: relative; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 1800 / 664; background: #3a2416; }
.hero-banner img { width: 100%; height: 100%; object-fit: cover; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin: 26px 0 0; }
.hero-cta h1 { margin: 0; }
.hero-cta .tag { font-family: var(--hand); color: var(--green); font-size: 1.6rem; margin: 4px 0 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 44px 0; }
.step { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); position: relative; }
.step .num { position: absolute; top: -16px; left: 22px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: #fff; background: var(--coral); box-shadow: 0 3px 0 #e2674b; }
.step h3 { margin-top: 10px; }
.step p { margin: 0; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px; margin-top: 18px; }
.book-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 10px; }
.book-card .cover { border-radius: 6px 16px 16px 6px; overflow: hidden; box-shadow: -6px 0 0 rgba(0,0,0,.08) inset, var(--shadow); aspect-ratio: 1400/1422; background: #fff; transition: transform .25s; }
.book-card:hover .cover { transform: translateY(-6px) rotate(-1deg); }
.book-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card h3 { margin: 4px 0 0; font-size: 1.2rem; }
.book-card .sub { font-weight: 600; color: var(--green); font-size: .95rem; }

/* ---------- book page ---------- */
.book-detail { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 44px; padding: 34px 0; align-items: start; }
.book-detail .cover { border-radius: 8px 22px 22px 8px; overflow: hidden; box-shadow: var(--shadow); }
.book-detail .meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.book-detail .actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.subtitle { font-family: var(--display); color: var(--green); font-size: 1.4rem; margin: -4px 0 6px; }
.narration-list { display: grid; gap: 12px; margin-top: 10px; }
.narration-item { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow-sm); }
.narration-item img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.narration-item .grow { flex: 1; min-width: 0; }
.narration-item strong { color: var(--blue); display: block; }
.progress-bar { height: 8px; border-radius: 99px; background: var(--cream); overflow: hidden; margin-top: 6px; }
.progress-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #46b894); border-radius: 99px; }

/* ---------- setup ---------- */
.setup { max-width: 720px; margin: 34px auto; }
.setup .intro-art { display: flex; gap: 22px; align-items: center; margin-bottom: 18px; }
.setup .intro-art img { width: 150px; height: auto; flex: none; }
.mic-check { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--paper); border-radius: 16px; margin: 18px 0; border: 2px dashed var(--line); }
.meter { flex: 1; height: 14px; border-radius: 99px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--butter), var(--coral)); transition: width .08s; }
.edition { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.edition label { border: 2px solid var(--line); border-radius: 16px; padding: 14px; cursor: pointer; background: #fff; font-weight: 700; color: var(--blue); }
.edition label:has(input:checked) { border-color: var(--coral); background: #fff5ef; }
.edition input { accent-color: var(--coral); margin-right: 6px; }
.edition small { display: block; color: #8a6f62; font-weight: 500; margin-top: 4px; }
.legal { background: var(--paper); border-radius: 16px; padding: 14px 16px; margin: 18px 0; font-size: .92rem; }

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: 230px 1fr; gap: 24px; padding: 22px 0 10px; }
.page-rail { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 120px); overflow: auto; position: sticky; top: 88px; padding: 4px 6px 4px 2px; }
.rail-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: #fff; border: 2px solid transparent; cursor: pointer; text-align: left; font: 600 .9rem var(--body); color: var(--ink-soft); box-shadow: var(--shadow-sm); }
.rail-item img { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; flex: none; }
.rail-item.active { border-color: var(--coral); background: #fff5ef; }
.rail-item .state { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; color: #fff; background: #e9d6c8; flex: none; }
.rail-item.done .state { background: var(--green); }
.rail-item.optional .state { background: var(--butter); color: var(--ink-soft); }
.studio-main { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 420px); gap: 24px; align-items: start; }
.stage { position: relative; }
.stage .page-view { border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); background: #fff; position: relative; }
.stage .page-view img { width: 100%; }
.stage-caption { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; color: #8a6f62; font-weight: 700; }
.prompter { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; position: sticky; top: 88px; }
.prompter .label { font-family: var(--display); color: var(--blue); font-size: 1.35rem; margin-bottom: 4px; }
.prompter .script { font-size: 1.12rem; line-height: 1.7; color: var(--ink); background: var(--paper); border-radius: 16px; padding: 16px 18px; max-height: max(260px, calc(100vh - 470px)); overflow: auto; white-space: pre-wrap; border: 2px solid var(--line); }
.script-wrap { position: relative; }
.prompter .script.has-more { -webkit-mask-image: linear-gradient(#000 calc(100% - 70px), transparent 100%); mask-image: linear-gradient(#000 calc(100% - 70px), transparent 100%); }
.scroll-hint { display: flex; width: 100%; justify-content: center; margin-top: 8px; border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; font: 700 .95rem var(--body); color: var(--blue); background: var(--butter); box-shadow: var(--shadow-sm); animation: nudge 1.6s ease-in-out infinite; }
.scroll-hint[hidden] { display: none; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
.prompter .script.reading { border-color: var(--green); background: #f3fbf7; }
.rec-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 0 6px; }
.rec-btn {
  width: 84px; height: 84px; border-radius: 50%; border: 6px solid #fff; cursor: pointer; display: grid; place-items: center;
  background: var(--coral); box-shadow: 0 0 0 3px var(--coral), var(--shadow); transition: transform .15s;
}
.rec-btn:hover { transform: scale(1.05); }
.rec-btn svg { width: 34px; height: 34px; color: #fff; }
.rec-btn.recording { background: #e5452a; box-shadow: 0 0 0 3px #e5452a, 0 0 0 0 rgba(229,69,42,.5); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 3px #e5452a, 0 0 0 0 rgba(229,69,42,.45); } 70% { box-shadow: 0 0 0 3px #e5452a, 0 0 0 20px rgba(229,69,42,0); } 100% { box-shadow: 0 0 0 3px #e5452a, 0 0 0 0 rgba(229,69,42,0); } }
.rec-time { font: 700 1.3rem var(--body); color: var(--blue); min-width: 70px; text-align: center; font-variant-numeric: tabular-nums; }
.rec-status { text-align: center; font-weight: 700; color: #8a6f62; min-height: 1.5em; }
.take { display: flex; align-items: center; gap: 10px; background: #f3fbf7; border: 2px solid #cfeadf; border-radius: 16px; padding: 10px 12px; margin-top: 14px; }
.take audio { flex: 1; height: 38px; }
.nav-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.char-count { text-align: right; font-weight: 700; font-size: .9rem; color: var(--green); margin-top: 4px; }
.char-count.over { color: #d0391c; }
.warn { background: #fff0ea; border: 2px solid #ffc9b8; color: #a3361b; border-radius: 14px; padding: 10px 14px; font-weight: 700; margin-top: 10px; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 250, 244, .55); font-family: var(--display); font-size: 9rem; color: var(--coral); text-shadow: 0 6px 0 #fff; pointer-events: none; border-radius: 10px; }

.seg { display: inline-flex; background: #fff; border-radius: 999px; padding: 3px; box-shadow: inset 0 0 0 2px var(--line); }
.seg button { border: 0; background: none; font: 700 .88rem var(--body); color: var(--blue); padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.seg button.on { background: var(--blue); color: #fff; }
.seg button:disabled { opacity: .6; cursor: wait; }
.compare { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-weight: 700; font-size: .88rem; color: #8a6f62; }
.compare button { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px; font: 700 .85rem var(--body); color: var(--blue); cursor: pointer; }
.compare button.on { border-color: var(--green); background: #f3fbf7; color: var(--green); }
.tip { margin-top: 8px; background: #fffbe0; border: 2px solid var(--butter); border-radius: 12px; padding: 8px 12px; font-weight: 600; font-size: .92rem; }
.meter.hot > i { background: #e5452a; }

/* Text written onto personalised pages (dedication, message, institution) */
.page-overlay { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; pointer-events: none; overflow: hidden; }
.overlay-dedication { left: 12%; right: 8%; top: 41%; bottom: 20%; }
.overlay-message { left: 8%; right: 6%; top: 22%; bottom: 25%; }   /* uses the cream clouds above; stops above Pete */
.overlay-dedication p, .overlay-message p { margin: 0; max-height: 100%; font-family: var(--hand); color: var(--blue); line-height: 1.3; font-size: calc(var(--pw, 600px) * .05); text-shadow: 0 1px 0 rgba(255,255,255,.6); white-space: pre-wrap; overflow-wrap: break-word; }
.overlay-dedication .sig, .overlay-message .sig { display: block; margin-top: .5em; font-size: .8em; color: var(--green); }
/* Covers the printed "[Institution Name]" placeholder on the INST copyright page */
.overlay-institution { left: 4%; right: 4%; top: 19.8%; height: 6.0%; background: #fff; }
.overlay-institution p { margin: 0; font-family: 'Libre Baskerville', Georgia, serif; font-weight: 700; color: #000; font-size: calc(var(--pw, 600px) * .05); white-space: nowrap; }

/* ---------- reader (Kotobee-style flipbook) ---------- */
.reader { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); background: radial-gradient(ellipse at center, #fff4e6 0%, var(--cream) 55%, #f6d8c2 100%); }
.reader-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: rgba(255,255,255,.75); backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgba(120,60,30,.08); z-index: 3; }
.reader-top .title { flex: 1; min-width: 0; }
.reader-top .title strong { display: block; font-family: var(--display); color: var(--blue); font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-top .title span { font-weight: 700; color: var(--green); font-size: .9rem; }
.reader-top .tools { display: flex; gap: 8px; }
.reader-stage { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 16px 70px; }
.book-shell { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.flip-host { margin: 0 auto; }
.flip-page { background: #fff; overflow: hidden; }
.flip-page .page-inner { position: relative; width: 100%; height: 100%; }
.flip-page img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.flip-page.speaking::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 5px rgba(254, 247, 162, .9); pointer-events: none; }
.side-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 52px; height: 52px; }
.side-arrow.prev { left: 12px; } .side-arrow.next { right: 12px; }
.reader-bottom { padding: 10px 16px 14px; background: rgba(255,255,255,.75); backdrop-filter: blur(8px); box-shadow: 0 -2px 10px rgba(120,60,30,.08); z-index: 3; }
.reader-bottom .row { display: flex; align-items: center; gap: 14px; max-width: 1000px; margin: 0 auto; }
.play-voice { min-width: 210px; }
.page-slider { flex: 1; accent-color: var(--coral); }
.page-num { font-weight: 700; color: var(--blue); min-width: 92px; text-align: right; font-variant-numeric: tabular-nums; }
.readalong { max-width: 1000px; margin: 0 auto 10px; background: #fff; border-radius: 16px; padding: 12px 18px; font-size: 1.12rem; line-height: 1.7; color: #6b5a52; box-shadow: var(--shadow-sm); max-height: 7.5em; overflow: auto; }
.readalong .w { transition: color .15s, background .15s; border-radius: 4px; }
.readalong .w.read { color: var(--ink); }
.readalong .w.now { background: var(--butter); color: var(--ink); box-shadow: 0 0 0 2px var(--butter); }
.narrated-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--butter); border-radius: 999px; padding: 6px 14px 6px 8px; font-weight: 700; color: var(--ink-soft); }
.narrated-chip img { width: 28px; height: 28px; object-fit: contain; }
.thumbs { position: absolute; left: 0; top: 0; bottom: 0; width: 260px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); z-index: 5; overflow: auto; padding: 14px; transform: translateX(-105%); transition: transform .25s; }
.thumbs.open { transform: none; }
.thumbs h3 { font-size: 1.1rem; }
.thumbs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.thumbs-grid button { border: 2px solid transparent; padding: 0; border-radius: 6px; overflow: hidden; cursor: pointer; background: #fff; position: relative; box-shadow: var(--shadow-sm); }
.thumbs-grid button.current { border-color: var(--coral); }
.thumbs-grid button span { position: absolute; bottom: 2px; right: 4px; font-size: .7rem; font-weight: 700; background: rgba(255,255,255,.85); border-radius: 6px; padding: 0 4px; }
.thumbs-grid button .voice { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--green); }
.end-card { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(252, 236, 220, .82); z-index: 6; backdrop-filter: blur(3px); }
.end-card .card { text-align: center; max-width: 440px; }
.end-card img { width: 160px; margin: 0 auto 8px; }
.start-card { position: absolute; inset: 0; display: grid; place-items: center; z-index: 6; background: rgba(252, 236, 220, .55); backdrop-filter: blur(2px); }
.start-card .card { text-align: center; max-width: 420px; }
.start-card img { width: 140px; margin: 0 auto 6px; }
.start-card .hand { font-size: 1.5rem; color: var(--green); }

/* ---------- share ---------- */
.share { max-width: 760px; margin: 40px auto; text-align: center; }
.share-link { display: flex; gap: 10px; margin: 16px 0; }
.share-link input { margin: 0; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 140%); opacity: 0; visibility: hidden; background: var(--blue); color: #fff; font-weight: 700; padding: 12px 22px; border-radius: 999px; box-shadow: var(--shadow); transition: transform .3s, opacity .3s, visibility .3s; z-index: 100; max-width: 90vw; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast.error { background: #c23a1e; }

.loading { display: grid; place-items: center; min-height: 50vh; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 6px solid var(--line); border-top-color: var(--coral); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; gap: 30px; }
  .book-detail { grid-template-columns: 1fr; }
  .studio { grid-template-columns: minmax(0, 1fr); }
  .studio > * { min-width: 0; }
  .page-rail { flex-direction: row; position: static; max-height: none; overflow-x: auto; }
  .rail-item { flex: none; }
  .rail-item .label { display: none; }
  .studio-main { grid-template-columns: minmax(0, 1fr); }
  .studio-main > * { min-width: 0; }
  .prompter { position: static; }
  .reader-stage { padding: 8px 8px 8px; }
  .side-arrow { display: none; }
  .play-voice { min-width: 0; }
  .brand-name { font-size: 1.1rem; }
  .edition { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  /* header: keep the name and both links on one line */
  .site-header { padding-left: 12px; padding-right: 12px; }
  .brand { gap: 8px; }
  .brand img { width: 40px; height: 40px; }
  .brand-name { font-size: 1rem; white-space: nowrap; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 6px 9px; font-size: .92rem; white-space: nowrap; }
  /* setup: on a phone the picture sits above the text instead of squeezing it */
  .setup .intro-art { flex-direction: column; text-align: center; gap: 10px; }
  .setup .intro-art img { width: 220px; }
  .mic-check { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .mic-check .meter { flex: 1 1 150px; }
  .mic-check .btn { flex: 1 1 100%; }
  /* studio: a smaller page picture so the words and the record button are on screen together */
  .studio-main .prompter { order: -1; }
  .studio-main .stage { width: min(100%, 260px); margin: 0 auto; }
  .studio-main .stage-caption { font-size: .85rem; }
  .setup .intro-art h1 { font-size: 1.8rem !important; }
  .reader-top { gap: 6px; padding: 8px 10px; }
  .reader-top .icon-btn { width: 36px; height: 36px; }
  .reader-top .icon-btn svg { width: 18px; height: 18px; }
  .reader-top .tools { gap: 5px; }
  .reader-top .title strong { font-size: 1rem; }
  .reader-top .title span { font-size: .78rem; }
  .reader-bottom { padding: 8px 10px 12px; }
  .reader-bottom .row { gap: 8px; }
  .play-voice { padding: 10px 14px; font-size: .95rem; white-space: nowrap; flex: none; }
  .reader-bottom .page-slider { flex: 1 1 auto; min-width: 0; }
  .reader-bottom .page-num { flex: none; min-width: 34px; text-align: right; font-size: .85rem; }
  .page-num { min-width: 0; font-size: .85rem; }
  .readalong { font-size: 1rem; max-height: 6em; padding: 10px 12px; }
  .hero-cta .btn.lg { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- reader: listener-paced page turning ---------- */
.side-arrow.next.ready { background: var(--coral); color: #fff; animation: turnPulse 1.5s ease-in-out infinite; }
@keyframes turnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(254, 139, 112, .55), var(--shadow-sm); transform: translateY(-50%) scale(1); }
  50% { box-shadow: 0 0 0 14px rgba(254, 139, 112, 0), var(--shadow-sm); transform: translateY(-50%) scale(1.08); }
}
.turn-hint {
  position: absolute; right: 74px; bottom: 14px; z-index: 4; display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--blue); font-weight: 700; font-size: .95rem; padding: 8px 14px; border-radius: 999px;
  box-shadow: var(--shadow-sm); opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; pointer-events: none;
}
.turn-hint.show { opacity: 1; transform: none; }
@media (max-width: 900px) {
  /* Phones/tablets: keep the arrows, floating over the page edges. */
  .side-arrow { display: inline-grid; width: 42px; height: 42px; background: rgba(255, 255, 255, .9); }
  .side-arrow.prev { left: 4px; } .side-arrow.next { right: 4px; }
  .turn-hint { right: 50%; transform: translate(50%, 8px); bottom: 8px; white-space: nowrap; }
  .turn-hint.show { transform: translate(50%, 0); }
}

/* Studio: nudge "Next page" once a take is saved (no auto-advance) */
#nextBtn.ready { animation: nextNudge 1.6s ease-in-out infinite; }
@keyframes nextNudge {
  0%, 100% { box-shadow: 0 4px 0 #00276a, 0 0 0 0 rgba(0, 59, 156, .45); }
  50% { box-shadow: 0 4px 0 #00276a, 0 0 0 10px rgba(0, 59, 156, 0); }
}

/* ---------- reader: volume ---------- */
.vol { display: flex; align-items: center; gap: 8px; flex: none; }
.vol .icon-btn[aria-pressed="true"] { background: #fff; color: #c23a1e; }
.vol-slider {
  -webkit-appearance: none; appearance: none; width: 110px; height: 8px; border-radius: 99px; cursor: pointer;
  background: linear-gradient(90deg, var(--green) var(--fill, 100%), var(--line) var(--fill, 100%));
}
.vol-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--green); box-shadow: var(--shadow-sm); }
.vol-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--green); }
@media (max-width: 600px) {
  /* Phones: just the speaker button (tap to mute); the device volume buttons do the rest. */
  .vol-slider { display: none; }
}

/* Reader header: author beside the title */
.reader-top .title strong .by { font-family: var(--body); font-style: normal; font-weight: 700; font-size: .72em; color: var(--green); margin-left: 6px; }

/* Andutione Handwritten has compact letterforms — give handwritten lines a little more size. */
.hero-cta .tag { font-size: 2.1rem; }
.site-footer .tagline { font-size: 1.95rem; }
.start-card .hand, .end-card .hand { font-size: 1.85rem !important; }
.setup .hand, .share .hand { font-size: 1.9rem !important; }

/* ---------- review & purchase ---------- */
.checkout { max-width: 980px; margin: 34px auto; }
.checkout-grid { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 34px; align-items: start; }
.checkout-cover img { border-radius: 8px 20px 20px 8px; box-shadow: var(--shadow); }
.included { list-style: none; padding: 0; margin: 14px 0 22px; display: grid; gap: 8px; font-weight: 600; }
.included li { background: #f3fbf7; border-radius: 12px; padding: 9px 14px; color: var(--ink-soft); }
.waiting { display: flex; gap: 14px; align-items: flex-start; background: var(--paper); border: 2px dashed var(--line); border-radius: 16px; padding: 14px 16px; margin-top: 14px; }
.test-box { background: #fffbe0; border: 2px solid var(--butter); border-radius: 16px; padding: 14px 16px; margin-top: 14px; }
.test-box .btn { display: flex; }
@media (max-width: 760px) { .checkout-grid { grid-template-columns: 1fr; } .checkout-cover { max-width: 320px; margin: 0 auto; } }

/* ---------- 24-hour window ---------- */
.countdown-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--butter); color: var(--ink-soft); font-weight: 700; font-size: .85rem; padding: 3px 10px; border-radius: 999px; }
.time-banner { background: #fff5ef; border: 2px solid #ffd2c4; color: var(--ink-soft); border-radius: 16px; padding: 10px 16px; margin: 0 0 14px; font-weight: 600; }
.expired-card { max-width: 620px; margin: 40px auto; text-align: center; }

/* ---------- keepsake downloads ---------- */
.keepsake { margin-top: 28px; padding-top: 22px; border-top: 2px dashed var(--line); text-align: left; }
.keepsake-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.keepsake-option { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 18px; background: var(--paper); border: 2px solid var(--line); text-decoration: none; color: var(--ink-soft); transition: border-color .2s, transform .15s; }
.keepsake-option:hover { border-color: var(--coral); transform: translateY(-2px); }
.keepsake-option strong { color: var(--blue); font-size: 1.1rem; }
.keepsake-option span { font-size: .92rem; }
.keepsake-option .k-ico { font-size: 1.8rem; }
.keepsake-option.featured { grid-column: 1 / -1; border-color: var(--gold, #C9A24A); }
@media (max-width: 600px) { .keepsake-grid { grid-template-columns: 1fr; } }

/* New Legacy Read Aloud medallion: keep ≥10% clear space, never stretch */
.brand img { width: 52px; height: 52px; object-fit: contain; filter: none; }
.footer-logo { width: 180px; height: auto; margin: 0 auto 14px; display: block; }
.end-card img, .share img[src*="medallion"] { padding: 6%; }
