/*
  epilogueapp.io. Colours, type and sizes come from the app's design tokens
  (Design/tokens.json in the app's repo); the Now Playing preview on the home
  page follows Design/reference/NowPlaying.dc.html in design points.
*/

@font-face {
  font-family: "Fraunces";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/Fraunces-Medium.ttf") format("truetype");
}

@font-face {
  font-family: "Fraunces";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url("/assets/fonts/Fraunces-Italic.ttf") format("truetype");
}

/* Themes ------------------------------------------------------------------ */

/* The page uses each theme's splash colours (Epilogue seen from outside);
   the Now Playing preview uses its Now Playing colours and aura. */

:root,
[data-theme="dusk"] {
  color-scheme: dark;
  --page: #1E1C34;
  --hero-top: #15172A;
  --hero-glow: rgba(90, 58, 68, 0.9);
  --np-top: #191C30;
  --np-mid: #1E1C34;
  --np-end: #262039;
  --np-glow: rgba(46, 63, 92, 0.6);
  --text: #F0E8D8;
  --text-2: #C9C0AF;
  --accent: #E0A24E;
  --cover-accent: #E0A24E;
  --surface: #2B2744;
  --on-text: #191C30;
  --ink: 240, 232, 216;
  --shade: 0, 0, 0;
  --aura-a: rgba(58, 80, 114, 0.8);
  --aura-b: rgba(90, 58, 68, 0.85);
  --aura-c: rgba(201, 116, 74, 0.38);
}

[data-theme="midnight"] {
  color-scheme: dark;
  --page: #0C0D16;
  --hero-top: #0A0B12;
  --hero-glow: rgba(224, 162, 78, 0.14);
  --np-top: #0A0B12;
  --np-mid: #0B0C14;
  --np-end: #0C0D16;
  --np-glow: rgba(46, 63, 92, 0.3);
  --text: #EDE6D7;
  --text-2: #A9A396;
  --accent: #E0A24E;
  --cover-accent: #E0A24E;
  --surface: #171926;
  --on-text: #0A0B12;
  --ink: 237, 230, 215;
  --shade: 0, 0, 0;
  --aura-a: rgba(46, 63, 92, 0.55);
  --aura-b: rgba(44, 37, 69, 0.65);
  --aura-c: rgba(224, 162, 78, 0.16);
}

[data-theme="aubergine"] {
  color-scheme: dark;
  --page: #2A2244;
  --hero-top: #1F1934;
  --hero-glow: rgba(232, 135, 90, 0.42);
  --np-top: #221B37;
  --np-mid: #2A2244;
  --np-end: #31284D;
  --np-glow: rgba(122, 92, 166, 0.35);
  --text: #F0E8D8;
  --text-2: #CBC0D3;
  --accent: #E8875A;
  --cover-accent: #E8875A;
  --surface: #3B3158;
  --on-text: #221B37;
  --ink: 240, 232, 216;
  --shade: 0, 0, 0;
  --aura-a: rgba(122, 92, 166, 0.6);
  --aura-b: rgba(90, 58, 68, 0.75);
  --aura-c: rgba(232, 135, 90, 0.36);
}

[data-theme="hearth"] {
  color-scheme: dark;
  --page: #26191E;
  --hero-top: #1A1115;
  --hero-glow: rgba(232, 174, 90, 0.38);
  --np-top: #1E1418;
  --np-mid: #26191E;
  --np-end: #2E1E24;
  --np-glow: rgba(201, 116, 74, 0.22);
  --text: #F4EADB;
  --text-2: #D0BFB2;
  --accent: #E8AE5A;
  --cover-accent: #E8AE5A;
  --surface: #3A262D;
  --on-text: #1E1418;
  --ink: 244, 234, 219;
  --shade: 0, 0, 0;
  --aura-a: rgba(201, 116, 74, 0.42);
  --aura-b: rgba(110, 44, 56, 0.75);
  --aura-c: rgba(232, 174, 90, 0.3);
}

/* Translucent ink and shadow strengths (tokens: derivedOpacities). */
:root {
  --o-track: 0.18;
  --o-seg: 0.14;
  --o-seg-fill: 0.78;
  --o-line: 0.22;
  --o-cover-shadow: 0.85;
  --o-grid-shadow: 0.8;
  --o-thumb: 0.45;
  --o-play: 0.7;
  --o-device: 0.7;
}

[data-theme="dawn"],
[data-theme="parchment"] {
  --o-track: 0.14;
  --o-seg: 0.12;
  --o-seg-fill: 0.72;
  --o-line: 0.2;
  --o-cover-shadow: 0.6;
  --o-grid-shadow: 0.55;
  --o-thumb: 0.3;
  --o-play: 0.45;
  --o-device: 0.35;
}

[data-theme="dawn"] {
  color-scheme: light;
  --page: #ECEAF1;
  --hero-top: #D9DBEA;
  --hero-glow: rgba(240, 178, 120, 0.5);
  --np-top: #E4E5EF;
  --np-mid: #ECEAF1;
  --np-end: #F4EAE2;
  --np-glow: rgba(46, 63, 92, 0.14);
  --text: #1B1D33;
  --text-2: #57546B;
  --accent: #B8582F;
  --cover-accent: #E0A24E;
  --surface: #FBFAFC;
  --on-text: #F0E8D8;
  --ink: 27, 29, 51;
  --shade: 27, 29, 51;
  --aura-a: rgba(176, 182, 226, 0.6);
  --aura-b: rgba(240, 178, 120, 0.45);
  --aura-c: rgba(224, 162, 78, 0.28);
}

/* No theme picked and the system is light: Dawn, as above. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --page: #ECEAF1;
    --hero-top: #D9DBEA;
    --hero-glow: rgba(240, 178, 120, 0.5);
    --np-top: #E4E5EF;
    --np-mid: #ECEAF1;
    --np-end: #F4EAE2;
    --np-glow: rgba(46, 63, 92, 0.14);
    --text: #1B1D33;
    --text-2: #57546B;
    --accent: #B8582F;
    --cover-accent: #E0A24E;
    --surface: #FBFAFC;
    --on-text: #F0E8D8;
    --ink: 27, 29, 51;
    --shade: 27, 29, 51;
    --aura-a: rgba(176, 182, 226, 0.6);
    --aura-b: rgba(240, 178, 120, 0.45);
    --aura-c: rgba(224, 162, 78, 0.28);
    --o-track: 0.14;
    --o-seg: 0.12;
    --o-seg-fill: 0.72;
    --o-line: 0.2;
    --o-cover-shadow: 0.6;
    --o-grid-shadow: 0.55;
    --o-thumb: 0.3;
    --o-play: 0.45;
    --o-device: 0.35;
  }
}

[data-theme="parchment"] {
  color-scheme: light;
  --page: #F0E8D8;
  --hero-top: #F6F0E5;
  --hero-glow: rgba(201, 116, 74, 0.26);
  --np-top: #F4EDE0;
  --np-mid: #F0E8D8;
  --np-end: #EADFCB;
  --np-glow: rgba(90, 58, 68, 0.1);
  --text: #2C2545;
  --text-2: #6B4A55;
  --accent: #B4562C;
  --cover-accent: #E0A24E;
  --surface: #FBF7EF;
  --on-text: #F0E8D8;
  --ink: 44, 37, 69;
  --shade: 44, 37, 69;
  --aura-a: rgba(214, 170, 160, 0.5);
  --aura-b: rgba(235, 201, 143, 0.5);
  --aura-c: rgba(201, 116, 74, 0.22);
}

/* Base ---------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 1.0625rem/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, ul, figure { margin: 0; }

h1, h2, h3, dt,
.wordmark,
.monogram {
  font-family: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 500;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

strong { font-weight: 600; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: 70rem;
  margin: 0 auto;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

/* Header and footer --------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: max(1.25rem, env(safe-area-inset-top));
  padding-bottom: 1.25rem;
}

.wordmark {
  font-size: 1.625rem;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark:hover { color: inherit; }

.site-nav a {
  display: inline-block;
  padding: 0.5rem 0;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover { color: var(--text); }

.site-footer {
  padding-top: clamp(3rem, 8vw, 5rem);
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* The E. monogram: Fraunces E with an accent dot, baseline-aligned
   (dot 0.15 em, gap 0.04 em). */
.monogram {
  display: inline-flex;
  align-items: baseline;
  color: var(--text);
  font-size: 4rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.monogram::after {
  content: "";
  width: 0.15em;
  height: 0.15em;
  margin-left: 0.04em;
  border-radius: 50%;
  background: var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem 2rem;
  align-items: end;
}

.footer-grid p + p { margin-top: 0.4rem; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
}

.footer-links a:hover { color: var(--accent); }

.fine-print {
  margin-top: 2rem;
  font-size: 0.75rem;
  opacity: 0.85;
}

@media (max-width: 34rem) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}

/* Home: hero ---------------------------------------------------------------- */

/* The splash background, with the glow from below fading into the page so
   the hero has no bottom edge. */
.hero {
  background:
    linear-gradient(180deg, transparent 72%, var(--page) 100%),
    radial-gradient(140% 45% at 50% 100%, var(--hero-glow) 0%, transparent 75%),
    linear-gradient(180deg, var(--hero-top) 0%, var(--page) 100%);
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2.5rem, 7vw, 6.5rem);
  align-items: center;
  padding-top: clamp(1.5rem, 5vw, 4rem);
  padding-bottom: clamp(3.5rem, 8vw, 6.5rem);
}

.hero h1 {
  max-width: 11.5em;
  font-size: clamp(2.75rem, 1.5rem + 4.4vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
}

/* The headline's full stop is the monogram's dot. */
.hero h1 .stop { color: var(--accent); }

.lead {
  max-width: 31rem;
  margin-top: 1.5rem;
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3125rem);
  line-height: 1.5;
}

.availability {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2.25rem;
}

.store-soon {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid rgba(var(--ink), var(--o-line));
  border-radius: 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.availability p {
  color: var(--text-2);
  font-size: 0.9375rem;
}

.showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

@media (max-width: 54rem) {
  .hero-body { grid-template-columns: minmax(0, 1fr); }
  .showcase { justify-self: center; }
}

/* Home: the Now Playing preview --------------------------------------------- */

.device {
  --s: 0.72;
  --bezel: 11px;
  position: relative;
  flex: none;
  width: calc(390px * var(--s) + 2 * var(--bezel));
  height: calc(844px * var(--s) + 2 * var(--bezel));
  border-radius: calc(56px * var(--s) + var(--bezel));
  background: #0B0C11;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 50px 90px -40px rgba(var(--shade), var(--o-device));
}

@media (max-width: 400px) { .device { --s: 0.68; --bezel: 10px; } }
@media (max-width: 350px) { .device { --s: 0.6; --bezel: 9px; } }

.screen {
  position: absolute;
  top: var(--bezel);
  left: var(--bezel);
  width: 390px;
  height: 844px;
  overflow: hidden;
  border-radius: 56px;
  transform: scale(var(--s));
  transform-origin: 0 0;
  background:
    radial-gradient(110% 50% at 50% 22%, var(--np-glow) 0%, transparent 72%),
    linear-gradient(180deg, var(--np-top) 0%, var(--np-mid) 60%, var(--np-end) 100%);
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.island {
  position: absolute;
  top: 11px;
  left: 50%;
  z-index: 2;
  width: 124px;
  height: 36px;
  margin-left: -62px;
  border-radius: 18px;
  background: #000;
}

/* Three colour fields drift while playing; on pause they stop and fade. */
.aura {
  position: absolute;
  left: -25%;
  top: -15%;
  width: 150%;
  height: 130%;
  pointer-events: none;
  transition: opacity 1.6s ease;
}

.blob {
  position: absolute;
  border-radius: 50%;
}

.blob-a { left: 4%; top: 2%; width: 78%; height: 48%; background: radial-gradient(closest-side, var(--aura-a) 0%, transparent 100%); animation: drift-a 14s ease-in-out infinite; }
.blob-b { left: 26%; top: 48%; width: 84%; height: 52%; background: radial-gradient(closest-side, var(--aura-b) 0%, transparent 100%); animation: drift-b 19s ease-in-out infinite; }
.blob-c { left: 46%; top: 22%; width: 58%; height: 42%; background: radial-gradient(closest-side, var(--aura-c) 0%, transparent 100%); animation: drift-c 24s ease-in-out infinite; }

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(16%, 9%) scale(1.18); }
  66% { transform: translate(-9%, 16%) scale(0.92); }
}

@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1.08); }
  50% { transform: translate(-20%, -14%) scale(0.88); }
}

@keyframes drift-c {
  0%, 100% { transform: translate(0, 0) scale(0.95); }
  40% { transform: translate(-14%, 12%) scale(1.25); }
  75% { transform: translate(12%, -16%) scale(1); }
}

/* Ribbon bars: scale Y 1 → 0.32 → 1 while playing. */
@keyframes eq {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.32); }
}

.bars rect {
  transform-box: fill-box;
  transform-origin: center;
  animation: eq 1s ease-in-out infinite;
}

.bars rect:nth-child(1) { animation-duration: 1.1s; animation-delay: -0.2s; }
.bars rect:nth-child(2) { animation-duration: 0.9s; animation-delay: -0.6s; }
.bars rect:nth-child(3) { animation-duration: 1.3s; animation-delay: -0.1s; }
.bars rect:nth-child(4) { animation-duration: 1s; animation-delay: -0.45s; }
.bars rect:nth-child(5) { animation-duration: 1.2s; animation-delay: -0.8s; }

.screen.is-paused .aura { opacity: 0; }
.screen.is-paused .blob { animation-play-state: paused; }
.screen.is-paused .bars rect { animation: none; }
.device.is-offscreen .blob,
.device.is-offscreen .bars rect { animation-play-state: paused; }

.np {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 54px 32px 28px;
}

.np-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  margin: 0 -10px;
}

.np-header svg { margin: 10px; }

.eyebrow {
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.np-cover {
  position: relative;
  display: flex;
  flex: none;
  flex-direction: column;
  justify-content: flex-end;
  width: 326px;
  height: 326px;
  margin-top: 14px;
  padding: 26px 26px 28px;
  overflow: hidden;
  border-radius: 12px;
  background: radial-gradient(120% 90% at 15% 0%, #3A5072 0%, #2E3F5C 55%);
  box-shadow:
    0 28px 50px -24px rgba(var(--shade), var(--o-cover-shadow)),
    inset 0 0 0 1px rgba(240, 232, 216, 0.06);
}

.np-cover-title {
  color: #F0E8D8;
  font-family: "Fraunces", Georgia, serif;
  font-size: 54px;
  font-style: italic;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.np-cover-rule {
  height: 1px;
  margin: 18px 0 12px;
  background: rgba(240, 232, 216, 0.3);
}

.np-cover-author {
  color: #E2DACA;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.np-ribbon {
  position: absolute;
  top: 0;
  right: 30px;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35));
}

.np-titles { margin-top: 26px; }

.np-chapter {
  font-family: "Fraunces", Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.np-book {
  margin-top: 4px;
  color: var(--text-2);
}

.np-times {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--text-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.np-scrubber {
  position: relative;
  height: 4px;
  margin-top: 28px;
  border-radius: 2px;
  background: rgba(var(--ink), var(--o-track));
}

.np-scrubber::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 60.9%;
  border-radius: 2px;
  background: var(--text);
}

.np-scrubber::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 60.9%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 2px 8px rgba(var(--shade), var(--o-thumb));
}

.np-timeline {
  position: relative;
  display: flex;
  gap: 3px;
  margin-top: 14px;
  padding-top: 16px;
}

.np-timeline + .np-times { margin-top: 6px; }

.np-timeline span {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(var(--ink), var(--o-seg));
}

.np-timeline .done { background: rgba(var(--ink), var(--o-seg-fill)); }

.np-timeline .now {
  background: linear-gradient(90deg, rgba(var(--ink), var(--o-seg-fill)) 75.5%, rgba(var(--ink), var(--o-seg)) 75.5%);
}

.np-marker {
  position: absolute;
  top: 0;
  left: 26.4%;
  margin-left: -5px;
  fill: var(--accent);
}

.np-transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
}

.np-transport > svg { flex: none; }

.np-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--text);
  color: var(--on-text);
  box-shadow: 0 14px 30px -12px rgba(var(--shade), var(--o-play));
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.np-play:focus-visible {
  outline: 3px solid #C9744A;
  outline-offset: 5px;
}

.np-play .icon-play { display: none; margin-left: 3px; }
.screen.is-paused .np-play .icon-play { display: block; }
.screen.is-paused .np-play .icon-pause { display: none; }

.np-utility {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.np-utility div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 48px;
}

.np-utility b {
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

.np-utility small {
  color: var(--text-2);
  font-size: 11px;
  line-height: 14px;
}

/* Home: theme picker -------------------------------------------------------- */

.themes {
  width: 100%;
  max-width: 22rem;
  margin: 0;
  padding: 0;
  border: 0;
  text-align: center;
}

.theme-icons {
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 2.4vw, 0.75rem);
}

.theme-icons label {
  position: relative;
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.theme-icons input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.theme-icons img {
  display: block;
  width: clamp(2.5rem, 11vw, 3rem);
  height: auto;
  aspect-ratio: 1;
  border-radius: 22.5%;
  box-shadow: 0 6px 14px -8px rgba(var(--shade), 0.6);
  transition: transform 0.2s ease;
}

.theme-icons label:hover img { transform: translateY(-2px); }

.theme-icons input:checked + img {
  box-shadow:
    0 0 0 2px var(--page),
    0 0 0 4px var(--text);
}

.theme-icons input:focus-visible + img {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.theme-note {
  min-height: 3.2em;
  margin-top: 1rem;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.theme-note strong {
  color: var(--text);
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.0625rem;
  font-weight: 500;
}

/* Home: sections ------------------------------------------------------------ */

.section {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 6vw, 5rem);
  padding-top: clamp(3.5rem, 9vw, 7rem);
}

.section-intro h2 {
  font-size: clamp(2rem, 1.5rem + 1.8vw, 2.875rem);
  line-height: 1.08;
  letter-spacing: -0.022em;
}

.section-intro p {
  margin-top: 1rem;
  color: var(--text-2);
}

.section-body { max-width: 40rem; }

@media (max-width: 54rem) {
  .section { grid-template-columns: minmax(0, 1fr); }
  .section-intro { max-width: 36rem; }
}

.facts {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: 1.5rem 2rem;
}

.facts dt {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.facts dd { color: var(--text-2); }

@media (max-width: 34rem) {
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  .facts dd + dt { margin-top: 1.25rem; }
}

.aside {
  margin-top: 2.25rem;
  color: var(--text-2);
}

.aside + .aside { margin-top: 1rem; }

.aside em {
  color: var(--text);
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1em;
}

/* Home: the Library glimpse ------------------------------------------------- */

.library {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.375rem 1rem;
  margin: 0 0 3rem;
  padding: 0;
  list-style: none;
}

@media (max-width: 40rem) {
  .library { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A generated cover: highlight at the top left, base from 55%. */
.cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 1;
  padding: 14px;
  overflow: hidden;
  border-radius: 8px;
  background: radial-gradient(120% 90% at 15% 0%, var(--hi) 0%, var(--base) 55%);
  box-shadow:
    0 16px 30px -18px rgba(var(--shade), var(--o-grid-shadow)),
    inset 0 0 0 1px rgba(240, 232, 216, 0.06);
}

.cover-title {
  display: -webkit-box;
  overflow: hidden;
  color: #F0E8D8;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1rem, 0.8rem + 0.6vw, 1.25rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.cover-author {
  margin-top: 6px;
  color: #E2DACA;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.cover-ribbon {
  position: absolute;
  top: 0;
  right: 14px;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.3));
}

.cover-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--cover-accent);
}

.book-title {
  margin-top: 10px;
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.book-meta {
  color: var(--text-2);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* Privacy policy and other long text ---------------------------------------- */

.page-hero {
  background: linear-gradient(180deg, var(--hero-top) 0%, var(--page) 100%);
}

.page-title {
  padding-top: clamp(1.5rem, 5vw, 3.5rem);
  padding-bottom: clamp(2rem, 5vw, 3rem);
}

.page-title > * { max-width: 42rem; }

.page-title h1 {
  font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.updated {
  margin-top: 0.9rem;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.prose {
  max-width: 42rem;
  line-height: 1.65;
}

.prose .lead { max-width: none; margin-top: 0; }

.prose h2 {
  margin-top: 2.75rem;
  font-size: 1.625rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.prose p,
.prose ul { margin-top: 0.75rem; }

.prose ul {
  padding: 0;
  list-style: none;
}

.prose li {
  position: relative;
  margin-top: 0.6rem;
  padding-left: 1.25rem;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.68em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
}

.prose a { color: var(--accent); }
.prose a:hover { color: var(--text); }

.summary {
  margin-top: 2.5rem;
  padding: 0.25rem 1.5rem 1.5rem;
  border-radius: 16px;
  background: var(--surface);
}

.summary h2 { margin-top: 1.25rem; }

.label {
  font-weight: 600;
  white-space: nowrap;
}

/* Motion -------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .blob,
  .bars rect { animation: none !important; }
  .theme-icons img { transition: none; }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}
