/* Readxo website.
   One idea drives the look: the page is lit by the book on top of the deck.
   --ground, --lift, --tint, --on-tint, and --backdrop come from that book's jacket
   (the same palette the app computes on device) and everything else is neutral. */

@property --ground   { syntax: '<color>'; inherits: true; initial-value: #252215; }
@property --lift     { syntax: '<color>'; inherits: true; initial-value: #4a452e; }
@property --tint     { syntax: '<color>'; inherits: true; initial-value: #f7e795; }
@property --on-tint  { syntax: '<color>'; inherits: true; initial-value: #242115; }
@property --backdrop { syntax: '<color>'; inherits: true; initial-value: #363022; }

:root {
  color-scheme: dark;

  --ink: rgba(255, 255, 255, 0.96);
  --ink-2: rgba(255, 255, 255, 0.72);
  --ink-3: rgba(255, 255, 255, 0.5);
  --hairline: rgba(255, 255, 255, 0.12);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-raised: rgba(255, 255, 255, 0.12);

  /* The card is paper, whatever the page is doing. Values match the app's Ink and InkMuted. */
  --paper-ink: #1b1917;
  --paper-muted: #6b655c;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --rounded: ui-rounded, "SF Pro Rounded", var(--sans);

  --page: 70rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius-card: 1.75rem;   /* Radius.card */
  --radius-panel: 1.75rem;
  --radius-cover: 0.625rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  transition: --ground 0.5s ease, --lift 0.5s ease, --tint 0.5s ease, --on-tint 0.5s ease, --backdrop 0.5s ease;
}

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

/* The attribute has to win over any display value set below. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.47 var(--sans);
  letter-spacing: -0.011em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 100;
  padding: 0.625rem 1rem; border-radius: 999px;
  background: var(--tint); color: var(--on-tint); font-weight: 600; text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Backdrop: the jacket's colors, behind everything ---------- */

.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--backdrop); pointer-events: none; }

.backdrop-layer {
  position: absolute; inset: -12%;
  background-size: cover; background-position: center;
  filter: blur(36px) saturate(1.2);
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: opacity;
}
.backdrop-layer.is-on { opacity: 1; }

/* Same job as the app's veil: keep type legible over any jacket. */
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.46) 45%, rgba(0, 0, 0, 0.74));
}

main, .site-footer { position: relative; z-index: 1; }

/* ---------- Navigation: a floating layer, content scrolls under it ---------- */

.nav {
  position: fixed; z-index: 50; top: max(0.75rem, env(safe-area-inset-top)); left: 50%;
  width: min(calc(100% - 1.5rem), var(--page));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.5rem 0.5rem 0.5rem 1.25rem;
  border-radius: 999px;
  background: rgba(22, 22, 24, 0.5);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: background-color 0.3s ease;
}
.nav.is-scrolled { background: rgba(22, 22, 24, 0.68); }

.wordmark {
  font: 700 1.25rem/1 var(--rounded); letter-spacing: -0.02em; text-decoration: none; color: var(--ink);
  padding: 0.5rem 0.25rem;
}
.wordmark span { color: var(--tint); }

.nav-links { display: flex; gap: 0.25rem; margin-left: auto; }
.nav-links a {
  padding: 0.5rem 0.875rem; border-radius: 999px;
  font-size: 0.9375rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--glass); }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.625rem 1.25rem; border-radius: 999px;
  background: var(--tint); color: var(--on-tint);
  font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  transition: transform 0.18s var(--ease-out), filter 0.2s ease;
}
.button:hover { filter: brightness(1.06); }
.button:active, .button.is-pressed { transform: scale(0.97); transition-duration: 0.1s; }
.button.is-quiet { background: var(--glass-raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); }

/* App Store control. Before launch it is a label; once APP_STORE_URL is set in js/site.js it becomes the link. */
.appstore {
  display: inline-flex; align-items: center; gap: 0.75rem;
  min-height: 3.5rem; padding: 0.5rem 1.375rem 0.5rem 1.125rem; border-radius: 1rem;
  background: #000; color: #fff; text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  transition: transform 0.18s var(--ease-out);
}
.appstore svg { width: 1.75rem; height: 1.75rem; flex: none; }
.appstore .label { display: grid; text-align: left; line-height: 1.1; }
.appstore .small { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.01em; opacity: 0.85; }
.appstore .big { font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.02em; }
a.appstore:active { transform: scale(0.97); transition-duration: 0.1s; }
.appstore:not([href]) { cursor: default; }

/* ---------- Type ---------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tint);
}

.display {
  font-size: clamp(2.75rem, 1.4rem + 5.6vw, 5.25rem);
  font-weight: 700; line-height: 1; letter-spacing: -0.04em;
  text-wrap: balance;
}

.headline {
  font-size: clamp(2rem, 1.3rem + 2.9vw, 3.25rem);
  font-weight: 700; line-height: 1.06; letter-spacing: -0.032em;
  text-wrap: balance;
}

.title { font-size: 1.375rem; font-weight: 650; line-height: 1.18; letter-spacing: -0.022em; text-wrap: balance; }

.lede { font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem); line-height: 1.42; letter-spacing: -0.016em; color: var(--ink-2); text-wrap: pretty; }

.body-2 { color: var(--ink-2); text-wrap: pretty; }
.fine { font-size: 0.8125rem; line-height: 1.45; letter-spacing: 0; color: var(--ink-3); }

/* ---------- Hero ---------- */

.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }

.hero {
  display: grid; align-items: center; gap: clamp(2rem, 5vw, 5rem);
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  min-height: min(100svh, 60rem);
  padding-block: 7.5rem 4rem;
}

.hero-copy { display: grid; gap: 1.5rem; justify-items: start; }
.hero-copy .lede { max-width: 31rem; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; margin-top: 0.5rem; }

/* The stage: reason, deck, controls. Laid out like the app's For You screen. */
.stage {
  --card-w: clamp(17.5rem, calc(100vw - 3.5rem), 21.25rem);
  --card-h: calc(var(--card-w) * 1.62);
  display: grid; justify-items: center; gap: 1rem;
  width: 100%;
}

.stage-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; width: var(--card-w); min-height: 2.25rem; }

.pill {
  display: inline-flex; align-items: center; gap: 0.375rem;
  max-width: 100%; padding: 0.5rem 0.875rem; border-radius: 999px;
  background: rgba(30, 30, 32, 0.55);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-size: 0.8125rem; font-weight: 550; letter-spacing: 0; color: var(--ink);
  white-space: nowrap;
}
.pill svg { width: 0.75rem; height: 0.75rem; flex: none; fill: var(--tint); }
.pill-text { overflow: hidden; text-overflow: ellipsis; }
.pill.reason { transition: opacity 0.2s ease; }
.pill.reason.is-changing { opacity: 0; }

button.pill { transition: transform 0.18s var(--ease-out); }
button.pill:active { transform: scale(0.94); transition-duration: 0.1s; }

.deck {
  position: relative; width: var(--card-w); height: var(--card-h);
  margin-bottom: 1.75rem;           /* room for the cards that peek out below */
  border-radius: var(--radius-card);
  touch-action: pan-y;
}
.deck:focus-visible { outline-offset: 8px; border-radius: calc(var(--radius-card) + 6px); }

.card {
  position: absolute; inset: 0;
  transform-origin: 50% 100%;       /* the card pivots from its bottom edge, like a held card */
  will-change: transform;
  user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
  transition: opacity 0.25s ease;
}
.card.is-entering { opacity: 0; }
.card.is-top { cursor: grab; }
.card.is-top.is-dragging { cursor: grabbing; }
.card.is-leaving { pointer-events: none; }

.card-face {
  position: relative; height: 100%;
  display: flex; flex-direction: column; gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--book-tint, #fff) 9%, #fff);
  color: var(--paper-ink);
  text-align: left;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s ease;
}
.card.is-top .card-face { box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28), 0 30px 60px rgba(0, 0, 0, 0.22); }
/* Picked up: responds on pointer down, before any movement. */
.card.is-top.is-held .card-face { transform: scale(1.012); box-shadow: 0 16px 28px rgba(0, 0, 0, 0.3), 0 44px 80px rgba(0, 0, 0, 0.28); transition-duration: 0.12s; }

/* The jacket is positioned, not flowed, so its natural size can never drive the card's layout. */
.card-cover { flex: 0 0 46%; min-height: 0; position: relative; }
.card-cover img {
  position: absolute; inset: 0; margin: auto;
  height: 100%; width: auto; max-width: 100%; object-fit: cover;
  border-radius: var(--radius-cover);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
  pointer-events: none; -webkit-user-drag: none;
}

.card-title {
  font: 600 1.5rem/1.14 var(--serif); letter-spacing: -0.012em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.card-author { margin-top: 0.25rem; font-size: 0.9375rem; font-weight: 500; color: var(--paper-muted); }
.card-hook {
  font-size: 0.9375rem; line-height: 1.42; letter-spacing: -0.006em; color: rgba(27, 25, 23, 0.9);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden;
}
/* One line only. Facts that do not fit wrap to a second line that is clipped away,
   so a fact is either shown whole or not at all, never cut mid word. */
.card-meta {
  margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.5rem;
  height: 1.625rem; overflow: hidden; flex: none;
  font-size: 0.75rem; font-weight: 500; line-height: 1.625rem; letter-spacing: 0.005em; color: var(--paper-muted);
  white-space: nowrap;
}
.card-meta .chip { padding: 0 0.625rem; border-radius: 999px; background: color-mix(in srgb, var(--genre) 14%, transparent); color: var(--chip-ink); }
.card-meta svg { width: 0.625rem; height: 0.625rem; fill: currentColor; vertical-align: -0.03em; margin-right: 0.125rem; }

/* SAVE and PASS fade in with the drag, so the outcome shows before release. */
.stamp {
  position: absolute; top: 1.5rem; z-index: 2;
  padding: 0.5rem 1rem; border-radius: 0.625rem;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid currentColor;
  font: 800 1.375rem/1 var(--rounded); letter-spacing: 0.12em;
  opacity: 0; pointer-events: none;
}
.stamp-save { left: 1.5rem; color: var(--book-accent, #2f6f4f); transform: rotate(-12deg); }
.stamp-pass { right: 1.5rem; color: var(--paper-muted); transform: rotate(12deg); }

.deck-empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 0.75rem;
  padding: 2rem; text-align: center; border-radius: var(--radius-card);
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--hairline);
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.deck-empty.is-on { opacity: 1; pointer-events: auto; }
.deck-empty svg { width: 2.5rem; height: 2.5rem; stroke: var(--ink-3); fill: none; stroke-width: 1.4; }
.deck-empty .title { font-family: var(--serif); }

.actions { display: flex; align-items: center; gap: 1.25rem; }
.round {
  display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%;
  background: rgba(30, 30, 32, 0.5);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  transition: transform 0.2s var(--ease-out), background-color 0.2s ease;
}
.round svg { width: 1.375rem; height: 1.375rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.round:hover { background: rgba(50, 50, 54, 0.6); }
.round:active, .round.is-pressed { transform: scale(0.9); transition-duration: 0.08s; }
.round.save { width: 4rem; height: 4rem; background: var(--tint); color: var(--on-tint); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.round.save:hover { background: var(--tint); filter: brightness(1.06); }
.round.save svg { fill: currentColor; stroke: none; }
.round:disabled { opacity: 0.35; pointer-events: none; }

.hint { font-size: 0.875rem; color: var(--ink-3); text-align: center; }
.hint kbd { font: inherit; font-weight: 600; color: var(--ink-2); }

/* ---------- Sections below the hero sit on the book's deep ground ---------- */

.below {
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--ground) 86%, transparent) 14rem, color-mix(in srgb, var(--ground) 94%, #000) 40rem);
  padding-top: 2rem;
}

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section-head { display: grid; gap: 1rem; max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); }

.split { display: grid; align-items: center; gap: clamp(2rem, 6vw, 6rem); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split .copy { display: grid; gap: 1.25rem; justify-items: start; }
.split.flip .copy { order: 2; }

.panel {
  position: relative; border-radius: var(--radius-panel);
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.panel-label { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.panel-label b { font-weight: 600; color: var(--tint); letter-spacing: 0; text-transform: none; font-size: 0.875rem; }

/* Taste: what the deck has learned so far */
.taste { display: grid; gap: 0.875rem; }
.taste-row { display: grid; grid-template-columns: minmax(0, 9.5rem) 1fr; align-items: center; gap: 1rem; font-size: 0.9375rem; font-weight: 500; }
.taste-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taste-track { height: 0.625rem; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.taste-fill { height: 100%; width: 100%; border-radius: inherit; background: var(--tint); transform-origin: 0 50%; transform: scaleX(0.1); will-change: transform; }
.taste-row.is-new span { color: var(--tint); }
.taste-note { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--hairline); font-size: 0.9375rem; color: var(--ink-2); text-wrap: pretty; }
.taste-note b { font-weight: 600; color: var(--ink); }

/* Shelf */
.shelf-list { display: grid; }
.shelf-row { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding-block: 0.875rem; border-top: 1px solid var(--hairline); }
.shelf-row:first-child { border-top: 0; padding-top: 0; }
.shelf-row:last-child { padding-bottom: 0; }
.shelf-row img { width: 3.25rem; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 0.375rem; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); }
.shelf-row .t { font: 600 1.0625rem/1.2 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-row .a { font-size: 0.875rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-row .state { font-size: 0.8125rem; font-weight: 600; color: var(--tint); white-space: nowrap; }
.shelf-progress { margin-top: 0.5rem; height: 0.25rem; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.shelf-progress i { display: block; height: 100%; border-radius: inherit; background: var(--tint); }
.stars { display: inline-flex; gap: 0.125rem; margin-top: 0.375rem; }
.stars svg { width: 0.8125rem; height: 0.8125rem; fill: var(--tint); }
.stars svg.off { fill: rgba(255, 255, 255, 0.18); }
.shelf-row.is-arriving { animation: arrive 0.5s var(--ease-out) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(-0.75rem) scale(0.98); } }

/* Book page showcase */
.bookpage {
  position: relative; overflow: hidden; border-radius: var(--radius-panel);
  background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--tint) 20%, transparent), transparent 70%), linear-gradient(to bottom, var(--lift), var(--ground) 55%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 80px rgba(0, 0, 0, 0.35);
  padding: 2.25rem 1.5rem 5.5rem; text-align: center;
  max-width: 24rem; margin-inline: auto; width: 100%;
}
.bookpage img { width: 46%; margin-inline: auto; border-radius: 0.5rem; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); aspect-ratio: 2 / 3; object-fit: cover; }
.bookpage h3 { margin-top: 1.5rem; font: 600 1.625rem/1.12 var(--serif); letter-spacing: -0.012em; text-wrap: balance; }
.bookpage .by { margin-top: 0.375rem; font-size: 0.9375rem; font-weight: 500; color: var(--ink-2); }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 1.5rem; padding-block: 0.875rem; border-block: 1px solid rgba(255, 255, 255, 0.12); }
.stat-strip div { display: grid; gap: 0.125rem; }
.stat-strip div + div { border-left: 1px solid rgba(255, 255, 255, 0.12); }
.stat-strip b { font-size: 1.0625rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-strip span { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-3); }
.bookpage .about { margin-top: 1.25rem; font-size: 0.9375rem; line-height: 1.45; color: var(--ink-2); text-align: left; }
.shelf-bar {
  position: absolute; left: 1rem; right: 1rem; bottom: 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.5rem 1.125rem; border-radius: 999px;
  background: rgba(20, 20, 22, 0.55);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 30px rgba(0, 0, 0, 0.35);
  font-size: 0.875rem; font-weight: 500; color: var(--ink-2);
}
.shelf-bar .button { min-height: 2.5rem; padding-inline: 1.125rem; }

/* Feature grid */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; }
.tile { grid-column: span 2; display: flex; flex-direction: column; gap: 0.625rem; min-height: 17rem; }
.tile.wide { grid-column: span 3; }
.tile .art { margin-top: auto; padding-top: 1.5rem; }
.tile p { font-size: 1rem; color: var(--ink-2); text-wrap: pretty; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip-btn {
  padding: 0.5rem 0.875rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.09); color: var(--ink-2);
  font-size: 0.875rem; font-weight: 550;
  transition: transform 0.18s var(--ease-out), background-color 0.2s ease, color 0.2s ease;
}
.chip-btn:active { transform: scale(0.95); transition-duration: 0.08s; }
.chip-btn[aria-pressed="true"] { background: var(--tint); color: var(--on-tint); }

.segmented { display: grid; gap: 0.375rem; }
.segmented button {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.625rem 0.875rem; border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.06); color: var(--ink-2); font-size: 0.9375rem; font-weight: 500; text-align: left;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.18s var(--ease-out);
}
.segmented button:active { transform: scale(0.98); transition-duration: 0.08s; }
.segmented button[aria-pressed="true"] { background: color-mix(in srgb, var(--tint) 18%, transparent); color: var(--ink); }
.segmented button svg { width: 1rem; height: 1rem; stroke: var(--tint); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity 0.15s ease; }
.segmented button[aria-pressed="true"] svg { opacity: 1; }

.searchbar { display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 1rem; border-radius: 999px; background: rgba(255, 255, 255, 0.09); color: var(--ink-3); font-size: 0.9375rem; }
.searchbar svg { width: 1.125rem; height: 1.125rem; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; flex: none; }
.search-results { display: grid; gap: 0.625rem; margin-top: 0.875rem; }
.search-results li { display: grid; grid-template-columns: 2rem 1fr; align-items: center; gap: 0.75rem; font-size: 0.875rem; color: var(--ink-2); }
.search-results img { width: 2rem; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 0.25rem; }
.search-results b { display: block; font: 600 0.9375rem/1.2 var(--serif); color: var(--ink); }

.sharecard {
  width: 9.5rem; aspect-ratio: 9 / 16; margin-inline: auto; border-radius: 1rem; overflow: hidden;
  display: grid; align-content: center; justify-items: center; gap: 0.5rem; padding: 1rem 0.75rem; text-align: center;
  background: radial-gradient(90% 50% at 50% 32%, color-mix(in srgb, var(--tint) 22%, transparent), transparent), linear-gradient(to bottom, var(--lift), var(--ground) 60%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 18px 40px rgba(0, 0, 0, 0.4);
  transform: rotate(3deg);
}
.sharecard .e { font-size: 0.5rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--tint); }
.sharecard img { width: 52%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 0.25rem; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45); }
.sharecard .t { font: 600 0.8125rem/1.15 var(--serif); }
.sharecard .f { margin-top: 0.5rem; font-size: 0.4375rem; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.6); }

.checks { display: grid; gap: 0.75rem; }
.checks li { display: grid; grid-template-columns: 1.25rem 1fr; gap: 0.75rem; align-items: start; font-size: 0.9375rem; color: var(--ink-2); }
.checks svg { width: 1.25rem; height: 1.25rem; margin-top: 0.1rem; stroke: var(--tint); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Closing */
.closing { display: grid; justify-items: center; gap: 1.5rem; text-align: center; padding-block: clamp(5rem, 12vw, 9rem); }
.closing .lede { max-width: 34rem; }

.site-footer { background: color-mix(in srgb, var(--ground) 94%, #000); border-top: 1px solid var(--hairline); padding-block: 2.5rem 3rem; }
.footer-grid { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: 0.9375rem; }
.footer-links a { color: var(--ink-2); text-decoration: none; padding-block: 0.375rem; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
.site-footer .fine { margin-top: 1.5rem; max-width: 46rem; }

/* ---------- Book sheet: a modal task, so it dims and pushes the page back ---------- */

.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; }
.scrim.is-on { pointer-events: auto; }

.sheet {
  position: fixed; z-index: 90; left: 50%; bottom: 0;
  width: min(100%, 30rem); max-height: min(92svh, 46rem);
  display: flex; flex-direction: column;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: radial-gradient(120% 40% at 50% 0%, color-mix(in srgb, var(--sheet-tint) 20%, transparent), transparent 70%), linear-gradient(to bottom, var(--sheet-lift), var(--sheet-ground) 46%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 -20px 80px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 110%);
  will-change: transform;
  visibility: hidden;
  touch-action: none;
}
.sheet.is-open { visibility: visible; }
.sheet-grab { flex: none; display: grid; place-items: center; height: 2rem; cursor: grab; touch-action: none; }
.sheet-grab::before { content: ""; width: 2.25rem; height: 0.3125rem; border-radius: 999px; background: rgba(255, 255, 255, 0.35); }
.sheet-close { position: absolute; top: 0.875rem; right: 0.875rem; z-index: 2; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); transition: transform 0.18s var(--ease-out); }
.sheet-close:active { transform: scale(0.9); transition-duration: 0.08s; }
.sheet-close svg { width: 0.875rem; height: 0.875rem; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; fill: none; }
.sheet-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 0.5rem 1.5rem 7rem; text-align: center; touch-action: pan-y; }
.sheet-scroll img { width: 42%; margin-inline: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 0.5rem; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); }
.sheet-scroll h2 { margin-top: 1.5rem; font: 600 1.75rem/1.12 var(--serif); letter-spacing: -0.012em; text-wrap: balance; }
.sheet-scroll .by { margin-top: 0.375rem; font-weight: 500; color: var(--ink-2); }
.sheet-scroll .about { margin-top: 1.25rem; text-align: left; color: var(--ink-2); }
.sheet-scroll .why { margin-top: 1.25rem; text-align: left; font-size: 0.9375rem; color: var(--ink-3); }
.sheet .stat-strip b { color: #fff; }
.sheet-bar {
  position: absolute; left: 1rem; right: 1rem; bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex; gap: 0.625rem; padding: 0.5rem; border-radius: 999px;
  background: rgba(20, 20, 22, 0.55);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 30px rgba(0, 0, 0, 0.4);
}
.sheet-bar .button { flex: 1; }
.sheet-bar .button.save { background: var(--sheet-tint); color: var(--sheet-on-tint); }

/* The page steps back while the sheet is up. */
.page { transform-origin: 50% 0; will-change: auto; }

/* ---------- Reveal on scroll: quiet, once ---------- */

[data-reveal] { opacity: 0; transform: translateY(1rem); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
[data-reveal].is-in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ---------- Legal and utility pages ---------- */

.legal { padding-block: 8.5rem 5rem; }
.legal .wrap { max-width: 44rem; }
.legal h1 { font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; }
.legal .updated { margin-top: 0.75rem; color: var(--ink-3); font-size: 0.9375rem; }
.legal h2 { margin-top: 2.75rem; font-size: 1.375rem; font-weight: 650; letter-spacing: -0.022em; line-height: 1.2; }
.legal p, .legal li { margin-top: 0.875rem; color: var(--ink-2); }
.legal ul { list-style: disc; padding-left: 1.25rem; }
.legal a { color: var(--tint); text-underline-offset: 0.2em; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal .summary { margin-top: 2rem; }

.workpage { min-height: 100svh; display: grid; place-items: center; padding: 7rem var(--gutter) 4rem; }
.workpage .bookpage { padding-bottom: 2.25rem; }
.workpage .cta { display: grid; gap: 0.75rem; margin-top: 1.75rem; }
.workpage .cta .button { width: 100%; }

/* ---------- Responsive ---------- */

@media (max-width: 60rem) {
  /* One column, and the deck moves up to sit right under the headline: on a phone it is
     the first thing within reach, and the explanation follows it. */
  .hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding-block: 6rem 3rem; gap: 0; min-height: 0; }
  .hero-copy { display: contents; }
  .hero .eyebrow { order: 1; }
  .hero .display { order: 2; margin-top: 0.875rem; font-size: clamp(2.5rem, 1.2rem + 6.4vw, 4.25rem); }
  .hero .stage { order: 3; margin-top: 1.75rem; }
  .hero .lede { order: 4; margin-top: 2.25rem; max-width: 34rem; }
  .hero-cta { order: 5; justify-content: center; margin-top: 1.5rem; }
  .split, .split.flip { grid-template-columns: minmax(0, 1fr); }
  .split.flip .copy { order: 0; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile, .tile.wide { grid-column: span 1; }
  .tile.full-sm { grid-column: span 2; }
}

@media (max-width: 40rem) {
  .nav-links { display: none; }
  .nav .button { margin-left: auto; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .tile, .tile.wide, .tile.full-sm { grid-column: span 1; min-height: 0; }
  .taste-row { grid-template-columns: minmax(0, 9.25rem) 1fr; font-size: 0.875rem; }
  .hint .keys { display: none; }
}

@media (max-width: 23.75rem) {
  .card-face { padding: 1rem 1.125rem; gap: 0.5rem; }
  .card-cover { flex-basis: 40%; }
  .card-title { font-size: 1.3125rem; }
  .card-hook { -webkit-line-clamp: 4; line-clamp: 4; font-size: 0.875rem; }
  .card-meta .opt { display: none; }
}

@media (hover: none) { .hint .keys { display: none; } }

/* ---------- Accessibility preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  :root { transition: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .shelf-row.is-arriving { animation: none; }
  .button, .round, .chip-btn, .segmented button, .card-face { transition: none; }
  .sharecard { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav, .pill, .round, .shelf-bar, .sheet-bar { -webkit-backdrop-filter: none; backdrop-filter: none; background: #1c1c1e; }
  .round.save { background: var(--tint); }
  .backdrop-layer { display: none; }
}

@media (prefers-contrast: more) {
  :root { --ink-2: rgba(255, 255, 255, 0.92); --ink-3: rgba(255, 255, 255, 0.8); --hairline: rgba(255, 255, 255, 0.5); }
  .nav, .pill, .round, .shelf-bar, .sheet-bar { -webkit-backdrop-filter: none; backdrop-filter: none; background: #000; box-shadow: inset 0 0 0 1px #fff; }
  .panel { background: #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6); }
  .backdrop::after { background: rgba(0, 0, 0, 0.82); }
}
