/* ============================================================
   LOMAX PUBLICATIONS — v1
   Design: editorial, warm paper, deep ink, muted oxblood accent
   ============================================================ */

:root {
  /* semantic tokens */
  --bg: #f4ede1;
  --bg-2: #ece2d0;
  --bg-deep: #e3d7bf;
  --text: #1a1612;
  --text-2: #2d261f;
  --text-soft: #4a3f33;
  --surface: #f4ede1;
  --surface-elev: #f4ede1;
  --surface-invert: #1a1612;
  --on-invert: #f4ede1;
  --oxblood: #7a1f22;
  --oxblood-hot: #9b2a2e;
  --gold: #b89968;
  --gold-soft: #d9c298;
  --rule: rgba(26, 22, 18, 0.12);
  --rule-strong: rgba(26, 22, 18, 0.25);
  --nav-bg: rgba(244, 237, 225, 0.85);
  --cursor-color: 244, 237, 225;
  --noise-blend: multiply;
  --noise-opacity: 0.045;
  --shadow-book: rgba(26, 22, 18, 0.35);
  --on-invert-rgb: 244, 237, 225;
  --text-rgb: 26, 22, 18;

  /* legacy alias names (don't break existing rules) */
  --paper: var(--bg);
  --paper-2: var(--bg-2);
  --paper-deep: var(--bg-deep);
  --ink: var(--text);
  --ink-2: var(--text-2);
  --ink-soft: var(--text-soft);

  --f-serif: "Fraunces", "Times New Roman", serif;
  --f-sans: "Inter", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.7, 0, 0.3, 1);

  --container: 1440px;
  --pad-x: clamp(24px, 5vw, 88px);
}

/* ============ Dark theme ============ */
[data-theme="dark"] {
  --bg: #0f0c08;
  --bg-2: #140f0a;
  --bg-deep: #1a1510;
  --text: #f0e6d4;
  --text-2: #d8caae;
  --text-soft: #a89879;
  --surface: #0f0c08;
  --surface-elev: #1a1510;
  --surface-invert: #f0e6d4;
  --on-invert: #0f0c08;
  --oxblood: #b8383c;
  --oxblood-hot: #d84a4e;
  --gold: #d9b878;
  --gold-soft: #e8cea0;
  --rule: rgba(240, 230, 212, 0.10);
  --rule-strong: rgba(240, 230, 212, 0.22);
  --nav-bg: rgba(15, 12, 8, 0.78);
  --cursor-color: 240, 230, 212;
  --noise-blend: screen;
  --noise-opacity: 0.06;
  --shadow-book: rgba(0, 0, 0, 0.7);
  --on-invert-rgb: 15, 12, 8;
  --text-rgb: 240, 230, 212;

  --paper: var(--bg);
  --paper-2: var(--bg-2);
  --paper-deep: var(--bg-deep);
  --ink: var(--text);
  --ink-2: var(--text-2);
  --ink-soft: var(--text-soft);
}

/* smooth crossfade on theme switch */
html { transition: background-color 0.6s var(--ease-out); }
body, .nav, .hero-grid, .voices, .foot, .letter, .entry, .voice,
.match-card, .match-opt, .book-card, .preloader, .marquee-quote,
.nav-cta, .btn, .story, .library, .match, .journal, .letter-field,
.theme-toggle, .theme-track, .theme-thumb {
  transition:
    background-color 0.6s var(--ease-out),
    color 0.6s var(--ease-out),
    border-color 0.6s var(--ease-out),
    box-shadow 0.6s var(--ease-out);
}

/* ============ Theme toggle ============ */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.theme-toggle {
  position: relative;
  width: 56px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--rule-strong);
  cursor: none;
  transition: border-color 0.35s var(--ease-out), background 0.35s var(--ease-out);
}
.theme-toggle:hover { border-color: var(--text); }
.theme-track {
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  display: flex;
  align-items: center;
}
.theme-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: grid;
  place-items: center;
  transform: translateX(0);
  transition: transform 0.45s var(--ease-out), background 0.45s var(--ease-out), color 0.45s var(--ease-out);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
[data-theme="dark"] .theme-thumb {
  transform: translateX(26px);
  background: var(--gold);
  color: #1a1612;
}
.theme-icon {
  position: absolute;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.theme-sun { opacity: 1; transform: scale(1); }
.theme-moon { opacity: 0; transform: scale(0.4) rotate(-40deg); }
[data-theme="dark"] .theme-sun { opacity: 0; transform: scale(0.4) rotate(40deg); }
[data-theme="dark"] .theme-moon { opacity: 1; transform: scale(1) rotate(0); }
@media (max-width: 520px) { .theme-toggle { display: none; } }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; -webkit-font-smoothing: antialiased; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  cursor: none;
}

@media (max-width: 900px) { body { cursor: auto; } }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: none; }
img, svg, canvas { display: block; max-width: 100%; }

::selection { background: var(--oxblood); color: var(--paper); }

/* ============ Cursor ============ */
.cursor, .cursor-dot {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  will-change: transform;
  mix-blend-mode: difference;
}
.cursor {
  width: 36px; height: 36px;
  border: 1.5px solid rgba(244, 237, 225, 0.9);
  border-radius: 50%;
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out),
              background 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.cursor-dot {
  width: 5px; height: 5px;
  background: rgba(244, 237, 225, 0.95);
  border-radius: 50%;
}
.cursor.is-hover { width: 64px; height: 64px; background: rgba(244, 237, 225, 0.08); }
.cursor.is-drag { width: 84px; height: 84px; background: var(--oxblood); border-color: var(--oxblood); }
@media (max-width: 900px) { .cursor, .cursor-dot { display: none; } }

/* ============ Noise ============ */
.noise {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9998;
  opacity: 0.045; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ============ Preloader ============ */
.preloader {
  position: fixed; inset: 0;
  background: var(--ink);
  color: var(--paper);
  z-index: 9999;
  display: grid; place-items: center;
  transition: opacity 0.8s var(--ease-out);
}
.preloader.gone { opacity: 0; pointer-events: none; }
.preloader-inner { text-align: center; }
.preloader-wordmark {
  font-family: var(--f-serif);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 300;
  letter-spacing: 0.14em;
  display: flex; gap: 0.12em; justify-content: center;
}
.preloader-wordmark span {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  animation: preLetter 0.8s var(--ease-out) forwards;
}
.preloader-wordmark span:nth-child(1) { animation-delay: 0.1s; }
.preloader-wordmark span:nth-child(2) { animation-delay: 0.2s; }
.preloader-wordmark span:nth-child(3) { animation-delay: 0.3s; }
.preloader-wordmark span:nth-child(4) { animation-delay: 0.4s; }
.preloader-wordmark span:nth-child(5) { animation-delay: 0.5s; }
@keyframes preLetter {
  to { opacity: 1; transform: translateY(0); }
}
.preloader-sub {
  font-family: var(--f-serif);
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.22em;
  text-align: center;
  margin-top: 6px;
  color: var(--f-cream, #f4ede1);
  opacity: 0;
  animation: preTag 0.8s 0.7s var(--ease-out) forwards;
}
.preloader-line {
  width: 240px; height: 1px;
  margin: 28px auto;
  background: rgba(244, 237, 225, 0.18);
  overflow: hidden;
}
.preloader-line span {
  display: block; height: 100%;
  background: var(--gold);
  width: 0;
  animation: preLine 1.4s 0.6s var(--ease-out) forwards;
}
@keyframes preLine { to { width: 100%; } }
.preloader-tag {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  animation: preTag 0.8s 1.4s var(--ease-out) forwards;
}
@keyframes preTag { to { opacity: 1; } }

/* ============ Scroll progress ============ */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 2px; width: 0%;
  background: var(--oxblood);
  z-index: 9997;
  transition: width 0.1s linear;
}

/* ============ Nav ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--pad-x);
  transition: background 0.4s var(--ease-out), backdrop-filter 0.4s var(--ease-out),
              padding 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  padding: 14px var(--pad-x);
  background: rgba(244, 237, 225, 0.85);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--rule);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-serif);
}
.nav-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
}
.nav-brand-text {
  font-size: 18px;
  letter-spacing: 0.02em;
}
.nav-brand-text em {
  font-style: italic;
  font-weight: 300;
  opacity: 0.7;
  margin-left: 4px;
}
.nav-links {
  display: flex; gap: 38px;
}
.nav-links a {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.25s var(--ease-out);
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
@media (max-width: 900px) { .nav-links { display: none; } }

.nav-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: transform 0.35s var(--ease-out), background 0.35s var(--ease-out);
}
.nav-cta:hover { background: var(--oxblood); transform: translateY(-1px); }
.nav-cta svg { transition: transform 0.35s var(--ease-out); }
.nav-cta:hover svg { transform: translateX(3px); }

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 140px var(--pad-x) 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  overflow: hidden;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse at 70% 50%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 50%, black 30%, transparent 70%);
  pointer-events: none;
}
.hero-gradient {
  position: absolute;
  top: -20%; right: -20%;
  width: 70%; height: 80%;
  background: radial-gradient(circle, rgba(122, 31, 34, 0.12), transparent 60%);
  pointer-events: none;
}

.hero-meta {
  position: absolute;
  top: 100px; left: var(--pad-x);
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.meta-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--oxblood);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  50% { transform: scale(1.4); opacity: 0.5; }
}
.meta-sep { opacity: 0.4; }

.hero-content { position: relative; z-index: 2; }

.hero-eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 32px;
}
.eyebrow-line {
  display: inline-block;
  width: 48px; height: 1px;
  background: var(--oxblood);
}

.hero-title {
  font-family: var(--f-serif);
  font-size: clamp(56px, 9vw, 132px);
  font-weight: 300;
  line-height: 0.94;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}
.hero-title .line {
  display: block;
  overflow: hidden;
}
.hero-title .word {
  display: inline-block;
  transform: translateY(0);
  will-change: transform;
}
.hero-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--oxblood);
}
.hero-title .accent {
  position: relative;
}
.hero-title .accent::after {
  content: "";
  position: absolute; left: 0; bottom: 0.08em;
  width: 100%; height: 0.08em;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
}

.hero-lede {
  font-family: var(--f-serif);
  font-size: clamp(18px, 1.4vw, 22px);
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 540px;
  margin-bottom: 40px;
}

.hero-ctas {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-bottom: 64px;
}

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px;
  font-size: 13px;
  letter-spacing: 0.04em;
  border-radius: 999px;
  transition: transform 0.35s var(--ease-out), background 0.35s var(--ease-out),
              color 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover { background: var(--oxblood); }
.btn-primary svg { transition: transform 0.4s var(--ease-out); }
.btn-primary:hover svg { transform: translateX(4px); }
.btn-ghost {
  border: 1px solid var(--ink);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.hero-stats {
  display: flex; gap: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.stat b {
  font-family: var(--f-serif);
  font-size: clamp(36px, 3.5vw, 52px);
  font-weight: 300;
  display: block;
  line-height: 1;
}
.stat span {
  display: block;
  margin-top: 6px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
/* A word-valued stat sitting beside numeric ones: scaled down and italicised so
   it carries the same optical weight as a single glyph rather than dwarfing it. */
.stat-text b {
  font-size: clamp(24px, 2.2vw, 32px);
  font-style: italic;
  white-space: nowrap;
}

.hero-book {
  position: relative;
  height: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#bookCanvas {
  width: 100%;
  height: 620px;
  cursor: grab;
}
#bookCanvas:active { cursor: grabbing; }
.hero-book-caption {
  position: relative;
  margin-top: 14px;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
}
.hero-book-caption em {
  font-style: italic;
  color: var(--oxblood);
  text-transform: none;
  letter-spacing: 0.1em;
  font-size: 11px;
}

.hero-scroll {
  position: absolute;
  bottom: 40px; left: var(--pad-x);
  display: flex; align-items: center; gap: 14px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero-scroll-line {
  width: 60px; height: 1px;
  background: var(--ink-soft);
  position: relative; overflow: hidden;
}
.hero-scroll-line::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--oxblood);
  animation: scrollLine 2.4s var(--ease-in-out) infinite;
}
@keyframes scrollLine {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 110px; gap: 30px; }
  .hero-book { height: 440px; order: -1; }
  .hero-stats { flex-wrap: wrap; gap: 28px; }
  .hero-meta { position: static; margin-bottom: 20px; }
  .hero-scroll { display: none; }
}

/* ============ Marquee Quote ============ */
.marquee-quote {
  background: var(--ink);
  color: var(--paper);
  padding: 30px 0;
  overflow: hidden;
  border-top: 1px solid var(--ink-2);
  border-bottom: 1px solid var(--ink-2);
}
.marquee-track {
  display: inline-flex;
  gap: 48px;
  white-space: nowrap;
  font-family: var(--f-serif);
  font-size: clamp(40px, 6vw, 88px);
  font-weight: 300;
  letter-spacing: -0.01em;
  animation: marquee 32s linear infinite;
}
.marquee-track em { font-style: italic; color: var(--gold); }
.m-dot {
  font-size: 0.4em;
  align-self: center;
  color: var(--oxblood);
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ============ Section head ============ */
.section-head {
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--pad-x);
  margin-bottom: 40px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.section-num {
  padding: 4px 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
}

.xl-title {
  font-family: var(--f-serif);
  font-size: clamp(44px, 6.5vw, 96px);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.xl-title span {
  display: block;
  overflow: hidden;
}
.xl-title em {
  font-style: italic;
  color: var(--oxblood);
}

/* ============ Story ============ */
.story {
  padding: 140px 0 160px;
  position: relative;
  background: linear-gradient(to bottom, var(--paper) 0%, var(--paper-2) 100%);
}
.story-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 100px;
  padding: 0 var(--pad-x);
  max-width: var(--container);
  margin: 0 auto;
}
.story-sticky {
  position: sticky;
  top: 90px;
  height: auto;
  max-height: none;
  align-self: start;
}
.story-image {
  width: 100%; height: 100%;
  display: grid; place-items: center;
}
.story-image-frame {
  width: 100%; max-width: 440px;
  aspect-ratio: 3/4;
  background: var(--paper-deep);
  border: 1px solid var(--rule-strong);
  position: relative;
  overflow: hidden;
  display: grid; place-items: center;
  box-shadow: 0 30px 80px -40px rgba(26, 22, 18, 0.3);
}
.story-image-grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='3'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.3;
  pointer-events: none;
}
.story-illustration {
  width: 85%;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(26, 22, 18, 0.2));
}

.story-text {
  display: flex; flex-direction: column;
  gap: 88px;
  padding-top: 40px;
}
.chapter {
  max-width: 460px;
}
.chapter-mark {
  font-family: var(--f-serif);
  font-size: 64px;
  font-weight: 300;
  font-style: italic;
  color: var(--oxblood);
  line-height: 1;
  margin-bottom: 24px;
  opacity: 0.7;
}
.chapter h2 {
  font-family: var(--f-serif);
  font-size: clamp(32px, 3.2vw, 46px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.chapter p {
  font-family: var(--f-serif);
  font-size: 19px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-soft);
}
.chapter-quote blockquote {
  font-family: var(--f-serif);
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.3;
  color: var(--ink);
  padding-left: 24px;
  border-left: 2px solid var(--oxblood);
}
.chapter-quote cite {
  display: block;
  margin-top: 16px;
  padding-left: 24px;
  font-family: var(--f-mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .story-inner { grid-template-columns: 1fr; gap: 50px; }
  .story-sticky { position: static; height: auto; }
  .story-image-frame { max-width: 320px; }
  .story-text { gap: 80px; padding-top: 0; }
}

/* ============ Library ============ */
.library {
  padding: 140px 0 160px;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}
.library-intro {
  padding: 0 var(--pad-x);
  max-width: var(--container);
  margin: 0 auto 80px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: end;
}
.library-intro p {
  font-family: var(--f-serif);
  font-size: 19px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 420px;
  margin-left: auto;
}

.library-shelf {
  display: flex;
  gap: 28px;
  padding: 0 var(--pad-x) 40px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-soft) transparent;
}
.library-shelf::-webkit-scrollbar { height: 2px; }
.library-shelf::-webkit-scrollbar-thumb { background: var(--ink-soft); }

.book-card {
  flex: 0 0 340px;
  scroll-snap-align: start;
  position: relative;
  cursor: none;
  transition: transform 0.6s var(--ease-out);
}
.book-card:hover { transform: translateY(-8px); }
.book-cover {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 30px 60px -20px rgba(26, 22, 18, 0.35);
  margin-bottom: 20px;
  transition: box-shadow 0.6s var(--ease-out);
}
.book-card:hover .book-cover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 40px 80px -20px rgba(26, 22, 18, 0.45);
}
.book-cover::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 6px;
  background: linear-gradient(to right, rgba(0,0,0,0.25), rgba(0,0,0,0));
  z-index: 2;
}
.book-cover-inner {
  position: absolute; inset: 0;
  padding: 40px 30px;
  display: flex; flex-direction: column;
  justify-content: space-between;
}
.book-series {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.7;
}
.book-title-cover {
  font-family: var(--f-serif);
  font-size: 32px;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.book-title-cover em { font-style: italic; }
.book-author-cover {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: auto;
  opacity: 0.85;
}
.book-deco {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 120px; height: 120px;
  opacity: 0.25;
}

.book-meta {
  display: flex; flex-direction: column; gap: 6px;
}
.book-title {
  font-family: var(--f-serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.15;
}
.book-title em { font-style: italic; }
.book-author {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.book-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-soft);
}
.book-price { color: var(--ink); }

.library-cta {
  text-align: center;
  padding: 60px var(--pad-x) 0;
}

/* ============ Voices ============ */
.voices {
  padding: 140px 0 160px;
  background: var(--ink);
  color: var(--paper);
}
.voices .section-head { color: var(--gold); }
.voices .section-num { border-color: rgba(184, 153, 104, 0.3); }
.voices .xl-title em { color: var(--gold); }
.voices-inner {
  padding: 0 var(--pad-x);
  max-width: var(--container);
  margin: 0 auto;
}
.voices-inner .xl-title { margin-bottom: 80px; }

.voices-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.voice {
  grid-column: span 4;
  padding: 36px 32px;
  border: 1px solid rgba(244, 237, 225, 0.12);
  background: rgba(244, 237, 225, 0.02);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  gap: 28px;
  transition: border-color 0.5s var(--ease-out), background 0.5s var(--ease-out),
              transform 0.5s var(--ease-out);
}
.voice:hover {
  border-color: var(--gold);
  background: rgba(184, 153, 104, 0.05);
  transform: translateY(-4px);
}
.voice-lg {
  grid-column: span 6;
}
.voice-lg:first-child .voice-quote { font-size: clamp(22px, 1.8vw, 28px); }
.voice-quote {
  font-family: var(--f-serif);
  font-size: clamp(18px, 1.3vw, 20px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.45;
  color: var(--paper);
}
.voice-name {
  font-family: var(--f-serif);
  font-size: 17px;
  margin-bottom: 2px;
}
.voice-role {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

@media (max-width: 900px) {
  .voice, .voice-lg { grid-column: span 12; }
}

/* ============ Match / Quiz ============ */
.match {
  padding: 140px 0 160px;
  background: var(--paper);
}
.match-inner {
  padding: 0 var(--pad-x);
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
  align-items: start;
}
.match-copy { padding-top: 20px; }
.match-copy p {
  font-family: var(--f-serif);
  font-size: 19px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-top: 24px;
  max-width: 400px;
}
.match-card {
  position: relative;
  padding: 50px 44px;
  background: var(--paper-deep);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  min-height: 480px;
  box-shadow: 0 30px 80px -40px rgba(26, 22, 18, 0.3);
}
.match-progress {
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--rule);
}
.match-progress span {
  display: block; height: 100%;
  width: 25%;
  background: var(--oxblood);
  transition: width 0.5s var(--ease-out);
}
.match-step { display: none; }
.match-step.active { display: block; animation: stepIn 0.6s var(--ease-out); }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.match-q {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 32px;
}
.match-options {
  display: flex; flex-direction: column; gap: 14px;
}
.match-opt {
  text-align: left;
  padding: 22px 24px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  font-family: var(--f-serif);
  font-size: 19px;
  font-weight: 300;
  line-height: 1.3;
  cursor: none;
  position: relative;
  transition: border-color 0.35s var(--ease-out), background 0.35s var(--ease-out),
              transform 0.35s var(--ease-out), color 0.35s var(--ease-out);
}
.match-opt::after {
  content: "→";
  position: absolute;
  right: 24px; top: 50%;
  transform: translateY(-50%) translateX(-8px);
  opacity: 0;
  font-family: var(--f-sans);
  color: var(--oxblood);
  transition: all 0.4s var(--ease-out);
}
.match-opt:hover {
  border-color: var(--ink);
  transform: translateX(6px);
}
.match-opt:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }

.match-book {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 28px;
  align-items: start;
}
.match-book-cover {
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, var(--oxblood), var(--ink));
  border-radius: 2px;
  box-shadow: 0 20px 40px -10px rgba(26, 22, 18, 0.4);
  position: relative;
  overflow: hidden;
}
.match-book-cover::before {
  content: "L";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--f-serif);
  font-size: 64px;
  color: var(--gold);
  font-style: italic;
  font-weight: 300;
}
.match-book-series {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 6px;
}
.match-book-title {
  font-family: var(--f-serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 14px;
}
.match-book-blurb {
  font-family: var(--f-serif);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.match-book-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .match-inner { grid-template-columns: 1fr; gap: 40px; }
  .match-book { grid-template-columns: 100px 1fr; gap: 20px; }
}

/* ============ Journal ============ */
.journal {
  padding: 140px 0 160px;
  background: var(--paper-2);
}
.journal-head {
  padding: 0 var(--pad-x);
  max-width: var(--container);
  margin: 0 auto 60px;
  display: flex; justify-content: space-between; align-items: end;
  gap: 40px;
}
.journal-all {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.3s var(--ease-out);
}
.journal-all:hover { color: var(--oxblood); }

.journal-grid {
  padding: 0 var(--pad-x);
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.entry {
  padding: 36px 32px;
  border: 1px solid var(--rule);
  background: var(--paper);
  transition: transform 0.5s var(--ease-out), border-color 0.5s var(--ease-out);
  cursor: none;
  position: relative;
  min-height: 280px;
  display: flex; flex-direction: column;
}
.entry:hover {
  transform: translateY(-6px);
  border-color: var(--ink);
}
.entry-meta {
  display: flex; gap: 10px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.entry h3 {
  font-family: var(--f-serif);
  font-size: clamp(22px, 1.5vw, 26px);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.entry p {
  font-family: var(--f-serif);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-soft);
}
.entry-read {
  margin-top: auto;
  padding-top: 24px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--oxblood);
  transition: transform 0.4s var(--ease-out);
}
.entry:hover .entry-read { transform: translateX(4px); }

@media (max-width: 900px) {
  .journal-grid { grid-template-columns: 1fr; }
  .journal-head { flex-direction: column; align-items: flex-start; }
}

/* ============ Letter / Newsletter ============ */
/* ============ Connect form ============ */
.connect {
  padding: 150px var(--pad-x);
  background: var(--paper);
  color: var(--ink);
  border-top: 1px solid var(--rule);
}
.connect-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 88px;
  align-items: start;
}
.connect-tag {
  font-family: var(--f-mono);
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--oxblood); margin-bottom: 22px;
}
.connect-copy h2 {
  font-family: var(--f-serif);
  font-size: clamp(34px, 4vw, 56px); font-weight: 500; line-height: 1.05;
  letter-spacing: -0.01em; margin-bottom: 20px;
}
.connect-copy h2 em { font-style: italic; color: var(--oxblood); }
.connect-copy p { font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 440px; }
.connect-direct { margin-top: 30px; font-size: 15px; color: var(--ink-soft); }
.connect-direct span { display: block; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 6px; }
.connect-direct a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule-strong); padding-bottom: 2px; }
.connect-direct a:hover { color: var(--oxblood); border-color: var(--oxblood); }

.connect-form { display: flex; flex-direction: column; gap: 30px; }
.lx-row { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.lx-field { display: flex; flex-direction: column; }
.lx-field label {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 10px;
}
.lx-field input, .lx-field select, .lx-field textarea {
  font-family: var(--f-sans); font-size: 17px; color: var(--ink);
  background: transparent; border: none; border-bottom: 1px solid var(--rule-strong);
  padding: 10px 0; transition: border-color 0.4s var(--ease-out);
}
.lx-field textarea { resize: vertical; min-height: 90px; }
.lx-field select { appearance: none; cursor: pointer; }
.lx-field input::placeholder, .lx-field textarea::placeholder { color: var(--ink-soft); font-style: italic; opacity: 0.6; }
.lx-field input:focus, .lx-field select:focus, .lx-field textarea:focus { outline: none; border-color: var(--oxblood); }
.lx-hp { position: absolute; left: -9999px; width: 0; height: 0; overflow: hidden; }
.lx-status { font-size: 15px; display: none; }
.lx-status.ok { display: block; color: #3c6b3c; }
.lx-status.err { display: block; color: var(--oxblood-hot); }
.lx-submit { align-self: flex-start; }
@media (max-width: 860px) {
  .connect-inner { grid-template-columns: 1fr; gap: 48px; }
  .lx-row { grid-template-columns: 1fr; gap: 30px; }
}

.letter {
  padding: 160px var(--pad-x);
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}
.letter::before {
  content: "L";
  position: absolute;
  right: -80px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--f-serif);
  font-size: 600px;
  line-height: 0.8;
  font-weight: 300;
  font-style: italic;
  color: rgba(244, 237, 225, 0.03);
  pointer-events: none;
}
.letter-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.letter-tag {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 28px;
}
.letter-copy h2 {
  font-family: var(--f-serif);
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.letter-copy h2 em { font-style: italic; color: var(--gold); }
.letter-copy p {
  margin-top: 24px;
  font-family: var(--f-serif);
  font-size: 18px;
  font-weight: 300;
  color: rgba(244, 237, 225, 0.65);
  max-width: 440px;
}

.letter-form { position: relative; }
.letter-field {
  display: flex;
  border-bottom: 1px solid rgba(244, 237, 225, 0.25);
  padding-bottom: 4px;
  transition: border-color 0.4s var(--ease-out);
}
.letter-field:focus-within { border-color: var(--gold); }
.letter-field input {
  flex: 1;
  padding: 20px 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--f-serif);
  font-size: 22px;
  font-weight: 300;
  color: var(--paper);
}
.letter-field input::placeholder { color: rgba(244, 237, 225, 0.35); font-style: italic; }
.letter-submit {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 22px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  transition: color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.letter-submit:hover { color: var(--paper); }
.letter-submit:hover svg { transform: translateX(4px); }
.letter-submit svg { transition: transform 0.3s var(--ease-out); }
.letter-fine {
  margin-top: 18px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 237, 225, 0.4);
}
.letter-done {
  margin-top: 18px;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 16px;
  color: var(--gold);
  display: none;
}
.letter-done.show { display: block; }

@media (max-width: 900px) {
  .letter-inner { grid-template-columns: 1fr; gap: 40px; }
}

/* ============ Footer ============ */
.foot {
  background: var(--paper-deep);
  padding: 100px var(--pad-x) 40px;
  border-top: 1px solid var(--rule);
}
.foot-top {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 2fr;
  gap: 80px;
  padding-bottom: 80px;
  border-bottom: 1px solid var(--rule);
}
.foot-wordmark {
  font-family: var(--f-serif);
  font-size: 56px;
  font-weight: 300;
  font-style: italic;
  line-height: 1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.foot-wordmark-sub {
  display: block;
  font-family: var(--f-mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-top: 10px;
}
.foot-brand p {
  font-family: var(--f-serif);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 380px;
  margin-bottom: 32px;
}
.foot-contacts { display: flex; flex-direction: column; gap: 8px; }
.foot-contacts a {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink);
  width: fit-content;
  position: relative;
}
.foot-contacts a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}
.foot-contacts a:hover::after { transform: scaleX(1); }

.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.foot-col h5 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.foot-col a {
  display: block;
  font-family: var(--f-serif);
  font-size: 17px;
  font-weight: 300;
  color: var(--ink);
  padding: 6px 0;
  transition: color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.foot-col a:hover { color: var(--oxblood); transform: translateX(4px); }

.foot-bottom {
  max-width: var(--container);
  margin: 30px auto 0;
  display: flex; justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .foot-top { grid-template-columns: 1fr; gap: 60px; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .foot-bottom { flex-direction: column; gap: 12px; }
}

/* ============ Reveal utilities ============ */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.fade-up.in { opacity: 1; transform: translateY(0); }

.xl-title span {
  opacity: 1;
}

/* ============================================================
   THEME — universal + dark refinements (cascade overrides)
   ============================================================ */

/* Theme-aware nav, cursor, noise */
.nav.scrolled { background: var(--nav-bg); }
.cursor { border-color: rgba(var(--cursor-color), 0.9); }
.cursor-dot { background: rgba(var(--cursor-color), 0.95); }
.cursor.is-hover { background: rgba(var(--cursor-color), 0.08); }
.noise { opacity: var(--noise-opacity); mix-blend-mode: var(--noise-blend); }

/* Preloader — pinned dark always (splash aesthetic) */
.preloader { background: #0f0c08; color: #f0e6d4; }
.preloader-line { background: rgba(240, 230, 212, 0.18); }

/* ----- Dark-mode: inverted sections refinements ----- */
/* .voices, .letter, .marquee-quote auto-flip their bg/text via --ink/--paper aliases,
   but their inner hardcoded rgba values need to flip too */

[data-theme="dark"] .voice {
  border-color: rgba(var(--on-invert-rgb), 0.12);
  background: rgba(var(--on-invert-rgb), 0.03);
}
[data-theme="dark"] .voice:hover {
  border-color: var(--oxblood);
  background: rgba(184, 56, 60, 0.08);
}

[data-theme="dark"] .marquee-quote {
  border-top-color: var(--rule);
  border-bottom-color: var(--rule);
}

[data-theme="dark"] .letter::before {
  color: rgba(var(--on-invert-rgb), 0.05);
}
[data-theme="dark"] .letter-copy p {
  color: rgba(var(--on-invert-rgb), 0.7);
}
[data-theme="dark"] .letter-field {
  border-bottom-color: rgba(var(--on-invert-rgb), 0.28);
}
[data-theme="dark"] .letter-field input::placeholder {
  color: rgba(var(--on-invert-rgb), 0.42);
}
[data-theme="dark"] .letter-fine {
  color: rgba(var(--on-invert-rgb), 0.5);
}

/* ----- Dark-mode: shadows deepen for lift ----- */
[data-theme="dark"] .book-cover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 2px 6px rgba(0, 0, 0, 0.5),
    0 40px 80px -20px rgba(0, 0, 0, 0.7);
}
[data-theme="dark"] .book-card:hover .book-cover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 2px 6px rgba(0, 0, 0, 0.6),
    0 55px 100px -20px rgba(0, 0, 0, 0.85);
}
[data-theme="dark"] .match-card {
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
}
[data-theme="dark"] .story-image-frame {
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.7);
}
[data-theme="dark"] .match-book-cover {
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
}

/* ----- Dark-mode: gradients, grain, scrollbar ----- */
[data-theme="dark"] .hero-gradient {
  background: radial-gradient(circle, rgba(216, 74, 78, 0.18), transparent 60%);
}
[data-theme="dark"] .story-image-grain {
  mix-blend-mode: overlay;
  opacity: 0.22;
}
[data-theme="dark"] .library-shelf {
  scrollbar-color: var(--gold-soft) transparent;
}
[data-theme="dark"] .library-shelf::-webkit-scrollbar-thumb {
  background: var(--gold-soft);
}

/* Dark mode: hero grid opacity slightly lower */
[data-theme="dark"] .hero-grid { opacity: 0.35; }

/* Dark mode: story illustration filter */
[data-theme="dark"] .story-illustration {
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5)) brightness(0.95);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   MOBILE RESPONSIVE — comprehensive fixes
   Breakpoints: 768px (tablet), 480px (small mobile)
   ============================================================ */

/* --- Global overflow guard --- */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* --- Hero title: prevent overflow-hidden from clipping GSAP-animated words ---
   The .line overflow:hidden is needed for the reveal animation.
   On mobile we reduce font-size so long words like "empowerment." fit in viewport. */
@media (max-width: 768px) {
  /* Root: tighten horizontal padding so more content fits */
  :root {
    --pad-x: clamp(20px, 5vw, 40px);
  }

  /* Nav: shrink "Begin" button text, prevent nav overflow */
  .nav {
    padding: 16px var(--pad-x);
  }
  .nav-cta {
    padding: 9px 16px;
    font-size: 12px;
    gap: 7px;
  }
  .nav-brand-text {
    font-size: 15px;
  }
  .nav-mark {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }

  /* Hero: single column, reduce padding, fix title font-size */
  .hero {
    grid-template-columns: 1fr;
    padding: 100px var(--pad-x) 80px;
    gap: 24px;
    min-height: auto;
  }

  /* Hero title: fluid size that keeps "empowerment." on-screen.
     At 375px with 20px padding each side, usable width = 335px.
     We use 8vw = 30px at 375px; Fraunces "empowerment." ~11 chars ≈ 280px — fits with margin.
     overflow-wrap ensures no word ever escapes the container. */
  .hero-title {
    font-size: clamp(30px, 8vw, 56px);
    line-height: 1.0;
    margin-bottom: 24px;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* Hero lede: comfortable reading size */
  .hero-lede {
    font-size: clamp(16px, 4.5vw, 19px);
    margin-bottom: 32px;
    max-width: 100%;
  }

  /* Hero CTAs: allow full-width wrapping */
  .hero-ctas {
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .btn {
    padding: 13px 22px;
    font-size: 12px;
  }

  /* Hero stats: 3-across but smaller numbers */
  .hero-stats {
    gap: 20px;
    flex-wrap: nowrap;
  }
  .stat b {
    font-size: clamp(28px, 7vw, 42px);
  }
  .stat span {
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  /* Hero book: shrink height when stacked */
  .hero-book {
    height: 320px;
    order: -1;
  }

  /* Hero meta: keep static (already set at 900px), just reduce gap */
  .hero-meta {
    font-size: 10px;
    gap: 8px;
    flex-wrap: wrap;
  }

  /* Hero eyebrow: shrink line + gap */
  .hero-eyebrow {
    margin-bottom: 20px;
    gap: 10px;
    font-size: 10px;
  }
  .eyebrow-line {
    width: 32px;
  }

  /* Section head */
  .section-head {
    padding: 0 var(--pad-x);
    margin-bottom: 28px;
  }

  /* XL titles: fluid scale down — must fit within padded container at 375px */
  .xl-title {
    font-size: clamp(30px, 8vw, 64px);
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* Story section: less vertical breathing room */
  .story {
    padding: 80px 0 100px;
  }
  .story-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 0 var(--pad-x);
  }
  .story-sticky {
    position: static;
    height: auto;
  }
  .story-image {
    justify-content: flex-start;
  }
  .story-image-frame {
    max-width: 280px;
    margin: 0 auto;
  }
  .story-text {
    gap: 60px;
    padding-top: 0;
  }
  .chapter h2 {
    font-size: clamp(26px, 6vw, 38px);
  }
  .chapter p {
    font-size: 17px;
  }
  .chapter-mark {
    font-size: 48px;
    margin-bottom: 16px;
  }
  .chapter-quote blockquote {
    font-size: clamp(20px, 5vw, 28px);
  }

  /* Library section */
  .library {
    padding: 80px 0 100px;
  }
  .library-intro {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 48px;
  }
  .library-intro p {
    margin-left: 0;
    max-width: 100%;
    font-size: 17px;
  }
  .library-shelf {
    /* Shrink cards slightly so partial next card is visible = scroll hint */
    padding: 0 var(--pad-x) 32px;
    gap: 20px;
  }
  .book-card {
    flex: 0 0 260px;
  }
  .book-title-cover {
    font-size: 26px;
  }
  .library-cta {
    padding: 40px var(--pad-x) 0;
  }

  /* Voices section */
  .voices {
    padding: 80px 0 100px;
  }
  .voices-inner .xl-title {
    margin-bottom: 48px;
  }
  .voice, .voice-lg {
    grid-column: span 12;
  }
  .voice {
    padding: 28px 24px;
    gap: 20px;
  }
  .voice-quote {
    font-size: clamp(16px, 4.5vw, 20px) !important;
  }

  /* Match/quiz section */
  .match {
    padding: 80px 0 100px;
  }
  .match-inner {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 0 var(--pad-x);
  }
  .match-card {
    padding: 36px 28px;
    min-height: auto;
  }
  .match-opt {
    padding: 18px 44px 18px 20px;
    font-size: 17px;
    /* prevent text from running under the absolute → arrow */
  }
  .match-book {
    grid-template-columns: 90px 1fr;
    gap: 16px;
  }
  .match-book-title {
    font-size: 22px;
  }
  .match-book-blurb {
    font-size: 14px;
  }

  /* Journal section */
  .journal {
    padding: 80px 0 100px;
  }
  .journal-head {
    padding: 0 var(--pad-x);
    margin-bottom: 40px;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .journal-grid {
    padding: 0 var(--pad-x);
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .entry {
    padding: 28px 24px;
    min-height: auto;
  }
  .entry h3 {
    font-size: clamp(20px, 5vw, 24px);
  }

  /* Newsletter / letter section */
  .letter {
    padding: 80px var(--pad-x);
  }
  .letter::before {
    /* decorative giant L — hide on mobile to avoid overflow */
    display: none;
  }
  .letter-inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .letter-copy h2 {
    font-size: clamp(28px, 7vw, 44px);
  }
  .letter-copy p {
    font-size: 16px;
    max-width: 100%;
  }
  .letter-field input {
    font-size: 18px;
    padding: 16px 0;
  }

  /* Footer */
  .foot {
    padding: 72px var(--pad-x) 32px;
  }
  .foot-top {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-bottom: 48px;
  }
  .foot-wordmark {
    font-size: 44px;
  }
  .foot-cols {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .foot-bottom {
    flex-direction: column;
    gap: 10px;
  }
}

/* --- 480px and below: tighten further --- */
@media (max-width: 480px) {
  :root {
    --pad-x: 18px;
  }

  /* Nav: hide brand text label, just keep mark + L + CTA */
  .nav {
    padding: 14px var(--pad-x);
  }
  .nav-brand-text {
    display: none;
  }
  .nav-actions {
    gap: 10px;
  }
  .nav-cta span {
    display: none; /* show just the arrow icon on tiny screens */
  }
  .nav-cta {
    padding: 9px 12px;
  }

  /* Hero title: extra small — keep everything readable, no clipping */
  .hero-title {
    font-size: clamp(32px, 10vw, 44px);
    letter-spacing: -0.015em;
  }

  /* Stats: allow wrap at very small sizes */
  .hero-stats {
    flex-wrap: wrap;
    gap: 16px 28px;
  }

  /* Hero book: compact */
  .hero-book {
    height: 260px;
  }

  /* Book shelf: nearly full width cards */
  .book-card {
    flex: 0 0 220px;
  }

  /* Match card */
  .match-card {
    padding: 28px 20px;
  }
  .match-opt {
    font-size: 16px;
    padding: 16px 16px;
  }
  /* Prevent match-opt hover translateX from causing overflow */
  .match-opt:hover {
    transform: none;
  }
  .match-book {
    grid-template-columns: 80px 1fr;
    gap: 14px;
  }

  /* Voices */
  .voice {
    padding: 24px 20px;
  }

  /* Footer: single column nav */
  .foot-cols {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* Letter field: prevent overflow */
  .letter-field {
    flex-direction: column;
    gap: 12px;
    border-bottom: none;
    padding-bottom: 0;
  }
  .letter-field input {
    border-bottom: 1px solid rgba(244, 237, 225, 0.25);
    padding-bottom: 8px;
  }
  .letter-submit {
    padding: 0;
    justify-content: flex-start;
  }
}

/* --- Ensure hero title lines never clip their content ---
   On mobile the GSAP animation sets translateY(110%) initially.
   Override so words are visible without JS running (headless / no-JS fallback). */
@media (max-width: 768px) {
  .hero-title .word {
    /* GSAP will override this at runtime; this ensures SSR/headless safety */
    transform: translateY(0);
  }
  .xl-title .reveal-inner {
    transform: translateY(0);
  }
}

/* --- Marquee: reduce font on small screens to prevent layout shift --- */
@media (max-width: 480px) {
  .marquee-track {
    font-size: clamp(28px, 9vw, 52px);
    gap: 28px;
  }
}

/* ============================================================
   MEDIA INTEGRATION — June 2026 (logo, story photo/video,
   voices feature, in-the-world gallery)
   ============================================================ */

/* Nav logo (replaces text mark) */
.nav-logo {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--ink);
}

/* Story — real portrait photo */
.story-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.story-photo-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(to top, rgba(15,12,8,0.82), rgba(15,12,8,0) 100%);
  color: #f4ede1;
}
.story-photo-name {
  font-family: var(--f-serif);
  font-size: 20px; font-weight: 500;
  letter-spacing: 0.01em;
}
.story-photo-role {
  font-family: var(--f-mono);
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold-soft);
}

/* Story — secondary photo stack under the sticky portrait */
.story-image {
  display: flex; flex-direction: column;
  justify-content: flex-start;
  gap: 18px;
  align-items: stretch;
  place-items: unset;
}
.story-image-frame { max-width: none; margin: 0 auto; width: 100%; max-width: 440px; }
.story-image-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%; max-width: 440px;
  margin: 18px auto 0;
}
.story-image-stack img {
  width: 100%;
  /* All four are portrait shots — a 3:4 box matches their native ratio so
     almost nothing is cropped. world-2 is slightly taller (0.69), so keep a
     small upward bias to guarantee headroom. */
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: center 12%;
  border: 1px solid var(--rule-strong);
  box-shadow: 0 18px 44px -30px rgba(26,22,18,0.35);
}

/* Story — in-his-own-words video (breaks wider than text column) */
.chapter-wide { max-width: none; }
.chapter-wide h2, .chapter-wide p { max-width: 460px; }
.story-video {
  margin-top: 26px;
  border: 1px solid var(--rule-strong);
  background: var(--ink);
  overflow: hidden;
  box-shadow: 0 24px 60px -34px rgba(26,22,18,0.45);
  width: 100%;
}
.story-video-el {
  width: 100%; height: auto; display: block;
  aspect-ratio: 16/9;
  object-fit: contain;
  background: var(--ink);
}
/* two founder videos under the photo stack in the left column */
.story-video-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%; max-width: 440px;
  margin: 14px auto 0;
}
.story-video-pair .story-video { margin-top: 0; }
.story-video-pair .story-video.is-portrait { max-width: none; }
@media (max-width: 560px) {
  .story-video-pair { grid-template-columns: 1fr; }
}
/* portrait (9:16) phone-shot videos — centered, capped width so they don't show huge side bars */
.story-video.is-portrait {
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}
.story-video.is-portrait .story-video-el {
  aspect-ratio: 9/16;
  object-fit: cover;
}

/* Voices — featured radio segment */
.voices-feature {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin: 12px 0 64px;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--rule);
  background: var(--paper-2);
}
.voices-feature-video {
  border: 1px solid var(--rule-strong);
  background: var(--ink);
  overflow: hidden;
  box-shadow: 0 24px 60px -34px rgba(26,22,18,0.45);
}
.voices-feature-el {
  width: 100%; height: auto; display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--ink);
}
.voices-feature-tag {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 14px;
}
.voices-feature-copy h3 {
  font-family: var(--f-serif);
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 400; line-height: 1.12;
  margin-bottom: 14px;
  color: var(--ink);
}
.voices-feature-copy p {
  font-size: 16px; line-height: 1.6;
  color: var(--ink-soft);
  max-width: 42ch;
}
.voices-feature-copy p em { color: var(--oxblood); font-style: italic; }
.voices-feature-src {
  margin-top: 18px;
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink-soft); opacity: 0.7;
}

/* In the World — gallery */
.world {
  padding: clamp(80px, 12vh, 160px) var(--pad-x) clamp(60px, 9vh, 120px);
  max-width: var(--container);
  margin: 0 auto;
}
.world-intro {
  max-width: 760px;
  margin: 32px 0 56px;
}
.world-intro p {
  font-size: 17px; line-height: 1.6;
  color: var(--ink-soft);
  margin-top: 18px; max-width: 52ch;
}
.world-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 1.6vw, 22px);
  align-items: start;
}
.world-shot {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
  /* Boxes match the photos' native 3:4 so cover-cropping never clips faces. */
  aspect-ratio: 3/4;
  box-shadow: 0 20px 50px -36px rgba(26,22,18,0.4);
}
.world-shot-wide {
  grid-column: 1 / -1;
  aspect-ratio: 2/1;
}
.world-shot img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s var(--ease-out);
}
/* The wide shot is a 4:3 landscape in a 2:1 window — bias upward so heads stay in frame. */
.world-shot-wide img { object-position: 50% 30%; }
.world-shot:hover img { transform: scale(1.05); }

/* Dark mode adjustments */
[data-theme="dark"] .voices-feature { background: var(--bg-2); }
[data-theme="dark"] .world-shot,
[data-theme="dark"] .story-video,
[data-theme="dark"] .voices-feature-video { border-color: var(--rule-strong); }

/* Responsive */
@media (max-width: 900px) {
  .voices-feature {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .world-gallery {
    grid-template-columns: 1fr;
  }
  .world-shot { aspect-ratio: 3/4; }
  /* Single column: show the landscape shot at its native ratio — zero crop. */
  .world-shot-wide { aspect-ratio: 4/3; }
}
@media (max-width: 560px) {
  .nav-logo { width: 30px; height: 30px; }
  .world-gallery { grid-template-columns: 1fr; gap: 10px; }
  .story-photo-caption { padding: 16px 16px 14px; }
  .story-photo-name { font-size: 17px; }
}

/* ============================================================
   3D BOOK SHELF — real Finding What's Missing editions
   ============================================================ */
.books3d-shelf {
  display: grid;
  /* Four editions: 2x2 on tablet, single row on wide screens. */
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 4vw, 64px);
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px var(--pad-x) 0;
}
@media (min-width: 1100px) {
  .books3d-shelf {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1340px;
    gap: clamp(18px, 2.6vw, 40px);
  }
}
.book3d {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin: 0;
}
.book3d-canvas {
  width: 100%;
  height: clamp(320px, 32vw, 440px);
  display: block;
  touch-action: pan-y;
}
/* Four-up shelf: narrower columns, so the canvas comes down with them.
   Must follow the base rule above — same specificity, source order decides. */
@media (min-width: 1100px) {
  .book3d-canvas { height: clamp(300px, 24vw, 400px); }
}
.book3d figcaption {
  display: flex; flex-direction: column;
  align-items: center; gap: 5px;
  text-align: center;
}
.book3d-title {
  font-family: var(--f-serif);
  font-size: clamp(18px, 1.5vw, 22px);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.book3d-edition {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--oxblood);
}
[data-theme="dark"] .book3d-edition { color: var(--gold); }
.book3d-desc {
  font-family: var(--f-sans, inherit);
  font-size: 13px;
  line-height: 1.55;
  max-width: 34ch;
  margin-top: 4px;
  opacity: 0.8;
}

@media (max-width: 820px) {
  .books3d-shelf {
    grid-template-columns: 1fr;
    gap: 48px;
    max-width: 420px;
  }
  .book3d-canvas { height: 380px; }
}

/* Voices — letters-from-the-inside intro */
.voices-letters-intro {
  max-width: 620px;
  margin: 0 0 44px;
}
.voices-letters-tag {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.voices-letters-intro p {
  font-family: var(--f-serif);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.5;
  color: var(--paper);
  opacity: 0.86;
}

/* ============================================================
   HANDWRITTEN LETTERS — real reader letters gallery + lightbox
   ============================================================ */
.letters-real {
  margin-top: 96px;
  padding-top: 64px;
  border-top: 1px solid rgba(184, 153, 104, 0.25);
}
.letters-real-head {
  max-width: 640px;
  margin-bottom: 44px;
}
.letters-real-tag {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.letters-real-head h3 {
  font-family: var(--f-serif);
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 400; line-height: 1.1;
  color: var(--paper);
  margin-bottom: 16px;
}
.letters-real-head p {
  font-size: 16px; line-height: 1.6;
  color: var(--paper); opacity: 0.7;
  max-width: 48ch;
}
.letters-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(12px, 1.4vw, 18px);
}
.letter-card {
  position: relative;
  display: block;
  padding: 0; margin: 0;
  border: 1px solid rgba(244, 237, 225, 0.14);
  background: #efe9dc;
  overflow: hidden;
  aspect-ratio: 3/4;
  cursor: pointer;
  transition: transform 0.5s var(--ease-out), border-color 0.5s var(--ease-out);
}
.letter-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.6s var(--ease-out);
}
.letter-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.letter-card:hover img { transform: scale(1.04); }
.letter-card-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 12px 10px;
  font-family: var(--f-mono);
  font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: #f4ede1;
  text-align: left;
  background: linear-gradient(to top, rgba(15,12,8,0.85), rgba(15,12,8,0));
}

/* Lightbox */
.letter-lightbox {
  position: fixed; inset: 0;
  z-index: 9000;
  display: none;
  align-items: center; justify-content: center;
  padding: 40px;
  background: rgba(12, 9, 6, 0.92);
  backdrop-filter: blur(4px);
}
.letter-lightbox.open { display: flex; }
.letter-lightbox img {
  max-width: min(92vw, 720px);
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 40px 120px -30px rgba(0,0,0,0.8);
  border-radius: 2px;
}
.letter-lightbox-close {
  position: absolute; top: 24px; right: 32px;
  width: 48px; height: 48px;
  font-size: 32px; line-height: 1;
  color: #f4ede1;
  background: none; border: none; cursor: pointer;
  opacity: 0.8; transition: opacity 0.3s;
}
.letter-lightbox-close:hover { opacity: 1; }

@media (max-width: 900px) {
  .letters-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 540px) {
  .letters-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .letter-lightbox { padding: 16px; }
}
