/* Marlo: paper at dusk. Warm ivory by day, plum-charcoal at night, soft light drifting behind each page.
   Tokens on :root; dark follows the system unless the reader picks with the toggle. */
@font-face { font-family: "Literata"; src: url("/fonts/literata.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/fonts/literata-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  --paper: #f5f0e8; --paper-2: #ece5d9; --card: #fbf8f3; --glass: rgb(253 250 245 / 0.62);
  --ink: #1f1a17; --ink-2: #4d4540; --muted: #766b61;
  --rule: rgb(31 26 23 / 0.16); --hair: rgb(31 26 23 / 0.09);
  --accent: #a8472b; --accent-2: #8a5a86; --accent-ink: #fff8f1; --accent-soft: rgb(168 71 43 / 0.1); --focus: #a8472b;
  --glow-1: #f4b48c; --glow-2: #eaaabd; --glow-3: #c3cfb2; --glow-opacity: 0.6; --grain-opacity: 0.045;
  --shadow-sm: 0 1px 2px rgb(45 28 18 / 0.06);
  --shadow: 0 1px 2px rgb(45 28 18 / 0.06), 0 18px 40px -22px rgb(45 28 18 / 0.35);
  --shadow-lg: 0 2px 4px rgb(45 28 18 / 0.08), 0 32px 64px -30px rgb(45 28 18 / 0.55);
  --moon: block; --sun: none;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --display: "Fraunces", "Literata", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --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='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --measure: 35rem; --reader-size: 1.1875rem; --radius: 14px; --radius-lg: 22px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111013; --paper-2: #1a181d; --card: #1d1b20; --glass: rgb(30 27 34 / 0.58);
    --ink: #eee8df; --ink-2: #c7beb4; --muted: #94897f;
    --rule: rgb(238 232 223 / 0.15); --hair: rgb(238 232 223 / 0.08);
    --accent: #eba27f; --accent-2: #b99ad8; --accent-ink: #1b120d; --accent-soft: rgb(235 162 127 / 0.13); --focus: #eba27f;
    --glow-1: #8c4129; --glow-2: #5a3160; --glow-3: #21404f; --glow-opacity: 0.55; --grain-opacity: 0.07;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 18px 40px -20px rgb(0 0 0 / 0.7);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.35), 0 32px 64px -26px rgb(0 0 0 / 0.85);
    --moon: none; --sun: block; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111013; --paper-2: #1a181d; --card: #1d1b20; --glass: rgb(30 27 34 / 0.58);
  --ink: #eee8df; --ink-2: #c7beb4; --muted: #94897f;
  --rule: rgb(238 232 223 / 0.15); --hair: rgb(238 232 223 / 0.08);
  --accent: #eba27f; --accent-2: #b99ad8; --accent-ink: #1b120d; --accent-soft: rgb(235 162 127 / 0.13); --focus: #eba27f;
  --glow-1: #8c4129; --glow-2: #5a3160; --glow-3: #21404f; --glow-opacity: 0.55; --grain-opacity: 0.07;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 18px 40px -20px rgb(0 0 0 / 0.7);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.35), 0 32px 64px -26px rgb(0 0 0 / 0.85);
  --moon: none; --sun: block; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip;
  background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.65 var(--serif);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* film grain over everything, very faint */
body::after { content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none; background: var(--noise); opacity: var(--grain-opacity); }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; transition: color 0.2s; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; display: block; }
.wrap { width: 100%; max-width: 70rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 70; }

/* ---------- header ---------- */
.site-head { position: relative; z-index: 5; }
.site-head .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 24px; padding-top: 18px; padding-bottom: 10px; }
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font: italic 400 1.75rem/1 var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.02em; }
.brand::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #ffe1c6, var(--accent) 58%, var(--accent-2)); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 18px 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.brand:hover { color: var(--ink); }
.nav { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 22px; font: 600 0.6875rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; }
.nav a { position: relative; text-decoration: none; color: var(--ink-2); padding: 12px 0; }
.nav a::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); transform: translateX(-50%) scale(0); transition: transform 0.35s var(--ease); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after, .nav a:hover::after { transform: translateX(-50%) scale(1); }
.theme-btn { grid-column: 2; grid-row: 1; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--hair); background: var(--glass); color: var(--ink-2); cursor: pointer; transition: border-color 0.2s, color 0.2s, transform 0.4s var(--ease); }
.theme-btn:hover { color: var(--ink); border-color: var(--rule); transform: rotate(-18deg); }
.theme-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.i-moon { display: var(--moon); } .i-sun { display: var(--sun); }
@media (min-width: 640px) {
  .site-head .wrap { grid-template-columns: auto minmax(0, 1fr) auto; padding-top: 22px; padding-bottom: 22px; }
  .nav { grid-column: 2; justify-self: end; gap: 0 30px; }
  .theme-btn { grid-column: 3; }
}

/* ---------- page frame ---------- */
main { flex: 1; position: relative; isolation: isolate; padding: 28px 0 120px; animation: page-in 0.7s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
/* the soft light behind each page; a book's pages take on its cover's tone */
.aura { position: absolute; inset: -140px 0 auto; height: min(95vh, 820px); z-index: -1; pointer-events: none; overflow: hidden; opacity: var(--glow-opacity);
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent); mask-image: linear-gradient(to bottom, #000 35%, transparent); }
.aura i { position: absolute; border-radius: 50%; will-change: transform; }
.aura i:nth-child(1) { width: 62vmax; height: 62vmax; left: -22vmax; top: -24vmax; background: radial-gradient(closest-side, var(--tone-glow, var(--glow-1)), transparent); animation: drift-a 28s ease-in-out infinite alternate; }
.aura i:nth-child(2) { width: 54vmax; height: 54vmax; right: -20vmax; top: -18vmax; background: radial-gradient(closest-side, var(--glow-2), transparent); animation: drift-b 34s ease-in-out infinite alternate; }
.aura i:nth-child(3) { width: 44vmax; height: 44vmax; left: 28%; top: 6vmax; background: radial-gradient(closest-side, var(--glow-3), transparent); animation: drift-c 40s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate3d(10vmax, 5vmax, 0) scale(1.08); } }
@keyframes drift-b { to { transform: translate3d(-8vmax, 7vmax, 0) scale(0.94); } }
@keyframes drift-c { to { transform: translate3d(-6vmax, -4vmax, 0) scale(1.12); } }
main[data-tone] { --tone-glow: color-mix(in oklab, var(--tone) 60%, var(--paper)); }
main[data-tone="0"], .cover.c0 { --tone: #c0683f; } main[data-tone="1"], .cover.c1 { --tone: #4f8070; }
main[data-tone="2"], .cover.c2 { --tone: #6f5f9a; } main[data-tone="3"], .cover.c3 { --tone: #bd8d3d; }
main[data-tone="4"], .cover.c4 { --tone: #4f6f99; } main[data-tone="5"], .cover.c5 { --tone: #a0506c; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 420; line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 0.5em; text-wrap: balance; font-variation-settings: "SOFT" 60; }
h1 { font-size: clamp(2.4rem, 7vw, 4rem); font-style: italic; font-weight: 340; font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.55rem, 3.6vw, 2.15rem); }
h3 { font-size: 1.2rem; font-weight: 480; }
.kicker { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 18px; font: 600 0.6875rem/1.2 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.kicker::before { content: ""; width: 26px; height: 1px; background: currentColor; opacity: 0.6; flex: none; }
.kicker a { text-decoration: none; }
.lede { font-size: clamp(1.15rem, 2.4vw, 1.375rem); line-height: 1.5; color: var(--ink-2); max-width: 36rem; margin: 0 0 32px; }
.muted { color: var(--muted); }
.small { font: 0.875rem/1.5 var(--sans); }
.orn { color: var(--accent); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 600 0.875rem/1 var(--sans); letter-spacing: 0.01em; padding: 15px 24px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); text-decoration: none; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.2s, border-color 0.2s, color 0.2s; }
.btn:hover { color: var(--paper); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn .arr { transition: transform 0.3s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); box-shadow: none; }
.btn.ghost:hover { background: var(--glass); border-color: var(--ink-2); color: var(--ink); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font: 600 0.8125rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.link-arrow .arr { transition: transform 0.3s var(--ease); }
.link-arrow:hover .arr { transform: translateX(4px); }

/* ---------- home ---------- */
.hero { display: grid; gap: 48px; align-items: center; padding: clamp(28px, 9vh, 104px) 0 clamp(44px, 9vh, 96px); }
.hero h1 { font-size: clamp(4.5rem, 19vw, 10rem); line-height: 0.86; letter-spacing: -0.045em; font-weight: 300; margin: 0 0 0.2em; margin-left: -0.04em; }
.hero .lede { font-style: italic; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 32px 0 0; font: 500 0.75rem/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hero-meta span + span::before { content: "✦"; margin-right: 18px; font-size: 0.6rem; color: var(--accent); vertical-align: 0.15em; }
.fan { display: none; }
@media (min-width: 860px) {
  .hero.has-fan { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
  .fan { display: block; position: relative; height: clamp(340px, 34vw, 440px); }
  .fan a { position: absolute; top: 50%; left: 50%; width: 50%; transition: transform 0.7s var(--ease); }
  .fan a:nth-child(1) { z-index: 3; transform: translate(-50%, -50%) rotate(-2deg); }
  .fan a:nth-child(2) { z-index: 2; transform: translate(-98%, -45%) rotate(-11deg); }
  .fan a:nth-child(3) { z-index: 1; transform: translate(-4%, -45%) rotate(9deg); }
  .fan:hover a:nth-child(1) { transform: translate(-50%, -54%) rotate(-1deg); }
  .fan:hover a:nth-child(2) { transform: translate(-112%, -44%) rotate(-15deg); }
  .fan:hover a:nth-child(3) { transform: translate(8%, -44%) rotate(13deg); }
  .fan .cover { box-shadow: var(--shadow-lg); }
}
.continue { display: none; margin: -20px 0 56px; }
.continue.show { display: block; }
.continue a { display: inline-flex; align-items: center; gap: 14px; max-width: 100%; padding: 8px 22px 8px 8px; border-radius: 999px; background: var(--glass); border: 1px solid var(--hair); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow-sm); text-decoration: none; transition: border-color 0.2s, transform 0.3s var(--ease); }
.continue a:hover { border-color: var(--rule); transform: translateY(-1px); color: inherit; }
.continue .dot { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--accent-ink); background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--accent) 55%, #fff), var(--accent) 60%, var(--accent-2)); }
.continue .dot svg { width: 13px; height: 13px; fill: currentColor; margin-left: 2px; }
.continue a > span:last-child { min-width: 0; }
.continue .lbl { display: block; font: 600 0.625rem/1.3 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.continue .ttl { display: block; font: italic 400 1.0625rem/1.3 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue .ttl:empty::before { content: "Pick up where you stopped"; }

.feature { position: relative; display: grid; gap: 16px; padding: clamp(26px, 5vw, 52px); margin: 0 0 88px; border-radius: var(--radius-lg); background: var(--glass); border: 1px solid var(--hair); -webkit-backdrop-filter: blur(16px) saturate(1.15); backdrop-filter: blur(16px) saturate(1.15); box-shadow: var(--shadow); overflow: hidden; }
.feature::before { content: "“"; position: absolute; right: clamp(16px, 4vw, 44px); top: -0.12em; font: italic 300 clamp(9rem, 22vw, 15rem)/1 var(--display); color: var(--accent); opacity: 0.12; pointer-events: none; }
.feature .kicker { margin-bottom: 4px; }
.feature h2 { margin: 0; font-size: clamp(2rem, 5.4vw, 3.25rem); line-height: 1.02; font-style: italic; font-weight: 340; font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.025em; }
.feature h2 a { text-decoration: none; }
.feature .from { margin: 0; font: 500 0.8125rem/1.4 var(--sans); color: var(--muted); }
.feature .from a { color: var(--ink-2); }
.feature .summary { margin: 4px 0 8px; max-width: 40rem; font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); }
@media (min-width: 860px) { .feature { grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 48px; } .feature > .go { grid-column: 2; grid-row: 1 / span 4; align-self: end; } }

.section { margin: 0 0 88px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 32px; padding-bottom: 16px; border-bottom: 1px solid var(--hair); }
.section-head h2 { margin: 0; font-style: italic; font-weight: 360; font-variation-settings: "SOFT" 100, "WONK" 1; }
.section-head a { font: 600 0.6875rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); white-space: nowrap; }

/* ---------- covers + book grid ---------- */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 44px 22px; }
@media (min-width: 720px) { .books { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 56px 40px; } }
.book-card { display: block; text-decoration: none; }
.book-card:hover { color: inherit; }
.book-card .cover { transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease); }
.book-card:hover .cover { transform: translateY(-6px) rotate(-1.2deg); box-shadow: var(--shadow-lg); }
.book-card h3 { margin: 18px 0 6px; font-size: 1.1875rem; line-height: 1.2; transition: color 0.2s; }
.book-card:hover h3 { color: var(--accent); }
.book-card .meta { font: 600 0.6875rem/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cover { position: relative; isolation: isolate; container-type: inline-size; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 3px 10px 10px 3px; background: var(--paper-2); box-shadow: var(--shadow); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
/* spine crease and a soft sheen, on typeset and uploaded covers alike */
.cover::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, rgb(0 0 0 / 0.3) 0, rgb(255 255 255 / 0.14) 2.4%, rgb(0 0 0 / 0.08) 4.6%, transparent 9%), linear-gradient(155deg, rgb(255 255 255 / 0.16), transparent 38%); }
.cover.type { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 20% 13% 13%; color: #fbf3e8;
  background: var(--noise), radial-gradient(120% 70% at 30% 10%, color-mix(in oklab, var(--tone) 70%, #fff4e6), transparent 60%), linear-gradient(170deg, var(--tone), color-mix(in oklab, var(--tone) 45%, #120c10));
  background-blend-mode: soft-light, normal, normal; }
.cover.type::before { content: ""; position: absolute; inset: 6% 6% 6% 9%; z-index: 1; border: 1px solid rgb(255 245 230 / 0.28); border-radius: 2px; }
.cover.type .t { position: relative; z-index: 2; font: italic 380 clamp(1rem, 14cqi, 2.75rem)/1.02 var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.015em; text-wrap: balance; text-shadow: 0 1px 12px rgb(0 0 0 / 0.18); }
.cover.type .o { position: relative; z-index: 2; margin-top: 9cqi; font-size: 6cqi; opacity: 0.75; }
.cover.type .a { position: relative; z-index: 2; margin-top: auto; font: 600 clamp(0.5rem, 5.2cqi, 0.8rem)/1 var(--sans); letter-spacing: 0.3em; text-transform: uppercase; opacity: 0.82; }
.badge { display: inline-block; font: 600 0.625rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---------- page heads ---------- */
.page-head { max-width: 46rem; margin: clamp(8px, 4vh, 40px) 0 56px; }
.page-head h1 { font-size: clamp(3rem, 11vw, 5.75rem); line-height: 0.92; letter-spacing: -0.04em; font-weight: 300; margin-bottom: 0.22em; }
.page-head .lede { font-style: italic; margin-bottom: 0; }

/* ---------- book page ---------- */
.book-top { display: grid; gap: 40px; margin: clamp(8px, 4vh, 40px) 0 88px; }
.book-top .cover { width: min(64%, 250px); box-shadow: var(--shadow-lg); }
@media (min-width: 760px) {
  .book-top { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 72px; align-items: center; }
  .book-top .cover { width: 100%; transform: rotate(-1.5deg); }
}
.book-top h1 { font-size: clamp(2.8rem, 8vw, 5.25rem); line-height: 0.95; letter-spacing: -0.04em; font-weight: 300; margin-bottom: 0.25em; }
.book-top .lede { font-style: italic; margin-bottom: 18px; }
.byline-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 26px; font: 600 0.6875rem/1.4 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.byline-row span + span::before { content: "✦"; margin-right: 18px; font-size: 0.55rem; color: var(--accent); vertical-align: 0.15em; }
.blurb { color: var(--ink-2); max-width: 38rem; white-space: pre-line; font-size: 1.125rem; line-height: 1.65; margin: 0 0 32px; }

/* contents as a thread: a life, one point at a time */
.toc { position: relative; list-style: none; max-width: 46rem; margin: 0 0 88px; padding: 0 0 0 30px; }
.toc::before { content: ""; position: absolute; left: 4px; top: 30px; bottom: 30px; width: 1px; background: linear-gradient(var(--accent), var(--rule) 22%, var(--rule) 78%, transparent); }
.toc li { position: relative; }
.toc li::before { content: ""; position: absolute; left: -30px; top: 27px; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 1px solid var(--ink-2); transition: background 0.3s, border-color 0.3s, box-shadow 0.3s; }
.toc li:first-child::before { background: var(--accent); border-color: var(--accent); }
.toc li:hover::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.toc a { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 6px 12px; padding: 18px 0 20px; text-decoration: none; border-bottom: 1px solid var(--hair); }
.toc a:hover { color: inherit; }
.toc .n { font: 600 0.6875rem/2.1rem var(--sans); letter-spacing: 0.14em; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc .ti { font: 440 1.375rem/1.3 var(--display); font-variation-settings: "SOFT" 60; padding-top: 2px; transition: transform 0.35s var(--ease), color 0.2s; }
.toc a:hover .ti { transform: translateX(5px); color: var(--accent); }
.toc .su { grid-column: 2; color: var(--muted); font-size: 0.96875rem; line-height: 1.55; }

.downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-width: 46rem; margin: 0 0 40px; }
.downloads a { display: grid; gap: 5px; padding: 15px 16px; border-radius: 12px; border: 1px solid var(--hair); background: var(--glass); text-decoration: none; transition: border-color 0.2s, transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.downloads a:hover { color: inherit; border-color: color-mix(in srgb, var(--accent) 50%, transparent); transform: translateY(-2px); box-shadow: var(--shadow); }
.downloads b { font: 600 0.9375rem/1.2 var(--sans); }
.downloads span { font: 0.75rem/1.35 var(--sans); color: var(--muted); }

/* ---------- reader ---------- */
.progress { position: fixed; left: 0; top: 0; z-index: 45; width: 100%; height: 2px; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--accent-2)); pointer-events: none; }
.reader { max-width: var(--measure); margin: 0 auto; }
.reader-tools { position: sticky; top: 12px; z-index: 6; display: flex; justify-content: flex-end; margin: 0 -4px 4px; pointer-events: none; }
.reader-tools .pill { transition: transform 0.45s var(--ease), opacity 0.3s; pointer-events: auto; display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--hair); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow-sm); }
.reader-tools button { min-width: 40px; height: 34px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font: 600 0.8125rem/1 var(--sans); cursor: pointer; transition: background 0.2s, color 0.2s; }
.reading .reader-tools .pill { transform: translateY(-170%); opacity: 0; pointer-events: none; }
.reader-tools button:hover { background: var(--accent-soft); color: var(--ink); }
.reader-tools svg { width: 15px; height: 15px; margin: 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.reader-head { text-align: center; margin: 20px 0 60px; }
.reader-head .kicker::after { content: ""; width: 26px; height: 1px; background: currentColor; opacity: 0.6; flex: none; }
.reader-head .num { display: block; margin: 0 0 14px; font: italic 400 1.1875rem/1.2 var(--display); font-variation-settings: "SOFT" 100; color: var(--muted); }
.reader-head h1 { margin: 0; font-size: clamp(2.4rem, 8.5vw, 4rem); line-height: 1; letter-spacing: -0.035em; font-weight: 320; }
.reader-head .o { display: block; margin-top: 30px; font-size: 0.8rem; color: var(--accent); }
.prose { font-size: var(--reader-size); line-height: 1.8; hyphens: auto; -webkit-hyphens: auto; font-variant-numeric: oldstyle-nums; hanging-punctuation: first; }
.prose p { margin: 0; text-indent: 1.5em; }
.prose > p:first-child, .prose hr + p, .prose h2 + p, .prose h3 + p, .prose h4 + p, .prose blockquote + p { text-indent: 0; }
.prose > p:first-child::first-line { font-variant-caps: all-small-caps; letter-spacing: 0.05em; }
.prose > p:first-child::first-letter { float: left; font-family: var(--display); font-style: normal; font-weight: 380; font-variation-settings: "SOFT" 100, "WONK" 1; font-size: 4.2em; line-height: 0.8; padding: 0.07em 0.1em 0 0; color: var(--accent); font-variant-caps: normal; }
.prose hr.scene-break { border: 0; height: auto; margin: 2.2em 0; text-align: center; overflow: visible; }
.prose hr.scene-break::after { content: "·  ✦  ·"; white-space: pre; color: var(--accent); font-size: 0.85em; }
.prose blockquote { margin: 1.4em 0; padding: 0.2em 0 0.2em 1.2em; border-left: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); color: var(--ink-2); font-style: italic; }
.prose blockquote p { text-indent: 0; }
.prose h2, .prose h3, .prose h4 { margin: 1.8em 0 0.7em; text-align: center; font-style: italic; }
.prose ul, .prose ol { margin: 0.8em 0; }
.chapter-nav { display: grid; gap: 12px; margin: 80px 0 0; }
.chapter-nav > span:empty { display: none; }
.chapter-nav a { display: block; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--hair); background: var(--glass); text-decoration: none; transition: border-color 0.2s, transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.chapter-nav a:hover { color: inherit; border-color: var(--rule); transform: translateY(-2px); box-shadow: var(--shadow); }
.chapter-nav .next { text-align: right; }
.chapter-nav .lbl { display: block; margin-bottom: 8px; font: 600 0.625rem/1 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.chapter-nav .ttl { font: italic 400 1.3125rem/1.25 var(--display); font-variation-settings: "SOFT" 100; }
@media (min-width: 560px) { .chapter-nav { grid-template-columns: 1fr 1fr; } .chapter-nav > span:empty { display: block; } .chapter-nav .next { grid-column: 2; } }
.take { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 36px; font: 500 0.8125rem/1 var(--sans); color: var(--muted); }
.take .l { margin-right: 6px; font-weight: 600; font-size: 0.625rem; letter-spacing: 0.18em; text-transform: uppercase; }
.take a { padding: 9px 13px; border-radius: 999px; border: 1px solid var(--hair); background: var(--glass); color: var(--ink-2); text-decoration: none; transition: border-color 0.2s; }
.take a:hover { border-color: var(--accent); color: var(--ink); }

/* ---------- other pages ---------- */
.page { max-width: 40rem; }
.page p { margin: 0 0 1em; }
.page .prose p { margin: 0; }
.upcoming { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.upcoming li { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 24px; align-items: center; padding: 32px 0; border-bottom: 1px solid var(--hair); }
@media (min-width: 720px) { .upcoming li { grid-template-columns: 150px minmax(0, 1fr); gap: 44px; } }
.upcoming h2 { margin: 10px 0 0.25em; font-style: italic; font-weight: 360; font-variation-settings: "SOFT" 100, "WONK" 1; }
.upcoming h2 a { text-decoration: none; }
.upcoming .blurb { font-size: 1rem; margin: 0; }
.empty { margin: 0 0 88px; padding: clamp(44px, 9vw, 72px) 24px; text-align: center; border-radius: var(--radius-lg); border: 1px solid var(--hair); background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--ink-2); font: italic 380 clamp(1.25rem, 3vw, 1.6rem)/1.45 var(--display); font-variation-settings: "SOFT" 100; }
.empty::before { content: "✦"; display: block; margin-bottom: 16px; font: normal 0.8rem/1 var(--sans); color: var(--accent); }
.empty small { display: block; margin-top: 10px; font: 0.875rem/1.5 var(--sans); color: var(--muted); }

/* ---------- footer ---------- */
.site-foot { position: relative; z-index: 1; border-top: 1px solid var(--hair); padding: 56px 0 128px; color: var(--muted); font: 0.875rem/1.5 var(--sans); }
.site-foot .wrap { display: grid; gap: 22px; }
.foot-mark { margin: 0; color: var(--ink); font: italic 300 clamp(3.25rem, 13vw, 6.5rem)/0.88 var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.045em; }
.foot-line { margin: 0; font: italic 1.125rem/1.5 var(--serif); color: var(--ink-2); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 24px; font: 600 0.6875rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; }
.foot-links a { padding: 8px 0; text-decoration: none; color: var(--ink-2); }
.foot-legal { font-size: 0.8125rem; }

/* ---------- music player (stays put across page changes) ---------- */
.player { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px); padding: 6px 18px 6px 6px; border-radius: 999px; background: var(--glass); border: 1px solid var(--hair); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2); box-shadow: var(--shadow-lg); font: 500 0.8125rem/1.2 var(--sans); }
.player[hidden] { display: none; }
.player button { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--ink); color: var(--paper); cursor: pointer; }
.player button svg { width: 13px; height: 13px; fill: currentColor; }
.player .bars { flex: none; display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.player .bars i { width: 2px; height: 30%; border-radius: 1px; background: var(--accent); }
.player.playing .bars i { animation: eq 0.9s ease-in-out infinite alternate; }
.player.playing .bars i:nth-child(2) { animation-delay: -0.35s; } .player.playing .bars i:nth-child(3) { animation-delay: -0.65s; }
@keyframes eq { from { height: 20%; } to { height: 100%; } }
.player .pt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }

/* listening: a chapter read aloud, with the paragraph being read softly lit */
.reader-tools .listen-btn { display: inline-flex; align-items: center; gap: 7px; padding: 0 13px 0 11px; color: var(--accent); }
.reader-tools .listen-btn svg { margin: 0; width: 16px; height: 16px; }
.reader-tools .listen-btn.on { background: var(--accent-soft); }
.listen { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 61; width: min(30rem, calc(100% - 32px)); overflow: hidden; padding: 12px 12px 10px 18px; border-radius: var(--radius-lg); background: var(--glass); border: 1px solid var(--hair); -webkit-backdrop-filter: blur(20px) saturate(1.25); backdrop-filter: blur(20px) saturate(1.25); box-shadow: var(--shadow-lg); font: 500 0.8125rem/1.25 var(--sans); animation: rise 0.45s var(--ease); }
.listen[hidden] { display: none; }
.player:not([hidden]) ~ .listen { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 60px); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 14px); } }
.ls-line { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--hair); }
.ls-line i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: transform 0.3s linear; }
.ls-top { display: flex; align-items: flex-start; gap: 10px; }
.ls-what { flex: 1; min-width: 0; margin: 2px 0 0; display: grid; gap: 2px; }
.ls-what b { font: italic 400 1.0625rem/1.25 var(--display); font-variation-settings: "SOFT" 100; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.ls-what span { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.listen button { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; transition: background 0.2s, color 0.2s; }
.listen button:hover { background: var(--accent-soft); color: var(--ink); }
.listen svg { width: 13px; height: 13px; fill: currentColor; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.ls-x svg { fill: none; stroke-width: 1.5; stroke-linecap: round; }
.ls-x { margin: -4px -2px 0 0; }
.ls-controls { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.listen .ls-play { width: 44px; height: 44px; background: var(--ink); color: var(--paper); }
.listen .ls-play:hover { background: var(--ink); color: var(--paper); transform: scale(1.04); }
.listen .ls-play svg { stroke: none; }
.ls-controls select { flex: 1; min-width: 0; margin-left: 6px; height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--hair); background: transparent; color: var(--ink-2); font: 500 0.8125rem/1 var(--sans); }
.listen .ls-speed { width: auto; min-width: 46px; padding: 0 10px; border-radius: 999px; font: 600 0.75rem/1 var(--sans); font-variant-numeric: tabular-nums; }
html.listening body { padding-bottom: 150px; }
html.listening .prose [data-b] { cursor: pointer; }
.prose .now { border-radius: 6px; background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: 0 0 0 0.4em color-mix(in srgb, var(--accent) 8%, transparent); transition: background 0.6s, box-shadow 0.6s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* print (the PDF download has its own styles) */
@media print {
  .site-head, .site-foot, .player, .listen, .reader-tools, .chapter-nav, .aura, .progress, .take { display: none !important; }
  body { background: #fff; color: #000; }
  body::after { display: none; }
}
