/* =========================================================
   Eternally Curious: the book as an object, the open-book reader,
   and the bottom dock. Loaded after book.css.
   ========================================================= */
:root {
  --cloth: #1f2453;          /* deep indigo cloth, from The First Principles of Life */
  --cloth-2: #161a3f;
  --foil: linear-gradient(135deg, #f3d48a 0%, #c9962f 38%, #f6dc98 55%, #a8761d 78%, #e9c06a 100%);
  --dock-h: 64px;
}

/* the top bar keeps only the name and the chapter; Contents moves to the dock */
.toc-btn { display: none; }

/* ---------- Home ---------- */
.home {
  min-height: calc(100svh - 3.5rem - var(--dock-h) - 1rem);
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(2rem, 5vw, 5rem);
  padding-block: clamp(2rem, 6vh, 4rem);
}
.home-title { margin: .6rem 0 0; font: 500 clamp(3.2rem, 7.6vw, 7rem)/.92 var(--sans); letter-spacing: -0.055em; }
.home-title em { color: var(--accent); }
.home-author { margin-top: 1.1rem; font: 400 .85rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); animation: fade-up 1.4s var(--ease-out) 1s both; }
.home .epigraph { animation-delay: 1.4s; }
.home-cta { margin-top: 2.2rem; animation: fade-up 1.4s var(--ease-out) 1.9s both; }
.home-stage { display: grid; justify-items: center; gap: 1.4rem; perspective: 1600px; }
.home-hint { font: 400 .7rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); animation: fade-up 1.4s var(--ease-out) 2.4s both; }

/* ---------- The book, in 3D ---------- */
.home-book {
  --w: clamp(230px, 27vw, 360px); --t: 26px; --ry: -24deg; --rx: 6deg;
  position: relative; display: block; width: var(--w); aspect-ratio: 2 / 3;
  transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 1.1s var(--ease-out);
  animation: book-arrive 1.8s var(--ease-out) .2s both;
  text-decoration: none; cursor: pointer;
}
@keyframes book-arrive { from { opacity: 0; transform: translateY(40px) rotateX(18deg) rotateY(-48deg); } }
.home-book::after {  /* the shadow on the table */
  content: ""; position: absolute; left: 6%; right: -8%; bottom: -9%; height: 14%;
  background: radial-gradient(closest-side, rgba(40, 25, 10, .32), transparent);
  filter: blur(8px); transform: translateZ(-60px) rotateX(80deg); pointer-events: none;
}
.hb-cover, .hb-back, .hb-first { position: absolute; inset: 0; border-radius: 3px 10px 10px 3px; }
.hb-back { background: var(--cloth-2); transform: translateZ(calc(var(--t) * -1)); box-shadow: 0 30px 60px -20px rgba(20, 15, 40, .55); }
.hb-edge {   /* the fore-edge: pages seen from the side */
  position: absolute; top: 2.5%; bottom: 2.5%; right: 2px; width: var(--t);
  transform-origin: 100% 50%; transform: rotateY(-90deg);
  background: repeating-linear-gradient(90deg, #f7f1e4 0 2px, #e6dccb 2px 3px);
  box-shadow: inset 0 0 8px rgba(0,0,0,.18);
}
.hb-first {  /* the first page, waiting under the cover */
  inset: 1.5% 2% 1.5% 0; transform: translateZ(-2px); background: #fffdf8;
  display: flex; flex-direction: column; justify-content: center; gap: .8rem; padding: 14%;
  box-shadow: inset 12px 0 18px -10px rgba(0,0,0,.18);
}
.hb-first-k { font: 400 .62rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.hb-first-t { font: 500 calc(var(--w) * .085)/1.08 var(--sans); letter-spacing: -0.04em; color: var(--ink); }
.hb-cover {
  transform-origin: 0 50%; transform-style: preserve-3d; backface-visibility: hidden;
  background:
    linear-gradient(90deg, rgba(0,0,0,.35) 0, rgba(255,255,255,.08) 3.2%, rgba(0,0,0,.12) 4.5%, transparent 7%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 30% 15%, #2b3170, var(--cloth) 55%, var(--cloth-2));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), inset -3px 0 6px rgba(0,0,0,.25);
  transition: transform 1.3s cubic-bezier(.6, 0, .25, 1);
}
.hb-inside {  /* the endpaper you see once the cover swings open */
  position: absolute; inset: 0; border-radius: inherit; transform: rotateY(180deg); backface-visibility: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(168,122,31,.18) 1.2px, transparent 1.6px) 0 0 / 14px 14px, #f6efe0;
}
.hb-art {
  position: absolute; left: 13%; right: 13%; top: 8%; aspect-ratio: 1100 / 1320;
  background: var(--foil);
  -webkit-mask: url("images/portrait-engraving.png") center / contain no-repeat;
          mask: url("images/portrait-engraving.png") center / contain no-repeat;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.35));
  animation: foil-shine 7s ease-in-out 2.2s infinite; background-size: 220% 220%;
}
@keyframes foil-shine { 0%, 100% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } }
.hb-title {
  position: absolute; left: 0; right: 0; bottom: 14%; text-align: center;
  font: 600 calc(var(--w) * .118)/.95 var(--sans); letter-spacing: -0.03em; text-transform: uppercase;
  background: var(--foil); background-size: 220% 220%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: foil-shine 7s ease-in-out 2.2s infinite;
}
.hb-author {
  position: absolute; left: 0; right: 0; bottom: 6.5%; text-align: center;
  font: 400 calc(var(--w) * .033)/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #d9b764;
}
.hb-ribbon {  /* a silk bookmark, like the one in the Dribbble shot */
  position: absolute; right: 16%; bottom: -26px; width: 20px; height: 44px; transform: translateZ(-12px);
  background: linear-gradient(90deg, #8c2f10, #b0471a 45%, #c9622f);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  animation: ribbon-sway 5s ease-in-out infinite; transform-origin: 50% 0;
}
@keyframes ribbon-sway { 0%, 100% { rotate: 0deg; } 50% { rotate: 3deg; } }
.home-book:hover { --ry: -16deg; --rx: 3deg; }
.home-book:focus-visible { outline: 3px solid var(--accent); outline-offset: 12px; }

/* opening the book */
.home-book.opening { --ry: 0deg; --rx: 0deg; transform: rotateX(0) rotateY(0) translateX(calc(var(--w) * .25)) scale(1.12); }
.home-book.opening .hb-cover { transform: rotateY(-168deg); }
.home-book.opening .hb-ribbon { opacity: 0; transition: opacity .3s; }

@media (max-width: 860px) {
  .home { grid-template-columns: 1fr; text-align: center; gap: 1.4rem; padding-top: 1.6rem; align-content: start; }
  .home-stage { order: -1; }
  .home-book { --w: min(62vw, 270px); --ry: -16deg; --rx: 4deg; }
  .home-text .eyebrow, .home-title, .home .epigraph, .home-contents { display: none; }
  .home-author { margin-top: .4rem; }
  .home-cta { margin-top: 1rem; justify-content: center; }
  .home-cta .begin { width: min(100%, 22rem); justify-content: center; }
  .home-hint { display: none; }
}

/* ---------- Bottom dock: Home · Contents · About ---------- */
.dock {
  position: fixed; z-index: 45; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; gap: .25rem; padding: .35rem; border-radius: 999px;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--line); box-shadow: 0 18px 40px -22px rgba(30, 20, 10, .45);
  animation: dock-in 1s var(--ease-out) .6s both;
}
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 24px); } }
.dock-i {
  display: inline-flex; align-items: center; gap: .5rem; padding: .62rem 1.05rem; border-radius: 999px;
  border: 0; background: transparent; color: var(--ink-2); text-decoration: none; cursor: pointer;
  font: 500 .88rem/1 var(--sans); transition: background .35s, color .35s;
}
.dock-i svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dock-i:hover { background: #f4f1ec; color: var(--ink); }
.dock-i[aria-current="page"] { background: var(--ink); color: #fff; }
@media (max-width: 640px) {
  .dock { left: 0; right: 0; bottom: 0; transform: none; border-radius: 18px 18px 0 0; justify-content: space-around;
          padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom)); animation-name: dock-in-m; }
  @keyframes dock-in-m { from { opacity: 0; transform: translateY(24px); } }
  .dock-i { flex-direction: column; gap: .3rem; font-size: .7rem; padding: .45rem 1rem; }
  body { padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom)); }
}
.site-footer { padding-bottom: calc(var(--dock-h) + 1.5rem); }

/* ---------- About & contact sheet ---------- */
.about-layer { position: fixed; inset: 0; z-index: 70; visibility: hidden; pointer-events: none; transition: visibility 0s .7s; }
.about-layer.open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.about-scrim { position: absolute; inset: 0; background: rgba(30, 20, 10, .2); backdrop-filter: blur(3px); opacity: 0; transition: opacity .6s; }
.about-layer.open .about-scrim { opacity: 1; }
.about-card {
  position: absolute; left: 50%; bottom: 0; width: min(520px, 100vw); transform: translate(-50%, 105%);
  background: #fff; border-radius: 22px 22px 0 0; padding: 1.6rem 1.6rem calc(1.6rem + env(safe-area-inset-bottom));
  box-shadow: 0 -30px 70px -40px rgba(0,0,0,.4); transition: transform .8s var(--ease-out);
  display: grid; grid-template-columns: 92px 1fr; gap: 1rem 1.2rem; align-items: center;
}
.about-layer.open .about-card { transform: translate(-50%, 0); }
.about-art { width: 92px; aspect-ratio: 1100 / 1320; background: var(--foil); background-color: #a87a1f;
  -webkit-mask: url("images/portrait-engraving.png") center / contain no-repeat; mask: url("images/portrait-engraving.png") center / contain no-repeat; }
.about-name { margin: 0; font: 500 1.4rem/1.1 var(--sans); letter-spacing: -0.03em; }
.about-role { margin: .35rem 0 0; font: 400 .72rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.about-links { grid-column: 1 / -1; list-style: none; margin: .4rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.about-links a { display: flex; justify-content: space-between; padding: .95rem .2rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: padding .4s var(--ease-out), color .3s; }
.about-links a:hover { padding-left: .6rem; color: var(--accent); }
.about-links span { color: var(--muted); }
.about-close { position: absolute; top: 1rem; right: 1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--line); background: #fff; font: 300 1.3rem/1 var(--sans); cursor: pointer; }

/* =========================================================
   The open-book reader (chapter pages)
   ========================================================= */
html.reading, html.reading body { height: 100%; overflow: hidden; }
html.reading .site-footer, html.reading .river { display: none; }
.reader { display: grid; justify-items: center; gap: .75rem; padding-top: var(--reader-top, 16px); }
.book-open { position: relative; width: var(--book-w); height: var(--page-h); }
.book-open .paper {
  position: absolute; top: 0; height: 100%; width: var(--page-w); background: #fff;
  box-shadow: 0 1px 0 #ece7de, 0 24px 50px -30px rgba(30, 20, 10, .45);
}
.book-open .paper.left { left: 0; border-radius: 6px 2px 2px 6px; background: linear-gradient(270deg, rgba(0,0,0,.07), rgba(0,0,0,0) 9%), #fff; }
.book-open .paper.right { right: 0; border-radius: 2px 6px 6px 2px; background: linear-gradient(90deg, rgba(0,0,0,.07), rgba(0,0,0,0) 9%), #fff; }
.book-open.single .paper.right { display: none; }
.book-open.single .paper.left { border-radius: 4px 8px 8px 4px; background: linear-gradient(90deg, rgba(0,0,0,.05), rgba(0,0,0,0) 4%), #fff; }
.book-open::before, .book-open::after {   /* page-stack edges at the sides */
  content: ""; position: absolute; top: 3px; bottom: 3px; width: 5px; background: repeating-linear-gradient(90deg, #fff 0 1px, #e7e1d6 1px 2px);
}
.book-open::before { left: -5px; border-radius: 3px 0 0 3px; }
.book-open::after { right: -5px; border-radius: 0 3px 3px 0; }
.book-open.single::before { display: none; }
.page-viewport { position: absolute; left: var(--pad-x); top: var(--pad-y); width: var(--view-w); height: var(--text-h); overflow: hidden; }
.page-flow {
  position: absolute; left: 0; top: 0; width: var(--view-w); height: var(--text-h);
  column-count: var(--cols); column-gap: var(--col-gap); column-fill: auto;
  transition: transform 0s;
}
/* everything inside a page: no page-width wrappers, calmer type */
.page-flow .wrap, .page-flow .prose, .page-flow .news, .page-flow .flow { max-width: none !important; width: auto !important; margin: 0 !important; padding-inline: 0 !important; }
.page-flow section, .page-flow article, .page-flow header, .page-flow nav { padding-block: 0 !important; }
.page-flow .story-head, .page-flow .hero { padding-top: .5rem !important; padding-bottom: 1.2rem !important; min-height: 0 !important; }
.page-flow .story-head h1, .page-flow .hero h1 { font-size: clamp(2rem, 3.4vw, 3rem) !important; line-height: 1 !important; }
.page-flow .ch-num { font-size: 2.4rem; margin-bottom: .6rem; }
.page-flow .brand-tile { width: 44px; margin-bottom: .8rem; }
.page-flow .flow { padding-top: 2.2rem !important; }
.page-flow .flow p, .page-flow p { font-size: 1rem !important; line-height: 1.7 !important; }
.page-flow .flow p:last-of-type { font-size: 1.1rem !important; }
.page-flow .flow p:first-of-type::first-letter { font-size: 3rem; }
.page-flow .chapter { font-size: 1.35rem !important; margin: 1.6rem 0 .8rem !important; break-after: avoid; }
.page-flow figure, .page-flow .card, .page-flow .book, .page-flow .stop, .page-flow .detour, .page-flow .news-card, .page-flow .log li,
.page-flow .turn-next, .page-flow blockquote, .page-flow .chapter + p { break-inside: avoid; }
.page-flow figure { margin: 1.2rem 0 !important; }
.page-flow figure svg, .page-flow figure img { max-height: calc(var(--text-h) - 5rem); width: auto; max-width: 100%; margin-inline: auto; display: block; }
.page-flow .ill-map { max-width: 100% !important; }
.page-flow .cards, .page-flow .books, .page-flow .news-list, .page-flow .protocol, .page-flow .grid-2 { grid-template-columns: 1fr !important; }
.page-flow .book { grid-template-columns: 7rem 1fr; padding: 1rem; }
.page-flow .road::before, .page-flow .stop::before, .page-flow .detour::before { display: none; }
.page-flow .stop { grid-template-columns: 1fr; gap: .2rem; padding-block: 1rem; }
.page-flow .stop-when { text-align: left; }
.page-flow .detour { padding-left: 0; }
.page-flow .section + .section::before, .page-flow .section + .section::after { display: none; }
.page-flow .section-title { font-size: 1.5rem !important; margin-bottom: 1rem !important; }
.page-flow .run { box-shadow: none; }
.page-flow .turn { padding-top: 2rem !important; }
.page-flow .turn::before { margin-bottom: 1.5rem; }
.page-flow .turn-t { font-size: 2rem; }
.page-flow .rv { opacity: 1 !important; transform: none !important; filter: none !important; }
.page-flow .to-be-continued { padding-block: 2rem 1rem !important; }

/* the spine shadow between the two pages */
.book-open .spine { position: absolute; top: 0; bottom: 0; left: 50%; width: 46px; transform: translateX(-50%); pointer-events: none; z-index: 3;
  background: linear-gradient(90deg, transparent, rgba(40,25,10,.10) 40%, rgba(40,25,10,.16) 50%, rgba(40,25,10,.10) 60%, transparent); }
.book-open.single .spine { display: none; }
.folio { position: absolute; bottom: calc(var(--pad-y) * .45); font: 400 .7rem/1 var(--mono); color: var(--muted); letter-spacing: .06em; z-index: 4; }
.folio.l { left: var(--pad-x); } .folio.r { right: var(--pad-x); }
.book-open.single .folio.r { display: none; }

/* turning leaves */
.leaf { position: absolute; top: 0; height: 100%; width: var(--page-w); overflow: hidden; background: #fff; z-index: 5;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; will-change: transform; }
.leaf .page-flow { left: var(--leaf-x); top: var(--pad-y); }
.leaf .page-flow * { animation: none !important; transition: none !important; }
.leaf .page-flow .ill, .leaf .page-flow .w { opacity: 1 !important; transform: none !important; filter: none !important; }
.leaf .page-flow .draw { stroke-dashoffset: 0 !important; }
.leaf-shade { position: absolute; inset: 0; pointer-events: none; opacity: 0; }

/* controls under the book */
.reader-controls { display: flex; align-items: center; gap: .6rem; }
.rc-btn { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
  font: 400 1.1rem/1 var(--sans); transition: border-color .3s, transform .4s var(--ease-out), opacity .3s; }
.rc-btn:hover { border-color: var(--ink-2); }
.rc-btn:active { transform: scale(.94); }
.rc-btn[disabled] { opacity: .35; cursor: default; }
.rc-count { min-width: 8.5rem; text-align: center; font: 400 .74rem/1 var(--mono); letter-spacing: .06em; color: var(--muted); }
.rc-mode { margin-left: .4rem; border: 0; background: none; color: var(--muted); font: 400 .72rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rc-mode:hover { color: var(--accent); }
.as-book { position: fixed; z-index: 44; right: 16px; top: calc(3.5rem + 12px); border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .5rem .9rem; font: 400 .72rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .home-book, .hb-cover, .hb-art, .hb-title, .hb-ribbon, .dock { animation: none !important; transition: none !important; }
}

/* as the book opens, the words beside it step back */
.home-text { transition: opacity .7s var(--ease-soft), transform .9s var(--ease-out), filter .7s; }
.home:has(.home-book.opening) .home-text { opacity: 0; transform: translateX(-28px); filter: blur(4px); }
.home:has(.home-book.opening) .home-hint { opacity: 0; transition: opacity .4s; }

/* phone home: the book up top, Begin reading resting just above the dock */
@media (max-width: 860px) {
  .home { min-height: calc(100svh - 3.5rem - var(--dock-h) - env(safe-area-inset-bottom) - 8px); align-content: space-between; padding-bottom: 1rem; }
  .home-stage { padding-top: 1rem; }
  .home-author { display: none; }   /* the name is already on the cover */
}

/* =========================================================
   Physics page turns: one double-sided sheet, shadows that follow the light
   ========================================================= */
.book-open { touch-action: none; }
.book-open.dragging, .book-open.dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.leaf3d {
  position: absolute; top: 0; height: 100%; width: var(--page-w); z-index: 7;
  transform-style: preserve-3d; will-change: transform;
}
.leaf-face {
  position: absolute; inset: 0; overflow: hidden; background: #fff;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 0 1px rgba(0,0,0,.08);
}
.leaf-face.back { transform: rotateY(180deg); }
.leaf-face.leaf-still { inset: auto; top: 0; bottom: 0; width: var(--page-w); z-index: 5; }
.leaf-face .page-flow { left: var(--leaf-x); top: var(--pad-y); }
.leaf-face .page-flow * { animation: none !important; transition: none !important; }
.leaf-face .page-flow .ill, .leaf-face .page-flow .w, .leaf-face .page-flow .rv { opacity: 1 !important; transform: none !important; filter: none !important; }
.leaf-face .page-flow .draw { stroke-dashoffset: 0 !important; }
.leaf-face .leaf-shade {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(40,25,10,.34), rgba(40,25,10,.10) 45%, rgba(40,25,10,.22));
}
.cast { position: absolute; top: 0; height: 100%; width: var(--page-w); z-index: 6; pointer-events: none; opacity: 0; }
.cast.from-left  { background: linear-gradient(90deg, rgba(40,25,10,.5), rgba(40,25,10,.12) 22%, transparent 55%); }
.cast.from-right { background: linear-gradient(270deg, rgba(40,25,10,.5), rgba(40,25,10,.12) 22%, transparent 55%); }

/* the home book: the words step aside as it opens */
.home:has(.home-book.opening-js) .home-text { opacity: 0; transform: translateX(-28px); filter: blur(4px); }
.home:has(.home-book.opening-js) .home-hint, .home-book.opening-js .hb-ribbon { opacity: 0; transition: opacity .4s; }

/* ---------- The crease, fixed ----------
   1) one shadow for the whole book, so neither page throws its shadow across the fold
   2) the spine shading stays on top of turning sheets, still pages and cast shadows
   3) every copied page face carries the same gutter shading as the real paper, so nothing pops when a turn ends */
.book-open { border-radius: 6px; box-shadow: 0 1px 0 #ece7de, 0 26px 54px -30px rgba(30, 20, 10, .45); }
.book-open .paper { box-shadow: none; }
.book-open .spine { z-index: 9; }
.leaf-face.g-l { background: linear-gradient(90deg, rgba(0,0,0,.07), rgba(0,0,0,0) 9%), #fff; }
.leaf-face.g-r { background: linear-gradient(270deg, rgba(0,0,0,.07), rgba(0,0,0,0) 9%), #fff; }
.leaf-face.g-s { background: linear-gradient(90deg, rgba(0,0,0,.05), rgba(0,0,0,0) 4%), #fff; }
.folio { z-index: 10; }

/* =========================================================
   Calmer pages: smaller type, less clutter
   ========================================================= */
.rc-mode, .as-book { display: none !important; }
.page-flow .flow p, .page-flow p { font-size: .92rem !important; line-height: 1.66 !important; }
.page-flow .flow p:last-of-type { font-size: 1rem !important; }
.page-flow .flow p:first-of-type::first-letter { font-size: 2.6rem; }
.page-flow .story-head h1, .page-flow .hero h1 { font-size: clamp(1.7rem, 2.8vw, 2.4rem) !important; }
.page-flow .ch-num { font-size: 2rem; margin-bottom: .4rem; }
.page-flow .chapter { font-size: 1.18rem !important; }
.page-flow .section-title { font-size: 1.3rem !important; }
.page-flow figcaption { font-size: .82rem !important; }
.page-flow .eyebrow, .page-flow .label, .page-flow .kicker { font-size: .66rem !important; }
.page-flow .turn-t { font-size: 1.7rem; }
.page-flow .news-head { font-size: 1.02rem; }
.page-flow .stop-num { font-size: 1.6rem; }
.page-flow .card h3, .page-flow .book h3 { font-size: 1.15rem; }

/* the Contents page, inside the book */
.page-flow .contents-head h1 { font-size: clamp(2rem, 3.4vw, 2.8rem) !important; }
.page-flow .toc-list { border-top: 1px solid var(--ink); }
.page-flow .toc-list li { break-inside: avoid; }
.page-flow .toc-list a { padding: .8rem .1rem; grid-template-columns: 2.2rem 1fr auto; gap: .7rem; }
.page-flow .toc-t { font-size: 1.02rem; }
.page-flow .toc-t small { font-size: .78rem; }

/* the opening page of the next chapter, as the sheet lands on it */
.leaf-face .opener { position: absolute; left: var(--pad-x); right: var(--pad-x); top: calc(var(--pad-y) + .5rem); }
.leaf-face .opener .ch-num { margin: 0 0 .4rem; font: 400 2rem/1 var(--mono); color: var(--gold); animation: none; }
.leaf-face .opener .eyebrow { margin: 0; font-size: .66rem; animation: none; }

/* =========================================================
   Changing chapter: the book stays put, a page turns, the words fade in
   ========================================================= */
.book-open { view-transition-name: book; }
.reader-controls { view-transition-name: controls; }
.dock { view-transition-name: dock; }
html:active-view-transition-type(turn)::view-transition-old(root),
html:active-view-transition-type(turn)::view-transition-new(root) { animation: none; }
html:active-view-transition-type(turn)::view-transition-group(book),
html:active-view-transition-type(turn)::view-transition-group(controls),
html:active-view-transition-type(turn)::view-transition-group(dock),
html:active-view-transition-type(turn)::view-transition-group(bookbar) { animation-duration: 0s; }
html:active-view-transition-type(turn)::view-transition-old(book) { animation: turn-old .5s ease both; }
html:active-view-transition-type(turn)::view-transition-new(book) { animation: turn-new .7s cubic-bezier(.22,1,.36,1) both; }
html:active-view-transition-type(turn)::view-transition-old(controls),
html:active-view-transition-type(turn)::view-transition-old(dock) { animation: none; opacity: 0; }
html:active-view-transition-type(turn)::view-transition-new(controls),
html:active-view-transition-type(turn)::view-transition-new(dock) { animation: none; }
@keyframes turn-old { to { opacity: 0; } }
@keyframes turn-new { from { opacity: 0; } }
/* no entrance flourishes when you arrive by turning a page */
.turned .ch-num, .turned .story-head .eyebrow, .turned .story-head .lede, .turned .hero .eyebrow, .turned .hero .lede,
.turned .hero .stats, .turned .brand-tile, .turned .dock { animation: none !important; }

/* home is just the book: no footer peeking under the dock */
body:has(.home) .site-footer { display: none; }

/* =========================================================
   One page, one book: chapters live side by side in one track
   ========================================================= */
html.deep .home { visibility: hidden; }            /* a link straight to a chapter: no flash of the cover */
html.reading .home { display: none; }
.reader[hidden] { display: none; }
.page-track { position: absolute; inset: 0; will-change: transform; }
.bk-pad { position: absolute; top: 0; width: var(--col-w); height: var(--text-h); display: grid; place-items: center; pointer-events: none; }
.leaf-face .bk-pad { left: var(--pad-x); top: var(--pad-y); }
.bk-pad svg { width: 52px; fill: none; stroke: var(--gold); stroke-width: 1.3; stroke-linecap: round; opacity: .5; }
.bk-fail { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); }

/* breathing room: openings sit lower, blocks are spaced evenly, nothing is stranded at a page foot */
.page-flow > .story-head:first-child, .page-flow > .hero:first-child { padding-top: calc(var(--text-h) * .12) !important; padding-bottom: 1.4rem !important; }
.page-flow > :not(:first-child) { padding-top: 1.8rem !important; }
.page-flow p { margin: 0 0 .9em; orphans: 2; widows: 2; }
.page-flow h1, .page-flow h2, .page-flow h3, .page-flow .chapter, .page-flow .section-title, .page-flow .eyebrow { break-after: avoid; }
.page-flow figure, .page-flow .yt, .page-flow .video, .page-flow .card, .page-flow .book, .page-flow .stop,
.page-flow .news-card, .page-flow .log li, .page-flow .stats li { break-inside: avoid; }
.page-flow figure { margin: 1.6rem 0 !important; }
.page-flow ul, .page-flow ol { padding-left: 1.1rem; }
.page-flow .toc-list, .page-flow .about-links, .page-flow .stats, .page-flow .log { padding-left: 0; }

/* the About page (it used to be the footer) */
.page-flow .about-head h1 { font-size: clamp(1.7rem, 2.8vw, 2.4rem) !important; }
.page-flow .about-page { display: grid; gap: 1rem; padding-top: .6rem !important; }
.page-flow .about-art { width: 110px; }
.page-flow .about-role { margin: 0; }
.page-flow .about-links { margin-top: .4rem; }
.page-flow .about-links a { font-size: .95rem; }
.page-flow .about-fine { margin-top: 1.6rem; font: 400 .7rem/1.7 var(--mono) !important; letter-spacing: .06em; color: var(--muted); }
.page-flow .about-links { break-inside: avoid; }
/* the résumé, set for a page: stats in three tidy columns, no grey band */
.page-flow .impact { background: none; border: 0; }
.page-flow .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem 1rem; margin: 0 !important; padding: 1.2rem 0 !important; border-block: 1px solid var(--line); }
.page-flow .stats strong { font-size: 1.6rem; }
.page-flow .stats span { font-size: .74rem; }
.page-flow .hero .lede { font-size: .98rem !important; }
.page-flow .hero .cta { margin-top: 1.2rem; }
/* the live run card, set for a page */
.page-flow .run { padding: 1.1rem !important; }
.page-flow .hypothesis { font-size: 1.35rem !important; line-height: 1.2; }
.page-flow .run-head { flex-wrap: wrap; gap: .4rem; }
.page-flow .run { overflow: visible; }                 /* a clipped box cannot flow across pages */
.page-flow .timeline li { grid-template-columns: 1fr; gap: .3rem; padding-block: 1rem; break-inside: avoid; }
.page-flow .timeline h3 em { display: block; margin-top: .15rem; }
.page-flow .to-be-continued p { font-size: 1.7rem !important; line-height: 1.2 !important; }

/* =========================================================
   Home = the closed book, lying exactly where the open book will be.
   Desktop: its cover is the right-hand page and the title sits on the left-hand page,
   so opening it is only the cover swinging over the title. Phone: the book is the one page.
   ========================================================= */
main { position: relative; }
.reader { position: absolute; top: 0; left: 0; right: 0; }
body:has(.home) { padding-bottom: 0 !important; }
html:not(.reading) body:has(.home) { overflow: hidden; }
.home.wrap {
  position: relative; display: block; max-width: none; margin: 0; padding: 0 !important;
  min-height: 0 !important; height: calc(100svh - var(--bar-h, 56px)); text-align: left;
}
.home-stage {
  position: absolute; left: calc(50% + var(--bk-x, 0px)); top: var(--bk-top, 18px);
  width: var(--pg-w, 360px); height: var(--pg-h, 540px); display: block; padding: 0; perspective: 2400px; order: 0;
}
.home-book, .one-page .home-book { --w: var(--pg-w, 360px); --t: 22px; --ry: -10deg; --rx: 3deg; width: 100%; height: 100%; aspect-ratio: auto; }
.home-book:hover { --ry: -6deg; --rx: 2deg; }
.hb-cover, .hb-back { border-radius: 2px 6px 6px 2px; }
.hb-art { left: 50%; right: auto; top: 9%; height: 52%; width: auto; translate: -50% 0; }
.hb-title { bottom: 15%; }
.hb-first {   /* the first page under the cover: plain paper, like the right-hand page it becomes */
  inset: 0; transform: translateZ(-1px); border-radius: 2px 6px 6px 2px; box-shadow: none;
  background: linear-gradient(90deg, rgba(0,0,0,.07), rgba(0,0,0,0) 9%), #fff;
}
.hb-inside { border-radius: 6px 2px 2px 6px; background: linear-gradient(90deg, rgba(0,0,0,.07), rgba(0,0,0,0) 9%), #fff; }
.home-hint { position: absolute; left: 0; right: 0; top: calc(100% + 1.4rem); margin: 0; text-align: center; display: block !important; transition: opacity .4s; }
.home-book.opening-js ~ .home-hint, .home-book.opening-js .hb-ribbon { opacity: 0; }
.home-text {
  position: absolute; left: calc(50% - var(--pg-w, 360px)); top: var(--bk-top, 18px);
  width: var(--pg-w, 360px); height: var(--pg-h, 540px); padding: var(--hp-y) calc(var(--hp-x) * 1.3);
  display: flex; flex-direction: column; justify-content: center;
}
.home-title { font-size: calc(var(--pg-w, 360px) * .14); }
.home:has(.home-book.opening-js) .home-text { opacity: 1; transform: none; filter: none; }   /* the cover sweeps over the words */
.one-page .home-text { display: none; }          /* phone: the book is the whole page; tap it to open */
.one-page .home-book { --ry: -4deg; --rx: 1.5deg; } .one-page .home-book:hover { --ry: -2deg; --rx: 1deg; }
.hb-first-k, .hb-first-t { visibility: hidden; }   /* plain paper: the real words fade in where they belong */

/* ---------- No header, no button row: only the book and the dock ---------- */
.rhead { position: absolute; top: calc(var(--pad-y) * .42); z-index: 10; max-width: calc(var(--page-w) - 2 * var(--pad-x));
  font: 400 .6rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.rhead.l { left: var(--pad-x); }
.rhead.r { right: var(--pad-x); text-align: right; }
.book-open.single .rhead.r { display: none; }
.edge-btn { position: absolute; top: 50%; translate: 0 -50%; z-index: 11; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.94); color: var(--ink);
  font: 400 1rem/1 var(--sans); cursor: pointer; opacity: 0; transition: opacity .3s; box-shadow: 0 6px 16px -10px rgba(30,20,10,.4); }
.edge-btn.prev { left: -18px; } .edge-btn.next { right: -18px; }
.book-open.single .edge-btn.prev { left: 6px; } .book-open.single .edge-btn.next { right: 6px; }
.book-open.hover-prev .edge-btn.prev, .book-open.hover-next .edge-btn.next, .edge-btn:focus-visible { opacity: 1; }
.book-open.hover-prev, .book-open.hover-next { cursor: pointer; }
.edge-btn[disabled] { visibility: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home-hint { top: calc(100% + 9px); font-size: .62rem; }

/* =========================================================
   The book as an object, rendered with care:
   cloth-covered boards that overhang the pages, a rounded spine, a page block you can see
   at the head, a pressed hinge, foil stamped into the cloth, light from the upper left,
   a tight contact shadow and a soft one on the table. The open book keeps the same boards.
   ========================================================= */
:root {
  --noise: 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --cloth-face: radial-gradient(130% 100% at 22% 8%, #2d3376, var(--cloth) 52%, #171b45);
  --sqy: 5px;   /* how far the boards stand proud of the pages, top and bottom */
  --sqx: 7px;   /* … and at the fore-edge */
}
.home-book, .one-page .home-book { --t: calc(var(--w) * .062); --hinge: calc(var(--w) * .055); }
.home-book::after { display: none; }

/* the two boards */
.hb-cover, .hb-back { top: calc(var(--sqy) * -1); bottom: calc(var(--sqy) * -1); left: 0; right: calc(var(--sqx) * -1); border-radius: 2px 6px 6px 2px; }
.hb-cover {
  background:
    linear-gradient(90deg, rgba(0,0,0,.45) 0, rgba(255,255,255,.06) 3px, transparent 10px,
      transparent calc(var(--hinge) - 7px), rgba(0,0,0,.32) calc(var(--hinge) - 1px), rgba(255,255,255,.13) calc(var(--hinge) + 1px),
      rgba(0,0,0,.10) calc(var(--hinge) + 4px), transparent calc(var(--hinge) + 14px)),
    var(--noise), var(--cloth-face);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset -1px 0 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.4);
}
.hb-cover::after {   /* the room's light on the cloth: a soft sheen that glides as the book leans */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; backface-visibility: hidden;
  background:
    linear-gradient(112deg, transparent calc(var(--sx, 32%) - 26%), rgba(255,255,255,.075) var(--sx, 32%), transparent calc(var(--sx, 32%) + 26%)),
    linear-gradient(155deg, rgba(255,255,255,.05), transparent 38%, rgba(0,0,0,.2));
  transition: background-position .3s;
}
.hb-back {
  background: var(--noise), #151939;
  box-shadow:                                   /* light from the upper left: a tight contact shadow, then a soft one */
    1px 2px 2px rgba(15, 10, 30, .38),
    6px 12px 18px -4px rgba(15, 10, 30, .26),
    24px 42px 64px -22px rgba(15, 10, 30, .34);
}

/* the thickness: rounded spine, head, tail and fore-edge */
.hb-spine, .hb-head, .hb-tail, .hb-edge { position: absolute; pointer-events: none; }
.hb-spine {
  left: 0; top: calc(var(--sqy) * -1); bottom: calc(var(--sqy) * -1); width: var(--t);
  transform-origin: 0 50%; transform: rotateY(90deg); border-radius: 3px;
  background: var(--noise), linear-gradient(90deg, #10132f 0%, #232963 30%, #2f367c 50%, #222860 70%, #0e1130 100%);
}
.hb-head, .hb-tail {
  left: 0; right: calc(var(--sqx) * -1); height: var(--t);
  background:
    linear-gradient(180deg, #181c44 0 9%, rgba(0,0,0,.25) 9% 12%, transparent 12% 88%, rgba(0,0,0,.25) 88% 91%, #181c44 91%),
    repeating-linear-gradient(180deg, #fbf7ee 0 1px, #e4dccb 1px 2px);
}
.hb-head { top: calc(var(--sqy) * -1); transform-origin: 50% 0; transform: rotateX(-90deg); }
.hb-tail { bottom: calc(var(--sqy) * -1); transform-origin: 50% 100%; transform: rotateX(90deg); }
.hb-edge {
  right: calc(var(--sqx) * -1); left: auto; top: calc(var(--sqy) * -1); bottom: calc(var(--sqy) * -1); width: var(--t);
  transform-origin: 100% 50%; transform: rotateY(-90deg); box-shadow: none;
  background:
    linear-gradient(90deg, #181c44 0 9%, rgba(0,0,0,.25) 9% 12%, transparent 12% 88%, rgba(0,0,0,.25) 88% 91%, #181c44 91%),
    repeating-linear-gradient(90deg, #fbf7ee 0 1px, #e4dccb 1px 2px);
}

/* the first leaf under the cover, and the inside of the cover (endpaper pasted on the board) */
.hb-first { inset: 0; transform: translateZ(-3px); }
.hb-inside { background: var(--noise), #1a1e4a; border-radius: 6px 2px 2px 6px; }
.hb-inside::before {
  content: ""; position: absolute; top: var(--sqy); bottom: var(--sqy); left: var(--sqx); right: 0;
  background: linear-gradient(270deg, rgba(0,0,0,.08), rgba(0,0,0,0) 9%), #fff;
}

/* foil pressed into the cloth, not printed on top of it */
.hb-art { filter: drop-shadow(0 -.6px 0 rgba(0,0,0,.55)) drop-shadow(0 .8px 0 rgba(255,255,255,.1)); }
.hb-title { filter: drop-shadow(0 -.6px 0 rgba(0,0,0,.55)) drop-shadow(0 .9px 0 rgba(255,255,255,.12)); }
.hb-author { text-shadow: 0 -.5px 0 rgba(0,0,0,.6), 0 .7px 0 rgba(255,255,255,.08); }

/* the silk ribbon comes out of the page block, between the boards */
.hb-ribbon { right: 9%; bottom: calc(var(--sqy) * -1 - 15px); height: 32px; width: 16px; transform: translateZ(calc(var(--t) * -.5)); }
.home-hint { top: calc(100% + 15px); }

/* the open book keeps its boards: the same cloth shows around the pages */
.book-open { isolation: isolate; box-shadow: none; }
.book-open .boards {
  position: absolute; z-index: -1; top: calc(var(--sqy) * -1); bottom: calc(var(--sqy) * -1); left: calc(var(--sqx) * -1); right: calc(var(--sqx) * -1);
  border-radius: 5px; pointer-events: none;
  background: linear-gradient(90deg, transparent calc(50% - 3px), rgba(0,0,0,.45) 50%, transparent calc(50% + 3px)), var(--noise), var(--cloth-face);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 1px 2px 2px rgba(15,10,30,.32), 6px 12px 18px -4px rgba(15,10,30,.22), 24px 42px 64px -22px rgba(15,10,30,.28);
}
.book-open.single .boards { background: var(--noise), var(--cloth-face); left: -3px; }
.book-open::before, .book-open::after { top: 1px; bottom: 1px; width: 4px; }
.book-open::before { left: -4px; } .book-open::after { right: -4px; }
.home-book { --ry: -17deg; --rx: 7deg; }
.home-book:hover { --ry: -13deg; --rx: 5deg; }
.one-page .home-book { --ry: -7deg; --rx: 3.5deg; }
.one-page .home-book:hover { --ry: -5deg; --rx: 2.5deg; }
:root { --cloth-face: radial-gradient(130% 100% at 22% 8%, #272d6c, var(--cloth) 50%, #161a42); }
.hb-cover::after {
  background:
    linear-gradient(112deg, transparent calc(var(--sx, 32%) - 24%), rgba(255,255,255,.05) var(--sx, 32%), transparent calc(var(--sx, 32%) + 24%)),
    linear-gradient(155deg, transparent 45%, rgba(0,0,0,.22));
}
/* seen from slightly above and to the left, the way you look down at a book on a table:
   the head and the fore-edge show their pages */
.home-book { --ry: -17deg; --rx: -8deg; }
.home-book:hover { --ry: -13deg; --rx: -6deg; }
.one-page .home-book { --ry: -8deg; --rx: -5deg; }
.one-page .home-book:hover { --ry: -6deg; --rx: -4deg; }
.home-book, .one-page .home-book { --t: calc(var(--w) * .08); }
/* your eye: a little above the book and toward the middle of the screen */
.home-stage { perspective: 1900px; perspective-origin: 20% -18%; }
.one-page .home-stage { perspective-origin: 50% -14%; }
.home-book { --rx: -4deg; } .home-book:hover { --rx: -3deg; }
.one-page .home-book { --rx: -2deg; } .one-page .home-book:hover { --rx: -1.5deg; }
/* warm paper on the edges: the head catches the light, the fore-edge sits in soft shade */
.hb-head { background:
    linear-gradient(180deg, #181c44 0 8%, rgba(0,0,0,.3) 8% 11%, transparent 11% 89%, rgba(0,0,0,.3) 89% 92%, #181c44 92%),
    linear-gradient(90deg, rgba(255,255,255,.25), rgba(0,0,0,.06)),
    repeating-linear-gradient(180deg, #f4eddd 0 1px, #dcd1bb 1px 2px); }
.hb-tail { background:
    linear-gradient(180deg, #11142f 0 8%, rgba(0,0,0,.3) 8% 11%, transparent 11% 89%, rgba(0,0,0,.3) 89% 92%, #11142f 92%),
    linear-gradient(rgba(40,25,10,.28), rgba(40,25,10,.28)),
    repeating-linear-gradient(180deg, #efe7d6 0 1px, #d6cab3 1px 2px); }
.hb-edge { background:
    linear-gradient(90deg, #12153a 0 8%, rgba(0,0,0,.3) 8% 11%, transparent 11% 89%, rgba(0,0,0,.3) 89% 92%, #12153a 92%),
    linear-gradient(180deg, rgba(40,25,10,.08), rgba(40,25,10,.2)),
    repeating-linear-gradient(90deg, #efe7d6 0 1px, #d3c7b0 1px 2px); }
.home-stage { perspective: 1700px; perspective-origin: 30% -12%; }
.home-book { --ry: -26deg; --rx: -10deg; } .home-book:hover { --ry: -22deg; --rx: -8deg; }
.one-page .home-book { --ry: -13deg; --rx: -6deg; } .one-page .home-book:hover { --ry: -11deg; --rx: -5deg; }
.home-book { animation-fill-mode: backwards; }   /* once it has arrived, let go: a held animation flattens the 3D edges */
.one-page .home-book { --ry: -6deg; --rx: -7deg; } .one-page .home-book:hover { --ry: -5deg; --rx: -6deg; }
.one-page { --sqx: 5px; --sqy: 4px; }

/* paper, in strips that bend */
.book-open { perspective: 2400px; }
.leaf3d { width: var(--page-w); will-change: auto; }
.leaf-seg { position: absolute; top: 0; height: 100%; transform-style: preserve-3d; will-change: transform; }
.leaf-face.seg { inset: auto; top: 0; bottom: 0; box-shadow: none; background-repeat: no-repeat; }
.leaf-face.seg.back { transform: rotateY(180deg); }
.leaf-face.seg .leaf-shade { opacity: 1; }
.rhead, .folio { z-index: 6; }   /* under a turning sheet, above the pages that lie still */

/* the travelling shadow under a turning sheet */
.cast-slot { position: absolute; top: 0; height: 100%; width: var(--page-w); overflow: hidden; z-index: 6; pointer-events: none; opacity: 0; }
.cast-slot .cast { left: 0; opacity: 1; z-index: auto; width: 100%; will-change: transform; }
.cast-slot .cast.from-left { transform-origin: 0 50%; }
.cast-slot .cast.from-right { transform-origin: 100% 50%; }
.primed { opacity: .002; pointer-events: none; }   /* a prepared sheet: already painted, waiting unseen */

/* ---------- one page in your hand: the paper fold ---------- */
.fold-clip { position: absolute; inset: 0; overflow: hidden; z-index: 7; border-radius: 2px 6px 6px 2px; pointer-events: none; }
.fold-clip .leaf-face { inset: 0; box-shadow: none; }
.fold-flap { transform-origin: 0 0; background: #f6f2e9 !important; }
.fold-flap .page-flow { opacity: .07; }                       /* the words, faintly through the paper */
.fold-under, .fold-light, .fold-bend, .fold-edge { position: absolute; left: 0; top: -80%; height: 160%; pointer-events: none; will-change: transform; }
.fold-under { transform-origin: 0 50%; background: linear-gradient(90deg, rgba(30,18,6,.34), rgba(30,18,6,.1) 40%, transparent); }
.fold-light { transform-origin: 0 50%; background: linear-gradient(90deg, rgba(255,255,255,.75), rgba(255,255,255,.15) 14%, transparent 40%, rgba(30,18,6,.06) 80%, rgba(30,18,6,.14)); }
.fold-bend { left: -46px; width: 46px; transform-origin: 100% 50%; background: linear-gradient(270deg, rgba(30,18,6,.16), rgba(30,18,6,.04) 55%, transparent); }
.fold-edge { left: -22px; width: 22px; transform-origin: 100% 50%; background: linear-gradient(270deg, rgba(30,18,6,.2), transparent); }
/* the spine side of a single page is paper, not the dark board */
.book-open.single .boards { left: 0; border-radius: 0 5px 5px 0; }
.fold-clip, .fold-clip * { backface-visibility: visible !important; -webkit-backface-visibility: visible !important; }   /* a mirrored flap is still a visible page */
.fold-under { background: linear-gradient(90deg, rgba(30,18,6,.26), rgba(30,18,6,.07) 45%, transparent); }

/* ---------- one page in view, still an open book: the facing page curves into the spine ---------- */
.page-viewport { left: calc(var(--sl, 0px) + var(--pad-x)); }
.folio.l, .rhead.l { left: calc(var(--sl, 0px) + var(--pad-x)); }
.book-open.single .paper.left {      /* the facing page, seen as it falls away into the gutter */
  display: block; left: 0; width: var(--sl); border-radius: 4px 0 0 4px;
  background: linear-gradient(90deg, #ece6da 0%, #faf7f0 30%, #fff 52%, #f1ece2 78%, #d9d1c2 100%);
}
.book-open.single .paper.right {     /* the page you are reading */
  display: block; left: var(--sl); right: auto; width: var(--page-w); border-radius: 0 6px 6px 0;
  background: linear-gradient(90deg, rgba(0,0,0,.09), rgba(0,0,0,.02) 5%, rgba(0,0,0,0) 10%), #fff;
}
.book-open.single .spine { display: block; left: var(--sl); width: 26px; }
.book-open.single::before { display: block; left: -4px; }            /* the edges of the pages already read */
.book-open.single .boards { left: calc(var(--sqx) * -1); border-radius: 5px; }
.fold-clip { inset: auto; top: 0; bottom: 0; left: 0; width: calc(var(--sl, 0px) + var(--page-w)); border-radius: 4px 6px 6px 4px; }
.fold-stage { position: absolute; top: 0; bottom: 0; left: var(--sl, 0px); width: var(--page-w); }
.book-open.single .edge-btn.prev { left: calc(var(--sl, 0px) + 4px); }
.book-open.single .spine { z-index: 6; }   /* the crease lies under a page that folds over it */

/* the same floating dock on phones as on the web */
@media (max-width: 640px) {
  .dock {
    left: 50%; right: auto; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
    border-radius: 999px; justify-content: flex-start; padding: .3rem; animation-name: dock-in;
  }
  .dock-i { flex-direction: row; gap: .45rem; font-size: .82rem; padding: .58rem .9rem; }
}

/* ---------- the shore: fine pale sand under the book, the sea breathing at the top ---------- */
html body {
  background:
    var(--noise),
    radial-gradient(120% 90% at 70% 100%, #f3ebdd, #efe5d3 55%, #e9dcc6);
  background-attachment: fixed;
}
.beach { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main { z-index: 1; }
.home-hint { color: #8a7a62; }

/* ---------- the shore, filmed: a real sea behind the book ---------- */
.beach { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.6s ease; overflow: hidden; }
.beach.ready { opacity: 1; }
.beach video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%;
  opacity: 0; transition: opacity 1.4s ease-in-out;
  filter: saturate(.92) brightness(1.06) sepia(.08);          /* a gentle, warm grade */
}
.beach video.on { opacity: 1; }
/* frame the sand: the foam meets the lower part of the book, the sea lies beyond; a little camera blur, focus on the book */
.beach video {
  object-position: 50% 100%; transform: scale(1.32); transform-origin: 50% 100%;
  filter: saturate(.9) brightness(1.07) sepia(.1) blur(1.4px);
}
/* soft light behind the title, so the words read clearly over the water */
.home-text { isolation: isolate; }
.home-text::before {
  content: ""; position: absolute; z-index: -1; inset: 6% -8% 6% -14%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(246, 240, 229, .9), rgba(246, 240, 229, .65) 55%, rgba(246, 240, 229, 0));
  filter: blur(6px);
}
.home-author, .home .eyebrow { color: #8a6a26; }
/* a phone shows the right-hand page; the facing page runs on past the left edge of the screen */
.book-open.bleed { justify-self: start; }
.book-open.bleed .boards { border-radius: 0 5px 5px 0; }
.book-open.bleed .paper.left { border-radius: 0; }

/* =========================================================
   Set like a printed book
   ========================================================= */
/* page numbers at the foot, centred; running heads at the top, centred */
.folio, .rhead { width: var(--page-w); max-width: none; text-align: center; padding-inline: var(--pad-x); box-sizing: border-box; }
.folio { bottom: calc(var(--pad-y) * .4); font: 400 .72rem/1 var(--sans); letter-spacing: .04em; color: #8a8174; font-variant-numeric: oldstyle-nums; }
.rhead { top: calc(var(--pad-y) * .42); font: 400 .58rem/1 var(--mono); letter-spacing: .16em; color: #9a917f; }
.folio.l, .rhead.l { left: var(--sl, 0px); }
.folio.r, .rhead.r { left: calc(var(--sl, 0px) + var(--page-w)); right: auto; }

/* the body text: justified, hyphenated, paragraphs marked by an indent rather than a gap */
.page-flow .flow > p {
  margin: 0 !important; text-align: justify; hyphens: auto; -webkit-hyphens: auto; text-wrap: pretty;
  text-indent: 1.5em; orphans: 2; widows: 2;
}
.page-flow .flow > p:first-child,
.page-flow .flow > :not(p) + p { text-indent: 0; }            /* flush after a heading, a picture or a break */
.page-flow .flow > p:first-of-type::first-letter { margin-top: .06em; }

/* subheadings: room above, close to their text, never stranded at a page foot */
.page-flow .flow > .chapter, .page-flow .flow > h2, .page-flow .flow > h3 {
  margin: 1.7em 0 .55em !important; text-align: left; break-after: avoid; break-inside: avoid;
}
.page-flow .flow > :first-child { margin-top: 0 !important; }
/* pictures sit in their own space, centred, with a quiet caption */
.page-flow .flow > figure, .page-flow .flow > .photo, .page-flow .flow > .video, .page-flow .flow > .logo-fig {
  margin: 1.4em auto 1.3em !important; text-align: center; break-inside: avoid;
}
.page-flow figcaption { margin-top: .6em !important; text-align: center; line-height: 1.45 !important; color: #8a8174; }

/* chapter openings: sunk down the page and centred, as books do */
.page-flow > .story-head:first-child, .page-flow > .hero:first-child {
  text-align: center; padding-top: calc(var(--text-h) * .16) !important; padding-bottom: 1.2rem !important;
}
.page-flow > .story-head:first-child h1, .page-flow > .hero:first-child h1 { margin-inline: auto; max-width: 16ch; }
.page-flow > .story-head:first-child .brand-tile { display: block; margin: 0 auto .9rem; }
.page-flow > .story-head:first-child .ch-num { margin-inline: auto; }
.page-flow > .hero:first-child .cta { justify-content: center; }
.page-flow > .story-head:first-child + .flow { padding-top: 1.2rem !important; }

/* the Contents page: titles, dotted leaders, page numbers */
.page-flow .toc-list { border-top: 0; margin-top: .6rem; }
.page-flow .toc-list a { grid-template-columns: 2rem auto 1fr auto; align-items: start; gap: 0 .5rem; padding: .7rem 0; border-bottom: 0; }
.page-flow .toc-list a:hover { padding-left: 0; background: none; }
.page-flow .toc-list a:hover .toc-t { color: var(--accent); }
.page-flow .toc-lead { align-self: start; margin-top: 1em; border-bottom: 1px dotted #b5ab99; min-width: 1rem; }
.page-flow .toc-y { font: 400 .9rem/1.2 var(--sans) !important; color: var(--ink-2); font-variant-numeric: oldstyle-nums; text-align: right; min-width: 1.6rem; padding-top: .1rem; }
.page-flow .toc-n { padding-top: .3rem; }
.page-flow .contents-head { text-align: center; }

/* About the author: centred, like the last page of a book */
.page-flow .about-head { text-align: center; }
.page-flow .about-page { justify-items: center; text-align: center; }
.page-flow .about-page > p { max-width: 30ch; }
.page-flow .about-links { width: 100%; text-align: left; }
/* the pocket edition: narrow measure, flush left so no word is stretched apart */
.book-open[data-edition="paperback"] .page-flow .toc-list a { grid-template-columns: 1.8rem auto 1fr auto; }
.book-open[data-edition="paperback"] .page-flow .toc-y { grid-column: auto; }
.book-open[data-edition="paperback"] .page-flow .flow > p { text-align: left; }
.page-flow .about-role { font-size: .64rem !important; line-height: 1.7 !important; letter-spacing: .12em; }

/* the author page, opposite the inside of the cover */
.page-flow .author-page { display: grid; justify-items: center; text-align: center; gap: .2rem; padding-top: calc(var(--text-h) * .08) !important; }
.page-flow .author-art {
  width: min(58%, 230px); aspect-ratio: 1100 / 1320; margin-bottom: 1.2rem;
  background: linear-gradient(160deg, #2b3170, var(--cloth) 60%, #141838);
  -webkit-mask: url("images/portrait-engraving.png") center / contain no-repeat;
          mask: url("images/portrait-engraving.png") center / contain no-repeat;
}
.page-flow .author-name { margin: 0; font: 500 clamp(1.5rem, 2.4vw, 2rem)/1.1 var(--sans) !important; letter-spacing: -0.035em; }
.page-flow .author-role { margin: .5rem 0 1.1rem !important; font: 400 .62rem/1.6 var(--mono) !important; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.page-flow .author-bio { max-width: 34ch; margin: 0 !important; color: var(--ink-2); }
/* front and back matter each fit on one page */
.page-flow .author-page { padding-top: calc(var(--text-h) * .04) !important; }
.page-flow .author-art { width: auto; height: calc(var(--text-h) * .32); max-width: 70%; margin-bottom: .9rem; }
.page-flow .author-bio { font-size: .86rem !important; line-height: 1.6 !important; }
.page-flow > .about-head:first-child { padding-top: calc(var(--text-h) * .05) !important; padding-bottom: .6rem !important; }
.page-flow .about-page { gap: .6rem; }
.page-flow .about-page > p:first-child { margin-bottom: .2rem; }
.page-flow .about-links a { padding: .62rem .2rem; font-size: .88rem; }
.page-flow .about-fine { margin-top: .6rem !important; font-size: .62rem !important; line-height: 1.6 !important; }

/* =========================================================
   Fixed editions: the page is laid out at trim size and scaled as a whole
   ========================================================= */
.book-frame { position: relative; }
.book-frame.bleed { justify-self: start; }
.book-frame > .book-open { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

/* inside a fixed edition nothing may depend on the screen: titles and cards get fixed sizes */
.page-flow h1, .page-flow .hero-x, .page-flow .story-head h1, .page-flow .hero h1 { font-size: 2.05rem !important; line-height: 1.04 !important; letter-spacing: -0.045em !important; }
.page-flow .contents-head h1 { font-size: 2.3rem !important; }
.page-flow .author-name { font-size: 1.7rem !important; line-height: 1.1 !important; }
.page-flow .card { padding: 1.1rem 1.25rem !important; }
.book-open[data-edition="paperback"] .page-flow h1, .book-open[data-edition="paperback"] .page-flow .hero-x { font-size: 1.75rem !important; }
.book-open[data-edition="paperback"] .page-flow .contents-head h1 { font-size: 2rem !important; }
/* drawings' labels and the book cards: fixed per edition, never per screen */
.page-flow .ill text { font-size: 15px !important; }
.page-flow .ill .tags text, .book-open[data-edition="paperback"] .page-flow .ill text { font-size: 17px !important; }
.page-flow .ill text.code { font-size: 13px !important; }
.page-flow .ill svg text.fit { font-size: 15px !important; }
.page-flow .ill { margin-inline: 0 !important; }
.page-flow .books { grid-template-columns: minmax(0, 1fr) !important; gap: 1rem !important; }
.page-flow .book { grid-template-columns: 6.5rem minmax(0, 1fr) !important; gap: 1rem !important; padding: 1rem !important; }
/* the video card, logo cards and timeline stops: fixed sizes inside the book */
.page-flow .yt-mark { padding: 8px !important; }
.page-flow .yt-title { font-size: 1.5rem !important; line-height: 1.1 !important; letter-spacing: -0.01em !important; }
.page-flow .yt-btn { width: 52px !important; height: 52px !important; }
.page-flow .logo-card.wide { padding: 24px 30px !important; }
.page-flow .stop { padding-left: 0 !important; }
/* the facing page, when enough of it shows: the real page before, curving into the spine */
.facing { position: absolute; left: 0; top: 0; bottom: 0; width: var(--sl); overflow: hidden; z-index: 2; pointer-events: none; }
.facing .leaf-face { inset: 0 auto; box-shadow: none; }
.facing::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,0) 60%, rgba(40,25,10,.06) 85%, rgba(40,25,10,.16)); }
/* a paragraph may break across pages like any book's; two lines are kept together at each end */
.page-flow .chapter + p, .page-flow .flow > p { break-inside: auto !important; orphans: 2; widows: 2; }
.page-flow .logo-card.wide img { width: 200px !important; max-width: 100% !important; height: auto !important; }
.page-flow .logo-card img { max-width: 100% !important; }

/* =========================================================
   App-sized type inside the book: 13px body, 14px subheadings, 16px titles
   ========================================================= */
.page-flow { font-size: 13px; }
.page-flow p, .page-flow li, .page-flow dd, .page-flow dt { font-size: 13px !important; line-height: 1.62 !important; }
.page-flow .flow > p:last-of-type { font-size: 13.5px !important; }
.page-flow .flow p:first-of-type::first-letter { font-size: 3.15em !important; }
.page-flow h1, .page-flow .hero-x, .page-flow .story-head h1, .page-flow .hero h1,
.page-flow .contents-head h1, .page-flow .about-head h1, .page-flow .author-name,
.book-open[data-edition="paperback"] .page-flow h1, .book-open[data-edition="paperback"] .page-flow .hero-x,
.book-open[data-edition="paperback"] .page-flow .contents-head h1 {
  font-size: 16px !important; line-height: 1.25 !important; font-weight: 600 !important; letter-spacing: -0.015em !important;
}
.page-flow h2, .page-flow h3, .page-flow .chapter, .page-flow .section-title, .page-flow .card h3, .page-flow .book h3,
.page-flow .news-head, .page-flow .yt-title {
  font-size: 14px !important; line-height: 1.35 !important; font-weight: 600 !important; letter-spacing: -0.01em !important;
}
.page-flow .ch-num { font-size: 14px !important; margin-bottom: .5rem !important; }
.page-flow .eyebrow, .page-flow .label, .page-flow .kicker, .page-flow .book-meta, .page-flow .author-role,
.page-flow .section-title span, .page-flow .detour-tag { font-size: 9.5px !important; letter-spacing: .12em !important; }
.page-flow figcaption, .page-flow .toc-t small, .page-flow .book-sub, .page-flow .stats span { font-size: 11px !important; line-height: 1.45 !important; }
.page-flow .toc-t { font-size: 13px !important; }
.page-flow .toc-y, .page-flow .toc-n { font-size: 12px !important; }
.page-flow .stats strong, .page-flow .stop-num { font-size: 16px !important; }
.page-flow .about-links a, .page-flow .author-bio, .page-flow .hero .lede { font-size: 12.5px !important; }
.page-flow .about-fine { font-size: 9px !important; }
.page-flow .brand-tile { width: 34px !important; }
.page-flow .yt-btn { width: 44px !important; height: 44px !important; }
.folio { font-size: 10px; }
.rhead { font-size: 8.5px; }
.end-mark { height: 0; margin: 0; padding: 0; overflow: hidden; }
/* body text set flush left, as apps set it; paragraphs still begin with an indent */
.page-flow .flow > p { text-align: left !important; hyphens: manual; }
.page-flow > .end-mark { height: 0 !important; padding: 0 !important; margin: 0 !important; }

/* a book is printed: whatever is on a page is simply there, finished, the moment you turn to it */
.page-flow *, .page-flow *::before, .page-flow *::after { animation: none !important; transition: none !important; }
.page-flow .ill, .page-flow .rv, .page-flow .w, .page-flow .ch-num, .page-flow .eyebrow, .page-flow .lede,
.page-flow .brand-tile, .page-flow .stats, .page-flow .caret { opacity: 1 !important; transform: none !important; filter: none !important; }
.page-flow .draw { stroke-dashoffset: 0 !important; }
.page-flow .ill-map .pins > * { opacity: 1 !important; }
.page-flow .ill-map .pin-ring { opacity: .45 !important; }
/* body text at 13px, beating every older, more specific rule */
.book-open .page-flow .flow p, .book-open .page-flow .flow > p, .book-open .page-flow .flow > p:last-of-type,
.book-open .page-flow p { font-size: 13px !important; line-height: 1.62 !important; }
.book-open .page-flow .author-bio, .book-open .page-flow .about-links a { font-size: 12.5px !important; }
.book-open .page-flow .about-fine { font-size: 9px !important; }
.book-open .page-flow .author-role, .book-open .page-flow .eyebrow { font-size: 9.5px !important; }
/* small text that happens to be set in paragraphs keeps its small size */
.book-open .page-flow p.eyebrow, .book-open .page-flow p.book-meta, .book-open .page-flow p.author-role,
.book-open .page-flow p.about-role { font-size: 9.5px !important; line-height: 1.6 !important; }
.book-open .page-flow p.ch-num { font-size: 14px !important; line-height: 1.2 !important; }
.book-open .page-flow p.stop-num { font-size: 16px !important; line-height: 1.1 !important; }
.book-open .page-flow p.book-sub, .book-open .page-flow p.road-foot { font-size: 11px !important; line-height: 1.45 !important; }
.book-open .page-flow p.about-fine { font-size: 9px !important; }
.book-open .page-flow p.author-bio { font-size: 12.5px !important; }

/* type, final: body 12px, captions 10px, labels 9px (subheadings 14px, titles 16px unchanged) */
.book-open .page-flow { font-size: 12px; }
.book-open .page-flow p, .book-open .page-flow li, .book-open .page-flow dd, .book-open .page-flow dt,
.book-open .page-flow .flow p, .book-open .page-flow .flow > p, .book-open .page-flow .flow > p:last-of-type,
.book-open .page-flow .toc-t, .book-open .page-flow .card-lede, .book-open .page-flow p.author-bio,
.book-open .page-flow .about-links a, .book-open .page-flow .hero .lede { font-size: 12px !important; line-height: 1.62 !important; }
.book-open .page-flow figcaption, .book-open .page-flow .toc-t small, .book-open .page-flow p.book-sub,
.book-open .page-flow .stats span, .book-open .page-flow p.road-foot { font-size: 10px !important; line-height: 1.45 !important; }
.book-open .page-flow .eyebrow, .book-open .page-flow p.eyebrow, .book-open .page-flow .label, .book-open .page-flow .kicker,
.book-open .page-flow p.book-meta, .book-open .page-flow p.author-role, .book-open .page-flow p.about-role,
.book-open .page-flow .section-title span, .book-open .page-flow .detour-tag, .book-open .page-flow p.about-fine { font-size: 9px !important; }
.book-open .page-flow .toc-y, .book-open .page-flow .toc-n { font-size: 11px !important; }
/* justified, as a book is set: hyphenation keeps the spacing even; the last line of a paragraph sits left */
.book-open .page-flow .flow > p,
.book-open[data-edition="paperback"] .page-flow .flow > p {
  text-align: justify !important; text-align-last: left; hyphens: auto !important; -webkit-hyphens: auto !important;
  hyphenate-limit-chars: 6 3 2; word-spacing: -0.01em;
}
/* no automatic hyphenation: devices hyphenate differently, which would move page breaks between them */
.book-open .page-flow .flow > p, .book-open[data-edition="paperback"] .page-flow .flow > p { hyphens: manual !important; -webkit-hyphens: manual !important; }

/* =========================================================
   Reading face: Literata, made for e-books (body, lists, captions);
   Space Grotesk stays for titles and subheadings, Space Mono for labels
   ========================================================= */
.book-open .page-flow p, .book-open .page-flow li, .book-open .page-flow dd, .book-open .page-flow dt,
.book-open .page-flow figcaption, .book-open .page-flow .toc-t small, .book-open .page-flow blockquote {
  font-family: 'Literata', Georgia, 'Times New Roman', serif !important;
  font-optical-sizing: auto; font-variant-numeric: oldstyle-nums proportional-nums; letter-spacing: 0 !important;
}
.book-open .page-flow p, .book-open .page-flow li { font-weight: 400; color: #23201c; }
/* labels and small print set in paragraphs keep their own faces */
.book-open .page-flow p.eyebrow, .book-open .page-flow p.book-meta, .book-open .page-flow p.author-role,
.book-open .page-flow p.about-role, .book-open .page-flow p.about-fine, .book-open .page-flow p.stop-num {
  font-family: var(--mono) !important; font-variant-numeric: normal; letter-spacing: .12em !important;
}
.book-open .page-flow p.stop-num { letter-spacing: -0.02em !important; font-family: var(--sans) !important; }
/* the drop cap in the reading face, gold */
.book-open .page-flow .flow p:first-of-type::first-letter { font-family: 'Literata', Georgia, serif; font-weight: 500; }

/* =========================================================
   Reading face: Inter (the open font made in the spirit of Apple's San Francisco)
   for everything inside the pages; Space Mono stays for small labels
   ========================================================= */
.book-open .page-flow, .book-open .page-flow p, .book-open .page-flow li, .book-open .page-flow dd, .book-open .page-flow dt,
.book-open .page-flow figcaption, .book-open .page-flow .toc-t, .book-open .page-flow .toc-t small, .book-open .page-flow blockquote,
.book-open .page-flow h1, .book-open .page-flow h2, .book-open .page-flow h3, .book-open .page-flow .chapter,
.book-open .page-flow .section-title, .book-open .page-flow .hero-x, .book-open .page-flow .author-name,
.book-open .page-flow .card h3, .book-open .page-flow .news-head, .book-open .page-flow .yt-title, .book-open .page-flow p.stop-num {
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif !important;
  font-optical-sizing: auto; font-variant-numeric: normal; font-feature-settings: 'cv11', 'ss03';
}
.book-open .page-flow p, .book-open .page-flow li { letter-spacing: -0.003em !important; color: #1f1d1a; }
.book-open .page-flow h1, .book-open .page-flow h2, .book-open .page-flow h3, .book-open .page-flow .chapter,
.book-open .page-flow .hero-x, .book-open .page-flow .author-name { letter-spacing: -0.02em !important; }
.book-open .page-flow .flow p:first-of-type::first-letter { font-family: 'Inter', sans-serif; font-weight: 600; }
.folio { font-family: 'Inter', sans-serif; font-variant-numeric: normal; }

/* =========================================================
   One book: the closed book and the open book match exactly where they meet
   ========================================================= */
.reader.staged { opacity: 0 !important; pointer-events: none !important; }
/* real pages printed into the closed book (scaled exactly like the open book) */
.hb-print { position: absolute !important; left: 0; top: 0; width: var(--page-w) !important; height: var(--page-h) !important;
  transform-origin: 0 0 !important; box-shadow: none !important; perspective: none !important; isolation: auto !important; pointer-events: none; }
.hb-print::before, .hb-print::after { display: none !important; }
.hb-print > .leaf-face { inset: 0; box-shadow: none; }
.hb-inside .hb-print { left: var(--sqx); top: var(--sqy); }
.hb-print .hb-folio, .hb-print .hb-rhead { left: 0 !important; right: auto !important; }
.hb-crease { position: absolute; top: 0; bottom: 0; z-index: 9; pointer-events: none; }
.hb-crease.l { left: 0; background: linear-gradient(90deg, rgba(40,25,10,.16), rgba(40,25,10,.10) 20%, rgba(40,25,10,0)); }
.hb-crease.r { right: 0; background: linear-gradient(270deg, rgba(40,25,10,.16), rgba(40,25,10,.10) 20%, rgba(40,25,10,0)); }
/* the inside of the cover, when it lies open with nothing printed: blank paper with the crease */
.hb-inside::before {
  background: linear-gradient(270deg, rgba(40,25,10,.16), rgba(40,25,10,.10) calc(var(--crease, 23px) * .2), rgba(40,25,10,0) var(--crease, 23px)),
              linear-gradient(270deg, rgba(0,0,0,.07), rgba(0,0,0,0) 9%), #fff;
}
.hb-first { background: linear-gradient(90deg, rgba(40,25,10,.16), rgba(40,25,10,.10) calc(var(--crease, 23px) * .2), rgba(40,25,10,0) var(--crease, 23px)),
                        linear-gradient(90deg, rgba(0,0,0,.07), rgba(0,0,0,0) 9%), #fff; }
/* the open cover lies on the sand and casts the same shadow as the open book's boards */
.hb-inside::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: var(--open, 0);
  box-shadow: 0 2px 2px rgba(15,10,30,.32), 0 12px 18px -4px rgba(15,10,30,.22), 0 40px 64px -22px rgba(15,10,30,.28); }
.hb-back { box-shadow: 1px 2px 2px rgba(15,10,30,.32), 6px 12px 18px -4px rgba(15,10,30,.22), 24px 42px 64px -22px rgba(15,10,30,.28); }
/* the open book shows no loose page-stack strips that the closed book lacks */
.book-frame .book-open::before, .book-frame .book-open::after { display: none; }

/* =========================================================
   Only one book exists. It arrives in 3D (fading a 3D object flattens it, so the fade is on its stand),
   and it stays open on the sand while you read: the pages are laid onto its own paper.
   ========================================================= */
.home-book { animation: book-rise 1.8s var(--ease-out) .2s backwards !important; }
@keyframes book-rise { from { transform: translateY(40px) rotateX(18deg) rotateY(-48deg); } }
.home-stage { animation: stand-in 1.2s ease .2s backwards; }
@keyframes stand-in { from { opacity: 0; } }
html.reading .home { display: block !important; }
html.reading .home-text, html.reading .home-hint { visibility: hidden !important; }
html.reading .home-book { pointer-events: none; }
html.reading .book-frame .boards { display: none; }      /* the real boards are the 3D book's own */
@media (prefers-reduced-motion: reduce) { .home-book, .home-stage { animation: none !important; } }

/* =========================================================
   The page stack lies ON the boards: stacked sheet edges and a soft shadow onto the cloth.
   Thickness follows your place in the book. At the spine the cloth folds down: a dip at head and tail.
   ========================================================= */
html.reading .book-frame .book-open[data-stack-r="0"] .paper.right { box-shadow: 1px 2px 2px rgba(12,10,28,.3), 3px 7px 12px -4px rgba(12,10,28,.24); }
html.reading .book-frame .book-open[data-stack-r="1"] .paper.right { box-shadow: 1px 1px 0 #ece6da, 2px 2px 0 #fbf8f2, 3px 4px 3px rgba(12,10,28,.34), 5px 10px 14px -4px rgba(12,10,28,.28); }
html.reading .book-frame .book-open[data-stack-r="2"] .paper.right { box-shadow: 1px 1px 0 #ece6da, 2px 2px 0 #fbf8f2, 3px 3px 0 #e2dacb, 4px 4px 0 #f8f4ec, 5px 6px 3px rgba(12,10,28,.34), 7px 12px 14px -4px rgba(12,10,28,.28); }
html.reading .book-frame .book-open[data-stack-r="3"] .paper.right { box-shadow: 1px 1px 0 #ece6da, 2px 2px 0 #fbf8f2, 3px 3px 0 #e2dacb, 4px 4px 0 #f8f4ec, 5px 5px 0 #ddd4c3, 6px 6px 0 #f6f1e8, 7px 8px 3px rgba(12,10,28,.34), 9px 14px 14px -4px rgba(12,10,28,.28); }
html.reading .book-frame .book-open[data-stack-l="0"] .paper.left { box-shadow: -1px 2px 2px rgba(12,10,28,.26), -3px 7px 12px -4px rgba(12,10,28,.2); }
html.reading .book-frame .book-open[data-stack-l="1"] .paper.left { box-shadow: -1px 1px 0 #ece6da, -2px 2px 0 #fbf8f2, -3px 4px 3px rgba(12,10,28,.34), -5px 10px 14px -4px rgba(12,10,28,.28); }
html.reading .book-frame .book-open[data-stack-l="2"] .paper.left { box-shadow: -1px 1px 0 #ece6da, -2px 2px 0 #fbf8f2, -3px 3px 0 #e2dacb, -4px 4px 0 #f8f4ec, -5px 6px 3px rgba(12,10,28,.34), -7px 12px 14px -4px rgba(12,10,28,.28); }
html.reading .book-frame .book-open[data-stack-l="3"] .paper.left { box-shadow: -1px 1px 0 #ece6da, -2px 2px 0 #fbf8f2, -3px 3px 0 #e2dacb, -4px 4px 0 #f8f4ec, -5px 5px 0 #ddd4c3, -6px 6px 0 #f6f1e8, -7px 8px 3px rgba(12,10,28,.34), -9px 14px 14px -4px rgba(12,10,28,.28); }
/* one page in view: its stack edges show at the outer edge and foot */
html.reading .book-frame .book-open.single .paper.left { box-shadow: none; }
/* the spine: where the boards fold down under the pages, the cloth dips into shadow */
.seam { position: absolute; z-index: 1; left: calc(var(--seam-x, 0px) - 9px); width: 18px; height: 9px; pointer-events: none; display: none;
  background: radial-gradient(50% 100% at 50% 50%, rgba(5,4,15,.75), rgba(5,4,15,.35) 55%, rgba(5,4,15,0)); }
.seam.t { top: -7px; } .seam.b { bottom: -7px; }
html.reading .book-frame .seam { display: block; }
/* stacks, tightened to sit within the cloth rim; the spine dip stays on the rim */
html.reading .book-frame .book-open[data-stack-r="0"] .paper.right { box-shadow: 1px 1px 2px rgba(12,10,28,.36), 2px 5px 10px -3px rgba(12,10,28,.26); }
html.reading .book-frame .book-open[data-stack-l="0"] .paper.left { box-shadow: -1px 1px 2px rgba(12,10,28,.36), -2px 5px 10px -3px rgba(12,10,28,.26); }
html.reading .book-frame .book-open[data-stack-r="1"] .paper.right { box-shadow: 1px 1px 0 #e9e2d4, 2px 2px 2px rgba(12,10,28,.36), 3px 6px 10px -3px rgba(12,10,28,.26); }
html.reading .book-frame .book-open[data-stack-l="1"] .paper.left { box-shadow: -1px 1px 0 #e9e2d4, -2px 2px 2px rgba(12,10,28,.36), -3px 6px 10px -3px rgba(12,10,28,.26); }
html.reading .book-frame .book-open[data-stack-r="2"] .paper.right { box-shadow: 1px 1px 0 #e9e2d4, 2px 2px 0 #fbf8f2, 3px 3px 2px rgba(12,10,28,.36), 4px 7px 10px -3px rgba(12,10,28,.26); }
html.reading .book-frame .book-open[data-stack-l="2"] .paper.left { box-shadow: -1px 1px 0 #e9e2d4, -2px 2px 0 #fbf8f2, -3px 3px 2px rgba(12,10,28,.36), -4px 7px 10px -3px rgba(12,10,28,.26); }
html.reading .book-frame .book-open[data-stack-r="3"] .paper.right { box-shadow: 1px 1px 0 #e9e2d4, 2px 2px 0 #fbf8f2, 3px 3px 0 #ddd4c3, 4px 4px 2px rgba(12,10,28,.36), 5px 8px 10px -3px rgba(12,10,28,.26); }
html.reading .book-frame .book-open[data-stack-l="3"] .paper.left { box-shadow: -1px 1px 0 #e9e2d4, -2px 2px 0 #fbf8f2, -3px 3px 0 #ddd4c3, -4px 4px 2px rgba(12,10,28,.36), -5px 8px 10px -3px rgba(12,10,28,.26); }
html.reading .book-frame .book-open.single .paper.left { box-shadow: none; }
.seam { height: 6px; } .seam.t { top: -6px; } .seam.b { bottom: -6px; }
/* real squares: the boards stand about 2% proud of the pages; the stack is one or two sheet lines with a crisp shadow */
:root { --sqx: 9px; --sqy: 7px; }
.one-page { --sqx: 6px; --sqy: 5px; }
html.reading .book-frame .book-open[data-stack-r="0"] .paper.right { box-shadow: 1px 1px 1.5px rgba(10,8,25,.45), 1px 3px 5px -1px rgba(10,8,25,.22); }
html.reading .book-frame .book-open[data-stack-l="0"] .paper.left { box-shadow: -1px 1px 1.5px rgba(10,8,25,.45), -1px 3px 5px -1px rgba(10,8,25,.22); }
html.reading .book-frame .book-open[data-stack-r="1"] .paper.right { box-shadow: 1px 1px 0 #e6dfd1, 2px 2px 1.5px rgba(10,8,25,.45), 2px 4px 5px -1px rgba(10,8,25,.22); }
html.reading .book-frame .book-open[data-stack-l="1"] .paper.left { box-shadow: -1px 1px 0 #e6dfd1, -2px 2px 1.5px rgba(10,8,25,.45), -2px 4px 5px -1px rgba(10,8,25,.22); }
html.reading .book-frame .book-open[data-stack-r="2"] .paper.right { box-shadow: 1px 1px 0 #e6dfd1, 2px 2px 1.5px rgba(10,8,25,.45), 2px 4px 5px -1px rgba(10,8,25,.22); }
html.reading .book-frame .book-open[data-stack-l="2"] .paper.left { box-shadow: -1px 1px 0 #e6dfd1, -2px 2px 1.5px rgba(10,8,25,.45), -2px 4px 5px -1px rgba(10,8,25,.22); }
html.reading .book-frame .book-open[data-stack-r="3"] .paper.right { box-shadow: 1px 1px 0 #e6dfd1, 2px 2px 0 #fbf8f2, 3px 3px 1.5px rgba(10,8,25,.45), 3px 5px 5px -1px rgba(10,8,25,.22); }
html.reading .book-frame .book-open[data-stack-l="3"] .paper.left { box-shadow: -1px 1px 0 #e6dfd1, -2px 2px 0 #fbf8f2, -3px 3px 1.5px rgba(10,8,25,.45), -3px 5px 5px -1px rgba(10,8,25,.22); }
html.reading .book-frame .book-open.single .paper.left { box-shadow: none; }
.seam { height: calc(var(--sqy) + 1px); width: 22px; left: calc(var(--seam-x, 0px) - 11px); } .seam.t { top: calc(var(--sqy) * -1 - 1px); } .seam.b { bottom: calc(var(--sqy) * -1 - 1px); }
/* lying open: the page block sits on the back board; no front-cover strip along its edges */
.home-book.lying-open .hb-head { background:
    linear-gradient(180deg, transparent 0 89%, rgba(0,0,0,.3) 89% 92%, #181c44 92%),
    repeating-linear-gradient(180deg, #f4eddd 0 1px, #dcd1bb 1px 2px); }
.home-book.lying-open .hb-tail { background:
    linear-gradient(180deg, #11142f 0 8%, rgba(0,0,0,.3) 8% 11%, transparent 11%),
    linear-gradient(rgba(40,25,10,.22), rgba(40,25,10,.22)),
    repeating-linear-gradient(180deg, #efe7d6 0 1px, #d6cab3 1px 2px); }
.home-book.lying-open .hb-edge { background:
    linear-gradient(90deg, #12153a 0 8%, rgba(0,0,0,.3) 8% 11%, transparent 11%),
    linear-gradient(180deg, rgba(40,25,10,.08), rgba(40,25,10,.2)),
    repeating-linear-gradient(90deg, #efe7d6 0 1px, #d3c7b0 1px 2px); }
/* the page block is set in from the boards (the squares): its head, tail and fore-edge sit inside the cover, never beyond it */
.hb-edge { right: 0 !important; left: auto !important; top: 0 !important; bottom: 0 !important;
  background: linear-gradient(180deg, rgba(40,25,10,.08), rgba(40,25,10,.2)), repeating-linear-gradient(90deg, #efe7d6 0 1px, #d3c7b0 1px 2px) !important; }
.hb-head { top: 0 !important; left: 0 !important; right: 0 !important;
  background: linear-gradient(90deg, rgba(255,255,255,.25), rgba(0,0,0,.06)), repeating-linear-gradient(180deg, #f4eddd 0 1px, #dcd1bb 1px 2px) !important; }
.hb-tail { bottom: 0 !important; left: 0 !important; right: 0 !important;
  background: linear-gradient(rgba(40,25,10,.28), rgba(40,25,10,.28)), repeating-linear-gradient(180deg, #efe7d6 0 1px, #d6cab3 1px 2px) !important; }

/* =========================================================
   The seam, identical before and after the open book takes over: one crease and one pair of spine dips
   on the stand over the hinge, darkening as the cover comes down; stacks already on the closed book
   ========================================================= */
.hb-first, .hb-inside::before { background: linear-gradient(var(--gdir, 90deg), rgba(0,0,0,.07), rgba(0,0,0,0) 9%), #fff; }
.hb-inside::before { --gdir: 270deg; }
.hb-shade, .hb-dip { position: absolute; pointer-events: none; z-index: 6; opacity: var(--open, 0); }
.hb-shade { top: 0; bottom: 0; left: calc(var(--spine-w, 46px) / -2); width: var(--spine-w, 46px);
  background: linear-gradient(90deg, transparent, rgba(40,25,10,.10) 40%, rgba(40,25,10,.16) 50%, rgba(40,25,10,.10) 60%, transparent); }
.hb-dip { left: calc(-11px * var(--bk-s, 1)); width: calc(22px * var(--bk-s, 1)); height: calc(var(--sqy) + 1px);
  background: radial-gradient(50% 100% at 50% 50%, rgba(5,4,15,.75), rgba(5,4,15,.35) 55%, rgba(5,4,15,0)); }
.hb-dip.t { top: calc(var(--sqy) * -1 - 1px); } .hb-dip.b { bottom: calc(var(--sqy) * -1 - 1px); }
html.reading .hb-shade, html.reading .hb-dip { display: none; }   /* the open book draws the same ones */
/* the cover's own shadow falls on its outer side, away from the seam */
.hb-inside::after { box-shadow: -2px 2px 2px rgba(15,10,30,.3), -8px 10px 16px -6px rgba(15,10,30,.2) !important; }
.home-book[data-stack-r="0"] .hb-first { box-shadow: 1px 1px 1.5px rgba(10,8,25,.45), 1px 3px 5px -1px rgba(10,8,25,.22); }
.home-book[data-stack-l="0"] .hb-inside::before { box-shadow: -1px 1px 1.5px rgba(10,8,25,.45), -1px 3px 5px -1px rgba(10,8,25,.22); }
.home-book[data-stack-r="1"] .hb-first { box-shadow: 1px 1px 0 #e6dfd1, 2px 2px 1.5px rgba(10,8,25,.45), 2px 4px 5px -1px rgba(10,8,25,.22); }
.home-book[data-stack-l="1"] .hb-inside::before { box-shadow: -1px 1px 0 #e6dfd1, -2px 2px 1.5px rgba(10,8,25,.45), -2px 4px 5px -1px rgba(10,8,25,.22); }
.home-book[data-stack-r="2"] .hb-first { box-shadow: 1px 1px 0 #e6dfd1, 2px 2px 1.5px rgba(10,8,25,.45), 2px 4px 5px -1px rgba(10,8,25,.22); }
.home-book[data-stack-l="2"] .hb-inside::before { box-shadow: -1px 1px 0 #e6dfd1, -2px 2px 1.5px rgba(10,8,25,.45), -2px 4px 5px -1px rgba(10,8,25,.22); }
.home-book[data-stack-r="3"] .hb-first { box-shadow: 1px 1px 0 #e6dfd1, 2px 2px 0 #fbf8f2, 3px 3px 1.5px rgba(10,8,25,.45), 3px 5px 5px -1px rgba(10,8,25,.22); }
.home-book[data-stack-l="3"] .hb-inside::before { box-shadow: -1px 1px 0 #e6dfd1, -2px 2px 0 #fbf8f2, -3px 3px 1.5px rgba(10,8,25,.45), -3px 5px 5px -1px rgba(10,8,25,.22); }

/* =========================================================
   The gutter, from first principles (v110)
   A hardcover of a few dozen pages lying open on a table:
   - both boards lie flat, so their rims are level; the spine cloth between them sits a little lower, in soft shade;
   - the text block is thin, so the pages lie almost flat and only curve into the fold over a narrow band;
     each side's curve is as tall as its stack (one leaf at the start of the book, the whole block at the end);
   - light from the upper left: the left page's slope into the fold faces away (darker), the right one faces it (lighter);
   - where the two pages touch there is a fine contact line, the darkest point;
   - seen from above the page heads stay one straight line: nothing cuts into the paper.
   ========================================================= */
.book-open .paper.left, .book-open.single .paper.left { clip-path: inset(-40px 0 -40px -40px); }
.book-open .paper.right { clip-path: inset(-40px -40px -40px 0); }
.hb-inside::before { clip-path: inset(-40px 0 -40px -40px); }
.hb-first { clip-path: inset(-40px -40px -40px 0); }
.book-open:not(.single) .paper.left, .book-open:not(.single) .paper.right { background: #fff; }
html:not(.one-page) .hb-first, html:not(.one-page) .hb-inside::before { background: #fff; }

/* how far each side's curve reaches from the fold, by the height of its stack (reference px on a 440px page) */
.book-open, .home-stage { --gl: 10; --gr: 10; }
.book-open[data-stack-l="1"], .home-book[data-stack-l="1"] ~ .hb-shade { --gl: 15; }
.book-open[data-stack-l="2"], .home-book[data-stack-l="2"] ~ .hb-shade { --gl: 20; }
.book-open[data-stack-l="3"], .home-book[data-stack-l="3"] ~ .hb-shade { --gl: 25; }
.book-open[data-stack-r="1"], .home-book[data-stack-r="1"] ~ .hb-shade { --gr: 15; }
.book-open[data-stack-r="2"], .home-book[data-stack-r="2"] ~ .hb-shade { --gr: 20; }
.book-open[data-stack-r="3"], .home-book[data-stack-r="3"] ~ .hb-shade { --gr: 25; }
.home-book[data-stack-l="0"] ~ .hb-shade { --gl: 10; } .home-book[data-stack-r="0"] ~ .hb-shade { --gr: 10; }

.book-open:not(.single) .spine, html:not(.one-page) .hb-shade { --k: 1px; transform: none;
  left: calc(50% - 32 * var(--k)); width: calc(64 * var(--k));
  background:
    /* the contact line where the pages meet */
    linear-gradient(90deg, rgba(25,18,10,0), rgba(25,18,10,.2) 50%, rgba(25,18,10,0)) calc(32 * var(--k) - 1.5 * var(--k)) 0 / calc(3 * var(--k)) 100% no-repeat,
    /* left slope, turned away from the light */
    linear-gradient(90deg, rgba(30,20,10,0), rgba(30,20,10,.012) 30%, rgba(30,20,10,.035) 52%, rgba(30,20,10,.07) 70%, rgba(30,20,10,.12) 84%, rgba(30,20,10,.17) 94%, rgba(30,20,10,.2))
      calc(32 * var(--k) - var(--gl) * var(--k)) 0 / calc(var(--gl) * var(--k)) 100% no-repeat,
    /* right slope, facing the light */
    linear-gradient(90deg, rgba(30,20,10,.1), rgba(30,20,10,.06) 10%, rgba(30,20,10,.03) 28%, rgba(30,20,10,.012) 50%, rgba(30,20,10,0))
      calc(32 * var(--k)) 0 / calc(var(--gr) * var(--k)) 100% no-repeat; }
html:not(.one-page) .hb-shade { --k: calc(1px * var(--bk-s, 1)); left: calc(-32 * var(--k)); }

/* the spine cloth between the two boards, at head and tail: a touch lower than the boards, so a touch darker */
.seam, .hb-dip { clip-path: none; border-radius: 0; z-index: 9;
  background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.14) 25%, rgba(0,0,0,.2) 50%, rgba(0,0,0,.14) 75%, rgba(0,0,0,0)); }
.seam.b, .hb-dip.b { background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.14) 25%, rgba(0,0,0,.2) 50%, rgba(0,0,0,.14) 75%, rgba(0,0,0,0)); }
.seam { width: 22px; height: var(--sqy); left: calc(var(--seam-x, 0px) - 11px); }
.seam.t { top: calc(var(--sqy) * -1); bottom: auto; } .seam.b { bottom: calc(var(--sqy) * -1); top: auto; }
.hb-dip { width: calc(22px * var(--bk-s, 1)); height: var(--sqy); left: calc(-11px * var(--bk-s, 1)); }
.hb-dip.t { top: calc(var(--sqy) * -1); bottom: auto; } .hb-dip.b { bottom: calc(var(--sqy) * -1); top: auto; }

/* the gutter shade lies on the still pages: a turning page, lifted above them, covers it (v111) */
.book-open .spine { z-index: 6; }

/* contents in parts: a quiet label, then the chapters it holds (v112) */
.page-flow .toc-list .toc-part { list-style: none; margin: 1.1rem 0 .1rem; padding: 0 0 .35rem; border-bottom: 1px solid var(--line, #e7e1d6);
  font: 600 13px/1.3 var(--sans) !important; color: var(--ink, #1a1a2e); break-after: avoid; }
.page-flow .toc-list .toc-part span { display: block; margin-bottom: .2rem; font: 400 9px/1 var(--mono) !important; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.page-flow .toc-list .toc-pro .toc-t { font-weight: 500; }
.page-flow .author-role a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* a stop with several pieces of work: a short list, one line of lead-in each (v114) */
.page-flow .stop-list { list-style: none; padding: 0 !important; margin: .4rem 0 0; }
.page-flow .stop-list li { margin: 0 0 .55rem; }
.page-flow .stop-list strong { font-weight: 600; color: var(--ink, #1a1a2e); }
.page-flow .stop-list strong a { color: inherit; }

/* side quests: one project to a page, each opening like a chapter (v120) */
.page-flow .quest-break { break-before: column; }
.page-flow .quest p.quest-link, .page-flow .quest p.quest-ask { text-indent: 0 !important; text-align: left !important; }
.page-flow .quest p.quest-link { margin-top: .9rem !important; font: 400 10px/1.4 var(--mono) !important; letter-spacing: .08em; }
.page-flow .quest p.quest-link a { color: var(--accent, #b4532a); text-decoration: none; }
.page-flow .quest p.quest-ask { margin-top: 1.4rem !important; padding-top: .8rem; border-top: 1px solid var(--line, #e7e1d6); color: var(--muted, #6b6b7b); }
.page-flow > .story-head.quest-break { text-align: center; padding-top: calc(var(--text-h) * .16) !important; padding-bottom: 1.2rem !important; }
.page-flow > .story-head.quest-break h1 { margin-inline: auto; max-width: 16ch; }
.page-flow > .story-head.quest-break h1, .page-flow > .story-head.quest-break .lede { text-align: center !important; }
.page-flow > .story-head.quest-break + .flow { padding-top: 1.2rem !important; }

/* Contents without descriptions: titles, leaders, numbers; the whole list on one page (v127) */
.page-flow[data-ch="contents"] .toc-list a { padding: .42rem 0 !important; align-items: baseline; }
.page-flow[data-ch="contents"] .toc-list .toc-part { margin: .9rem 0 .15rem; padding-bottom: .3rem; }
.page-flow[data-ch="contents"] .toc-n { padding-top: 0; }
.page-flow[data-ch="contents"] > .story-head:first-child { padding-top: calc(var(--text-h) * .06) !important; padding-bottom: .6rem !important; }

/* Contents hierarchy: the prologue, the parts and the last page sit at the left edge, one line each,
   with the same small label; chapters sit indented beneath their part (v129) */
.page-flow[data-ch="contents"] .toc-list .toc-part { display: flex; align-items: baseline; gap: .7rem; }
.page-flow[data-ch="contents"] .toc-list .toc-part span { display: inline; margin: 0; }
.page-flow[data-ch="contents"] .toc-list .toc-pro a { grid-template-columns: auto auto 1fr auto !important; gap: 0 .7rem !important; align-items: baseline; }
.page-flow[data-ch="contents"] .toc-list .toc-pro .toc-n { font: 400 9px/1 var(--mono) !important; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); padding: 0; }
.page-flow[data-ch="contents"] .toc-list .toc-pro .toc-t { font: 600 13px/1.3 var(--sans) !important; color: var(--ink, #1a1a2e); }
.page-flow[data-ch="contents"] .toc-list .toc-back { margin-top: .9rem; }
.page-flow[data-ch="contents"] .toc-list .toc-inter .toc-t { color: inherit; font-weight: inherit; }
/* the pocket edition: the prologue line stays on one line, and a part never splits across pages */
.page-flow[data-ch="contents"] .toc-list .toc-inter + .toc-inter,
.page-flow[data-ch="contents"] .toc-list .toc-part + li { break-before: avoid; }
[data-edition="paperback"] .page-flow[data-ch="contents"] .toc-list .toc-pro a { gap: 0 .5rem !important; }
[data-edition="paperback"] .page-flow[data-ch="contents"] .toc-list .toc-pro .toc-t { white-space: nowrap; font-size: 12px !important; }
[data-edition="paperback"] .page-flow[data-ch="contents"] .toc-list .toc-pro .toc-n { letter-spacing: .1em; }
[data-edition="paperback"] .page-flow[data-ch="contents"] .toc-list a { padding: .3rem 0 !important; }
[data-edition="paperback"] .page-flow[data-ch="contents"] .toc-list .toc-part { margin: .7rem 0 .1rem; }
[data-edition="paperback"] .page-flow[data-ch="contents"] .toc-list .toc-back { margin-top: .7rem; }
[data-edition="paperback"] .page-flow[data-ch="contents"] > .story-head:first-child { padding-top: calc(var(--text-h) * .03) !important; }

/* Contents, simplest form: titles and page numbers; part names are quiet headings, their chapters sit beneath (v133) */
.page-flow[data-ch="contents"] .toc-clean a { grid-template-columns: auto 1fr auto !important; gap: 0 .6rem !important; align-items: baseline; padding: .42rem 0 !important; }
.page-flow[data-ch="contents"] .toc-clean .toc-top .toc-t { font: 600 13px/1.3 var(--sans) !important; color: var(--ink, #1a1a2e); }
.page-flow[data-ch="contents"] .toc-clean .toc-ch a { padding-left: 1.1rem !important; }
.page-flow[data-ch="contents"] .toc-clean .toc-ch .toc-t { font: 400 12px/1.3 var(--sans) !important; color: var(--ink, #1a1a2e); }
.page-flow[data-ch="contents"] .toc-clean .toc-part { display: block; border: 0; margin: .9rem 0 0; padding: .42rem 0 .1rem;
  font: 600 13px/1.3 var(--sans) !important; color: var(--ink, #1a1a2e); }
.page-flow[data-ch="contents"] .toc-clean .toc-top { margin-top: .9rem; }
.page-flow[data-ch="contents"] .toc-clean .toc-top:first-child { margin-top: 0; }
.page-flow[data-ch="contents"] .toc-clean .toc-part + .toc-ch, .page-flow[data-ch="contents"] .toc-clean .toc-ch + .toc-ch { break-before: avoid; }
[data-edition="paperback"] .page-flow[data-ch="contents"] .toc-clean a { padding: .32rem 0 !important; }
[data-edition="paperback"] .page-flow[data-ch="contents"] .toc-clean .toc-top, [data-edition="paperback"] .page-flow[data-ch="contents"] .toc-clean .toc-part { margin-top: .7rem; }
[data-edition="paperback"] .page-flow[data-ch="contents"] .toc-clean .toc-top:first-child { margin-top: 0; }
[data-edition="paperback"] .page-flow[data-ch="contents"] .toc-clean .toc-ch a { padding-left: 1.1rem !important; }
