:root {
  --ink: #050405;
  --ink-2: #0d0a0b;
  --paper: #ece6dc;
  --paper-dim: #b9b2a7;
  --red: #c3121c;
  --crimson: #8e0f16;
  --silver: #a6a6a6;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sub: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.defs { position: absolute; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1120px, 100% - 40px); margin: 0 auto; }
.wrap.narrow { width: min(760px, 100% - 40px); }

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--silver);
  margin: 0 0 14px;
  font-weight: 600;
}

h1, h2 { font-weight: 500; line-height: 1.05; margin: 0; }
h1 em, h2 em { font-style: italic; color: var(--red); font-weight: 400; }

.btn {
  display: inline-block;
  padding: 14px 30px;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--red);
  transition: background 0.3s, color 0.3s, transform 0.3s;
}
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: #e0242c; transform: translateY(-2px); }
.btn.ghost { color: var(--paper); border-color: rgba(236, 230, 220, 0.5); }
.btn.ghost:hover { border-color: var(--paper); background: rgba(236, 230, 220, 0.06); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 70% 45%, #3a070c 0%, var(--ink) 60%);
}
.sparkle { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner {
  position: relative;
  width: min(1180px, 100% - 40px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
  padding: 80px 0;
}
.hero h1 { font-size: clamp(3.2rem, 8vw, 6.6rem); }
.hero .sub { font-style: italic; font-size: 1.35rem; margin: 18px 0 4px; color: var(--paper-dim); }
.hero .byline { font-size: 1.2rem; letter-spacing: 0.4em; text-transform: uppercase; margin: 0 0 26px; }
.hero .tags { font-size: 1.02rem; color: var(--paper-dim); max-width: 34em; margin: 0 0 34px; border-left: 2px solid var(--red); padding-left: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* The paperback: a WebGL book, with the flat cover as the fallback */
.hero-book {
  position: relative;
  margin: 0;
  width: 100%;
  height: min(80vh, 46rem);
  cursor: grab;
  touch-action: pan-y pinch-zoom;
}
.hero-book:active { cursor: grabbing; }
.hero-book::before {
  content: "";
  position: absolute;
  inset: 20% 10% -4%;
  background: radial-gradient(ellipse 50% 40% at 50% 64%, rgba(195, 18, 28, 0.38), transparent 70%);
  filter: blur(18px);
  pointer-events: none;
}
.book-flat {
  position: absolute;
  inset: 0;
  margin: auto;
  height: 80%;
  width: auto;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.75);
  transition: opacity 0.4s ease;
}
.book-canvas { position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s ease; }
.book-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.hero-book.is-ready .book-canvas { opacity: 1; }
.hero-book.is-ready .book-flat { opacity: 0; }

.scroll-cue { position: absolute; bottom: 28px; left: 50%; translate: -50% 0; width: 26px; height: 42px; border: 1px solid rgba(236,230,220,.5); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; translate: -50% 0; background: var(--paper); border-radius: 2px; animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* The scroll story: a pop-up paper world seen through a moving camera */
.seq { position: relative; background: var(--ink); }
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  perspective: 1000px;
  perspective-origin: 50% 42%;
  background: #05060c;
}
.sky { position: absolute; inset: 0; background: linear-gradient(var(--sky-top, #0a1024), var(--sky-bot, #1b1830)); }
.sky::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(1.4px 1.4px at 12% 18%, #efe9df, transparent), radial-gradient(1px 1px at 33% 9%, #efe9df, transparent),
    radial-gradient(1.6px 1.6px at 58% 22%, #efe9df, transparent), radial-gradient(1px 1px at 72% 12%, #c3121c, transparent),
    radial-gradient(1.2px 1.2px at 86% 28%, #efe9df, transparent), radial-gradient(1px 1px at 22% 34%, #efe9df, transparent),
    radial-gradient(1.3px 1.3px at 46% 6%, #efe9df, transparent), radial-gradient(1px 1px at 94% 8%, #efe9df, transparent);
  opacity: 0.7;
}
.world { position: absolute; left: 50%; top: 58%; width: 0; height: 0; transform-style: preserve-3d; }
.world > * { position: absolute; left: 0; top: 0; }
.ground {
  width: 14000px; height: 4800px;
  transform-origin: 0 0;
  transform: translate3d(-3000px, 0, -3600px) rotateX(90deg);
  background: #121522;
}
.prop { transform-style: preserve-3d; transform-origin: 50% 100%; }
.hinge { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 50% 100%; }
.face, .back { position: absolute; inset: 0; }
.back { transform: translateZ(-6px); filter: brightness(0.32); }
.prop svg, .shadow svg { display: block; width: 100%; height: 100%; }
.prop.flat { transform-origin: 50% 50%; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5)); }
.light { transform-origin: 50% 50%; pointer-events: none; }
.shadow { transform-origin: 0 0; pointer-events: none; }
.shadow > div { width: 100%; height: 100%; transform: scaleY(-1); filter: brightness(0) blur(5px); }
.frag { background: #ece5d6; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); opacity: 0; }
.frag.red { background: #b3121b; }
.frag.print { background: repeating-linear-gradient(#ece5d6 0 5px, #9a9286 5px 6px); }

.wash {
  position: absolute; inset: 0; z-index: 8; pointer-events: none;
  background: #f4efe4;
}
.wash::after {
  content: ""; position: absolute; top: -10%; bottom: -10%; width: 22%;
  left: var(--band, -20%);
  background: linear-gradient(90deg, transparent, rgba(150, 170, 200, 0.55), transparent);
  filter: blur(30px);
}

.grain {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background-image: var(--noise);
  opacity: 0.12;
  mix-blend-mode: overlay;
}
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.6) 100%);
}

/* Her words: each word a torn paper slip that hinges up off the page */
.words { position: absolute; inset: 0; z-index: 6; pointer-events: none; perspective: 700px; }
.wline {
  position: absolute; top: 11vh; margin: 0;
  max-width: min(46rem, 52vw);
  font-size: clamp(1.4rem, 2.5vw, 2.3rem);
  line-height: 1.85;
  visibility: hidden;
}
.wline.left { left: 6vw; }
.wline.right { right: 6vw; text-align: right; }
.wline.center { left: 50%; translate: -50% 0; text-align: center; max-width: min(50rem, 80vw); }
.slip {
  display: inline-block;
  padding: 0.04em 0.34em 0.1em;
  margin: 0 -0.05em;
  background: #ece5d6;
  color: #17110f;
  font-weight: 600;
  transform-origin: 50% 100%;
  rotate: var(--tilt);
  translate: 0 var(--dy);
  clip-path: polygon(0 6%, 18% 0, 46% 5%, 74% 0, 100% 4%, 98% 52%, 100% 96%, 70% 100%, 38% 95%, 12% 100%, 0 94%, 2% 48%);
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.55));
  opacity: 0;
}
.slip.key {
  background: #a3111a;
  color: #f4eee4;
  font-style: italic;
  font-size: 1.45em;
  padding: 0 0.3em 0.06em;
}
.skip {
  position: absolute; z-index: 9; top: 20px; right: 24px;
  font-size: 0.82rem; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none;
  padding: 8px 14px; border: 1px solid rgba(236,230,220,.35); background: rgba(0,0,0,.35);
}
.skip:hover { border-color: var(--paper); }
.progress { position: absolute; z-index: 6; left: 0; bottom: 0; height: 2px; width: 100%; background: rgba(255,255,255,.08); }
.progress span { display: block; height: 100%; width: 100%; background: var(--red); transform-origin: 0 50%; transform: scaleX(0); }

/* Content sections */
main section { padding: 120px 0; position: relative; }
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.in { opacity: 1; transform: none; }

.tropes { background: var(--ink-2); padding-top: 40px; }
.trope-list { list-style: none; padding: 0; margin: 0 0 70px; display: flex; flex-wrap: wrap; gap: 12px; }
.trope-list li {
  padding: 10px 18px; font-size: 1.05rem; font-style: italic;
  background: var(--paper); color: #1a1214;
  clip-path: polygon(0 4%, 3% 0, 97% 3%, 100% 0, 99% 96%, 96% 100%, 4% 97%, 0 100%);
  box-shadow: 0 6px 12px rgba(0,0,0,.4);
}
.trope-list li:nth-child(3n+2) { background: var(--crimson); color: var(--paper); }
.crave { margin: 0; text-align: center; padding: 50px 20px; border-top: 1px solid rgba(236,230,220,.12); border-bottom: 1px solid rgba(236,230,220,.12); }
.crave p:last-child { font-size: clamp(1.6rem, 3.4vw, 2.5rem); font-style: italic; line-height: 1.25; margin: 0 auto; max-width: 22em; }

/* Praise: one card, the reviewer on the left and her line set large on the right */
.praise { background: var(--ink); }
.praise-title { text-align: center; font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.praise-sub { text-align: center; color: var(--paper-dim); font-style: italic; margin: 10px 0 50px; }
.praise-card {
  margin: 0 auto;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
  padding: 24px;
  background: #151213;
  border: 1px solid rgba(236, 230, 220, 0.08);
  border-radius: 18px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
}
.praise-side { display: flex; flex-direction: column; justify-content: center; padding: 26px 18px 26px 22px; }
.praise-head { font-size: 1.35rem; font-weight: 600; margin: 0 0 14px; }
.praise-rest { color: var(--paper-dim); font-size: 1.05rem; margin: 0 0 30px; }
.praise-side figcaption { display: grid; gap: 2px; padding-top: 18px; border-top: 1px solid rgba(236, 230, 220, 0.12); }
.praise-side figcaption strong { font-size: 1.1rem; letter-spacing: 0.08em; }
.praise-side figcaption span { color: var(--silver); font-size: 0.9rem; font-style: italic; }
.praise-big {
  position: relative;
  margin: 0;
  display: grid;
  align-items: center;
  padding: 60px 44px;
  min-height: 420px;
  border-radius: 12px;
  background: radial-gradient(ellipse at 70% 30%, #4a0a10, #120708 75%);
  overflow: hidden;
}
.praise-big::before {
  content: "“";
  position: absolute;
  top: -14px;
  left: 22px;
  font-size: 12rem;
  line-height: 1;
  color: var(--red);
  opacity: 0.55;
}
.praise-big p {
  position: relative;
  margin: 0;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  font-style: italic;
  line-height: 1.15;
}

.warnings h2 { font-size: 2.2rem; margin-bottom: 18px; }
.warnings p { color: #d6cfc4; }
details { margin: 26px 0; border: 1px solid rgba(236,230,220,.2); padding: 14px 20px; }
summary { cursor: pointer; letter-spacing: .2em; text-transform: uppercase; font-size: .85rem; font-weight: 600; }
.cw-list { columns: 2; gap: 30px; padding-left: 20px; margin: 16px 0 4px; color: #d6cfc4; }
.note { font-style: italic; border-left: 2px solid var(--red); padding-left: 16px; }

.author { background: var(--ink-2); }
.author-grid { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 70px; align-items: center; }
.author-photo { margin: 0; position: relative; }
.author-photo img { filter: contrast(1.05); box-shadow: 0 30px 70px rgba(0,0,0,.6); }
.author-photo::after { content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 1px solid var(--red); z-index: -1; }
.author h2 { font-size: clamp(2.4rem, 4.4vw, 3.4rem); margin-bottom: 22px; }
.author-text p { color: #d6cfc4; }
.links { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 26px; }
.links a { text-decoration: none; border-bottom: 1px solid var(--red); padding-bottom: 2px; letter-spacing: .06em; }
.links a:hover { color: #fff; border-color: #fff; }

.newsletter { text-align: center; }
.newsletter h2 { font-size: 2.4rem; margin-bottom: 18px; }
.newsletter p { color: #d6cfc4; margin-bottom: 32px; }

.final { background: radial-gradient(ellipse at 35% 50%, #3a070c, var(--ink) 65%); }
.final-grid { display: grid; grid-template-columns: 260px 1fr; gap: 60px; align-items: center; justify-content: center; max-width: 820px; }
.final img { box-shadow: 0 30px 70px rgba(0,0,0,.7); }
.final h2 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
.final p { font-style: italic; font-size: 1.4rem; color: var(--paper-dim); margin: 10px 0 30px; }

.site-foot { text-align: center; padding: 40px 20px 60px; color: var(--silver); font-size: .9rem; letter-spacing: .14em; border-top: 1px solid rgba(236,230,220,.08); }

/* Concept-preview tape. The server adds it to the page (lib/preview-notice.mjs).
   Slim and translucent at the bottom so it never takes space from the story;
   only its controls take clicks. Adapted from Blood Code. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.preview-notice {
  position: fixed; z-index: 45; inset: auto 0 0;
  height: calc(44px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  pointer-events: none;
  background: #f3cf45ed; color: #111;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #111;
}
.preview-notice::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: repeating-linear-gradient(115deg, #111 0 12px, transparent 12px 22px);
}
.preview-tape {
  position: absolute; inset: 4px 230px auto 0; height: 39px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 25px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 25px), transparent);
}
.preview-notice[data-preview-notice="neutral"] .preview-tape { right: 64px; }
.preview-tape-track { display: flex; width: max-content; animation: preview-tape-flow 34s linear infinite; }
.preview-tape-group { display: flex; flex-shrink: 0; }
.preview-tape-group > span {
  display: flex; align-items: center; gap: 1.8rem; padding-right: 1.8rem; height: 39px; white-space: nowrap;
  font: 700 0.74rem/1 var(--serif); letter-spacing: 0.16em; text-transform: uppercase;
}
.preview-tape-group i { font-style: normal; font-size: 0.9rem; }
@keyframes preview-tape-flow { to { transform: translateX(-50%); } }
.preview-tape-controls {
  position: absolute; top: 0; right: max(12px, env(safe-area-inset-right));
  display: flex; gap: 0.5rem; align-items: center; pointer-events: auto;
}
.preview-tape-controls a, .preview-tape-pause {
  display: inline-flex; justify-content: center; gap: 0.65rem; align-items: center;
  min-height: 44px; padding: 0.4rem 0.65rem; border: 0; background: transparent; color: #111;
  text-decoration: none; font: 700 0.78rem/1 var(--serif); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
}
.preview-tape-controls a { border-left: 1px solid #1115; }
.preview-cta-copy { display: flex; flex-direction: column; gap: 4px; }
.preview-cta-copy small { font: 500 0.66rem/1 var(--serif); letter-spacing: 0.08em; }
.preview-tape-controls a:hover, .preview-tape-pause:hover { background: #1111; }
.preview-tape-controls a:focus-visible, .preview-tape-pause:has(input:focus-visible) { outline: 2px solid #111; outline-offset: -4px; }
.preview-tape-pause { position: relative; width: 44px; }
.preview-tape-pause svg { fill: currentColor; }
.preview-tape-pause input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.preview-tape-pause .i-play, .preview-notice:has(input:checked) .i-pause { display: none; }
.preview-notice:has(input:checked) .i-play { display: inline; }
.preview-notice:has(input:checked) .preview-tape-track { animation-play-state: paused; }
/* Keep the first screen's buttons, the story's skip button and the footer clear of the tape. */
.has-preview-notice .hero-inner { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.has-preview-notice .scroll-cue { bottom: calc(56px + env(safe-area-inset-bottom)); }
.has-preview-notice .site-foot { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }

/* Phones: the story's words go to the top, away from the thumb */
@media (max-width: 760px) {
  body { font-size: 18px; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; gap: 36px; padding: 70px 0 110px; }
  .hero-book { order: -1; }
  .hero-book { height: min(52vh, 26rem); }
  .praise-card { grid-template-columns: 1fr; padding: 14px; }
  .praise-big { order: -1; min-height: 0; padding: 50px 26px; }
  .praise-side { padding: 14px 10px 10px; }
  .hero .tags { border-left: 0; padding-left: 0; margin-left: auto; margin-right: auto; }
  .actions { justify-content: center; }
  .world { top: 72%; }
  .preview-tape { right: 205px; }
  .preview-notice[data-preview-notice="neutral"] .preview-tape { right: 52px; }
  .preview-tape-group > span { font-size: 0.66rem; gap: 1.2rem; padding-right: 1.2rem; }
  .preview-tape-controls { right: max(4px, env(safe-area-inset-right)); gap: 0; }
  .preview-tape-controls a { font-size: 0.7rem; padding-inline: 0.5rem; }
  .has-preview-notice .skip { bottom: calc(60px + env(safe-area-inset-bottom)); }
  .has-preview-notice .scroll-cue { display: none; }
  .wline, .wline.left, .wline.right, .wline.center { top: 9vh; left: 5vw; right: 5vw; translate: none; max-width: none; text-align: center; font-size: 1.35rem; }
  .skip { top: auto; bottom: 26px; right: 50%; translate: 50% 0; font-size: .72rem; }
  main section { padding: 80px 0; }
  .author-grid { grid-template-columns: 1fr; gap: 40px; }
  .cw-list { columns: 1; }
  .author-photo { width: min(320px, 80%); margin: 0 auto; }
  .final-grid { grid-template-columns: 1fr; text-align: center; gap: 30px; }
  .final img { width: 200px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue span { animation: none; }
  .preview-tape-track { animation: none; }
  .preview-tape-pause { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
