:root {
  --ink: #161616;
  --muted: #5c574e;
  --paper: #f4efe6;
  --sage: #4f6d4f;
  --sage-dark: #3a5439;
  --gold: #b8964a;
  --navy: #0e131c;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
.sans { font-family: Calibri, "Segoe UI", system-ui, sans-serif; }
a { color: var(--sage-dark); text-decoration: none; }
a:hover { color: var(--gold); }
.wrap { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }
header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(244,239,230,.94);
  border-bottom: 1px solid #e0d8c8;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; gap: 16px; flex-wrap: wrap;
}
.logo { letter-spacing: .22em; font-size: 14px; font-weight: 700; color: var(--sage-dark); }
nav { display: flex; flex-wrap: wrap; gap: 6px 14px; }
nav a { font-size: 13px; letter-spacing: .04em; }
.hero {
  padding: 56px 0 28px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 40px;
  align-items: center;
}
.kicker {
  font-family: Calibri, sans-serif;
  letter-spacing: .16em;
  font-size: 11px;
  color: var(--sage);
  text-transform: uppercase;
}
h1 { font-size: clamp(32px, 5vw, 50px); line-height: 1.08; margin: 10px 0 16px; color: var(--sage-dark); }
h2 { font-size: 30px; color: var(--sage-dark); margin: 8px 0 12px; }
.lead { font-size: 18px; color: var(--muted); max-width: 40em; }
.hero img, .card img { width: 100%; display: block; }
.hero img { border-radius: 8px; box-shadow: 0 16px 36px rgba(0,0,0,.18); max-height: 520px; object-fit: cover; }
.btns { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  font-family: Calibri, sans-serif;
  display: inline-block;
  padding: 11px 18px;
  border-radius: 3px;
  border: 1px solid var(--sage);
  background: var(--sage);
  color: #fff !important;
  letter-spacing: .04em;
  font-size: 14px;
}
.btn.ghost { background: transparent; color: var(--sage-dark) !important; }
section { padding: 52px 0; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.card {
  background: #fff;
  border: 1px solid #e3dccf;
  border-radius: 8px;
  overflow: hidden;
}
.card img { height: 280px; object-fit: cover; object-position: top; }
.card.portrait img { height: auto; max-height: none; object-fit: contain; background: #0c1410; }
.card .pad { padding: 14px 16px 18px; }
.card h3 { font-size: 17px; margin-bottom: 4px; }
.card p { font-size: 13px; color: var(--muted); font-family: Calibri, sans-serif; }
.price { color: var(--sage-dark); font-weight: 700; margin-top: 8px; font-family: Calibri, sans-serif; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: start; }
.box { background: #fff; border-left: 6px solid var(--gold); padding: 22px 24px; }
.navy { background: var(--navy); color: #ece7db; }
.navy h2, .navy .kicker { color: var(--gold); }
.navy p { color: #c4bba8; }
.navy a { color: var(--gold); }
.navy .card { background: #161b26; border-color: #2a3140; color: #ece7db; }
.navy .card h3 { color: #f3ead8; }
.navy .card p { color: #b7ae9d; }
.quote {
  margin-top: 18px;
  border-left: 4px solid var(--gold);
  padding: 8px 0 8px 16px;
  color: var(--ink);
  font-style: italic;
}
.soon { margin: 28px 0 8px; font-family: Calibri, sans-serif; color: var(--sage-dark); }
.page { padding: 48px 0 72px; }
.page h1 { font-size: 36px; }
.page p, .page li { margin: 10px 0; color: var(--muted); }
.page ul { padding-left: 18px; }
footer {
  background: var(--navy);
  color: #b7ae9d;
  padding: 36px 0 28px;
  font-family: Calibri, sans-serif;
  font-size: 14px;
}
footer a { color: #e6d7b0; }
footer strong { color: #fff; letter-spacing: .18em; }
.footgrid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 22px;
}
.footgrid a, .footgrid p { display: block; margin: 6px 0; }
.copy { margin-top: 22px; border-top: 1px solid #2a3140; padding-top: 14px; font-size: 13px; }
@media (max-width: 800px) {
  .hero, .split, .footgrid { grid-template-columns: 1fr; }
}

.bookcover { background: #f7f1e6; border: 1px solid #e3dccf; }
.bookcover img { height: 280px; width: 100%; object-fit: contain; object-position: center; background: #f7f1e6; }
.dropbtn {
  background: none; border: 0; color: #e6d7b0; font: inherit;
  padding: 6px 0; cursor: pointer; letter-spacing: .04em;
}
.drop { margin: 4px 0 10px; }
.drop a { display: inline-block; margin-right: 10px; }
.icons a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin: 6px 8px 0 0;
  border: 1px solid #e6d7b0; border-radius: 50%;
  color: #e6d7b0; font-size: 12px; font-family: Calibri, sans-serif;
}

.testimonial { margin: 18px 0 6px; padding: 14px 18px; border-left: 4px solid var(--gold); background: rgba(184,150,74,.08); font-style: italic; color: var(--ink); }
.testimonial p { margin: 0 0 6px; }
.testimonial cite { font-style: normal; font-size: 14px; color: var(--muted); }

/* ---------- v2: page helpers ---------- */
nav a[aria-current="page"] { color: var(--gold); }
.page h2 { font-size: 22px; margin: 26px 0 6px; }
.page code { font-size: 14px; background: rgba(184,150,74,.1); padding: 1px 5px; border-radius: 3px; }

/* ---------- v2: homepage hero (one screen) ----------
   To add a background picture later, set --hero-bg on .hero-screen
   (or in :root) and add the class "has-bg", e.g.
   .hero-screen { --hero-bg: url("img/hero.jpg"); }
   <section class="vision hero-screen has-bg">  */
body.home { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.home main { flex: 1; display: flex; }
.hero-screen {
  --hero-bg: none;
  --hero-overlay: rgba(244,239,230,.72);
  flex: 1; position: relative;
  display: grid; place-items: center;
  padding: 32px 20px;
  background-color: var(--paper);
  background-image: var(--hero-bg);
  background-size: cover; background-position: center;
}
.hero-screen.has-bg::before { content: ""; position: absolute; inset: 0; background: var(--hero-overlay); }
.hero-screen > * { position: relative; }
.footbar { background: var(--navy); color: #b7ae9d; font-size: 13px; padding: 12px 0; }
.footbar-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 18px; }
.footbar-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footbar a { color: #e6d7b0; }

/* ---------- v2: mobile menu ---------- */
.menu-toggle {
  display: none; background: none; border: 1px solid #d8cfbd; border-radius: 3px;
  width: 40px; height: 34px; padding: 8px 9px; cursor: pointer;
  flex-direction: column; justify-content: space-between;
}
.menu-toggle span { display: block; height: 2px; background: var(--sage-dark); border-radius: 1px; transition: transform .25s ease, opacity .2s ease; }
.nav.open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.open .menu-toggle span:nth-child(2) { opacity: 0; }
.nav.open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 800px) {
  header .nav { position: relative; flex-wrap: nowrap; }
  .menu-toggle { display: flex; }
  header nav {
    position: absolute; top: 100%; left: -20px; right: -20px;
    flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid #e0d8c8;
    box-shadow: 0 10px 24px rgba(0,0,0,.08);
    max-height: 0; overflow: hidden; visibility: hidden;
    transition: max-height .3s ease, visibility .3s;
  }
  header .nav.open nav { max-height: 420px; visibility: visible; }
  header nav a { padding: 13px 20px; font-size: 15px; border-top: 1px solid #ebe4d6; }
  .hero-screen { padding: 28px 18px; }
  .vision p { font-size: 16px !important; }
}

/* ---------- v2: cookie consent ---------- */
.cookie-banner {
  position: fixed; left: 50%; bottom: 18px; z-index: 60;
  width: min(720px, calc(100% - 28px));
  transform: translate(-50%, 12px); opacity: 0;
  transition: opacity .45s ease, transform .45s ease;
  background: #fffdf8; color: var(--ink);
  border: 1px solid #e3dccf; border-top: 3px solid var(--gold); border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0,0,0,.14);
  padding: 16px 18px; font-size: 14px; line-height: 1.5;
}
.cookie-banner.show { opacity: 1; transform: translate(-50%, 0); }
.cookie-banner[hidden] { display: none; }
.cookie-text { color: var(--muted); }
.cookie-text a { text-decoration: underline; }
.cookie-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cookie-banner .btn { padding: 8px 14px; font-size: 13px; cursor: pointer; }
.cookie-panel { margin-top: 12px; padding-top: 10px; border-top: 1px solid #ebe4d6; }
.cookie-panel[hidden] { display: none; }
.cookie-opt { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; color: var(--muted); cursor: pointer; }
.cookie-opt input { margin-top: 4px; accent-color: var(--sage); width: 16px; height: 16px; flex: none; }
.cookie-opt strong { color: var(--sage-dark); }
.cookie-link {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: #e6d7b0; letter-spacing: inherit; text-align: left;
}
.cookie-link:hover { color: var(--gold); }
.cookie-link.inline { color: var(--sage-dark); text-decoration: underline; }
@media (max-width: 520px) {
  .cookie-banner { bottom: 10px; padding: 14px; }
  .cookie-main .btn { flex: 1; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-banner, header nav, .menu-toggle span { transition: none; }
}

/* ---------- v3: book shelf ---------- */
.grid.shelf { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.book-card { transition: transform .2s ease, box-shadow .2s ease; }
.book-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0,0,0,.12); }
.book-open {
  display: flex; flex-direction: column; justify-content: flex-start;
  width: 100%; height: 100%; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.book-open:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.grid.shelf { --cover-ratio: 2 / 3; }
.grid.shelf.tall { --cover-ratio: 616 / 1000; }
#shelf, #books { scroll-margin-top: 64px; }
.book-cover { display: block; aspect-ratio: var(--cover-ratio); overflow: hidden; background: #0c1410; }
.card .book-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.book-card .pad { display: block; }
.book-title { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.book-sub { display: block; font-size: 13px; color: var(--muted); font-family: Calibri, sans-serif; letter-spacing: .04em; }
.type-cover {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px;
  width: 100%; height: 100%; padding: 18px; text-align: center;
  background: var(--navy); color: var(--gold); border: 1px solid #2a3140;
}
.tc-title { font-family: Georgia, serif; font-size: 24px; line-height: 1.15; color: #e6d7b0; }
.tc-mark { font-family: Calibri, sans-serif; letter-spacing: .22em; font-size: 12px; font-weight: 700; }
.tc-soon { font-family: Calibri, sans-serif; letter-spacing: .12em; font-size: 11px; text-transform: uppercase; color: #b7ae9d; }

/* ---------- v3: book detail view ---------- */
html.dialog-open { overflow: hidden; }
.book-dialog {
  border: 0; padding: 0; margin: auto; background: transparent;
  width: min(880px, calc(100% - 32px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  overflow: visible;
}
.book-dialog::backdrop { background: rgba(14,19,28,.55); }
.book-dialog[open] { animation: bookIn .28s ease; }
@keyframes bookIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.book-dialog-inner {
  position: relative; display: grid; grid-template-columns: 300px 1fr; gap: 30px;
  background: var(--paper); color: var(--ink);
  border: 1px solid #e3dccf; border-top: 4px solid var(--gold); border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  padding: 30px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto;
}
.book-dialog-cover { border-radius: 6px; overflow: hidden; box-shadow: 0 12px 28px rgba(0,0,0,.2); align-self: start; }
.book-dialog-cover img { width: 100%; height: auto; display: block; }
.book-dialog-cover .type-cover { aspect-ratio: 2 / 3; }
.book-dialog-text h2 { margin-top: 6px; }
.book-dialog-text .lead { font-size: 17px; }
.book-dialog .btns { margin-top: 22px; }
.book-dialog .btn { cursor: pointer; }
.book-close {
  position: absolute; top: 10px; right: 12px; width: 38px; height: 38px;
  border: 1px solid #d8cfbd; border-radius: 50%; background: #fffdf8;
  color: var(--sage-dark); font-size: 24px; line-height: 1; cursor: pointer;
}
.book-close:hover { color: var(--gold); border-color: var(--gold); }
.book-close:focus-visible, .book-dialog .btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 700px) {
  .book-dialog-inner { grid-template-columns: 1fr; gap: 18px; padding: 22px 18px; }
  .book-dialog-cover { width: 150px; }
  .book-dialog-text h2 { font-size: 25px; }
}
@media (max-width: 520px) {
  .grid.shelf { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .book-title { font-size: 15px; }
  .tc-title { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .book-card, .book-dialog[open] { transition: none; animation: none; }
}

/* ---------- v4: accessibility ---------- */
.kicker { color: var(--sage-dark); }
:focus-visible { outline: 3px solid var(--sage-dark); outline-offset: 3px; }
footer :focus-visible, .footbar :focus-visible, .navy :focus-visible { outline-color: var(--gold); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.page .btns { margin-top: 28px; }

/* ---------- v4: homepage sound control ---------- */
.sound-ctrl { position: absolute; right: 22px; bottom: 18px; display: flex; gap: 8px; }
.sound-btn {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--sage); background: rgba(255,253,248,.85); color: var(--sage-dark);
  transition: background .2s ease, color .2s ease;
}
.sound-btn:hover { background: var(--sage); color: #fff; }
.sound-btn .i-pause, .sound-btn.is-playing .i-play { display: none; }
.sound-btn.is-playing .i-pause { display: inline; }
.sound-btn .i-off, .sound-btn.is-muted .i-on { display: none; }
.sound-btn.is-muted .i-off { display: inline; }
@media (max-width: 520px) { .sound-ctrl { right: 14px; bottom: 12px; } .sound-btn { width: 34px; height: 34px; } }

/* ---------- v4: hero background, ready for later ----------
   To switch on: add class "has-bg" to the homepage section and set the image:
   .hero-screen.has-bg { --hero-bg: url("img/hero-bg.jpg"); }
   The cream overlay is strongest behind the text so the green stays readable. */
.hero-screen.has-bg {
  --hero-overlay: radial-gradient(ellipse 70% 75% at 50% 50%, rgba(244,239,230,.9) 0%, rgba(244,239,230,.84) 55%, rgba(244,239,230,.62) 100%);
}
.hero-screen.has-bg .vision-inner p:not(.words) { color: var(--sage-dark); }

/* ---------- v5: homepage background photo ----------
   Default: img/hero-bg.* (Picture 2). One-line swap to Picture 1:
   in index.html add "bg-alt" to the section: class="vision hero-screen has-bg bg-alt"  */
.hero-screen.has-bg {
  --hero-bg: url("img/hero-bg.jpg");
  --hero-overlay: radial-gradient(ellipse 56% 60% at 50% 50%, rgba(244,239,230,.74) 0%, rgba(244,239,230,.70) 62%, rgba(244,239,230,.34) 84%, rgba(244,239,230,.06) 100%);
  background-position: 50% 55%;
}
.hero-screen.has-bg.bg-alt { --hero-bg: url("img/hero-bg-alt.jpg"); }
/* a soft cream halo right behind the letters keeps them crisp over the busier parts of the photo */
.hero-screen.has-bg .vision-inner p, .hero-screen.has-bg .vision-inner h1 {
  text-shadow: 0 0 2px rgba(244,239,230,1), 0 0 8px rgba(244,239,230,.95), 0 0 16px rgba(244,239,230,.85), 0 0 28px rgba(244,239,230,.6);
}
@supports (background-image: image-set(url("x.webp") type("image/webp"))) {
  .hero-screen.has-bg { --hero-bg: image-set(url("img/hero-bg.webp") type("image/webp"), url("img/hero-bg.jpg") type("image/jpeg")); }
  .hero-screen.has-bg.bg-alt { --hero-bg: image-set(url("img/hero-bg-alt.webp") type("image/webp"), url("img/hero-bg-alt.jpg") type("image/jpeg")); }
}
@media (max-width: 600px) {
  .hero-screen.has-bg {
    background-position: 32% 50%;
    --hero-overlay: radial-gradient(ellipse 105% 52% at 50% 50%, rgba(244,239,230,.76) 0%, rgba(244,239,230,.72) 62%, rgba(244,239,230,.42) 86%, rgba(244,239,230,.15) 100%);
  }
}

/* ---------- v6: music label beside the player ---------- */
.sound-ctrl { align-items: center; }
.sound-label {
  font-size: 12px; letter-spacing: .06em; color: var(--sage-dark);
  background: rgba(255,253,248,.82); border: 1px solid #e3dccf; border-radius: 999px;
  padding: 5px 12px; white-space: nowrap;
  opacity: .0; transform: translateX(6px); transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.sound-label em { font-style: italic; font-family: Georgia, "Times New Roman", serif; letter-spacing: 0; }
.sound-ctrl:hover .sound-label, .sound-ctrl:focus-within .sound-label, .sound-ctrl.is-on .sound-label { opacity: 1; transform: none; }
@media (hover: none) { .sound-ctrl.is-on .sound-label { opacity: 1; } }
@media (max-width: 520px) { .sound-label { font-size: 11px; padding: 4px 10px; } }
@media (prefers-reduced-motion: reduce) { .sound-label { transition: none; } }

/* ---------- v7: about portrait, album, journal ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 360px); gap: 44px; align-items: start; }
.portrait-frame {
  margin: 6px 0 0; padding: 8px; background: #fffdf8;
  border: 1px solid #e3dccf; border-radius: 14px;
  box-shadow: 0 18px 40px rgba(14,19,28,.14), 0 2px 6px rgba(14,19,28,.06);
  position: relative;
}
.portrait-frame::after { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(184,150,74,.55); border-radius: 9px; pointer-events: none; }
.portrait-frame img { display: block; width: 100%; height: auto; border-radius: 9px; }
.album-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 44px; align-items: start; }
.album-card { --cover-ratio: 537 / 800; margin-top: 6px; }
.book-subtitle { font-style: italic; color: var(--muted); font-size: 17px; margin: -4px 0 12px; }
.tracklist-title { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--sage-dark); font-family: Calibri, "Segoe UI", system-ui, sans-serif; margin: 20px 0 8px; }
.tracklist-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 20px; align-items: start; }
.tracklist-art { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 10px 24px rgba(0,0,0,.2); }
.tracklist { padding-left: 1.9em; font-size: 16px; color: var(--ink); }
.tracklist li { padding: 3px 0; break-inside: avoid; }
.tracklist li::marker { color: var(--gold); font-weight: 700; }
@media (max-width: 800px) {
  .about-grid, .album-grid { grid-template-columns: 1fr; gap: 26px; }
  .portrait-frame { max-width: 360px; width: 100%; justify-self: center; }
  .album-card { max-width: 240px; width: 100%; justify-self: center; }
}
@media (max-width: 420px) { .tracklist-wrap { grid-template-columns: minmax(0, 1fr) 112px; gap: 12px; } .tracklist { font-size: 15px; } }

/* ---------- v8: "Look inside" page viewer (viewer.js) ---------- */
.page-viewer {
  border: 0; padding: 0; margin: auto; background: transparent;
  width: min(1180px, calc(100% - 24px)); height: calc(100vh - 24px); height: calc(100dvh - 24px);
  max-width: none; max-height: none; overflow: visible;
}
.page-viewer::backdrop { background: rgba(14,19,28,.72); }
.page-viewer[open] { animation: bookIn .28s ease; }
.pv-panel {
  display: flex; flex-direction: column; height: 100%;
  background: var(--paper); border: 1px solid #e3dccf; border-top: 4px solid var(--gold); border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35); outline: none;
}
.pv-head { display: flex; align-items: center; gap: 16px; padding: 12px 14px 10px 22px; border-bottom: 1px solid #e3dccf; }
.pv-title { font-family: Georgia, "Times New Roman", serif; font-weight: 700; color: var(--sage-dark); font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-counter { font-family: Calibri, "Segoe UI", system-ui, sans-serif; font-size: 14px; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.pv-close {
  width: 38px; height: 38px; flex: none; border: 1px solid #d8cfbd; border-radius: 50%; background: #fffdf8;
  color: var(--sage-dark); font-size: 24px; line-height: 1; cursor: pointer;
}
.pv-body { flex: 1; min-height: 0; display: flex; align-items: center; gap: 12px; padding: 16px 14px 18px; }
.pv-stage { flex: 1; height: 100%; min-width: 0; display: flex; align-items: center; justify-content: center; touch-action: pan-y; container-type: size; }
.pv-slide { height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; animation: pvIn .25s ease; }
@keyframes pvIn { from { opacity: 0; } to { opacity: 1; } }
.pv-page { display: block; aspect-ratio: 705 / 1000; height: 100%; max-width: 100%; }
@supports (height: 1cqh) {
  .pv-page { height: min(100cqh, 141.8cqw); max-width: none; }
  .pv-slide.is-spread .pv-page { height: min(100cqh, 70.9cqw); }
}
.pv-page img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  box-shadow: 0 10px 28px rgba(14,19,28,.22); border-radius: 3px; background: #fbf3ef;
  -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.pv-slide.is-spread .pv-page:first-child img { border-radius: 3px 0 0 3px; box-shadow: -6px 10px 28px rgba(14,19,28,.2), inset -12px 0 18px -14px rgba(0,0,0,.25); }
.pv-slide.is-spread .pv-page:last-child img { border-radius: 0 3px 3px 0; box-shadow: 6px 10px 28px rgba(14,19,28,.2); }
.pv-nav {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid #d8cfbd; background: #fffdf8;
  color: var(--sage-dark); font-size: 30px; line-height: 1; cursor: pointer; padding-bottom: 4px;
  transition: color .2s ease, border-color .2s ease, opacity .2s ease;
}
.pv-nav:hover:not(:disabled), .pv-close:hover { color: var(--gold); border-color: var(--gold); }
.pv-nav:disabled { opacity: .3; cursor: default; }
.pv-close:focus-visible, .pv-nav:focus-visible, .pv-end .btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pv-end {
  max-width: 440px; text-align: center; background: #fffdf8; border: 1px solid #e3dccf; border-radius: 10px;
  padding: 34px 30px 30px; box-shadow: 0 12px 30px rgba(14,19,28,.12); position: relative;
}
.pv-end::before { content: ""; position: absolute; left: 50%; top: 0; width: 64px; height: 3px; margin-left: -32px; background: var(--gold); }
.pv-end-text { text-wrap: balance; font-family: Georgia, "Times New Roman", serif; font-size: 21px; line-height: 1.4; color: var(--ink); margin: 10px 0 22px; }
.pv-end .btns { justify-content: center; margin-top: 0; }
.pv-end .btn { cursor: pointer; }
@media (max-width: 700px) {
  .page-viewer { width: 100%; height: 100vh; height: 100dvh; }
  .pv-panel { border-radius: 0; border-left: 0; border-right: 0; }
  .pv-head { padding: 10px 10px 8px 16px; gap: 10px; }
  .pv-title { font-size: 15px; }
  .pv-counter { font-size: 13px; }
  .pv-body { position: relative; padding: 12px 8px 14px; }
  .pv-nav { position: absolute; top: 50%; margin-top: -21px; width: 42px; height: 42px; z-index: 2; background: rgba(255,253,248,.88); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
  .pv-prev { left: 6px; } .pv-next { right: 6px; }
  .pv-nav:disabled { opacity: 0; pointer-events: none; }
  .pv-end { padding: 28px 20px 24px; margin: 0 10px; }
  .pv-end-text { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { .page-viewer[open], .pv-slide { animation: none; } }
.book-dialog:focus, .book-dialog:focus-visible, .page-viewer:focus, .page-viewer:focus-visible { outline: none; }

/* ---------- v9: Meteor control on every page ---------- */
.sound-ctrl.is-global { position: fixed; right: 18px; bottom: 18px; z-index: 55; transition: bottom .3s ease; }
.sound-ctrl.is-global .sound-btn { box-shadow: 0 4px 14px rgba(14,19,28,.12); background: rgba(255,253,248,.94); }
.sound-ctrl.is-global .sound-btn:hover { background: var(--sage); }
.sound-ctrl.is-global .sound-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sound-hint { display: none; }
.sound-ctrl.is-blocked .sound-hint { display: inline; }
.sound-ctrl.is-blocked .sound-label { opacity: 1; transform: none; }
.sound-ctrl.is-blocked [data-sound="play"] { animation: soundPulse 2.2s ease-in-out infinite; }
@keyframes soundPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(184,150,74,.55); } 50% { box-shadow: 0 0 0 7px rgba(184,150,74,0); } }
html.dialog-open .sound-ctrl.is-global { opacity: .35; }
footer { padding-bottom: 64px; }
@media (max-width: 520px) { .sound-ctrl.is-global { right: 12px; bottom: 12px; } }
@media (prefers-reduced-motion: reduce) { .sound-ctrl.is-blocked [data-sound="play"] { animation: none; } .sound-ctrl.is-global { transition: none; } }
body.home .footbar-inner { padding-right: 100px; }
@media (max-width: 520px) { body.home .footbar-inner { padding-right: 84px; } }

/* ---------- v9: healthcare illustration ---------- */
.health-figure {
  margin: 0; padding: 8px; background: #fffdf8; border: 1px solid #e3dccf; border-radius: 14px;
  box-shadow: 0 18px 40px rgba(14,19,28,.12), 0 2px 6px rgba(14,19,28,.05); position: relative; align-self: start;
}
.health-figure::after { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(184,150,74,.5); border-radius: 9px; pointer-events: none; }
.health-figure img { display: block; width: 100%; height: auto; border-radius: 9px; }
.health-figure figcaption { font-family: Calibri, "Segoe UI", system-ui, sans-serif; font-size: 14px; color: var(--muted); text-align: center; padding: 10px 6px 4px; letter-spacing: .02em; }

/* ---------- v9: page headings (one h1 per page, same look as before) ---------- */
h1.page-title { font-size: 30px; line-height: 1.25; margin: 8px 0 12px; }
h1.page-kicker { font-weight: 400; line-height: 1.55; margin: 0; }

/* ---------- v9: FAQ accordion, price tables, legal templates ---------- */
.faq { margin-top: 22px; border-top: 1px solid #e3dccf; max-width: 46em; }
.faq-item { border-bottom: 1px solid #e3dccf; }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 4px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h2 { font-size: 19px; margin: 0; color: var(--sage-dark); line-height: 1.35; }
.faq-item summary::after { content: "+"; flex: none; width: 30px; height: 30px; border: 1px solid #d8cfbd; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--gold); font-size: 20px; font-family: Calibri, sans-serif; transition: transform .2s ease; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item summary:hover h2 { color: var(--gold); }
.faq-item summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.faq-a { padding: 0 4px 16px; }
.faq-a p { margin: 0; }
.price-table { width: 100%; max-width: 46em; border-collapse: collapse; margin: 12px 0 8px; background: #fffdf8; border: 1px solid #e3dccf; border-radius: 8px; overflow: hidden; }
.price-table th, .price-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #ebe4d6; vertical-align: top; color: var(--ink); font-weight: 400; }
.price-table thead th { font-family: Calibri, sans-serif; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--sage-dark); background: rgba(79,109,79,.07); font-weight: 700; }
.price-table td:last-child { white-space: nowrap; font-weight: 700; color: var(--sage-dark); }
.cookie-table td:last-child { white-space: normal; font-weight: 400; color: var(--muted); }
.cookie-table td, .cookie-table th { font-size: 15px; }
.price-table tbody tr:last-child th, .price-table tbody tr:last-child td { border-bottom: 0; }
.page .note { background: rgba(184,150,74,.1); border-left: 4px solid var(--gold); padding: 10px 14px; max-width: 46em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.updated { font-family: Calibri, sans-serif; font-size: 13px; letter-spacing: .04em; }
mark.ph { background: #fbe7a6; color: #5a4300; padding: 0 4px; border-radius: 3px; font-family: Calibri, sans-serif; font-size: .92em; font-weight: 700; }
.template-note { font-family: Calibri, sans-serif; font-size: 14px; }
@media (max-width: 600px) {
  .cookie-table thead { display: none; }
  .cookie-table tr { display: block; border-bottom: 1px solid #ebe4d6; padding: 8px 0; }
  .cookie-table th, .cookie-table td { display: block; border: 0; padding: 4px 12px; }
  .faq-item summary h2 { font-size: 17px; }
}

/* ---------- v12: shared zen frame (from the About portrait) ---------- */
.zen-frame, .portrait-frame, .health-figure,
.book-card .book-cover, .book-dialog-cover {
  padding: 8px; background: #fffdf8;
  border: 1px solid #e3dccf; border-radius: 14px;
  box-shadow: 0 18px 40px rgba(14,19,28,.12), 0 2px 6px rgba(14,19,28,.05);
  position: relative;
}
.zen-frame::after, .book-card .book-cover::after, .book-dialog-cover::after {
  content: ""; position: absolute; inset: 14px; border: 1px solid rgba(184,150,74,.55); border-radius: 9px; pointer-events: none; z-index: 2;
}
.zen-frame img, .book-card .book-cover img, .book-dialog-cover img { border-radius: 9px; }
.zen-frame { margin: 0; }
/* cards: no white box, the frame carries the picture */
.card.book-card { background: transparent; border: 0; border-radius: 14px; overflow: visible; box-shadow: none; }
.card.book-card:hover { box-shadow: none; transform: translateY(-3px); }
.book-card .book-cover { aspect-ratio: auto; overflow: visible; }
.book-card .book-cover img { aspect-ratio: var(--cover-ratio, 537 / 800); height: auto; object-fit: cover; }
.book-card .pad { padding: 14px 6px 4px; text-align: center; background: transparent; }
.book-card:hover .book-cover { box-shadow: 0 22px 44px rgba(14,19,28,.16), 0 2px 6px rgba(14,19,28,.06); }
.book-dialog-cover { overflow: visible; }
.tracklist-art { padding: 6px; background: #fffdf8; border: 1px solid #e3dccf; border-radius: 12px; box-shadow: 0 10px 24px rgba(14,19,28,.12); }

/* ---------- v12: schools hero rotator ---------- */
.hero-rotator { max-width: 360px; width: 100%; justify-self: center; align-self: start; }
.hr-stage { position: relative; aspect-ratio: 537 / 800; border-radius: 9px; overflow: hidden; background: #0c1410; }
.hr-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; display: block; }
.hr-slide.is-active { opacity: 1; z-index: 1; }
.hero .hr-slide img, .hr-slide img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; box-shadow: none; max-height: none; display: block; }
.hr-slide:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.hr-caption { font-family: Calibri, "Segoe UI", system-ui, sans-serif; font-size: 14px; color: var(--muted); text-align: center; padding: 10px 6px 4px; letter-spacing: .02em; }
.hr-title { color: var(--ink); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .hr-slide { transition: none; } }
@media (max-width: 800px) { .hero-rotator { max-width: 300px; } }
.journal-notify { margin-top: 26px; font-size: 18px; }
/* v12: book detail facts */
.title-sub { display: block; font-size: .62em; font-style: italic; font-weight: 400; color: var(--muted); margin-top: 6px; line-height: 1.3; }
.book-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 16px 0 6px; padding: 14px 16px; border-top: 1px solid rgba(184,150,74,.45); border-bottom: 1px solid rgba(184,150,74,.45); }
.book-facts div { min-width: 0; }
.book-facts dt { font-family: Calibri, "Segoe UI", system-ui, sans-serif; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--sage-dark); }
.book-facts dd { margin: 2px 0 0; font-size: 16px; color: var(--ink); }
.avail { display: inline-block; margin-left: 6px; font-family: Calibri, "Segoe UI", system-ui, sans-serif; font-size: 12px; letter-spacing: .06em; color: var(--sage-dark); border: 1px solid rgba(184,150,74,.6); border-radius: 999px; padding: 1px 9px; vertical-align: 2px; }
.avail.soon { margin-left: 0; }
.book-fine { font-family: Calibri, "Segoe UI", system-ui, sans-serif; font-size: 13px; color: var(--muted); margin-top: 12px; }
@media (max-width: 520px) { .book-facts { grid-template-columns: 1fr; } }
/* v14: Dream Builder look-inside thumbnails */
.db-look-title { font-family: Calibri, "Segoe UI", system-ui, sans-serif; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--sage-dark); margin: 18px 0 8px; font-weight: 400; }
.db-thumbs { list-style: none; margin: 0 0 6px; padding: 4px 2px 12px; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.db-thumbs li { flex: 0 0 auto; scroll-snap-align: start; }
.db-thumb { display: block; width: 86px; padding: 5px; background: #fffdf8; border: 1px solid #e3dccf; border-radius: 10px; box-shadow: 0 8px 18px rgba(14,19,28,.10); cursor: zoom-in; position: relative; transition: transform .2s ease, box-shadow .2s ease; }
.db-thumb::after { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(184,150,74,.5); border-radius: 6px; pointer-events: none; }
.db-thumb img { display: block; width: 100%; height: auto; border-radius: 6px; -webkit-user-drag: none; }
.db-thumb:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(14,19,28,.14); }
.db-thumb:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .db-thumb { transition: none; } }
@media (max-width: 520px) { .db-thumb { width: 78px; } }

/* ---------- v16: journals and stories sections, coming-soon order button ---------- */
.shelf-heading { font-size: 26px; margin: 34px 0 18px; padding-bottom: 8px; border-bottom: 1px solid rgba(184,150,74,.45); }
.page-kicker + .shelf-heading { margin-top: 6px; }
#journals, #stories { scroll-margin-top: 64px; }
.book-dialog .btn[disabled] { opacity: .5; cursor: not-allowed; }
.book-dialog-text { min-width: 0; }

/* ---------- v19: matching journal buttons (buy, look inside, back) + Amazon line ---------- */
.book-dialog .journal-btns { flex-wrap: nowrap; gap: 10px; align-items: stretch; }
.book-dialog .journal-btns .btn { white-space: nowrap; padding: 11px 16px; font-size: 14px; line-height: 1.2; text-align: center; flex: 0 0 auto; }
.btn.amazon { background: var(--sage-dark); border-color: var(--sage-dark); }
.btn.amazon:hover { background: var(--sage); border-color: var(--sage); }
.amazon-also { font-family: Calibri, "Segoe UI", system-ui, sans-serif; font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.amazon-also a { color: var(--sage-dark) !important; text-decoration: underline; text-underline-offset: 3px; }
.amazon-also a:hover { color: var(--sage) !important; }
.amazon-also a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 520px) {
  .book-dialog .journal-btns { flex-direction: column; }
  .book-dialog .journal-btns .btn { width: 100%; }
}
@media (min-width: 701px) and (max-width: 859px) { .book-dialog .journal-btns { flex-direction: column; } .book-dialog .journal-btns .btn { width: 100%; } }

/* v23: justified body text (zero specificity, so existing centred or left rules still win) */
:where(main p, main li, main dd, dialog p, dialog li, dialog dd) { text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto; }
:where(main .btns, main .kicker, main figcaption, main nav, .book-card .pad, .db-thumbs, .pv-end, .type-cover, .book-fine, .amazon-also, .book-facts) :where(p, li, dd),
:where(main .kicker, .book-fine, .amazon-also, .book-facts dd, .pv-end-text) { text-align: start; hyphens: manual; }
:where(.pv-end, .type-cover) :where(p) { text-align: center; }
@media (max-width: 480px) { :where(main p, main li, main dd, dialog p, dialog li, dialog dd) { text-align: left; hyphens: manual; -webkit-hyphens: manual; } }
