/* The Zone 210 Playbook (assets/book.js). Sizes are in em so the whole book scales with --pw, the width of one page. */

/* ---------- view switch + calmer hero while reading ---------- */
.view-toggle { display: inline-flex; gap: 2px; padding: 4px; background: color-mix(in srgb, var(--surface) 76%, transparent); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.vbtn { font: inherit; font-weight: 700; color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer; touch-action: manipulation; white-space: nowrap; transition: color 0.15s, background 0.15s; }
.vbtn:hover { color: var(--ink); }
.vbtn[aria-pressed="true"] { color: var(--on-gold); background: linear-gradient(180deg, #ffc93c, var(--gold)); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 2px 8px rgba(207, 148, 16, 0.35); }
.vbtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 640px) { .tools { flex-wrap: wrap; } }

body.view-book .hero { padding-top: clamp(18px, 3vw, 30px); padding-bottom: 14px; }
body.view-book .eyebrow, body.view-book .lead { display: none; }
body.view-book .hero h1 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); }
body.view-book .controls { margin-top: 14px; }

/* ---------- the book ---------- */
#bookhost { padding: 6px 0 26px; }
.bk {
  --pw: max(250px, min(calc((100vw - 56px) / 2), 540px, calc((100vh - 235px) / 1.3)));
  --ph: calc(var(--pw) * 1.3);
  --paper: #fbf5e6;
  --paper-2: #f1e7cc;
  --p-ink: #2b2118;
  --p-muted: #7b6b52;
  --p-line: rgba(70, 48, 20, 0.2);
  --leather: #6a1d2e;
  --leather-2: #3f0f1c;
  --foil: linear-gradient(115deg, #fff0b0 0%, #e8b84a 28%, #fff3bf 48%, #c98f1d 70%, #f3cf6b 100%);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --hand: "Bradley Hand", "Segoe Print", "Chalkboard SE", "Comic Sans MS", cursive;
  --flip: 900ms;
  font-size: calc(var(--pw) / 28);
  user-select: none;
  -webkit-user-select: none;
}
:root[data-theme="dark"] .bk {
  --paper: #2d2839;
  --paper-2: #221e2c;
  --p-ink: #f2e9d6;
  --p-muted: #b7aa90;
  --p-line: rgba(255, 236, 200, 0.2);
}
.bk[data-mode="single"] {
  --pw: min(calc(100vw - 52px), 430px);
  --ph: max(430px, min(calc(var(--pw) * 1.66), calc(100vh - 190px)));
  font-size: min(calc(var(--pw) / 23), calc(var(--ph) / 32)); /* also fit short screens (landscape tablets, small laptops) */
}

.bk-stage { display: grid; place-items: center; padding: 1.4em 0 1.6em; overflow-x: clip; }
.bk-book {
  position: relative;
  width: calc(var(--pw) * 2);
  height: var(--ph);
  transform-style: flat;
  transition: transform var(--flip) cubic-bezier(0.45, 0.05, 0.25, 1);
  touch-action: pan-y;
  -webkit-touch-callout: none;
  --el: 0px;
  --er: 14px;
}
.bk-book[data-first="1"] { transform: translateX(-25%); }
.bk[data-mode="single"] .bk-book { width: var(--pw); transform: none; }

/* a gentle float while the book is closed */
.bk-book[data-first="1"] .bk-leaves { animation: bkfloat 5.5s ease-in-out infinite; }
@keyframes bkfloat { 50% { transform: translateY(-0.45em) rotateY(-4deg); } }
html[data-saver="on"] .bk-book[data-first="1"] .bk-leaves, :root[data-motion="calm"] .bk-book .bk-leaves { animation: none; }
@media (prefers-reduced-motion: reduce) { .bk-book .bk-leaves { animation: none !important; } }

.bk-shadow { position: absolute; left: -2%; right: -2%; bottom: -2.6em; height: 3em; background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.5), transparent 72%); filter: blur(0.5em); opacity: 0.7; transition: opacity 0.6s; }
.bk-book[data-first="1"] .bk-shadow { left: 50%; right: -2%; }
:root:not([data-theme="dark"]) .bk-shadow { opacity: 0.45; }

/* hard covers behind the pages */
.bk-board {
  position: absolute;
  top: -0.7em;
  bottom: -0.7em;
  background: linear-gradient(145deg, var(--leather), var(--leather-2));
  box-shadow: inset 0 0 0 0.12em rgba(255, 220, 140, 0.25), inset 0 0 1.6em rgba(0, 0, 0, 0.55), 0 0.5em 1.4em rgba(0, 0, 0, 0.45);
  transition: opacity 0.35s ease 0.25s;
}
.bk-board-l { left: -0.9em; width: calc(50% + 0.9em); border-radius: 0.7em 0 0 0.7em; }
.bk-board-r { left: 50%; right: -0.9em; border-radius: 0 0.7em 0.7em 0; }
.bk-book[data-first="1"] .bk-board-l { opacity: 0; transition-delay: 0s; }
.bk[data-mode="single"] .bk-board-l { display: none; }
.bk[data-mode="single"] .bk-board-r { left: -0.7em; right: -0.7em; border-radius: 0.7em; }

/* the inside of the back cover, seen after the last page */
.bk-endpaper {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  right: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.45), transparent 12%),
    repeating-linear-gradient(45deg, rgba(255, 215, 120, 0.1) 0 0.35em, transparent 0.35em 1.1em),
    repeating-linear-gradient(-45deg, rgba(255, 215, 120, 0.1) 0 0.35em, transparent 0.35em 1.1em),
    linear-gradient(160deg, #7b2336, #4a1222);
}
.bk[data-mode="single"] .bk-endpaper { left: 0; }

/* the visible thickness of the page stacks */
.bk-edge { position: absolute; top: 0.25em; bottom: 0.25em; width: var(--w, 0); pointer-events: none; z-index: 0; transition: width 0.7s ease; background: repeating-linear-gradient(90deg, #efe5cc 0 1px, #cfc19f 1px 2px); }
.bk-edge-r { left: 100%; --w: var(--er); border-radius: 0 0.15em 0.15em 0; box-shadow: inset 2px 0 3px rgba(0, 0, 0, 0.25); }
.bk-edge-l { right: 100%; --w: var(--el); border-radius: 0.15em 0 0 0.15em; box-shadow: inset -2px 0 3px rgba(0, 0, 0, 0.25); }
:root[data-theme="dark"] .bk-edge { background: repeating-linear-gradient(90deg, #4a4357 0 1px, #38324a 1px 2px); }
.bk[data-mode="single"] .bk-edge-l { display: none; }
.bk[data-mode="single"] .bk-edge-r { left: 100%; }

/* ---------- leaves ---------- */
.bk-leaves { position: absolute; inset: 0; transform-style: flat; perspective: 2600px; perspective-origin: 50% 42%; }
.bk-leaf {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform var(--flip) cubic-bezier(0.45, 0.05, 0.25, 1);
}
.bk[data-mode="single"] .bk-leaf { left: 0; width: 100%; }
.bk-leaf.flipped { transform: rotateY(-180deg); }
.bk[data-mode="single"] .bk-leaf.flipped:not(.turning) { visibility: hidden; }
.bk-leaf.dragging { transition: none !important; visibility: visible !important; }
.bk-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--paper);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  color: var(--p-ink);
}
.bk-face.back { transform: rotateY(180deg); }
.bk-leaf.turning .bk-face, .bk-leaf.dragging .bk-face { box-shadow: 0 0 2.2em rgba(0, 0, 0, 0.4); }
.bk-page { position: absolute; inset: 0; }
.bk-page.fade { animation: bkfade 0.25s ease; }
@keyframes bkfade { from { opacity: 0; } }

/* paper grain, and shading toward the spine */
.bk-face::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .27 0 0 0 0 .15 0 0 0 .14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .bk-face::before { opacity: 0.25; }
.bk[data-mode="single"] .bk-face::before { display: none; }
.bk-face.front { background-image: linear-gradient(90deg, rgba(60, 35, 10, 0.3), rgba(60, 35, 10, 0.08) 5%, transparent 12%); }
.bk-face.back { background-image: linear-gradient(270deg, rgba(60, 35, 10, 0.3), rgba(60, 35, 10, 0.08) 5%, transparent 12%); }
:root[data-theme="dark"] .bk-face.front { background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.15) 5%, transparent 12%); }
:root[data-theme="dark"] .bk-face.back { background-image: linear-gradient(270deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.15) 5%, transparent 12%); }
.bk-face > .bk-page { z-index: 1; }
.bk-shade { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity var(--flip) ease-in; }
.bk-face.front .bk-shade { background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55)); }
.bk-face.back .bk-shade { background: linear-gradient(270deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55)); opacity: 0.8; transition-timing-function: ease-out; }
.bk-leaf.flipped .bk-face.front .bk-shade { opacity: 0.8; }
.bk-leaf.flipped .bk-face.back .bk-shade { opacity: 0; }
.bk-leaf.dragging .bk-face.front .bk-shade { opacity: calc(var(--p, 0) * 0.8); transition: none; }
.bk-leaf.dragging .bk-face.back .bk-shade { opacity: calc((1 - var(--p, 0)) * 0.8); transition: none; }
.bk-face[inert] .bk-page { pointer-events: none; }

/* the cover is thicker leather: no grain, a rounded outer corner */
.bk-leaf:first-child .bk-face.front { background: linear-gradient(145deg, var(--leather), var(--leather-2)); border-radius: 0 0.7em 0.7em 0; box-shadow: 0 0 0 0.12em rgba(255, 220, 140, 0.18) inset; }
.bk-leaf:first-child .bk-face.front::before { opacity: 0.6; }
.bk-leaf:first-child .bk-face.front { background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.1) 5%, transparent 12%), linear-gradient(145deg, var(--leather), var(--leather-2)); }
.bk-leaf:first-child .bk-face.back { border-radius: 0.7em 0 0 0.7em; }
.bk[data-mode="single"] .bk-leaf:first-child .bk-face.front { border-radius: 0.6em; }
.bk[data-mode="single"] .bk-face { border-radius: 0.5em; }

/* page turn click zones and the curl peek */
.bk-hit { position: absolute; top: 0; bottom: 0; width: 9%; z-index: 100; cursor: pointer; }
.bk-hit-l { left: 0; }
.bk-hit-r { right: 0; }
.bk-hit::after { content: ""; position: absolute; bottom: 0; width: 0; height: 0; transition: width 0.25s, height 0.25s; }
.bk-hit-r::after { right: 0; background: linear-gradient(135deg, rgba(0, 0, 0, 0.28) 0%, var(--paper-2) 55%); box-shadow: -3px -3px 8px rgba(0, 0, 0, 0.25); border-top-left-radius: 0.5em; }
.bk-hit-l::after { left: 0; background: linear-gradient(225deg, rgba(0, 0, 0, 0.28) 0%, var(--paper-2) 55%); box-shadow: 3px -3px 8px rgba(0, 0, 0, 0.25); border-top-right-radius: 0.5em; }
@media (hover: hover) { .bk-hit:hover::after { width: 3em; height: 3em; } }
.bk-book[data-first="1"] .bk-hit-l, .bk-book[data-s="0"] .bk-hit-l { pointer-events: none; }
.bk-hit-l { display: block; }
.bk[data-mode="single"] .bk-hit { display: none; }
.bk-book[data-first="1"] .bk-hit-r { display: none; }
.bk-book[data-s="0"] .bk-hit-r { display: none; }

/* a ribbon marker hanging below the book */
.bk-ribbon { position: absolute; left: calc(50% - 0.45em); bottom: -2.1em; width: 0.9em; height: 2.6em; background: linear-gradient(90deg, #b3172b, #e0364c 50%, #a01425); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); z-index: 0; transform-origin: top center; animation: bksway 6s ease-in-out infinite; }
@keyframes bksway { 50% { transform: rotate(2.5deg); } }
.bk-book[data-first="1"] .bk-ribbon, .bk[data-mode="single"] .bk-ribbon { display: none; }
html[data-saver="on"] .bk-ribbon { animation: none; }

/* ---------- the bar under the book ---------- */
.bk-bar { display: flex; align-items: center; gap: 0.9em; flex-wrap: wrap; justify-content: center; max-width: 760px; margin: 0 auto; font-size: 16px; padding: 0 4px; }
.bk-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; box-shadow: var(--shadow); touch-action: manipulation; transition: transform 0.12s, background 0.15s; }
.bk-btn:hover:not(:disabled) { transform: translateY(-2px); background: var(--gold-soft); }
.bk-btn:disabled { opacity: 0.35; cursor: default; }
.bk-btn:focus-visible, .bk-range:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.bk-range { flex: 1 1 110px; min-width: 80px; accent-color: var(--gold-deep); height: 28px; cursor: pointer; }
.bk-sub { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.5em 1em; max-width: 760px; margin: 0.7em auto 0; font-size: 16px; }
.bk-label { text-align: center; color: var(--muted); font-size: 0.88rem; font-weight: 600; min-height: 1.3em; }
.bk-snd { font: 700 0.8rem var(--font); color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 12px; cursor: pointer; touch-action: manipulation; }
.bk-snd:hover { color: var(--ink); background: var(--gold-soft); }
.bk-snd:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.bk-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }

/* ---------- page contents ---------- */
.pg { position: absolute; inset: 0; padding: 8% 10% 7%; display: flex; flex-direction: column; font-family: var(--serif); color: var(--p-ink); line-height: 1.5; }
.pg-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; font-size: 0.72em; letter-spacing: 0.16em; text-transform: uppercase; color: var(--p-muted); border-bottom: 1px solid var(--p-line); padding-bottom: 0.7em; }
.pg-top .chap { font-weight: 700; }
.pg-top .gnum { font-family: var(--hand); text-transform: none; letter-spacing: 0; font-size: 1.35em; color: color-mix(in srgb, var(--a, #888) 70%, var(--p-ink)); }
.g-title { margin: 0.55em 0 0; font-size: 2.6em; font-weight: 800; line-height: 1.04; letter-spacing: -0.015em; color: var(--p-ink); text-wrap: balance; }
.kicker { margin: 0.4em 0 0; font-size: 0.8em; letter-spacing: 0.3em; text-transform: uppercase; color: var(--p-muted); font-weight: 700; }
.orn { display: flex; align-items: center; gap: 0.6em; margin: 0.6em 0 0.8em; color: color-mix(in srgb, var(--a, #c98f1d) 60%, var(--p-ink)); font-size: 1.2em; }
.orn i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--p-line), transparent); }
.g-tag { margin: 0 0 1em; font-size: 1.18em; line-height: 1.6; hyphens: auto; }
.pg-text .g-tag::first-letter, .pg-one .g-tag::first-letter { float: left; font-size: 3.3em; line-height: 0.82; padding: 0.06em 0.1em 0 0; font-weight: 800; color: color-mix(in srgb, var(--a, #c98f1d) 75%, var(--p-ink)); }
.pg-welcome .g-tag::first-letter, .pg-end .g-tag::first-letter { float: none; font-size: inherit; padding: 0; color: inherit; }

.facts { margin: auto 0 1em; display: grid; grid-template-columns: 1fr 1fr; gap: 0.7em 1em; font-family: var(--font); font-size: 0.82em; }
.facts div { padding: 0.55em 0.8em; border: 1px dashed var(--p-line); border-radius: 0.7em; background: color-mix(in srgb, var(--a, #888) 7%, transparent); }
.facts dt { font-size: 0.72em; letter-spacing: 0.14em; text-transform: uppercase; color: var(--p-muted); font-weight: 700; }
.facts dd { margin: 0.1em 0 0; font-weight: 700; line-height: 1.3; }
.g-actions { display: flex; align-items: center; gap: 0.8em; }
.bk-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  flex: 1;
  min-height: 3em;
  padding: 0.6em 1.2em;
  font: 800 1.05em var(--font);
  color: var(--on-gold);
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(145deg, #ffd15a, var(--gold) 55%, #e89b0b);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 0.25em 0 #b9790a, 0 0.7em 1.2em rgba(180, 120, 10, 0.35);
  transition: transform 0.12s, box-shadow 0.12s;
  touch-action: manipulation;
}
.bk-play:hover { transform: translateY(-0.1em); }
.bk-play:active { transform: translateY(0.18em); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 0.07em 0 #b9790a; }
.bk-play:focus-visible, .bk-fav:focus-visible, .bk-link:focus-visible, .toc button:focus-visible, .photo:focus-visible, .c-open:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.bk-fav { flex: none; width: 3em; height: 3em; display: grid; place-items: center; color: var(--p-muted); background: transparent; border: 1.5px solid var(--p-line); border-radius: 50%; cursor: pointer; touch-action: manipulation; transition: color 0.15s, background 0.15s, transform 0.15s; }
.bk-fav:hover { color: #d99a0b; transform: scale(1.08); }
.bk-fav[aria-pressed="true"] { color: #e0a000; background: rgba(245, 180, 31, 0.18); border-color: #e0a000; }
.bk-fav[aria-pressed="true"] svg path { fill: currentColor; }
.bk-link { font: 700 0.95em var(--font); color: color-mix(in srgb, var(--blue) 80%, var(--p-ink)); background: none; border: 0; padding: 0.5em 0; cursor: pointer; text-align: left; touch-action: manipulation; }
.bk-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.pg-foot { margin-top: auto; padding-top: 0.8em; text-align: center; font-size: 0.85em; color: var(--p-muted); letter-spacing: 0.1em; }
.pg-foot span { color: color-mix(in srgb, var(--a, #c98f1d) 60%, var(--p-muted)); }
.pg-text .facts + .g-actions { margin-bottom: 0.4em; }

/* picture page */
.pg-art { justify-content: center; align-items: stretch; }
.pg-art .wash, .pg-one .wash { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(70% 45% at 50% 38%, color-mix(in srgb, var(--a) 36%, transparent), transparent 72%), radial-gradient(60% 40% at 25% 88%, color-mix(in srgb, var(--b) 26%, transparent), transparent 72%); }
.ghost { position: absolute; right: -0.15em; bottom: 0.2em; font-size: 11em; line-height: 1; opacity: 0.1; transform: rotate(-12deg); pointer-events: none; filter: saturate(0.6); }
.art-box { position: relative; margin: auto 0; padding: 0.4em 0; }
.photo { position: relative; display: block; text-decoration: none; color: var(--p-ink); background: #fffdf6; padding: 0.6em 0.6em 0.5em; border-radius: 0.25em; box-shadow: 0 0.1em 0.2em rgba(0, 0, 0, 0.25), 0 1em 1.8em -0.4em rgba(40, 20, 0, 0.5); transform: rotate(-1.6deg); transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1); }
.photo:hover { transform: rotate(0.4deg) scale(1.02); }
.shot { position: relative; display: block; aspect-ratio: 960 / 539; overflow: hidden; border-radius: 0.1em; background: linear-gradient(135deg, var(--a), var(--b)); }
.shot .bk-emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 4.5em; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #222; }
.cap { display: block; padding: 0.5em 0.2em 0.1em; font-family: var(--hand); font-size: 1.15em; color: #3a2d1c; }
.tape { position: absolute; z-index: 2; width: 4.6em; height: 1.45em; background: rgba(255, 233, 160, 0.78); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.tape.t1 { top: -0.6em; left: -1.1em; transform: rotate(-38deg); }
.tape.t2 { top: -0.6em; right: -1.1em; transform: rotate(36deg); }
.sticker { position: absolute; z-index: 3; padding: 0.4em 0.95em; border-radius: 999px; font: 800 0.8em var(--font); letter-spacing: 0.02em; box-shadow: 0 0.2em 0.6em rgba(0, 0, 0, 0.35); }
.sticker.new { right: -0.5em; top: -0.9em; color: #2b1f00; background: linear-gradient(145deg, #ffe08a, #f5b41f); transform: rotate(7deg); }
.sticker.feat { left: -0.5em; top: -0.9em; color: #fff; background: linear-gradient(145deg, #9a6cf0, #6a3fd0); transform: rotate(-6deg); }
.sticker.online { left: -0.5em; bottom: -0.7em; color: #fff; background: linear-gradient(145deg, #25b974, #12804b); transform: rotate(-5deg); }
.stamps { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5em 0.6em; margin: 0.4em 0 0; }
.stamp { padding: 0.25em 0.8em; font: 700 0.72em var(--font); letter-spacing: 0.12em; text-transform: uppercase; color: color-mix(in srgb, var(--a) 70%, var(--p-ink)); border: 1.5px dashed color-mix(in srgb, var(--a) 60%, transparent); border-radius: 999px; transform: rotate(var(--r, -1.5deg)); }
.stamp:nth-child(even) { --r: 1.8deg; }

/* welcome, contents, end */
.pg-welcome .g-title, .pg-end .g-title, .pg-toc .g-title { margin-top: 0.3em; }
.howto { list-style: none; margin: 0.4em 0 0; padding: 0; display: grid; gap: 0.55em; font-family: var(--font); font-size: 0.9em; }
.howto li { display: flex; gap: 0.7em; align-items: flex-start; }
.howto b { flex: none; width: 1.8em; height: 1.8em; display: grid; place-items: center; font-weight: 400; background: color-mix(in srgb, var(--gold) 20%, transparent); border-radius: 50%; }
.showing { margin: 1em 0 0; font: 600 0.82em var(--font); color: var(--p-muted); padding-top: 0.8em; border-top: 1px dashed var(--p-line); }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5em; }
.toc li { display: block; }
.toc button { display: flex; align-items: baseline; gap: 0.5em; width: 100%; padding: 0.15em 0; font: 800 1.1em var(--serif); color: var(--p-ink); background: none; border: 0; cursor: pointer; text-align: left; touch-action: manipulation; }
.toc button:hover .ct { color: color-mix(in srgb, var(--gold-deep) 80%, var(--p-ink)); text-decoration: underline; text-underline-offset: 4px; }
.toc .dots { flex: 1; border-bottom: 2px dotted var(--p-line); transform: translateY(-0.25em); }
.toc .pn { font-family: var(--hand); font-weight: 400; color: var(--p-muted); }
.toc small { display: block; font: 500 0.74em var(--font); color: var(--p-muted); line-height: 1.35; margin-top: -0.1em; }
.pg-toc .bk-link { margin-top: auto; }
.end-actions { display: grid; gap: 0.7em; margin-top: 0.6em; justify-items: start; }
.end-actions .bk-play { flex: none; }

/* ---------- the cover ---------- */
.cover { position: absolute; inset: 0; padding: 7% 8% 15%; display: flex; flex-direction: column; font-family: var(--serif); color: #f4dca0; text-align: center; overflow: hidden; z-index: 1; }
.cover::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 80% at 30% 0%, rgba(255, 255, 255, 0.12), transparent 55%); }
.c-frame { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5em; margin: 1.1em; padding: 1em; border: 0.14em solid rgba(240, 200, 110, 0.75); border-radius: 0.3em; box-shadow: 0 0 0 0.35em rgba(0, 0, 0, 0), inset 0 0 0 0.35em transparent, inset 0 0 0 0.45em rgba(240, 200, 110, 0.25); }
.c-corner { position: absolute; width: 2.6em; height: 2.6em; border: 0.14em solid #e9c36a; z-index: 2; }
.c-corner.tl { top: 0.55em; left: 0.55em; border-right: 0; border-bottom: 0; border-radius: 0.8em 0 0 0; }
.c-corner.tr { top: 0.55em; right: 0.55em; border-left: 0; border-bottom: 0; border-radius: 0 0.8em 0 0; }
.c-corner.bl { bottom: 0.55em; left: 0.55em; border-right: 0; border-top: 0; border-radius: 0 0 0 0.8em; }
.c-corner.br { bottom: 0.55em; right: 0.55em; border-left: 0; border-top: 0; border-radius: 0 0 0.8em 0; }
.c-pre { margin: 0; font: 700 0.78em var(--font); letter-spacing: 0.22em; white-space: nowrap; text-transform: uppercase; color: #e9c36a; }
.c-title { margin: 0.2em 0; display: grid; gap: 0.05em; font-size: 3.6em; font-weight: 900; line-height: 0.95; letter-spacing: -0.01em; }
.c-title span { background: var(--foil); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0.04em 0.02em rgba(0, 0, 0, 0.6)); animation: bkfoil 6s ease-in-out infinite; }
.c-title em { font-size: 0.36em; font-weight: 400; font-style: italic; color: #e9c36a; letter-spacing: 0.1em; }
@keyframes bkfoil { 50% { background-position: 100% 0; } }
html[data-saver="on"] .c-title span { animation: none; }
.c-orn { display: flex; align-items: center; gap: 0.6em; width: 70%; color: #e9c36a; font-size: 1.4em; }
.c-orn i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #e9c36a, transparent); }
.c-icons { display: flex; gap: 0.5em; font-size: 1.7em; filter: drop-shadow(0 0.05em 0.05em rgba(0, 0, 0, 0.55)); }
.c-count { margin: 0.2em 0 0; font: italic 600 1.05em var(--serif); color: #f4dca0; }
.c-feat { position: relative; z-index: 3; margin-top: 0.5em; padding: 0.45em 1.1em; font: 700 0.85em var(--font); color: #f4dca0; background: rgba(0, 0, 0, 0.25); border: 0.1em solid rgba(240, 200, 110, 0.7); border-radius: 999px; cursor: pointer; touch-action: manipulation; }
.c-feat b { color: #fff; }
.c-feat:hover { background: rgba(240, 200, 110, 0.18); }
.c-feat:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.c-open { position: absolute; left: 50%; bottom: 2.1em; transform: translateX(-50%); z-index: 3; font: 800 0.95em var(--font); letter-spacing: 0.04em; padding: 0.7em 1.5em; color: #3b1a05; background: var(--foil); border: 0; border-radius: 999px; cursor: pointer; box-shadow: 0 0.2em 0 #8c5a0a, 0 0.7em 1.2em rgba(0, 0, 0, 0.45); white-space: nowrap; touch-action: manipulation; animation: bkpulse 2.4s ease-in-out infinite; }
@keyframes bkpulse { 50% { transform: translateX(-50%) scale(1.05); } }
html[data-saver="on"] .c-open { animation: none; }
.bk[data-mode="single"] .cover { padding-bottom: 17%; }
.bk[data-mode="single"] .c-title { font-size: 3.1em; }

/* ---------- phone: one page at a time ---------- */
.pg-one { padding: 6.5% 7.5% 5%; gap: 0; overflow: hidden; }
.pg-one .pg-top { font-size: 0.66em; }
.pg-one .art-box { margin: 0.9em 0 0.6em; padding: 0.3em 0.2em; }
.pg-one .photo { padding: 0.45em 0.45em 0.35em; }
.pg-one .cap { font-size: 1em; padding-top: 0.35em; }
.pg-one .g-title { font-size: 1.95em; margin: 0.35em 0 0; }
.pg-one .g-tag { font-size: 1.02em; line-height: 1.5; margin: 0.45em 0 0.7em; }
.pg-one .chips { display: flex; flex-wrap: wrap; gap: 0.4em; margin: 0 0 0.9em; font: 700 0.7em var(--font); }
.pg-one .chips span { padding: 0.3em 0.8em; border: 1.5px dashed color-mix(in srgb, var(--a) 55%, transparent); border-radius: 999px; color: color-mix(in srgb, var(--a) 70%, var(--p-ink)); }
.pg-one .g-actions { margin-top: auto; padding-bottom: 0.3em; }
.pg-one .bk-play { min-height: 2.8em; }
.pg-one .bk-fav { width: 2.8em; height: 2.8em; }
.pg-one.pg-welcome .toc { margin-top: 0.4em; gap: 0.35em; }
.pg-one.pg-welcome .toc button { font-size: 0.98em; }
.pg-one.pg-welcome .toc small { display: none; }
.pg-one.pg-welcome .g-title, .pg-one.pg-end .g-title { font-size: 1.9em; }
.pg-one .showing { margin-top: auto; }
.pg-one.pg-end { justify-content: center; }
.bk[data-mode="single"] .pg-blank { background: var(--paper-2); }
.bk[data-mode="single"] .bk-face.back { background-image: repeating-linear-gradient(0deg, transparent 0 1.6em, var(--p-line) 1.6em calc(1.6em + 1px)); }

@media (prefers-reduced-motion: reduce), (update: slow) {
  .bk-book, .bk-leaf, .bk-shade { transition: none; }
}
html[data-saver="on"] .bk { --flip: 520ms; }
html[data-saver="on"] .bk-leaf.turning .bk-face { box-shadow: none; }

.bk a, .bk img { -webkit-user-drag: none; }
