/* Rat Race Reader — public styles.
   Colours come from the reader's theme (look.css: --bg --paper --ink --muted --line --accent --glow) and, on a work's
   page, from the work itself (works.css: --w-accent --w-deep --w-light). Fonts are self-hosted (look.css): Fraunces for
   display, Inter for the interface, and the reader's chosen face (--f-read) for the reading.
   No inline styles (strict CSP), no images: every picture is SVG or CSS.
   Motion: view transitions between pages and levels, drifting scenes, page turns, reveals as you scroll. The reader's
   "Movement" setting (data-motion: full · gentle · none) calms or stops all of it, and none of it is needed to read. */

:root {
  --f-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --f-ui: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-read: 'Literata', Georgia, serif;
  --f-scale: 1;
  --fs: 19px; --lh: 1.7;
  --measure: 68ch;
  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: linear(0, .22 6%, .66 15%, 1.04 27%, 1.11 34%, 1.06 45%, .99 60%, 1);
  --top-h: 64px;
  --hl: var(--accent);
  --ink-2: color-mix(in oklab, var(--ink) 82%, var(--bg));
  --line-2: color-mix(in oklab, var(--line) 55%, var(--bg));
  --shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent), 0 14px 34px -12px color-mix(in srgb, var(--ink) 22%, transparent);
  --shadow-lg: 0 2px 6px color-mix(in srgb, var(--ink) 8%, transparent), 0 34px 70px -24px color-mix(in srgb, var(--ink) 38%, transparent);
}
[data-width="narrow"] { --measure: 56ch; }
[data-width="wide"] { --measure: 84ch; }
/* On a work's page (with "Tint" on) the work's own colour leads the highlights and washes the page very slightly. */
[data-tint="on"] body[data-work] { --hl: color-mix(in oklab, var(--w-accent) 80%, var(--ink) 20%); background: color-mix(in oklab, var(--bg) 94%, var(--w-accent)); }
[data-tint="on"][data-dark="1"] body[data-work] { --hl: color-mix(in oklab, var(--w-accent) 75%, white 25%); }
@media (min-width: 861px) { html { zoom: var(--dz, 1); } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 76px); interpolate-size: allow-keywords; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; transition: background-color .5s var(--ease), color .5s var(--ease); }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.1; letter-spacing: -.015em; text-wrap: balance; margin: 0 0 .5em; font-variation-settings: 'SOFT' 50, 'WONK' 0; }
p { margin: 0 0 1em; text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--glow) 70%, transparent); color: var(--ink); }
kbd { font-family: var(--f-ui); font-size: .82em; font-weight: 700; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px; padding: .05em .4em; background: var(--paper); }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.fine { font-size: .85rem; color: var(--muted); }
.eyebrow { font-family: var(--f-ui); font-size: .76rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--hl); margin: 0 0 .8rem; }
.display { font-family: var(--f-display); font-weight: 500; font-size: clamp(2.4rem, 6.4vw, 5rem); line-height: .98; letter-spacing: -.03em; font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; }
.display em { font-style: italic; color: var(--hl); font-weight: 400; }
.lede { font-size: clamp(1.06rem, 1.7vw, 1.22rem); color: var(--ink-2); max-width: 40rem; line-height: 1.6; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: .6rem 1rem; z-index: 90; border-radius: 8px; }
.skip:focus { left: 8px; top: 8px; }
.ic { flex: none; width: 18px; height: 18px; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: 0 1.2rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; transition: transform .35s var(--spring), background-color .2s, border-color .2s, box-shadow .3s; }
.btn:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); box-shadow: 0 10px 24px -12px var(--accent); }
.btn.primary:hover { background: color-mix(in oklab, var(--accent) 85%, var(--ink)); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { border-color: var(--line); }
.btn.small { min-height: 40px; padding: 0 1rem; font-size: .92rem; }
.tool { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: 0 .9rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 650; cursor: pointer; transition: border-color .2s, background-color .2s, transform .35s var(--spring); }
.tool:hover { border-color: var(--hl); transform: translateY(-1px); }
.tool[aria-pressed="true"] { background: var(--hl); border-color: var(--hl); color: var(--bg); }
.tool .ic { width: 16px; height: 16px; }

/* ---------- header */
.top { position: sticky; top: 0; z-index: 40; height: var(--top-h); background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5); border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); transition: translate .45s var(--ease), background-color .5s; }
.top-in { height: 100%; display: flex; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; }
.brand .mark { width: 30px; height: 30px; color: var(--hl); transition: rotate .8s var(--spring); }
.brand:hover .mark { rotate: -12deg; }
.wordmark { display: inline-flex; align-items: baseline; gap: .3rem; white-space: nowrap; }
.wm-a { font-family: var(--f-ui); font-size: .72rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.wm-b { font-family: var(--f-display); font-size: 1.45rem; font-style: italic; font-weight: 500; color: var(--ink); font-variation-settings: 'opsz' 72, 'SOFT' 100, 'WONK' 1; line-height: 1; }
.top-nav { display: flex; gap: .2rem; margin-left: auto; }
.top-nav a { color: var(--ink-2); text-decoration: none; font-size: .92rem; font-weight: 600; padding: .45rem .75rem; border-radius: 999px; transition: background-color .2s, color .2s; }
.top-nav a:hover { background: var(--line-2); color: var(--ink); }
.top-nav a[aria-current="page"] { color: var(--hl); }
.top-tools { display: flex; align-items: center; gap: .45rem; }
.fzpill { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); }
.fzpill button { width: 34px; min-height: 36px; border: 0; background: none; color: var(--ink); font-family: var(--f-display); font-size: .82rem; font-weight: 700; cursor: pointer; }
.fzpill button + button { font-size: 1.15rem; border-left: 1.5px solid var(--line); }
.fzpill button:hover { background: var(--line-2); }
.look-btn { display: inline-flex; align-items: center; gap: .4rem; min-height: 38px; padding: 0 .9rem; border-radius: 999px; border: 1.5px solid var(--hl); background: transparent; color: var(--hl); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; transition: background-color .2s, color .2s, transform .35s var(--spring); }
.look-btn:hover { background: var(--hl); color: var(--bg); transform: rotate(-2deg) scale(1.04); }
.look-btn .ic { width: 16px; height: 16px; }
@media (max-width: 760px) {
  .top-nav { display: none; }
  .top-tools { margin-left: auto; }
  .look-btn span { display: none; }
  .look-btn { padding: 0 .6rem; }
  .wm-a { font-size: .6rem; letter-spacing: .14em; }
  .wm-b { font-size: 1.25rem; }
}

/* ---------- home: hero with the riffling book */
.home-hero { position: relative; overflow: clip; padding: clamp(2.5rem, 7vw, 6rem) 0 clamp(2rem, 5vw, 4rem); }
.home-hero::before { content: ''; position: absolute; inset: -30% -10% auto 40%; height: 120%; background: radial-gradient(closest-side, color-mix(in srgb, var(--glow) 55%, transparent), transparent); filter: blur(10px); z-index: -1; animation: breathe 12s ease-in-out infinite; }
/* Phones: the words, then the riffling book, then "How long have you got?". Wide screens: the book beside both. */
.hh-grid { display: grid; gap: 1.6rem; align-items: center; grid-template-areas: "text" "art" "pick"; }
.hh-grid > * { min-width: 0; }
.hh-text { grid-area: text; }
.hh-art { grid-area: art; }
.time-pick { grid-area: pick; }
@media (min-width: 900px) {
  .hh-grid { grid-template-columns: 1.15fr .85fr; grid-template-areas: "text art" "pick art"; row-gap: 0; }
  .hh-text { align-self: end; }
  .time-pick { align-self: start; margin-top: 1.8rem; }
}
.home-hero .display .line { display: block; }
.home-hero .display .line:nth-child(1) { animation: rise-in 1s var(--ease) both; }
.home-hero .display .line:nth-child(2) { animation: rise-in 1s .12s var(--ease) both; }
.home-hero .display .line:nth-child(3) { animation: rise-in 1s .24s var(--ease) both; }
.tp-q { font-family: var(--f-display); font-style: italic; font-size: 1.15rem; margin-bottom: .7rem; color: var(--ink-2); }
.tp-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; max-width: 34rem; }
.tp { position: relative; display: flex; flex-direction: column; gap: .1rem; padding: .9rem 1rem; border-radius: 16px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; overflow: hidden; transition: transform .45s var(--spring), border-color .25s, box-shadow .35s; }
.tp b { font-family: var(--f-display); font-size: 1.25rem; font-weight: 600; }
.tp span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tp::after { content: ''; position: absolute; inset: auto 0 0; height: 3px; background: var(--hl); scale: 0 1; transform-origin: left; transition: scale .5s var(--ease); }
.tp:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--hl); }
.tp:hover::after, .tp.on::after { scale: 1 1; }
.tp.on { border-color: var(--hl); background: color-mix(in oklab, var(--paper) 88%, var(--hl)); }
/* Phones: slim buttons, one tight line each, so the book above keeps its room. */
@media (max-width: 899px) {
  .tp-q { font-size: 1rem; margin-bottom: .4rem; }
  .tp-row { gap: .45rem; }
  .tp { padding: .4rem .55rem .45rem; border-radius: 12px; gap: 0; }
  .tp b { font-size: 1rem; line-height: 1.2; }
  .tp span { font-size: .7rem; white-space: nowrap; }
  .tp .tp-long { display: none; }
}
@media (min-width: 900px) { .tp .tp-short { display: none; } }

.hh-art { display: grid; place-items: center; min-height: 360px; overflow: clip; }
/* Phones: the box is tall enough for a whole page turn (the pages rise about 270 px at this size), so no flip is cut off. */
@media (max-width: 899px) {
  .home-hero { padding-top: 1.1rem; }
  .hh-grid { gap: .4rem; }
  .hh-art { min-height: 0; height: 225px; display: flex; justify-content: center; }
  .hb-stage { flex: none; width: 460px; max-width: none; scale: .8; margin: -95px 0 -60px; }
  .hb-stage .hb { translate: 85px 0; }
  .hh-text .lede { margin-bottom: 0; }
}
/* Phones: the headline flows into two balanced lines sized to the screen, and the intro sits a little tighter,
   so the book gets the height. */
@media (max-width: 599px) {
  .home-hero .eyebrow { font-size: .68rem; letter-spacing: .14em; margin-bottom: .45rem; }
  .home-hero .display { font-size: min(8.1vw, 2.5rem); line-height: 1.02; margin-bottom: .45rem; text-wrap: balance; }
  .home-hero .display .line { display: inline; }
  .home-hero .lede { font-size: .95rem; line-height: 1.5; }
}
.hb-stage { position: relative; width: 460px; max-width: 100%; height: 380px; perspective: 1800px; display: grid; place-items: center; }
.hb { position: relative; width: 190px; height: 260px; transform-style: preserve-3d; translate: 95px 0; transform: rotateX(52deg) rotateZ(-18deg); animation: hb-float 9s ease-in-out infinite; }
.hb > div { position: absolute; inset: 0; border-radius: 2px 8px 8px 2px; transform-origin: left center; transform-style: preserve-3d; backface-visibility: visible; }
.hb-back { background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 85%, black), color-mix(in oklab, var(--accent) 50%, black)); transform: translateZ(-6px); box-shadow: 0 0 0 1px color-mix(in srgb, black 20%, transparent); }
.hb-front { background: linear-gradient(225deg, color-mix(in oklab, var(--accent) 85%, black), color-mix(in oklab, var(--accent) 55%, black)); transform: rotateY(-178deg) translateZ(6px); }
.hb-page { --pg: #f7f0e1; background: linear-gradient(90deg, #d9ccb2 0, var(--pg) 9%, var(--pg) 90%, #e9dfca), repeating-linear-gradient(transparent 0 13px, rgba(60,40,20,.12) 13px 14px); background-blend-mode: multiply; background-size: 100% 100%, 76% 72%; background-position: 0 0, 50% 50%; background-repeat: no-repeat; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent); }
[data-dark="1"] .hb-page { --pg: #e8dcc4; filter: brightness(.92); }
.hb-p1 { animation: riffle 7s 0s ease-in-out infinite alternate; }
.hb-p2 { animation: riffle 7.6s .9s ease-in-out infinite alternate; }
.hb-p3 { animation: riffle 8.2s 1.8s ease-in-out infinite alternate; }
.hb-p4 { animation: riffle 8.8s 2.7s ease-in-out infinite alternate; }
.hb-p5 { animation: riffle 9.4s 3.6s ease-in-out infinite alternate; }
.hb-shadow { position: absolute; inset: auto 15% 8% 15%; height: 40px; background: radial-gradient(closest-side, color-mix(in srgb, var(--ink) 28%, transparent), transparent); filter: blur(6px); animation: shadow-pulse 9s ease-in-out infinite; z-index: -1; }
.hb-words { position: absolute; inset: 0; pointer-events: none; }
.hb-words span { position: absolute; left: 50%; top: 52%; font-family: var(--f-display); font-style: italic; font-size: 1.25rem; color: var(--hl); opacity: 0; white-space: nowrap; animation: word-rise 12s linear infinite; }
.hb-words span:nth-child(1) { --dx: -150px; animation-delay: 0s; }
.hb-words span:nth-child(2) { --dx: 90px; animation-delay: 2s; }
.hb-words span:nth-child(3) { --dx: -60px; animation-delay: 4s; font-size: 1.5rem; }
.hb-words span:nth-child(4) { --dx: 120px; animation-delay: 6s; }
.hb-words span:nth-child(5) { --dx: -170px; animation-delay: 8s; font-size: 1.4rem; }
.hb-words span:nth-child(6) { --dx: 40px; animation-delay: 10s; font-size: 1.05rem; }

/* ---------- ticker of first lines */
.ticker { border-block: 1px solid var(--line); background: color-mix(in oklab, var(--paper) 70%, var(--bg)); overflow: hidden; padding: .9rem 0; mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent); }
.ticker-track { display: flex; width: max-content; gap: 3.5rem; animation: marquee 110s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.fl { white-space: nowrap; font-family: var(--f-display); font-size: 1.12rem; color: var(--ink-2); }
.fl q { font-style: italic; quotes: '“' '”'; }
.fl cite { font-family: var(--f-ui); font-style: normal; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-left: .6rem; }
.fl::after { content: '✦'; margin-left: 3.5rem; color: var(--hl); font-size: .8rem; }

/* ---------- library */
.library { padding: clamp(3rem, 7vw, 6rem) 0 3rem; }
.lib-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.2rem 2rem; margin-bottom: 2.2rem; }
.lib-head h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 500; font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; }
.lib-tools { display: flex; flex-direction: column; gap: .7rem; align-items: stretch; min-width: min(100%, 26rem); }
.search { display: flex; align-items: center; gap: .5rem; padding: 0 1rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); transition: border-color .2s, box-shadow .3s; }
.search:focus-within { border-color: var(--hl); box-shadow: 0 0 0 5px color-mix(in srgb, var(--hl) 16%, transparent); }
.search .ic { color: var(--muted); }
.search input { flex: 1; min-height: 46px; border: 0; background: none; color: var(--ink); font: inherit; outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { border: 1.5px solid var(--line); background: transparent; color: var(--ink-2); border-radius: 999px; padding: .3rem .8rem; font: inherit; font-size: .85rem; font-weight: 650; cursor: pointer; transition: all .2s; }
.chip:hover { border-color: var(--hl); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.shelf { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.4rem 2rem; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.book { display: flex; flex-direction: column; gap: 1.1rem; }
.book.filtered-out { display: none; }
.book-meta h3 { font-size: 1.45rem; margin-bottom: .2rem; }
.book-meta h3 a { color: var(--ink); text-decoration: none; }
.book-meta h3 a:hover { color: var(--hl); }
.book-meta p { margin: 0 0 .5rem; }
.book-hook { font-size: .95rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.book-times { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .78rem; font-weight: 700; }
.book-times span { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.book-times .ic { width: 14px; height: 14px; }
.book-times .t-here { background: color-mix(in oklab, var(--paper) 70%, var(--hl)); color: var(--ink); }
.shelf-empty { font-family: var(--f-display); font-style: italic; font-size: 1.2rem; color: var(--muted); }

/* the covers: a book you can almost pick up (tilts toward the pointer, see site.js) */
.cover-3d { --rx: 4deg; --ry: -16deg; --mx: 50%; --my: 30%; }
.cover { position: relative; display: block; width: min(100%, 230px); aspect-ratio: 2 / 3; text-decoration: none; transform-style: preserve-3d; transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .7s var(--spring), filter .4s; filter: drop-shadow(18px 22px 22px color-mix(in srgb, black 30%, transparent)); }
.cover:hover, .cover:focus-visible { --ry: -4deg; --rx: 2deg; transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-8px); filter: drop-shadow(24px 34px 28px color-mix(in srgb, black 34%, transparent)); }
.cover-face, .hero-cover .cover-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; padding: 14% 12% 12% 16%; border-radius: 3px 10px 10px 3px; color: var(--w-light, #f4ecdc); text-align: center; overflow: hidden;
  background: radial-gradient(120% 80% at 30% 0%, color-mix(in oklab, var(--w-accent, #9a3b26) 70%, white 8%), transparent 70%), linear-gradient(165deg, var(--w-accent, #9a3b26), var(--w-deep, #222) 88%);
  box-shadow: inset 6px 0 10px -6px rgba(0,0,0,.6), inset -1px 0 0 rgba(255,255,255,.12); }
.cover-band { position: absolute; inset: 7% 7% 7% 11%; border: 1px solid color-mix(in srgb, var(--w-light, #f4ecdc) 45%, transparent); border-radius: 2px 6px 6px 2px; outline: 1px solid color-mix(in srgb, var(--w-light, #f4ecdc) 22%, transparent); outline-offset: 4px; }
.cover .emblem, .hero-cover .emblem { width: 34%; height: auto; position: relative; filter: drop-shadow(0 1px 0 rgba(0,0,0,.35)); }
.em-stroke { fill: none; stroke: var(--w-light, #f4ecdc); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.em-fill { fill: var(--w-light, #f4ecdc); }
.em-cut { fill: var(--w-deep, #222); }
.cover-title { position: relative; font-family: var(--f-display); font-size: clamp(1.15rem, 2.2vw, 1.55rem); font-weight: 600; line-height: 1.02; letter-spacing: -.01em; text-wrap: balance; font-variation-settings: 'opsz' 96, 'SOFT' 100, 'WONK' 1; text-shadow: 0 1px 0 rgba(0,0,0,.35); transition: font-variation-settings .8s var(--ease), letter-spacing .8s var(--ease); }
.cover:hover .cover-title { font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 0; letter-spacing: .01em; }
.cover-rule { position: relative; width: 30%; height: 1px; background: currentColor; opacity: .6; }
.cover-author { position: relative; font-family: var(--f-ui); font-size: .62rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; opacity: .9; }
.cover-year { position: absolute; bottom: 9%; font-family: var(--f-display); font-style: italic; font-size: .8rem; opacity: .7; }
.cover-spine { position: absolute; inset: 0 auto 0 0; width: 8%; border-radius: 3px 0 0 3px; background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(255,255,255,.18) 45%, rgba(0,0,0,.25)); pointer-events: none; }
.cover-pages { position: absolute; top: 1.6%; bottom: 1.6%; right: -7px; width: 9px; border-radius: 0 3px 3px 0; background: repeating-linear-gradient(90deg, #f3ead7 0 1px, #d9ccb1 1px 2px); transform: translateZ(-2px); box-shadow: inset -2px 0 3px rgba(0,0,0,.18); }
.cover-shine { position: absolute; inset: 0; border-radius: 3px 10px 10px 3px; pointer-events: none; background: radial-gradient(60% 45% at var(--mx) var(--my), rgba(255,255,255,.28), transparent 70%); mix-blend-mode: soft-light; opacity: 0; transition: opacity .4s; }
.cover:hover .cover-shine, .hero-cover:hover .cover-shine { opacity: 1; }

.coming-h { margin-top: 4rem; font-size: 1.3rem; font-style: italic; font-weight: 400; color: var(--muted); }
.coming { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.ghost { display: flex; flex-direction: column; gap: .4rem; }
.ghost-cover { aspect-ratio: 2 / 3; border: 1.5px dashed var(--line); border-radius: 3px 10px 10px 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; padding: 1rem; text-align: center; color: var(--muted); background: repeating-linear-gradient(135deg, transparent 0 12px, var(--line-2) 12px 13px); transition: border-color .3s, color .3s, rotate .5s var(--spring); }
.ghost-cover span { font-family: var(--f-display); font-size: 1.05rem; font-weight: 600; line-height: 1.1; }
.ghost-cover small { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.ghost:hover .ghost-cover { border-color: var(--hl); color: var(--ink-2); rotate: -2deg; }

/* ---------- browse by mood: chips that filter the coverflow, the timeline and the grid together */
.moods { display: flex; gap: .55rem; overflow-x: auto; padding: .2rem 0 .6rem; margin: -.6rem 0 .4rem; scrollbar-width: none; scroll-snap-type: x proximity; }
.moods::-webkit-scrollbar { display: none; }
.mood { flex: none; scroll-snap-align: start; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: .5rem .95rem .55rem; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); text-align: left; cursor: pointer; transition: transform .4s var(--spring), border-color .25s, background-color .25s, box-shadow .3s; }
.mood b { font-family: var(--f-display); font-size: 1.02rem; font-weight: 600; font-style: italic; line-height: 1.2; }
.mood small { font-size: .72rem; color: var(--muted); font-weight: 600; }
.mood:hover { transform: translateY(-2px); border-color: var(--hl); }
.mood.on { background: var(--hl); border-color: var(--hl); color: var(--bg); box-shadow: 0 10px 22px -12px var(--hl); }
.mood.on small { color: color-mix(in srgb, var(--bg) 80%, transparent); }

/* ---------- the coverflow: the book in the middle faces you, its neighbours turn away (site.js sets --d, the signed
   distance from the middle in covers, and --ad, its size). Without JavaScript: a plain row of covers to swipe. */
.flow { --fw: clamp(170px, 46vw, 250px); position: relative; margin: .4rem 0 0; }
.flow-track { position: relative; display: flex; list-style: none; margin: 0; padding: 2.4rem calc(50% - var(--fw) / 2) 1rem; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; perspective: 1300px; perspective-origin: 50% 35%; outline: none; }
.flow-track::-webkit-scrollbar { display: none; }
.flow-track:focus-visible { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 18px; }
.flow-item { --d: 0; --ad: 0; flex: none; width: var(--fw); min-width: 0; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; transform-style: preserve-3d; position: relative; }
/* Only the cover turns: the slot itself stays square, so scroll snapping lines up with the real positions. */
.js .flow-item { margin-inline: calc(var(--fw) * -.16); }
.js .flow-item > .cover { transform: translateZ(calc(var(--ad) * -230px)) rotateY(calc(var(--d) * -52deg)); opacity: calc(1 - var(--ad) * .28); transition: opacity .2s; }
.js .flow-item:first-child { margin-left: 0; } .js .flow-item:last-child { margin-right: 0; }
.flow-item.out { display: none; }
.flow .cover { --rx: 0deg; --ry: 0deg; width: 100%; filter: drop-shadow(0 26px 26px color-mix(in srgb, black 34%, transparent)); -webkit-box-reflect: below 6px linear-gradient(transparent 72%, rgba(255, 255, 255, .16)); }
.flow-item.is-center .cover { filter: drop-shadow(0 30px 34px color-mix(in srgb, black 40%, transparent)) drop-shadow(0 0 30px color-mix(in srgb, var(--w-accent) 35%, transparent)); }
.flow-cap { width: 100%; margin-top: 1.4rem; text-align: center; }
.js .flow-item .flow-cap { display: none; }
.flow-caption { width: min(34rem, calc(100% - 32px)); margin: .6rem auto 0; min-height: 9.5rem; text-align: center; }
.flow-caption .flow-cap { margin-top: 0; animation: cap-in .45s var(--ease) both; }
.flow-cap h3 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: .2rem; font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; }
.flow-cap h3 a { color: var(--ink); text-decoration: none; }
.flow-cap h3 a:hover { color: var(--hl); }
.flow-cap .muted { margin-bottom: .5rem; }
.flow-hook { color: var(--ink-2); font-size: .98rem; max-width: 32rem; margin-inline: auto; }
.flow-cap .book-times { justify-content: center; }
.flow-btn { position: absolute; top: calc(2.4rem + var(--fw) * .75); translate: 0 -50%; z-index: 20; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); color: var(--ink); font-family: var(--f-display); font-size: 1.8rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 4px; transition: transform .35s var(--spring), border-color .2s, opacity .2s; }
.flow-btn:hover { transform: scale(1.08); border-color: var(--hl); }
.flow-btn:disabled { opacity: .3; cursor: default; transform: none; }
.flow-prev { left: max(12px, calc(50% - var(--fw) * 1.25 - 60px)); }
.flow-next { right: max(12px, calc(50% - var(--fw) * 1.25 - 60px)); }
@media (max-width: 640px) { .flow-btn { width: 40px; height: 40px; font-size: 1.5rem; } }

/* ---------- through time: the timeline under the coverflow */
.ts { margin: 1.4rem auto 3rem; max-width: 64rem; }
.ts-now { text-align: center; margin: 0 0 .6rem; min-height: 2.4rem; }
.ts-year { font-family: var(--f-display); font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 600; color: var(--hl); font-variant-numeric: lining-nums tabular-nums; font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; }
.ts-title { font-family: var(--f-display); font-style: italic; color: var(--muted); }
.ts-axis { position: relative; height: 64px; margin: 0 12px; cursor: pointer; touch-action: pan-y; user-select: none; }
.ts-line { position: absolute; left: 0; right: 0; top: 22px; height: 2px; background: linear-gradient(90deg, var(--line) 0 7.6%, transparent 7.6% 9.4%, var(--line) 9.4%); border-radius: 1px; }
.ts-break { position: absolute; left: 7.9%; top: 15px; width: 1.2%; height: 16px; border-inline: 2px solid var(--muted); transform: skewX(-20deg); opacity: .6; }
.ts-tick { position: absolute; top: 34px; translate: -50% 0; font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.ts-tick::before { content: ''; position: absolute; left: 50%; top: -12px; width: 1px; height: 8px; background: var(--line); }
.ts-tancient { left: 3.54%; } .ts-t1600 { left: 12%; } .ts-t1700 { left: 39.74%; } .ts-t1800 { left: 67.48%; } .ts-t1900 { left: 95.23%; }
.ts-dot { position: absolute; left: var(--x, 0%); top: 23px; translate: -50% -50%; width: 14px; height: 14px; padding: 0; border-radius: 50%; border: 2.5px solid var(--bg); background: color-mix(in oklab, var(--w-accent, var(--hl)) 80%, var(--ink)); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ink) 25%, transparent); cursor: pointer; transition: scale .4s var(--spring), opacity .3s, box-shadow .3s; }
.ts-dot:hover { scale: 1.35; }
.ts-dot.on { scale: 1.75; z-index: 2; box-shadow: 0 0 0 2px var(--hl), 0 0 18px var(--w-accent, var(--hl)); }
.ts-dot.dim { opacity: .18; pointer-events: none; }
.ts-axis.dragging { cursor: grabbing; }
.all-head { margin-top: 1rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.all-h { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 500; margin: 0; }
.book.mood-out { display: none; }

/* ---------- three levels, explained */
.how { padding: clamp(3rem, 7vw, 6rem) 0; background: color-mix(in oklab, var(--paper) 55%, var(--bg)); border-block: 1px solid var(--line); }
.how h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 500; max-width: 26ch; }
.levels-demo { display: grid; gap: 1.2rem; margin-top: 2.4rem; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.ld { position: relative; padding: 1.4rem 1.4rem 1.2rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ld h3 { font-size: 1.5rem; margin-bottom: .6rem; }
.ld-time { font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--hl); margin-bottom: .3rem; }
.ld ul { margin: 0; padding-left: 1.1rem; color: var(--ink-2); font-size: .95rem; }
.ld-page { height: 118px; display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 14px 18px; margin-bottom: 1rem; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); }
.ld-page span { height: 6px; border-radius: 3px; background: color-mix(in oklab, var(--ink) 18%, var(--bg)); transform-origin: left; animation: line-write 4.5s var(--ease) infinite; }
.ld-page span:nth-child(odd) { width: 96%; } .ld-page span:nth-child(even) { width: 88%; } .ld-page span:last-child { width: 58%; }
.ld-essence .ld-page span { background: var(--hl); height: 8px; }
.ld-page span:nth-child(2) { animation-delay: .1s; } .ld-page span:nth-child(3) { animation-delay: .2s; } .ld-page span:nth-child(4) { animation-delay: .3s; }
.ld-page span:nth-child(5) { animation-delay: .4s; } .ld-page span:nth-child(6) { animation-delay: .5s; } .ld-page span:nth-child(7) { animation-delay: .6s; }
.ld-page span:nth-child(8) { animation-delay: .7s; } .ld-page span:nth-child(9) { animation-delay: .8s; }

/* ---------- authors */
.authors-strip { padding: clamp(3rem, 6vw, 5rem) 0; }
.authors-strip h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 500; }
.astrip { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.4rem; }
.acard { display: inline-flex; align-items: center; gap: .8rem; padding: .7rem 1.2rem .7rem .7rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .4s var(--spring), box-shadow .3s; }
.acard:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: var(--shadow); }
.acard b { display: block; font-family: var(--f-display); font-size: 1.1rem; font-weight: 600; }
.acard small { color: var(--muted); }
.amono { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--hl); color: var(--bg); font-family: var(--f-display); font-weight: 600; font-style: italic; font-size: 1.1rem; flex: none; }
.amono.big { width: 76px; height: 76px; font-size: 1.8rem; }
.page-head { padding: clamp(2.5rem, 7vw, 5rem) 0 1.5rem; }
.page-head .display { font-size: clamp(2.2rem, 5.6vw, 4.2rem); max-width: 18ch; }
.authors { display: flex; flex-direction: column; gap: 3.5rem; padding-bottom: 4rem; }
.author { scroll-margin-top: calc(var(--top-h) + 20px); padding-top: 2rem; border-top: 1px solid var(--line); }
.author-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1rem; }
.author-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0; }
.author-head p { margin: .2rem 0 0; }
.shelf.mini { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-top: 1.4rem; }
.shelf.mini .book-meta h3 { font-size: 1.1rem; }
.prose-page { max-width: 44rem; padding-bottom: 4rem; font-family: var(--f-read); font-size: calc(var(--fs) * var(--f-scale)); line-height: var(--lh); }
.prose-page h2 { font-size: 1.6rem; margin-top: 2.2rem; }
.prose-page .lede { font-family: var(--f-read); }
.lost .display { max-width: 20ch; }

/* ---------- a work: the banner */
.work-hero { position: relative; overflow: clip; isolation: isolate; color: var(--w-light); padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  background: radial-gradient(120% 90% at 85% -10%, color-mix(in oklab, var(--w-accent) 55%, var(--w-deep)), transparent 60%), linear-gradient(180deg, color-mix(in oklab, var(--w-deep) 85%, black), var(--w-deep)); }
.work-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--w-deep) 70%, transparent), transparent 70%); }
.scene { position: absolute; inset: auto 0 0 0; width: 100%; height: 75%; z-index: -2; }
.scene .sc-far { fill: color-mix(in oklab, var(--w-deep) 62%, var(--w-accent)); opacity: .55; }
.scene .sc-mid { fill: color-mix(in oklab, var(--w-deep) 80%, black); opacity: .9; }
.scene .sc-near { fill: color-mix(in oklab, var(--w-deep) 70%, black); }
.scene .sc-snowcaps { fill: var(--w-light); opacity: .55; }
.scene-snow { --glow-fire: #ff8a3d; }
.scene-snow .sc-far { opacity: .8; fill: color-mix(in oklab, var(--w-deep) 85%, black); }
.scene-snow .sc-glow { animation: fire-glow 7s ease-in-out infinite; }
.scene-jungle .sc-moon { fill: var(--w-light); opacity: .85; filter: drop-shadow(0 0 30px var(--w-light)); }
.scene-jungle .sc-far { fill: color-mix(in oklab, var(--w-deep) 60%, #2f6b45); opacity: .7; }
.sc-frond { transform-box: fill-box; transform-origin: 50% 100%; fill: color-mix(in oklab, var(--w-deep) 80%, black); animation: sway 7s ease-in-out infinite alternate; }
.sc-f2 { animation-duration: 8.5s; animation-delay: -2s; } .sc-f3 { animation-duration: 6.5s; animation-delay: -4s; } .sc-f4 { animation-duration: 9s; animation-delay: -1s; }
.sc-eyes { fill: var(--w-accent); filter: drop-shadow(0 0 6px var(--w-accent)); transform-box: fill-box; transform-origin: center; animation: blink 6s infinite; }
.sc-flies circle { fill: #f6e27a; filter: drop-shadow(0 0 5px #f6e27a); animation: firefly 5s ease-in-out infinite alternate; }
.sc-flies circle:nth-child(2) { animation-delay: -1s; animation-duration: 6s; } .sc-flies circle:nth-child(3) { animation-delay: -2.4s; animation-duration: 4.4s; }
.sc-flies circle:nth-child(4) { animation-delay: -3s; animation-duration: 7s; } .sc-flies circle:nth-child(5) { animation-delay: -.5s; animation-duration: 5.5s; } .sc-flies circle:nth-child(6) { animation-delay: -4s; animation-duration: 6.4s; }
.scene-road .sc-sun { fill: var(--w-accent); opacity: .85; filter: drop-shadow(0 0 40px var(--w-accent)); animation: sun-rise 14s var(--ease) both; }
.sc-road { fill: none; stroke: color-mix(in oklab, var(--w-light) 30%, var(--w-deep)); stroke-width: 26; stroke-linecap: round; opacity: .55; }
.sc-road-dash { fill: none; stroke: var(--w-light); stroke-width: 2.5; stroke-dasharray: 10 14; opacity: .7; animation: road 3s linear infinite; }
.sc-kite { fill: var(--w-accent); stroke: var(--w-light); stroke-width: 1.5; animation: kite 8s ease-in-out infinite alternate; transform-box: fill-box; }
.sc-kite-tail { fill: none; stroke: var(--w-light); stroke-width: 1.5; }
.scene-mountain .sc-mist { fill: var(--w-light); opacity: .12; animation: mist 22s linear infinite alternate; }
.sc-bridge { fill: none; stroke: var(--w-light); stroke-width: 1.6; opacity: .55; transform-box: fill-box; transform-origin: 50% 0; animation: bridge 5s ease-in-out infinite alternate; }
.sc-crown { fill: #e6b84e; filter: drop-shadow(0 0 10px #e6b84e); }
.sc-glint { fill: #fff; transform-box: fill-box; transform-origin: center; animation: glint 4s ease-in-out infinite; }
/* the sea (Moby-Dick): two swells rolling opposite ways, the Pequod riding them, a whale sounding now and then */
.scene-sea .sc-moon { fill: var(--w-light); opacity: .8; filter: drop-shadow(0 0 30px var(--w-light)); }
.scene-sea .sc-far { opacity: .75; }
.sc-swell-a { animation: swell 16s linear infinite; }
.sc-swell-b { animation: swell 11s linear infinite reverse; }
.sc-ship { fill: color-mix(in oklab, var(--w-deep) 60%, black); stroke: color-mix(in oklab, var(--w-deep) 60%, black); stroke-width: 3; transform-box: fill-box; transform-origin: 50% 100%; animation: ride 7s ease-in-out infinite alternate; }
.sc-ship path:nth-child(3) { fill: color-mix(in srgb, var(--w-light) 55%, transparent); stroke: none; }
.sc-fluke { fill: color-mix(in oklab, var(--w-deep) 70%, black); animation: sound 13s ease-in-out infinite; }
/* the dawn (Zarathustra): the sun climbing behind his mountain, slow rays, the eagle circling with the serpent */
.scene-dawn .sc-sun { fill: var(--w-accent); opacity: .9; filter: drop-shadow(0 0 50px var(--w-accent)); animation: sun-rise 14s var(--ease) both; }
.sc-rays { stroke: var(--w-light); stroke-width: 3; opacity: .1; transform-box: view-box; transform-origin: 600px 300px; animation: spin 90s linear infinite; }
.scene-dawn .sc-cave { fill: color-mix(in oklab, var(--w-deep) 40%, black); }
.sc-orbit { transform-box: view-box; transform-origin: 760px 170px; animation: spin 32s linear infinite; }
.sc-eagle { fill: color-mix(in oklab, var(--w-deep) 55%, black); }
.sc-serpent { fill: none; stroke: var(--w-accent); stroke-width: 2.5; stroke-linecap: round; }
/* the railway (Anna Karenina): snow, the station, the rails, and a lamp coming slowly down the line */
.scene-rail .sc-far { fill: color-mix(in oklab, var(--w-deep) 75%, black); opacity: .7; }
.sc-station { fill: color-mix(in oklab, var(--w-deep) 55%, black); }
.sc-rails { fill: none; stroke: color-mix(in oklab, var(--w-light) 40%, var(--w-deep)); stroke-width: 3; stroke-linecap: round; }
.sc-trainlamp { fill: #ffe9b0; filter: drop-shadow(0 0 14px #ffd36b); transform-box: fill-box; transform-origin: center; animation: approach 18s ease-in infinite; }
.sc-gaslamp { fill: #ffd98a; filter: drop-shadow(0 0 12px #ffc75a); animation: flicker 4s steps(1) infinite; }
.sc-steam circle { fill: var(--w-light); opacity: .1; animation: steam 9s ease-out infinite; }
.sc-steam circle:nth-child(2) { animation-delay: -3s; } .sc-steam circle:nth-child(3) { animation-delay: -6s; }
/* the city (Crime and Punishment): tenements, a canal, one garret window burning */
.scene-city .sc-far { fill: color-mix(in oklab, var(--w-deep) 70%, var(--w-accent)); opacity: .5; }
.scene-city .sc-mid { fill: color-mix(in oklab, var(--w-deep) 65%, black); }
.sc-windows { fill: var(--w-light); opacity: .12; }
.sc-garret { fill: #ffd56b; filter: drop-shadow(0 0 10px #ffc94d); animation: flicker 3s steps(1) infinite; }
.sc-bridge-city { fill: none; stroke: color-mix(in oklab, var(--w-deep) 50%, black); stroke-width: 9; }
.sc-water { fill: color-mix(in oklab, var(--w-deep) 80%, black); }
.sc-ripples { stroke: var(--w-light); stroke-width: 2; stroke-linecap: round; opacity: .18; animation: ripple 6s ease-in-out infinite alternate; }
/* the river (Heart of Darkness): forest walls, mist, a steamer shouldering upstream */
.scene-river .sc-far { fill: color-mix(in oklab, var(--w-deep) 75%, black); opacity: .95; }
.scene-river .sc-near { fill: color-mix(in oklab, var(--w-deep) 55%, black); }
.scene-river .sc-mist { fill: var(--w-light); opacity: .1; animation: mist 26s linear infinite alternate; }
.sc-station { fill: var(--w-accent); filter: drop-shadow(0 0 8px var(--w-accent)); animation: flicker 5s steps(1) infinite; }
.sc-boat { fill: color-mix(in oklab, var(--w-deep) 45%, black); transform-box: fill-box; transform-origin: 50% 100%; animation: ride 5s ease-in-out infinite alternate; }
.sc-boat-wheel { fill: none; stroke: color-mix(in oklab, var(--w-deep) 45%, black); stroke-width: 4; }
.sc-smoke circle { fill: var(--w-light); opacity: .1; animation: steam 8s ease-out infinite; }
.sc-smoke circle:nth-child(2) { animation-delay: -2.7s; } .sc-smoke circle:nth-child(3) { animation-delay: -5.4s; }
/* the camp (Meditations): stars wheeling slowly overhead, the emperor's tent lit, a fire and its sparks */
.sc-sky { fill: var(--w-light); transform-box: view-box; transform-origin: 600px 700px; animation: spin 240s linear infinite; }
.sc-sky circle:nth-child(3n) { animation: twinkle-star 4s ease-in-out infinite alternate; }
.scene-camp .sc-far { fill: color-mix(in oklab, var(--w-deep) 70%, black); opacity: .8; }
.scene-camp .sc-mid { fill: color-mix(in oklab, var(--w-deep) 55%, black); }
.sc-tents { fill: color-mix(in oklab, var(--w-deep) 40%, black); }
.sc-tent-lit { fill: color-mix(in oklab, var(--w-accent) 55%, var(--w-deep)); filter: drop-shadow(0 0 18px color-mix(in srgb, var(--w-accent) 60%, transparent)); animation: flicker 6s steps(1) infinite; }
.sc-tent-door { fill: #ffd27a; opacity: .85; }
.sc-palisade { fill: none; stroke: color-mix(in oklab, var(--w-deep) 40%, black); stroke-width: 4; }
.sc-fire { fill: #ffb347; filter: drop-shadow(0 0 14px #ff9a3c); transform-box: fill-box; transform-origin: 50% 100%; animation: flame .9s ease-in-out infinite alternate; }
.sc-sparks circle { fill: #ffd08a; animation: spark 3s ease-out infinite; }
.sc-sparks circle:nth-child(2) { animation-delay: -1s; } .sc-sparks circle:nth-child(3) { animation-delay: -2s; }
/* the pond (Walden): firs, still water, the cabin with its smoke and lit window, a loon diving */
.scene-pond .sc-far { fill: color-mix(in oklab, var(--w-deep) 70%, black); opacity: .95; }
.scene-pond .sc-reflect { fill: color-mix(in oklab, var(--w-deep) 60%, black); opacity: .5; }
.sc-cabin { fill: color-mix(in oklab, var(--w-deep) 45%, black); }
.sc-cabin-window { fill: #ffd27a; filter: drop-shadow(0 0 8px #ffc65a); animation: flicker 5s steps(1) infinite; }
.sc-loon { fill: color-mix(in oklab, var(--w-deep) 30%, black); animation: dive 11s ease-in-out infinite; }
.fx-pond::before, .fx-pond::after { content: ''; position: absolute; inset: -300px 0 0; background-image: radial-gradient(4px 2.5px at 30px 40px, #e0902a, transparent), radial-gradient(3px 2px at 170px 120px, #c9562b, transparent), radial-gradient(4px 2.5px at 90px 230px, #e8b04a, transparent); background-size: 260px 320px; opacity: .55; animation: leaves 18s linear infinite; }
.fx-pond::after { background-size: 380px 420px; opacity: .4; animation-duration: 26s; }
/* the windmills (Don Quixote): sails turning, the low sun, the knight on Rocinante */
.scene-windmill .sc-sun { fill: var(--w-accent); opacity: .7; filter: drop-shadow(0 0 50px var(--w-accent)); }
.scene-windmill .sc-far { fill: color-mix(in oklab, var(--w-deep) 70%, var(--w-accent)); opacity: .6; }
.scene-windmill .sc-mid { fill: color-mix(in oklab, var(--w-deep) 70%, black); }
.sc-mills { fill: color-mix(in oklab, var(--w-light) 70%, var(--w-deep)); opacity: .85; }
.sc-sails { fill: color-mix(in oklab, var(--w-deep) 55%, black); transform-box: view-box; }
.sc-sails-a { transform-origin: 900px 210px; animation: spin 14s linear infinite; }
.sc-sails-b { transform-origin: 1075px 228px; animation: spin 11s linear infinite; }
.sc-knight { fill: color-mix(in oklab, var(--w-deep) 40%, black); animation: ride 1.6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
.sc-lance { fill: none; stroke: color-mix(in oklab, var(--w-deep) 40%, black); stroke-width: 3; }
/* the town (Middlemarch): spire and clock, lit windows, rooks over the fields */
.scene-town .sc-far { fill: color-mix(in oklab, var(--w-deep) 65%, var(--w-accent)); opacity: .55; }
.scene-town .sc-mid { fill: color-mix(in oklab, var(--w-deep) 60%, black); }
.scene-town .sc-near { fill: color-mix(in oklab, var(--w-deep) 75%, black); }
.sc-clock { fill: var(--w-light); opacity: .75; }
.sc-lit { fill: #ffd27a; filter: drop-shadow(0 0 6px #ffc65a); animation: flicker 7s steps(1) infinite; }
.sc-birds { fill: none; stroke: color-mix(in oklab, var(--w-deep) 40%, black); stroke-width: 2.5; stroke-linecap: round; animation: rooks 24s ease-in-out infinite alternate; }
/* the marsh (Great Expectations): flat land, the beacon, the gibbet, the hulk, the churchyard, the mist */
.scene-marsh .sc-far { fill: color-mix(in oklab, var(--w-deep) 85%, black); }
.sc-hulk, .sc-marks { fill: color-mix(in oklab, var(--w-deep) 45%, black); stroke: color-mix(in oklab, var(--w-deep) 45%, black); stroke-width: 3; }
.sc-beacon { fill: #ffb24d; filter: drop-shadow(0 0 10px #ff9a3c); animation: flicker 4s steps(1) infinite; }
.sc-graves { fill: color-mix(in oklab, var(--w-deep) 55%, black); }
.scene-marsh .sc-mist { fill: var(--w-light); opacity: .14; animation: mist 30s linear infinite alternate; }
.scene-marsh .sc-near { fill: color-mix(in oklab, var(--w-deep) 65%, black); }
.sc-reeds { fill: none; stroke: color-mix(in oklab, var(--w-deep) 55%, black); stroke-width: 3; }
/* the ice (Frankenstein): the aurora, a far lightning flash, the ship held fast, a sledge on the floes */
.sc-aurora path { fill: var(--w-accent); opacity: .18; filter: blur(6px); transform-box: fill-box; animation: aurora 9s ease-in-out infinite alternate; }
.sc-aurora path:nth-child(2) { fill: var(--w-light); opacity: .1; animation-duration: 13s; }
.sc-bolt { fill: #f2f6ff; opacity: 0; filter: drop-shadow(0 0 12px #cfe0ff); animation: bolt 9s linear infinite; }
.scene-ice .sc-far { fill: color-mix(in oklab, var(--w-light) 25%, var(--w-deep)); opacity: .85; }
.scene-ice .sc-near { fill: color-mix(in oklab, var(--w-light) 35%, var(--w-deep)); }
.sc-ship-ice { fill: color-mix(in oklab, var(--w-deep) 50%, black); stroke: color-mix(in oklab, var(--w-deep) 50%, black); stroke-width: 3; }
.sc-sledge { fill: color-mix(in oklab, var(--w-deep) 30%, black); animation: sledge 40s linear infinite; }
/* the monastery (The Brothers Karamazov): white walls, gold domes that catch the light, birches, the bell */
.scene-monastery .sc-far { fill: color-mix(in oklab, var(--w-deep) 70%, black); opacity: .8; }
.sc-walls { fill: color-mix(in oklab, var(--w-light) 75%, var(--w-deep)); opacity: .9; }
.sc-domes { fill: var(--w-accent); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--w-accent) 50%, transparent)); }
.sc-crosses { fill: none; stroke: var(--w-accent); stroke-width: 3; }
.sc-gates { fill: color-mix(in oklab, var(--w-deep) 50%, black); }
.sc-bell { fill: var(--w-accent); transform-box: fill-box; transform-origin: 50% 0; animation: bell 3s ease-in-out infinite alternate; }
.sc-birches { fill: none; stroke: var(--w-light); stroke-width: 5; opacity: .55; stroke-dasharray: 18 4 30 3; }
.scene-monastery .sc-near { fill: color-mix(in oklab, var(--w-deep) 65%, black); }
.sc-firststar { fill: var(--w-light); animation: twinkle-star 3s ease-in-out infinite alternate; }
.hero-fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fx-snow::before, .fx-snow::after, .fx-rail::before, .fx-rail::after, .fx-marsh::before { content: ''; position: absolute; inset: -400px 0 0; background-image: radial-gradient(2px 2px at 20px 30px, #fff, transparent), radial-gradient(2px 2px at 140px 80px, #fff, transparent), radial-gradient(1.5px 1.5px at 90px 160px, #fff, transparent), radial-gradient(2.5px 2.5px at 180px 200px, #fff, transparent), radial-gradient(1.5px 1.5px at 60px 260px, #fff, transparent); background-size: 220px 300px; opacity: .55; animation: snowfall 14s linear infinite; }
.fx-snow::after, .fx-rail::after { background-size: 340px 420px; opacity: .35; animation-duration: 24s; filter: blur(1px); }
.fx-star::before, .fx-sea::before, .fx-dawn::before, .fx-ice::before, .fx-monastery::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 30px 40px, #fff, transparent), radial-gradient(1px 1px at 120px 90px, #fff, transparent), radial-gradient(1.5px 1.5px at 200px 20px, #fff, transparent); background-size: 260px 160px; opacity: .5; animation: twinkle 5s ease-in-out infinite alternate; }

.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 860px) { .hero-grid { grid-template-columns: auto 1fr; gap: 3.5rem; } }
.hero-cover { position: relative; width: clamp(118px, 22vw, 250px); aspect-ratio: 2 / 3; transform-style: preserve-3d; transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .7s var(--spring); filter: drop-shadow(22px 30px 30px rgba(0,0,0,.5)); animation: cover-in 1.1s var(--ease) both; }
@media (max-width: 859px) { .hero-cover { justify-self: start; } }
.hero-text .eyebrow { color: color-mix(in oklab, var(--w-light) 70%, var(--w-accent)); }
.work-title { font-family: var(--f-display); font-weight: 500; font-size: clamp(2.6rem, 7.4vw, 5.6rem); line-height: .95; letter-spacing: -.035em; margin: 0 0 .2em; font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.orig { font-family: var(--f-read); font-style: italic; font-size: 1.2rem; opacity: .75; margin: 0 0 .8rem; }
.byline { font-size: 1.05rem; margin-bottom: 1.2rem; }
.byline a { color: var(--w-light); font-weight: 700; text-decoration-color: color-mix(in srgb, var(--w-light) 40%, transparent); }
.byline .muted { color: color-mix(in srgb, var(--w-light) 65%, transparent); }
.hook { font-family: var(--f-read); font-size: clamp(1.1rem, 1.9vw, 1.35rem); line-height: 1.5; max-width: 38rem; opacity: .95; }
.vs { display: grid; gap: .45rem; max-width: 34rem; margin-top: 1.6rem; padding: 1rem 1.1rem; border-radius: 14px; background: color-mix(in srgb, black 22%, transparent); border: 1px solid color-mix(in srgb, var(--w-light) 14%, transparent); backdrop-filter: blur(6px); }
.vs-row { display: grid; grid-template-columns: 8.4rem 1fr 6.5rem; align-items: center; gap: .7rem; font-size: .82rem; }
.vs-l { font-weight: 650; opacity: .85; }
.vs-row b { text-align: right; font-weight: 700; }
.vs-track { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--w-light) 12%, transparent); overflow: hidden; }
.vs-bar { display: block; height: 100%; width: var(--vs, 100%); min-width: 4px; border-radius: 4px; background: var(--w-accent); box-shadow: 0 0 12px var(--w-accent); transform-origin: left; animation: bar-grow 1.6s .4s var(--ease) both; }
.vs-book .vs-bar { background: color-mix(in srgb, var(--w-light) 55%, transparent); box-shadow: none; animation-duration: 2.4s; }
@media (max-width: 480px) { .vs-row { grid-template-columns: 6rem 1fr 4.6rem; font-size: .76rem; } }

/* ---------- a work: the level bar */
.levelbar { position: sticky; top: var(--top-h); z-index: 30; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line); transition: top .45s var(--ease); }
.levelbar-in { display: flex; align-items: center; gap: .8rem; min-height: 66px; padding-block: .5rem; }
.lvl-tabs { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); flex: 1; max-width: 34rem; padding: 4px; border-radius: 999px; background: var(--line-2); border: 1px solid var(--line); }
.lvl-tab { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .3rem .4rem; min-height: 46px; border-radius: 999px; color: var(--ink-2); text-decoration: none; text-align: center; transition: color .35s; }
.lvl-name { font-family: var(--f-display); font-weight: 600; font-size: .98rem; line-height: 1.1; }
.lvl-min { font-size: .7rem; font-weight: 700; letter-spacing: .06em; opacity: .75; }
.lvl-tab[aria-current] { color: var(--bg); }
.lvl-tab:hover:not([aria-current]) { color: var(--ink); }
.lvl-ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 999px; background: var(--hl); box-shadow: 0 6px 18px -8px var(--hl); transition: translate .6s var(--spring); }
.lvl-tabs:has([data-lv="short"][aria-current]) .lvl-ind { translate: 100% 0; }
.lvl-tabs:has([data-lv="essence"][aria-current]) .lvl-ind { translate: 200% 0; }
.lvl-tools { display: flex; gap: .45rem; margin-left: auto; }
.cyc-ic { display: inline-block; font-weight: 800; transition: rotate .5s var(--spring); }
[data-level-now="essence"] .cyc-ic { rotate: 180deg; }
/* Phones: one compact row (the header above stays pinned too), so the two bars leave room to read. */
@media (max-width: 640px) {
  :root { --top-h: 56px; }
  .levelbar-in { gap: .4rem; min-height: 56px; padding-block: .35rem; }
  .lvl-tabs { max-width: none; padding: 3px; }
  .lvl-tab { min-height: 42px; padding: .2rem .25rem; }
  .lvl-name { font-size: .8rem; }
  .lvl-min { font-size: .64rem; }
  .lvl-tools { gap: .3rem; }
  .lvl-tools .tool { width: 40px; padding: 0; justify-content: center; }
  .lvl-tools .tool span:not(.cyc-ic) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- a work: body with the side menu */
.work-body { display: grid; gap: 2rem; padding-top: 2.5rem; padding-bottom: 5rem; }
@media (min-width: 1100px) { .work-body { grid-template-columns: 210px minmax(0, 1fr); gap: 4rem; } }
.toc { display: none; }
@media (min-width: 1100px) {
  .toc { display: block; position: sticky; top: calc(var(--top-h) + 100px); align-self: start; padding-left: 1rem; border-left: 2px solid var(--line); transition: top .45s var(--ease); }
}
.toc-h { font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.toc-list { list-style: none; margin: 0 0 .8rem; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.toc-list a { display: block; padding: .3rem 0; color: var(--ink-2); text-decoration: none; font-size: .92rem; font-weight: 550; transition: color .2s, translate .35s var(--spring); }
.toc-list a:hover { color: var(--ink); translate: 3px 0; }
.toc-list a.on { color: var(--hl); font-weight: 750; translate: 4px 0; }
.toc-shared { padding-top: .8rem; border-top: 1px dashed var(--line); }
.toc-progress { position: absolute; left: -2px; top: 0; width: 2px; height: 100%; }
.toc-progress span { display: block; width: 100%; height: calc(var(--p, 0) * 100%); background: var(--hl); border-radius: 2px; transition: height .2s linear; }

.reading { min-width: 0; }
.reading { max-width: 66rem; --read-size: calc(var(--fs) * var(--f-scale)); }
.prose { max-width: var(--measure); font-family: var(--f-read); font-size: var(--read-size); line-height: var(--lh); color: var(--ink); hanging-punctuation: first; }
.prose p { margin: 0 0 1em; }
[data-align="justify"] .prose p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.level-intro { font-size: .85rem; color: var(--muted); margin: 0 0 1.6rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.level-intro b { color: var(--hl); font-weight: 750; }
.epigraph { margin: 0 0 3rem; padding: 1.4rem 0 1.4rem 1.6rem; border-left: 3px solid var(--hl); }
.epigraph blockquote { margin: 0; font-family: var(--f-display); font-style: italic; font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.3; font-weight: 400; font-variation-settings: 'opsz' 96, 'SOFT' 100, 'WONK' 1; }
.epigraph blockquote::before { content: '“'; } .epigraph blockquote::after { content: '”'; }
.epigraph figcaption { margin-top: .6rem; font-size: .82rem; color: var(--muted); }

.sec { padding-top: 1rem; margin-bottom: 4rem; scroll-margin-top: calc(var(--top-h) + 86px); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; margin-bottom: 1.6rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.sec-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin: 0; font-weight: 500; font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; }
.sec-kicker { flex-basis: 100%; margin: 0; font-size: .74rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--hl); }
.sec-note { margin: 0; font-family: var(--f-display); font-style: italic; color: var(--muted); }

/* the story */
.part { margin-bottom: 2.2rem; }
.part-head { display: flex; align-items: baseline; gap: .8rem; font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin-bottom: .7rem; }
.part-n { font-family: var(--f-display); font-size: .72em; font-weight: 600; color: var(--hl); letter-spacing: .06em; min-width: 2.2em; font-variant-numeric: lining-nums; }
[data-caps="on"] .part .prose > p:first-child::first-letter { font-family: var(--f-display); font-weight: 600; color: var(--hl); font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; }
@supports (initial-letter: 3) { [data-caps="on"] .part .prose > p:first-child::first-letter { initial-letter: 3; margin-right: .12em; } }
@supports not (initial-letter: 3) { [data-caps="on"] .part .prose > p:first-child::first-letter { float: left; font-size: 3.6em; line-height: .82; padding: .06em .1em 0 0; } }
[data-caps="on"] .part:not(.first) .prose > p:first-child::first-letter { initial-letter: 2; }
@supports not (initial-letter: 2) { [data-caps="on"] .part:not(.first) .prose > p:first-child::first-letter { font-size: 2.6em; } }

/* the timeline */
.timeline { list-style: none; margin: 0; padding: 1.4rem .2rem 1.2rem; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 210px); gap: 1rem; overflow-x: auto; scroll-snap-type: x proximity; position: relative; scrollbar-width: thin; scrollbar-color: var(--hl) transparent; background: linear-gradient(var(--line), var(--line)) 0 3.6rem / 100% 2px no-repeat; }
.tl-item { scroll-snap-align: start; display: grid; grid-template-rows: 2rem 1.4rem auto; gap: .3rem; }
.tl-when { font-family: var(--f-display); font-size: 1.25rem; font-weight: 600; color: var(--hl); white-space: nowrap; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--hl); margin-top: .2rem; transition: scale .4s var(--spring); }
.tl-item:hover .tl-dot { scale: 1.4; background: var(--hl); }
.tl-what { font-size: .92rem; color: var(--ink-2); line-height: 1.45; }

/* the people */
.cast-group { margin-bottom: 2rem; }
.cast-name { font-family: var(--f-ui); font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .8rem; }
.cast { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); }
.person { display: flex; gap: .9rem; padding: 1rem 1.1rem; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); transition: transform .45s var(--spring), box-shadow .35s, border-color .3s; }
.person:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in oklab, var(--line) 50%, var(--hl)); }
.mono { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font-family: var(--f-display); font-style: italic; font-weight: 600; font-size: 1.05rem; color: var(--bg); background: var(--hl); transition: rotate .6s var(--spring); }
.person:hover .mono { rotate: -12deg; }
.hue-1 .mono { background: color-mix(in oklab, var(--hl) 60%, #2f6b8f); }
.hue-2 .mono { background: color-mix(in oklab, var(--hl) 60%, #3f7a45); }
.hue-3 .mono { background: color-mix(in oklab, var(--hl) 55%, #7a4f9a); }
.hue-4 .mono { background: color-mix(in oklab, var(--hl) 55%, #b07d1c); }
.person h4 { font-size: 1.15rem; margin: .1rem 0 .15rem; }
.person .role { font-size: .82rem; font-weight: 700; color: var(--hl); margin-bottom: .35rem; }
.person p { font-size: .93rem; color: var(--ink-2); margin: 0; line-height: 1.5; }

/* the themes */
.themes { display: flex; flex-direction: column; }
.theme { display: grid; grid-template-columns: 3.4rem 1fr; gap: 0 1rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line-2); }
.theme-n { grid-row: span 2; margin: 0; font-family: var(--f-display); font-size: 2.2rem; line-height: 1; font-weight: 300; color: var(--hl); font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; }
.theme h3 { font-size: clamp(1.25rem, 2.4vw, 1.55rem); font-style: italic; font-weight: 500; margin-bottom: .5rem; }
.theme-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .7rem; }
.theme-chips li { font-family: var(--f-display); font-style: italic; font-size: clamp(1.3rem, 3vw, 1.9rem); padding: .4rem 1.2rem; border-radius: 999px; border: 1.5px solid var(--hl); color: var(--hl); }

/* the lessons */
.lessons { list-style: none; counter-reset: lesson; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.lesson { counter-increment: lesson; position: relative; padding: 1.3rem 1.3rem 1rem 1.3rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.lesson::before { content: counter(lesson); position: absolute; right: .6rem; top: -.6rem; font-family: var(--f-display); font-size: 5.5rem; font-weight: 700; line-height: 1; color: color-mix(in oklab, var(--hl) 14%, transparent); font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1; }
.lesson h3 { position: relative; font-size: 1.22rem; margin-bottom: .5rem; }
.lesson .prose { position: relative; font-size: calc(var(--read-size) * .92); }
.lessons.one { grid-template-columns: 1fr; }
.lessons.one .lesson { padding: 2rem; background: color-mix(in oklab, var(--paper) 85%, var(--hl)); }
.lessons.one .lesson .prose { font-family: var(--f-display); font-style: italic; font-size: clamp(1.3rem, 3vw, 1.8rem); line-height: 1.3; }
.lessons.one .lesson::before { content: none; }

/* the takeaways */
.ta { display: grid; gap: 1.6rem; }
@media (min-width: 900px) { .ta { grid-template-columns: 1fr 1fr; } }
.ta-label { display: flex; align-items: center; gap: .45rem; font-family: var(--f-ui); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .9rem; }
.ta-col { display: flex; flex-direction: column; gap: .9rem; }
.ta-card { padding: 1.2rem 1.25rem .5rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.ta-std .ta-card { border-top: 3px solid var(--hl); }
.ta-alt .ta-card { background: transparent; border-style: dashed; }
.ta-card h4 { font-size: 1.15rem; margin-bottom: .4rem; }
.ta-card .prose { font-size: calc(var(--read-size) * .9); }
.lens { display: inline-block; margin: 0 0 .5rem; padding: .15rem .65rem; border-radius: 999px; background: var(--hl); color: var(--bg); font-size: .74rem; font-weight: 800; letter-spacing: .04em; }

/* quotations, facts, read it */
.quotes { display: grid; grid-auto-flow: column; grid-auto-columns: min(88%, 32rem); gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .4rem .2rem 1.2rem; scrollbar-width: thin; scrollbar-color: var(--hl) transparent; }
.quote { scroll-snap-align: start; position: relative; margin: 0; padding: 2.2rem 1.6rem 1.3rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; }
.quote::before { content: '“'; position: absolute; top: -.2rem; left: 1rem; font-family: var(--f-display); font-size: 5rem; line-height: 1; color: var(--hl); opacity: .5; }
.quote blockquote { margin: 0; font-family: var(--f-read); font-style: italic; font-size: calc(var(--read-size) * 1.05); line-height: 1.5; }
.quote figcaption { font-size: .8rem; color: var(--muted); }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.fact { display: flex; gap: .9rem; padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.fact-n { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--hl); color: var(--hl); font-family: var(--f-display); font-weight: 700; }
.fact p { margin: 0; font-size: .95rem; color: var(--ink-2); }
.readit { display: grid; gap: 1.6rem; padding: clamp(1.4rem, 4vw, 2.4rem); border-radius: 24px; color: var(--w-light, var(--bg)); background: radial-gradient(100% 120% at 100% 0%, color-mix(in oklab, var(--w-accent, var(--accent)) 60%, transparent), transparent 60%), var(--w-deep, var(--ink)); }
@media (min-width: 900px) { .readit { grid-template-columns: 1.3fr 1fr; align-items: center; } }
.readit h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 500; }
.readit .btn.primary { background: var(--w-light, var(--bg)); border-color: var(--w-light, var(--bg)); color: var(--w-deep, var(--ink)); box-shadow: none; white-space: normal; text-align: left; }
.facts-dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; font-size: .9rem; }
.facts-dl dt { font-weight: 800; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; opacity: .7; padding-top: .2rem; }
.facts-dl dd { margin: 0; }
.why, .next { margin-top: 2.4rem; }
.why h3, .next h3 { font-size: 1.5rem; }
.next-list { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .7rem; }
.next-list b { font-family: var(--f-display); font-size: 1.1rem; }
.sources { margin-top: 2.4rem; padding: 1rem 1.2rem; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); }
.sources summary { cursor: pointer; font-weight: 700; }
.sources ul { font-size: .9rem; }
.sources::details-content { block-size: 0; overflow: clip; transition: block-size .5s var(--ease), content-visibility .5s allow-discrete; }
.sources[open]::details-content { block-size: auto; }

/* reading aloud */
.speaking { background: color-mix(in srgb, var(--glow) 45%, transparent); border-radius: 6px; box-shadow: 0 0 0 .3em color-mix(in srgb, var(--glow) 45%, transparent); transition: background-color .4s; }
.speaking-bar { position: fixed; z-index: 45; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); translate: -50% 0; display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem .5rem .6rem; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); animation: pop-up .5s var(--spring) both; }
.speaking-bar .tool { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 30%, transparent); }
.speak-what { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }

/* ---------- the Look panel (a popover drawer) */
/* A new theme fades in: colours ease across the page (a view transition would close the panel). */
.theme-fade, .theme-fade * { transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease), fill .45s var(--ease) !important; }
.look { position: fixed; inset: 0 0 0 auto; width: min(460px, 100vw); height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--bg); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden; display: none; flex-direction: column;
  translate: 100% 0; transition: translate .5s var(--ease), display .5s allow-discrete, overlay .5s allow-discrete; }
.look:popover-open { display: flex; translate: 0 0; }
@starting-style { .look:popover-open { translate: 100% 0; } }
.look::backdrop { background: color-mix(in srgb, black 0%, transparent); backdrop-filter: blur(0); transition: background-color .5s, backdrop-filter .5s, display .5s allow-discrete, overlay .5s allow-discrete; }
.look:popover-open::backdrop { background: color-mix(in srgb, black 30%, transparent); backdrop-filter: blur(3px); }
@starting-style { .look:popover-open::backdrop { background: color-mix(in srgb, black 0%, transparent); backdrop-filter: blur(0); } }
.look-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.2rem .4rem; }
.look-head h2 { font-size: 1.7rem; margin: 0; font-style: italic; font-weight: 500; }
.look-x { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; transition: rotate .4s var(--spring); }
.look-x:hover { rotate: 90deg; }
.look-sample { margin: .4rem 1.2rem .6rem; padding: 1rem 1.1rem; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); font-family: var(--f-read); font-size: calc(var(--fs) * var(--f-scale)); line-height: var(--lh); max-height: 9.5em; overflow: hidden; }
[data-align="justify"] .look-sample { text-align: justify; hyphens: auto; }
.look-sample .drop { float: left; font-family: var(--f-display); font-size: 3.2em; line-height: .8; padding: .05em .08em 0 0; color: var(--hl); }
[data-caps="off"] .look-sample .drop { float: none; font-size: 1em; line-height: inherit; padding: 0; color: inherit; font-family: inherit; }
.look-sample em { font-size: .8em; color: var(--muted); }
.look-body { flex: 1; overflow-y: auto; padding: 0 1.2rem 1rem; overscroll-behavior: contain; scrollbar-width: thin; }
.look-sec { padding: 1rem 0; border-top: 1px solid var(--line); }
.look-sec h3 { font-family: var(--f-ui); font-size: .76rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: .8rem; }
.look-sub { font-size: .78rem; font-weight: 700; color: var(--muted); margin: .9rem 0 .45rem; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .6rem; }
.sw { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; font: inherit; }
.sw-chip { position: relative; display: grid; place-items: center; width: 100%; height: 50px; border-radius: 12px; background: var(--sw-bg); color: var(--sw-ink); border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); box-shadow: inset 0 -7px 0 var(--sw-accent); transition: transform .4s var(--spring), box-shadow .3s; }
.sw-chip b { font-family: var(--f-display); font-size: 1.15rem; font-weight: 600; margin-top: -6px; }
.sw-name { font-size: .7rem; font-weight: 650; text-align: center; line-height: 1.15; color: var(--ink-2); }
.sw:hover .sw-chip { transform: translateY(-2px) rotate(-2deg); }
.sw[aria-pressed="true"] .sw-chip { box-shadow: inset 0 -7px 0 var(--sw-accent), 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.sw[aria-pressed="true"] .sw-chip::after { content: '✓'; position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--bg); font-size: .75rem; font-weight: 900; display: grid; place-items: center; }
.fonts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.fontopt { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .6rem .75rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); text-align: left; cursor: pointer; transition: border-color .2s, transform .35s var(--spring); }
.fontopt b { font-size: 1.12rem; font-weight: 500; line-height: 1.2; }
.fontopt small { font-family: var(--f-ui); font-size: .7rem; color: var(--muted); line-height: 1.3; }
.fontopt:hover { border-color: var(--hl); transform: translateY(-1px); }
.fontopt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: color-mix(in oklab, var(--paper) 88%, var(--accent)); }
.sliders { display: grid; gap: 1rem; }
.slider { display: flex; flex-direction: column; gap: .4rem; font-size: .88rem; font-weight: 650; }
.slider > span:first-child { display: flex; justify-content: space-between; }
.slider output { font-weight: 800; color: var(--accent); }
.slider-row { display: flex; align-items: center; gap: .6rem; }
.slider input[type="range"] { flex: 1; accent-color: var(--accent); width: 100%; }
.mini { border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: .2rem .7rem; font: inherit; font-size: .78rem; font-weight: 750; cursor: pointer; }
.mini[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 999px; background: var(--line-2); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: none; color: var(--ink-2); border-radius: 999px; padding: .4rem .85rem; font: inherit; font-size: .85rem; font-weight: 650; cursor: pointer; transition: background-color .25s, color .25s; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 18%, transparent); }
.tog { display: flex; align-items: center; gap: .6rem; margin-top: .9rem; font-size: .9rem; cursor: pointer; }
.tog input { width: 20px; height: 20px; accent-color: var(--accent); }
.look-foot { display: flex; justify-content: space-between; gap: .6rem; padding: .8rem 1.2rem max(.8rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }

/* ---------- footer */
.foot { margin-top: 2rem; padding: 3rem 0 2.5rem; border-top: 1px solid var(--line); background: color-mix(in oklab, var(--paper) 50%, var(--bg)); }
.foot-in { display: grid; gap: 1.6rem; }
@media (min-width: 800px) { .foot-in { grid-template-columns: 1.2fr 1fr; } .foot-in > .fine:last-child { grid-column: 1 / -1; } }
.foot-brand .fine { max-width: 34rem; margin-top: .6rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-content: start; }
.foot-links a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem; }
.foot-links a:hover { color: var(--hl); }

/* ---------- reading progress (scroll-driven where the browser can; site.js sets --p elsewhere) */
.progress { position: fixed; z-index: 60; inset: 0 0 auto; height: 3px; pointer-events: none; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--hl), color-mix(in oklab, var(--hl) 60%, var(--glow))); transform-origin: left; transform: scaleX(var(--p, 0)); }
@supports (animation-timeline: scroll()) {
  .progress span { animation: progress linear both; animation-timeline: scroll(root); }
}

/* ---------- reveal on scroll (only when site.js runs; without it everything is simply there) */
.js .reveal { opacity: 0; translate: 0 22px; transition: opacity .8s var(--ease), translate .9s var(--ease); }
.js .reveal.in { opacity: 1; translate: 0 0; }
.js .cast .reveal:nth-child(2), .js .lessons .reveal:nth-child(2), .js .shelf .reveal:nth-child(2) { transition-delay: .08s; }
.js .cast .reveal:nth-child(3), .js .lessons .reveal:nth-child(3), .js .shelf .reveal:nth-child(3) { transition-delay: .16s; }
.js .cast .reveal:nth-child(4), .js .lessons .reveal:nth-child(4), .js .shelf .reveal:nth-child(4) { transition-delay: .24s; }

/* ---------- switching level without view transitions (older browsers) */
.level.lv-enter { animation: lv-in .55s var(--ease) both; }

/* ---------- view transitions: between pages (the cover and title morph) and between levels */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .55s; animation-timing-function: var(--ease); }
::view-transition-old(root) { animation: fade-out .25s ease both; }
::view-transition-new(root) { animation: fade-in .45s .05s ease both; }
.levels { view-transition-name: levels; }
::view-transition-old(levels) { animation: lv-out .28s ease both; }
::view-transition-new(levels) { animation: lv-in .55s .05s var(--ease) both; }
.lvl-ind { view-transition-name: lvl-ind; }

/* ---------- movement settings */
[data-motion="gentle"] .scene *, [data-motion="gentle"] .hero-fx::before, [data-motion="gentle"] .hero-fx::after, [data-motion="gentle"] .ticker-track,
[data-motion="gentle"] .hb, [data-motion="gentle"] .hb *, [data-motion="gentle"] .ld-page span, [data-motion="gentle"] .home-hero::before { animation-play-state: paused !important; }
[data-motion="gentle"] .js .reveal, .js[data-motion="gentle"] .reveal { translate: 0 0; }
[data-motion="gentle"] .cover, [data-motion="gentle"] .hero-cover { --rx: 0deg; --ry: 0deg; }
[data-motion="none"] *, [data-motion="none"] *::before, [data-motion="none"] *::after { animation: none !important; transition: none !important; }
.js[data-motion="none"] .reveal { opacity: 1; translate: 0 0; }
[data-motion="none"] .cover, [data-motion="none"] .hero-cover { --rx: 0deg; --ry: 0deg; }
:root[data-motion="none"]::view-transition-group(*), :root[data-motion="none"]::view-transition-old(*), :root[data-motion="none"]::view-transition-new(*) { animation: none !important; }

/* ---------- keyframes */
@keyframes rise-in { from { opacity: 0; translate: 0 .5em; filter: blur(6px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }
@keyframes breathe { 50% { scale: 1.08; opacity: .8; } }
@keyframes hb-float { 0%, 100% { transform: rotateX(52deg) rotateZ(-18deg) translateZ(0); } 50% { transform: rotateX(48deg) rotateZ(-14deg) translateZ(24px); } }
@keyframes riffle { 0%, 12% { transform: rotateY(-3deg); } 88%, 100% { transform: rotateY(-176deg); } }
@keyframes shadow-pulse { 50% { scale: .86; opacity: .7; } }
@keyframes word-rise { 0% { opacity: 0; transform: translate(-50%, 0) translateX(0) scale(.8); } 10% { opacity: .95; } 70% { opacity: .5; } 100% { opacity: 0; transform: translate(-50%, -190px) translateX(var(--dx)) scale(1.05); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes line-write { 0% { scale: 0 1; } 30%, 80% { scale: 1 1; } 100% { scale: 1 1; opacity: .4; } }
@keyframes fire-glow { 50% { opacity: .55; } }
@keyframes sway { from { rotate: -3deg; } to { rotate: 3deg; } }
@keyframes blink { 0%, 44%, 50%, 100% { scale: 1 1; } 47% { scale: 1 .1; } }
@keyframes firefly { 0% { translate: 0 0; opacity: .2; } 50% { opacity: 1; } 100% { translate: 18px -22px; opacity: .3; } }
@keyframes sun-rise { from { translate: 0 60px; opacity: 0; } to { translate: 0 0; opacity: .85; } }
@keyframes road { to { stroke-dashoffset: -48; } }
@keyframes kite { from { translate: 0 0; rotate: -6deg; } to { translate: 40px -18px; rotate: 8deg; } }
@keyframes mist { from { translate: -120px 0; } to { translate: 160px 0; } }
@keyframes bridge { from { rotate: -1deg; } to { rotate: 1deg; } }
@keyframes glint { 0%, 70%, 100% { scale: 0; } 80% { scale: 2.2; } }
@keyframes ripple { from { translate: -14px 0; opacity: .1; } to { translate: 14px 0; opacity: .24; } }
@keyframes twinkle-star { to { opacity: .3; } }
@keyframes flame { from { scale: 1 1; } to { scale: .9 1.12; } }
@keyframes spark { from { translate: 0 0; opacity: 1; } to { translate: 12px -80px; opacity: 0; } }
@keyframes dive { 0%, 60% { translate: 0 0; opacity: 1; } 66% { translate: 10px 14px; opacity: 0; } 86% { translate: 90px 14px; opacity: 0; } 92%, 100% { translate: 90px 0; opacity: 1; } }
@keyframes leaves { to { translate: -60px 320px; rotate: 6deg; } }
@keyframes rooks { from { translate: -80px 10px; } to { translate: 120px -20px; } }
@keyframes aurora { from { translate: -40px 0; scale: 1 .9; } to { translate: 40px 8px; scale: 1 1.15; } }
@keyframes bolt { 0%, 88%, 92%, 95%, 100% { opacity: 0; } 89%, 91% { opacity: .9; } 94% { opacity: .5; } }
@keyframes sledge { from { translate: -500px 0; } to { translate: 500px 0; } }
@keyframes bell { from { rotate: -9deg; } to { rotate: 9deg; } }
@keyframes cap-in { from { opacity: 0; translate: 0 8px; } }
@keyframes swell { to { translate: -300px 0; } }
@keyframes ride { from { rotate: -2.5deg; translate: 0 0; } to { rotate: 2deg; translate: 0 7px; } }
@keyframes sound { 0%, 35% { translate: 0 70px; opacity: 0; } 50%, 70% { translate: 0 0; opacity: 1; } 88%, 100% { translate: 0 70px; opacity: 0; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes approach { 0% { scale: .5; opacity: .2; } 70% { opacity: 1; } 100% { scale: 2.4; opacity: 0; } }
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: .75; } 52% { opacity: .95; } }
@keyframes steam { from { translate: 0 0; scale: .6; opacity: .14; } to { translate: -40px -90px; scale: 1.6; opacity: 0; } }
@keyframes snowfall { to { translate: 40px 400px; } }
@keyframes twinkle { to { opacity: .2; } }
@keyframes cover-in { from { opacity: 0; translate: 0 30px; rotate: -4deg; } to { opacity: 1; translate: 0 0; rotate: 0deg; } }
@keyframes bar-grow { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes lv-out { to { opacity: 0; translate: 0 -14px; filter: blur(4px); } }
@keyframes lv-in { from { opacity: 0; translate: 0 22px; filter: blur(6px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-up { from { opacity: 0; translate: -50% 30px; } }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- print: just the guide, black on white */
@media print {
  .top, .levelbar, .toc, .foot, .look, .scene, .hero-fx, .progress, .speaking-bar, .vs, .hero-cover, .skip { display: none !important; }
  body, .work-hero { background: #fff !important; color: #000 !important; }
  .work-hero { padding: 0 0 1rem; }
  .work-title { font-size: 2.4rem; text-shadow: none; }
  .js .reveal { opacity: 1 !important; translate: none !important; }
  .person, .lesson, .ta-card, .quote, .fact { break-inside: avoid; border-color: #ccc; background: none; }
  .quotes { display: block; } .quote { margin-bottom: .8rem; }
  .readit { color: #000; background: none; border: 1px solid #ccc; }
  a { color: #000; }
}
