/* =========================================================================
   REMZY — appremzy.com
   Dark espresso cinematic ground, warm ivory paper, antique gold.
   Display type is Bodoni Moda (the didone on the app's book cover);
   Archivo carries the interface.
   ========================================================================= */

/* Self-hosted variable fonts (SIL Open Font License; see /fonts). The family
   names must stay exactly 'Bodoni Moda' and 'Archivo': the 3D book draws its
   cover and pages with them too. */
@font-face {
  font-family: 'Bodoni Moda';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/bodoni-moda.v23.woff2') format('woff2');
}
@font-face {
  font-family: 'Bodoni Moda';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/bodoni-moda-italic.v23.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/archivo.v23.woff2') format('woff2');
}

:root {
  /* ground */
  --black:      #0b0908;
  --black-2:    #100d0c;
  --espresso:   #17110d;
  --espresso-2: #1f1712;

  /* paper + ink */
  --ivory:      #f4ece0;
  --ivory-dim:  #cdc2b2;
  --muted:      #9a8d7c;
  --faint:      #6b6053;

  /* accent */
  --gold:       #c9a05a;
  --gold-lit:   #e6c489;
  --gold-deep:  #8f6d38;

  --hair:       rgba(244, 236, 224, 0.10);
  --hair-soft:  rgba(244, 236, 224, 0.055);

  --display: 'Bodoni Moda', 'Didot', 'Times New Roman', serif;
  --ui: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1240px;
  --gut: clamp(1.25rem, 4.5vw, 4rem);

  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  /* One motion language. Things arrive on --ease (fast out, long settle),
     state changes use --ease-soft, and there are three speeds. */
  --t-quick: 0.3s;
  --t-move: 0.7s;
  --t-scene: 1.2s;

  /* How long the opening title card holds before the hero begins. Zero when
     the opening is skipped. */
  --intro: 1.5s;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
.intro-skip { --intro: 0s; }
/* Someone who scrolls, taps or presses a key during the title card gets the
   finished hero at once rather than waiting on the choreography. */
.intro-done .panel--hero { --intro: 0s; }

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--ivory);
  font-family: var(--ui);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, dl { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

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

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

.skip-link {
  position: fixed; left: 1rem; top: -60px; z-index: 999;
  background: var(--gold); color: #1a1206;
  padding: 0.7rem 1.1rem; border-radius: 2px; font-weight: 600;
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 1px solid var(--gold-lit);
  outline-offset: 4px;
}

/* ---------- atmosphere: fine film grain over everything ---------- */
.grain {
  /* Was inset:-50% (4x viewport area) with mix-blend-mode:overlay, which made
     the compositor re-blend the whole page on every frame and was the main
     source of scroll stutter. Plain low-opacity overlay looks near-identical. */
  position: fixed; inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0.16;
  will-change: transform;
  transform: translateZ(0);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  animation: grainShift 8s steps(4) infinite;
}
@keyframes grainShift {
  0%   { transform: translate3d(0, 0, 0); }
  25%  { transform: translate3d(-6px, 4px, 0); }
  50%  { transform: translate3d(5px, -5px, 0); }
  75%  { transform: translate3d(-4px, -3px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* =========================================================================
   Typography primitives
   ========================================================================= */

.display {
  text-wrap: balance;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-size: clamp(2.1rem, 1.3rem + 3.4vw, 4.4rem);
}

.eyebrow {
  font-family: var(--ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
}

/* =========================================================================
   Buttons
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.4s var(--ease-soft),
              border-color 0.4s var(--ease-soft),
              color 0.4s var(--ease-soft),
              transform 0.5s var(--ease);
  will-change: transform;
}

.btn--gold {
  background: linear-gradient(178deg, var(--gold-lit), var(--gold) 62%, var(--gold-deep));
  color: #1c1305;
  box-shadow: 0 18px 44px -22px rgba(201, 160, 90, 0.85),
              inset 0 1px 0 rgba(255, 245, 220, 0.55);
}
.btn--gold:hover { filter: brightness(1.06); }

.btn--ghost {
  border-color: rgba(244, 236, 224, 0.24);
  color: var(--ivory);
  padding: 0.7rem 1.4rem;
  font-size: 0.82rem;
  background: rgba(244, 236, 224, 0.04);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-lit); }

.btn--quiet {
  color: var(--ivory-dim);
  padding-inline: 0.4rem;
  border-bottom: 1px solid transparent;
  border-radius: 0;
}
.btn--quiet:hover { color: var(--ivory); border-bottom-color: var(--gold); }

/* =========================================================================
   Opening title card
   -------------------------------------------------------------------------
   Pure CSS and time-based: it never waits on the network or on WebGL, so it
   cannot hold the page hostage. JS only adds .intro-done to cut it short.
   ========================================================================= */

.curtain {
  position: fixed; inset: 0; z-index: 950;
  background: var(--black);
  display: grid; place-items: center;
  pointer-events: none;
  /* The wordmark leaves first, then the dark lifts. The two never overlap the
     headline: it only starts rising once the card is fully transparent. */
  animation: curtainOut 0.7s var(--ease-soft) 0.95s both;
}
.curtain__inner {
  display: grid; gap: 1.3rem; justify-items: center;
  animation: markOut 0.4s var(--ease-soft) 0.72s both;
}
@keyframes markOut { to { opacity: 0; transform: translateY(-6px); } }
.curtain__mark {
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--ivory);
  animation: markIn 0.9s var(--ease) 0.05s both;
}
.curtain__rule {
  display: block;
  width: 150px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold-lit) 50%, var(--gold) 70%, transparent);
  transform-origin: center;
  animation: ruleIn 0.9s var(--ease) 0.15s both;
}
@keyframes curtainOut { to { opacity: 0; visibility: hidden; } }
@keyframes markIn {
  from { opacity: 0; letter-spacing: 0.9em; text-indent: 0.9em; }
  to   { opacity: 0.94; letter-spacing: 0.5em; text-indent: 0.5em; }
}
@keyframes ruleIn { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

.intro-skip .curtain { display: none; }
.intro-done .curtain { animation: none; opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease-soft), visibility 0.35s; }

/* The book comes up out of the dark once it exists. The 3D scene raises its
   own lights at the same moment, so this is only a short safety fade. */
.stage__canvas { opacity: 0; transition: opacity 0.9s var(--ease-soft); }
body:not(.is-loading) .stage__canvas { opacity: 1; }

/* Hero copy: each headline line rises out of its own mask, then the rest
   follows. These run on their own clock, not on load events. */
.panel__title .line { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.panel__title .line > span {
  display: block;
  animation: lineUp 1.15s var(--ease) backwards;
  animation-delay: calc(var(--intro) + 0.10s);
}
.panel__title .line + .line > span { animation-delay: calc(var(--intro) + 0.24s); }
.panel--hero .panel__eyebrow { animation: fadeUp 0.9s var(--ease) backwards; animation-delay: var(--intro); }
.panel--hero .panel__body    { animation: fadeUp 1.0s var(--ease) backwards; animation-delay: calc(var(--intro) + 0.55s); }
.panel--hero .panel__actions { animation: fadeUp 1.0s var(--ease) backwards; animation-delay: calc(var(--intro) + 0.75s); }
.scroll-cue { animation: fadeIn 1.2s var(--ease-soft) backwards; animation-delay: calc(var(--intro) + 1.7s); }
.nav { animation: fadeIn 1.0s var(--ease-soft) backwards; animation-delay: calc(var(--intro) + 0.3s); }

@keyframes lineUp { from { transform: translateY(108%); } to { transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =========================================================================
   Nav
   ========================================================================= */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 800;
  transition: background-color 0.5s var(--ease-soft), border-color 0.5s;
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  /* backdrop-filter here forced the compositor to re-sample and blur the
     backdrop every frame while the WebGL canvas repainted underneath. Solid
     translucent fill looks the same on this palette and costs nothing. */
  background: rgba(11, 9, 8, 0.90);
  border-bottom-color: var(--hair-soft);
}

.nav__inner {
  width: min(100% - (var(--gut) * 2), var(--wrap));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-block: 1.1rem;
}

.nav__brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-right: auto;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}
.nav__icon { border-radius: 6px; }

.nav__links { display: flex; gap: 2.1rem; font-size: 0.85rem; color: var(--ivory-dim); }
.nav__links a { position: relative; padding-block: 0.2rem; transition: color 0.3s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.nav__links a:hover { color: var(--ivory); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav__toggle {
  display: none;
  width: 34px; height: 30px;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; justify-content: center; gap: 7px;
}
.nav__toggle span {
  display: block; height: 1px; background: var(--ivory);
  transition: transform 0.4s var(--ease), opacity 0.3s;
}
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

.nav__mobile {
  display: none;
  flex-direction: column;
  padding: 0 var(--gut) 1.5rem;
  background: rgba(11, 9, 8, 0.985);
  border-bottom: 1px solid var(--hair-soft);
}
.nav__mobile a {
  padding: 1rem 0;
  border-top: 1px solid var(--hair-soft);
  font-size: 1rem;
  color: var(--ivory-dim);
}
.nav__mobile-cta { color: var(--gold) !important; font-weight: 600; }
.nav__mobile.is-open { display: flex; }

/* =========================================================================
   THE EXPERIENCE — sticky 3D act
   ========================================================================= */

.experience {
  position: relative;
  height: 470vh;           /* the scroll runway for the whole book story */
}

.experience__stage {
  /* Fixed rather than sticky so the same canvas can be reused by the finale
     at the bottom of the page. Sections below have opaque backgrounds, so it
     is naturally covered except where a section opts out. */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  opacity: 1;
  /* opacity is written from scroll position; a CSS transition would only lag it */
  pointer-events: none;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(84, 58, 34, 0.42), transparent 68%),
    radial-gradient(ellipse 50% 40% at 78% 22%, rgba(201, 160, 90, 0.11), transparent 70%),
    var(--black);
}

.stage__canvas {
  position: absolute;
  inset: 0;
  transform: translateZ(0);
  width: 100%;
  height: 100%;
  display: block;
}

.stage__vignette {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(ellipse 78% 70% at 50% 50%, transparent 42%, rgba(6, 5, 4, 0.72) 100%);
}

.stage__fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 12vh 6vw;
}
/* A class selector outranks the UA's [hidden] rule, so state it explicitly. */
.stage__fallback[hidden] { display: none; }
.stage__fallback img {
  max-height: 62vh;
  width: auto;
  filter: drop-shadow(0 40px 70px rgba(0,0,0,0.7));
}

/* ---------------- copy panels ---------------- */

.panels {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* Chapter Two sits as a band under the macro shot, not beside the book. */
.panel.panel--band {
  left: 50%;
  bottom: 7vh;
  transform: translate(-50%, 26px);
  width: min(92vw, 660px);
  text-align: center;
  isolation: isolate;
}
.panel.panel--band.is-active { transform: translate(-50%, 0); }
.panel.panel--band .panel__body { margin-inline: auto; max-width: 46ch; }
.panel.panel--band::before {
  content: "";
  position: absolute;
  inset: -3.5rem -4.5rem;
  z-index: -1;
  background: radial-gradient(closest-side,
      rgba(8,6,5,0.94) 0%, rgba(8,6,5,0.84) 55%, rgba(8,6,5,0) 100%);
  pointer-events: none;
}

.finale__cta { margin-top: 2rem; pointer-events: auto; }

/* =========================================================================
   FINALE — the book returns and shuts
   ========================================================================= */
.finale {
  position: relative;
  z-index: 10;
  height: 210vh;
  background: transparent;          /* let the fixed book layer through */
}
/* The waitlist above is an opaque panel; this feathers its bottom edge into
   the book behind, so the hand-over reads as one continuous dark space. */
.finale::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 55vh;
  background: linear-gradient(180deg, var(--black-2) 0%, rgba(16, 13, 12, 0.86) 30%, rgba(16, 13, 12, 0) 100%);
  pointer-events: none;
}
.finale { --fin: 1; }
.finale__copy {
  position: relative; isolation: isolate;
  /* 0 -> 1 between 45% and 80% of the finale, i.e. as the cover comes down */
  --show: clamp(0, (var(--fin) - 0.45) * 2.86, 1);
  opacity: var(--show);
  transform: translate3d(0, calc((1 - var(--show)) * 22px), 0);
}
.finale:not(.is-shown) .finale__cta { pointer-events: none; }
.finale__copy::before {
  content: "";
  position: absolute;
  inset: -4rem -2rem -3.5rem;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(8, 6, 5, 0.9) 0%, rgba(8, 6, 5, 0.7) 55%, rgba(8, 6, 5, 0) 100%);
  pointer-events: none;
}
/* Once someone has joined, the closing button would ask them to do it again. */
.is-joined-site .finale__cta { visibility: hidden; }
.finale__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: end center;
  padding-bottom: clamp(3rem, 8vh, 6rem);
  pointer-events: none;
}
.finale__copy { text-align: center; }
.finale__title {
  font-size: clamp(2.2rem, 1.4rem + 3.4vw, 4.2rem);
  text-shadow: 0 18px 50px rgba(0,0,0,0.8);
}
.finale__sub {
  margin-top: 1.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}
@media (max-width: 820px) {
  .panel.panel--band { bottom: 6vh; }
  .finale { height: 180vh; }
}

.panel {
  position: absolute;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease-soft), transform 1.1s var(--ease);
  pointer-events: none;
  will-change: opacity, transform;
  backface-visibility: hidden;
}
.panel.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Short landscape screens: size the hero by height too, so headline, copy and
   buttons always end above the book. */
@media (min-aspect-ratio: 16/10) and (min-width: 821px) {
  .panel--hero .panel__title { font-size: min(clamp(2.5rem, 1.4rem + 4.6vw, 5.4rem), 10.4vh); }
  .panel--hero .panel__body { margin-top: min(1.5rem, 2.4vh); }
  .panel--hero .panel__actions { margin-top: min(2.9rem, 4.4vh); }
}

@media (max-height: 780px) and (min-width: 821px) {
  .panel--hero { top: max(9vh, 5.9rem); }
  .panel--hero .panel__eyebrow { margin-bottom: 1.1rem; }
  .panel--hero .panel__title { font-size: min(clamp(2.5rem, 1.4rem + 4.6vw, 5.4rem), 9.6vh); }
  .panel--hero .panel__actions { margin-top: 3.4vh; }
}

/* hero: centred, the book sits beneath it. Never closer to the top than the
   header's height plus breathing room. */
.panel--hero {
  left: 50%;
  top: max(11vh, 6.4rem);
  transform: translate(-50%, 26px);
  width: min(92vw, 780px);
  text-align: center;
}
.panel--hero.is-active { transform: translate(-50%, 0); }

/* While the hero is being scrubbed by scroll, opacity and offset are written
   every frame from JS, so the CSS transition would lag behind and read as
   stutter. */
.panel--hero.is-scrubbed { transition: none; }

.panel__eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.panel__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.4rem + 4.6vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
  text-shadow: 0 18px 50px rgba(0, 0, 0, 0.75);
}
.panel__title--sm {
  font-size: clamp(1.9rem, 1.2rem + 2.2vw, 3rem);
  line-height: 1.08;
}

.panel__body {
  margin-top: 1.5rem;
  font-size: clamp(0.98rem, 0.94rem + 0.25vw, 1.14rem);
  color: var(--ivory-dim);
  max-width: 44ch;
  margin-inline: auto;
  text-shadow: 0 6px 24px rgba(0,0,0,0.7);
}

.panel__actions {
  margin-top: 2.9rem;
  display: flex;
  gap: 1.4rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* Side panels can drift over an ivory page as the camera pushes in, so
   each one carries its own soft scrim to guarantee contrast. */
.panel--side::before {
  content: "";
  position: absolute;
  inset: -2.5rem -3rem;
  z-index: -1;
  /* closest-side: the gradient reaches zero exactly at the box edge, so
     the scrim never shows a rectangular outline over a bright page. */
  background: radial-gradient(closest-side,
      rgba(8, 6, 5, 0.96) 0%,
      rgba(8, 6, 5, 0.90) 52%,
      rgba(8, 6, 5, 0.55) 78%,
      rgba(8, 6, 5, 0) 100%);
  pointer-events: none;
}

/* side panels: keep the book visible in the middle of the frame */
.panel--side {
  isolation: isolate;
  top: 50%;
  width: min(38vw, 400px);
  transform: translateY(calc(-50% + 26px));
}
.panel--side.is-active { transform: translateY(-50%); }
.panel--side .panel__body { margin-inline: 0; max-width: 34ch; }
.panel--left { left: var(--gut); }
.panel--right { right: var(--gut); text-align: right; }
.panel--right .panel__body { margin-left: auto; }

/* ---------------- scroll cue ---------------- */

.scroll-cue {
  /* Bottom-left, in the same place "Skip the story" takes over once the
     book starts to open, so neither ever sits on top of the book. */
  position: absolute;
  left: calc(var(--gut) + var(--safe-l));
  bottom: calc(3.4vh + var(--safe-b));
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.55rem 0;
  transition: opacity 0.7s var(--ease-soft);
}
.scroll-cue.is-hidden { opacity: 0; }
.scroll-cue__line {
  width: 1px; height: 30px;
  background: linear-gradient(to bottom, transparent, var(--gold));
  position: relative;
  overflow: hidden;
}
.scroll-cue__line::after {
  content: "";
  position: absolute; left: 0; top: -60%;
  width: 100%; height: 60%;
  background: var(--gold-lit);
  animation: cueRun 2.4s var(--ease-soft) infinite;
}
@keyframes cueRun {
  0% { top: -60%; } 100% { top: 110%; }
}
.scroll-cue__label {
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

/* ---------------- chapter rail ---------------- */

.rail {
  position: absolute;
  right: calc(var(--gut) * 0.6);
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  opacity: 0;
  transition: opacity 0.6s var(--ease-soft);
}
.rail.is-visible { opacity: 1; }
.rail__track {
  display: block;
  width: 1px; height: 22vh;
  background: rgba(244, 236, 224, 0.14);
  position: relative;
}
.rail__track i {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 0%;
  background: var(--gold);
}
.rail { pointer-events: none; }
.rail.is-visible { pointer-events: auto; }
.rail__stop {
  position: absolute;
  right: -5px; top: var(--at);
  width: 11px; height: 11px;
  margin-top: -5px;
  padding: 0;
  border: 0; background: none;
  cursor: pointer;
}
/* a comfortable hit area around a small mark */
.rail__stop::before { content: ""; position: absolute; inset: -12px -10px -12px -64px; }
.rail__stop::after {
  content: "";
  position: absolute; left: 3px; top: 3px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--black);
  box-shadow: 0 0 0 1px rgba(244, 236, 224, 0.38);
  transition: background-color var(--t-quick) var(--ease-soft), box-shadow var(--t-quick) var(--ease-soft), transform var(--t-move) var(--ease);
}
.rail__stop.is-past::after { background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.rail__stop.is-current::after { background: var(--gold-lit); box-shadow: 0 0 0 1px var(--gold-lit), 0 0 14px rgba(230, 196, 137, 0.7); transform: scale(1.5); }
.rail__label {
  position: absolute; right: 22px; top: 50%;
  transform: translate(6px, -50%);
  font-size: 0.6rem; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ivory-dim);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--t-quick) var(--ease-soft), transform var(--t-move) var(--ease);
  pointer-events: none;
}
.rail__stop:hover .rail__label,
.rail__stop:focus-visible .rail__label,
.rail__stop.is-current .rail__label { opacity: 1; transform: translate(0, -50%); }
.rail__stop.is-current .rail__label { color: var(--gold-lit); }
.rail__stop:focus-visible { outline: none; }
.rail__stop:focus-visible::after { box-shadow: 0 0 0 1px var(--black), 0 0 0 3px var(--gold-lit); }

/* ---------------- skip the story ---------------- */
.stage__skip {
  position: absolute;
  left: calc(var(--gut) + var(--safe-l));
  bottom: calc(3.4vh + var(--safe-b));
  z-index: 7;
  pointer-events: auto;
  padding: 0.55rem 0;
  font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-move) var(--ease-soft), visibility var(--t-move), color var(--t-quick) var(--ease-soft);
}
.stage__skip span { display: inline-block; margin-left: 0.35em; transition: transform var(--t-move) var(--ease); }
.stage__skip.is-visible { opacity: 1; visibility: visible; }
.stage__skip:hover, .stage__skip:focus-visible { color: var(--gold-lit); }
.stage__skip:hover span { transform: translateY(3px); }
/* Keyboard users reach it from the very first Tab, wherever the story is. */
.stage__skip:focus-visible { opacity: 1; visibility: visible; }

/* =========================================================================
   NO-WEBGL FALLBACK
   The scroll act needs a live canvas to justify its runway, so without one
   the whole stage collapses into an ordinary stacked section: a still of
   the book, then the same copy, in order.
   ========================================================================= */

.no-webgl .experience { height: auto; }

.no-webgl .experience__stage {
  position: relative;
  height: auto;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  padding: calc(6rem + 8vh) 0 clamp(4rem, 9vw, 7rem);
}

.no-webgl .stage__canvas,
.no-webgl .stage__vignette,
.no-webgl .scroll-cue,
.no-webgl .rail { display: none; }

.no-webgl .stage__fallback {
  position: relative;
  inset: auto;
  order: 1;
  display: block;
  padding: 0 var(--gut);
}
.no-webgl .stage__fallback img {
  max-height: 54vh;
  width: auto;
  margin-inline: auto;
  /* the poster has its own shadow; fade its dark edges into the page */
  filter: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
}

.no-webgl .panels {
  position: relative;
  inset: auto;
  order: 2;
  pointer-events: auto;
  display: grid;
  gap: clamp(3.5rem, 8vw, 6rem);
  padding: clamp(3.5rem, 8vw, 6rem) var(--gut) 0;
}

.no-webgl .panel {
  position: relative;
  inset: auto;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  width: auto;
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
}
.no-webgl .panel--side::before { display: none; }
.no-webgl .panel--right { text-align: center; }
.no-webgl .panel--right .panel__body,
.no-webgl .panel--side .panel__body { margin-inline: auto; max-width: 44ch; }

/* =========================================================================
   INSIDE THE BOOK (features)
   ========================================================================= */

.inside {
  contain: layout paint;
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, var(--black) 0%, var(--espresso) 100%);
  padding-block: clamp(5rem, 11vw, 9rem);
  border-top: 1px solid var(--hair-soft);
}

.section-head { margin-bottom: clamp(3rem, 6vw, 5rem); }

.inside__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}
.inside__side { display: grid; gap: clamp(2rem, 4vw, 3rem); }

/* ---------------- the page studio ----------------
   One parchment page; three arrangements of the same five pieces. Every
   piece is absolutely placed from custom properties, so switching layout is
   a single attribute change and the browser tweens the rest. */
.studio { margin: 0; position: sticky; top: 6.5rem; }
.studio__page { width: 100%; }
.studio__page {
  --lift: 0;
  position: relative;
  aspect-ratio: 4 / 5;
  max-width: min(440px, (100svh - 15rem) * 0.8);
  margin-inline: auto;
  border-radius: 3px 10px 10px 3px;
  background:
    linear-gradient(90deg, rgba(60, 40, 22, 0.22) 0%, rgba(60, 40, 22, 0.06) 4%, transparent 11%),
    radial-gradient(ellipse 90% 70% at 60% 40%, #fbf5ea 0%, #f1e7d6 70%, #e6d9c3 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    6px 0 0 -2px #e9dfcd, 9px 2px 0 -3px #ddd1bc,
    0 50px 90px -40px rgba(0, 0, 0, 0.9),
    0 18px 40px -22px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  container-type: inline-size;
}
.studio__item {
  position: absolute;
  left: var(--x); top: var(--y); width: var(--w);
  margin: 0;
  transform: rotate(var(--r, 0deg));
  transition:
    left var(--t-scene) var(--ease), top var(--t-scene) var(--ease),
    width var(--t-scene) var(--ease), transform var(--t-scene) var(--ease),
    opacity var(--t-move) var(--ease-soft), box-shadow var(--t-move) var(--ease-soft),
    padding var(--t-scene) var(--ease), font-size var(--t-scene) var(--ease);
}
.studio__photo {
  padding: var(--mat, 0);
  background: #fffdf8;
  box-shadow: 0 10px 22px -12px rgba(40, 26, 12, 0.6), 0 1px 2px rgba(40, 26, 12, 0.25);
}
.studio__photo img { width: 100%; height: auto; aspect-ratio: var(--ar, 1); object-fit: cover; transition: aspect-ratio var(--t-scene) var(--ease); }
.studio__tape {
  position: absolute; left: 50%; top: -9px;
  width: 34%; height: 18px;
  transform: translateX(-50%) rotate(var(--tr, -3deg));
  background: repeating-linear-gradient(90deg, rgba(201, 160, 90, 0.62) 0 6px, rgba(230, 196, 137, 0.62) 6px 12px);
  box-shadow: 0 1px 2px rgba(40, 26, 12, 0.2);
  opacity: var(--tape, 1);
  transition: opacity var(--t-move) var(--ease-soft), box-shadow var(--t-move) var(--ease-soft);
}
.studio__tape--b { --tr: 4deg; background: repeating-linear-gradient(135deg, rgba(126, 148, 168, 0.55) 0 5px, rgba(244, 236, 224, 0.7) 5px 10px); }
.studio__title {
  font-family: var(--display);
  font-size: clamp(1.25rem, 7.2cqw, 2.3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: #2a1e14;
}
.studio__note {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(0.8rem, 3.5cqw, 1.08rem);
  line-height: 1.5;
  color: #4a3a2a;
}
.studio__date {
  font-size: clamp(0.5rem, 2.1cqw, 0.66rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8f6d38;
}
.studio__tab {
  position: absolute; right: 0; top: 13%;
  width: 16px; height: 46px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, var(--gold-lit), var(--gold));
  box-shadow: -2px 2px 5px rgba(40, 26, 12, 0.25);
  transition: transform var(--t-move) var(--ease), box-shadow var(--t-move) var(--ease-soft);
}

/* -- scrapbook: crooked, overlapping, taped -- */
.studio[data-layout="scrapbook"] .studio__photo--a { --x: 8%;  --y: 11%; --w: 56%; --r: -4deg; --mat: 2.2%; --ar: 1.03; }
.studio[data-layout="scrapbook"] .studio__photo--b { --x: 54%; --y: 31%; --w: 36%; --r: 5deg;  --mat: 2%;   --ar: 0.86; }
.studio[data-layout="scrapbook"] .studio__title    { --x: 10%; --y: 68%; --w: 50%; --r: -2deg; }
.studio[data-layout="scrapbook"] .studio__note     { --x: 10%; --y: 78%; --w: 66%; --r: -1deg; }
.studio[data-layout="scrapbook"] .studio__date     { --x: 46%; --y: 4.5%; --w: 46%; --r: 0deg; text-align: right; }

/* -- gallery: one framed picture, square to the page -- */
.studio[data-layout="gallery"] .studio__photo--a { --x: 12%; --y: 8%;  --w: 76%; --r: 0deg; --mat: 3.2%; --ar: 1.18; --tape: 0; box-shadow: 0 0 0 1px rgba(143, 109, 56, 0.55), 0 16px 30px -18px rgba(40, 26, 12, 0.7); }
.studio[data-layout="gallery"] .studio__photo--b { --x: 66%; --y: 64%; --w: 22%; --r: 0deg; --mat: 1.4%; --ar: 0.86; --tape: 0; }
.studio[data-layout="gallery"] .studio__title    { --x: 12%; --y: 63%; --w: 50%; }
.studio[data-layout="gallery"] .studio__note     { --x: 12%; --y: 72%; --w: 52%; }
.studio[data-layout="gallery"] .studio__date     { --x: 12%; --y: 94%; --w: 76%; text-align: left; }

/* -- letter: the words lead, the pictures are keepsakes -- */
.studio[data-layout="letter"] .studio__photo--a { --x: 62%; --y: 8%;  --w: 27%; --r: 3deg;  --mat: 1.6%; --ar: 0.86; }
.studio[data-layout="letter"] .studio__photo--b { --x: 50%; --y: 70%; --w: 34%; --r: -3deg; --mat: 1.6%; --ar: 1.2; --tape: 0; }
.studio[data-layout="letter"] .studio__title    { --x: 12%; --y: 12%; --w: 46%; }
.studio[data-layout="letter"] .studio__note     { --x: 12%; --y: 42%; --w: 74%; font-size: clamp(0.95rem, 4.5cqw, 1.38rem); }
.studio[data-layout="letter"] .studio__date     { --x: 12%; --y: 25%; --w: 46%; text-align: left; }

/* Hovering a ledger row (or tapping it) picks its pieces out on the page. */
.studio[data-hl] [data-part] { opacity: 0.32; }
.studio[data-hl="photo"]   [data-part="photo"],
.studio[data-hl="note"]    [data-part="note"],
.studio[data-hl="date"]    [data-part="date"],
.studio[data-hl="layout"]  [data-part="layout"],
.studio[data-hl="sticker"] [data-part="photo"] { opacity: 1; }
.studio[data-hl="sticker"] .studio__photo img { opacity: 0.4; }
.studio[data-hl="sticker"] .studio__tape { opacity: 1; box-shadow: 0 0 0 1px var(--gold-lit), 0 0 16px rgba(230, 196, 137, 0.8); }
.studio[data-hl="sticker"] .studio__photo { box-shadow: 0 0 0 2px var(--gold), 0 10px 22px -12px rgba(40, 26, 12, 0.6); }
.studio[data-hl="date"] .studio__tab { transform: translateX(-4px) scaleX(1.25); box-shadow: 0 0 18px rgba(230, 196, 137, 0.9); }
.studio__photo img { transition: opacity var(--t-move) var(--ease-soft), aspect-ratio var(--t-scene) var(--ease); }

.studio__bar { margin-top: 1.6rem; display: grid; gap: 0.9rem; justify-items: center; text-align: center; }
.studio__layouts {
  display: inline-flex; gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--hair);
  border-radius: 999px;
  transition: opacity var(--t-move) var(--ease-soft), border-color var(--t-move) var(--ease-soft);
}
.studio[data-hl="layout"] .studio__layouts { border-color: var(--gold); }
.studio__btn {
  padding: 0.6rem 1.15rem;
  min-height: 44px;
  border: 0; border-radius: 999px;
  background: transparent;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  transition: background-color var(--t-quick) var(--ease-soft), color var(--t-quick) var(--ease-soft);
}
.studio__btn:hover { color: var(--ivory); }
.studio__btn[aria-pressed="true"] { background: var(--ivory); color: #1c1305; }
.studio__hint { font-size: 0.78rem; color: var(--faint); max-width: 34ch; }

.ledger__row { cursor: default; }
.ledger__row.is-hl { background: rgba(201, 160, 90, 0.07); }
.ledger__row.is-hl dt { color: var(--gold-lit); }
.ledger dt { transition: color var(--t-quick) var(--ease-soft); }

.inside__lead p {
  font-family: var(--display);
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.5;
  color: var(--ivory-dim);
  font-style: italic;
}

/* an editorial ledger, not a grid of cards */
.ledger__row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 2rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--hair);
  align-items: baseline;
  transition: background-color 0.5s var(--ease-soft);
}
.ledger__row:last-child { border-bottom: 1px solid var(--hair); }
.ledger__row:hover { background: rgba(244, 236, 224, 0.022); }

.ledger dt {
  font-family: var(--display);
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.45rem);
  color: var(--ivory);
}
.ledger dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.pullquote {
  margin: clamp(4rem, 9vw, 7rem) 0 0;
  padding-top: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--hair);
  text-align: center;
}
.pullquote blockquote {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.6rem, 1rem + 2.6vw, 3.1rem);
  line-height: 1.24;
  color: var(--ivory);
}

/* =========================================================================
   ON THIS DAY — centred and quiet, deliberately not "book left, text right"
   ========================================================================= */

.onthisday {
  position: relative;
  z-index: 10;
  contain: layout paint;
  background: var(--espresso);
  padding-block: clamp(6rem, 12vw, 9.5rem);
  border-top: 1px solid var(--hair-soft);
  text-align: center;
}
.onthisday__inner { max-width: 60ch; margin-inline: auto; }
.onthisday__title { margin-inline: auto; margin-bottom: 1.8rem; }
.onthisday__body {
  color: var(--ivory-dim);
  font-size: clamp(1rem, 0.96rem + 0.3vw, 1.12rem);
  max-width: 52ch; margin-inline: auto;
}
/* Wide screens: words and the returning page side by side, so the whole
   section fits one screen and nothing has to pass under the header while
   the year goes by. */
@media (min-width: 1000px) {
  .onthisday { text-align: left; }
  .onthisday__inner {
    max-width: var(--wrap);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(3rem, 7vw, 7rem);
    align-items: center;
  }
  .onthisday__title, .onthisday__body { margin-inline: 0; }
  .onthisday__title { font-size: clamp(2.3rem, 1rem + 2.7vw, 3.8rem); text-wrap: balance; }
  .onthisday__title br { display: none; }
  .otd { margin-top: 0; text-align: center; }
}
.onthisday__mark {
  margin-top: 1.8rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  opacity: calc(0.25 + 0.75 * var(--back, 1));
}

/* A year going by. --t (0..1) is written from scroll; --away peaks mid-year,
   --back is the last stretch when the page returns. Without JS all three
   keep their defaults and the page simply sits there, returned. */
.otd { --t: 1; --away: 0; --back: 1; margin-top: clamp(3rem, 6vw, 4.5rem); min-width: 0; }
.otd__months {
  position: relative;
  height: 2.2rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 32%, #000 68%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 32%, #000 68%, transparent);
}
.otd__months::after {
  content: ""; position: absolute; left: 50%; bottom: 0;
  width: 1px; height: 0.55rem; background: var(--gold);
}
.otd__strip {
  position: absolute; left: 50%; top: 0;
  display: flex;
  /* 13 labels, 5.5rem apart; slide from the first to the last */
  transform: translate3d(calc(-2.75rem - var(--t) * 66rem), 0, 0);
  will-change: transform;
}
.otd__strip span {
  flex: 0 0 5.5rem;
  text-align: center;
  font-size: 0.64rem; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted);
}
.otd__strip span:first-child, .otd__strip span:last-child { color: var(--gold-lit); }
.otd__card {
  position: relative;
  width: min(54vw, 250px, 30vh);
  margin: 1.6rem auto 0;
  padding: 10px 10px 44px;
  background: #f6efe3;
  border-radius: 2px;
  box-shadow: 0 calc(26px + 30px * var(--back)) calc(50px + 30px * var(--back)) -30px rgba(0, 0, 0, 0.9),
              0 0 calc(60px * var(--back)) -10px rgba(201, 160, 90, calc(0.45 * var(--back)));
  transform: translate3d(0, calc(var(--away) * 14px), 0) scale(calc(1 - var(--away) * 0.09)) rotate(calc(-2deg + var(--away) * 2deg));
  opacity: calc(1 - var(--away) * 0.72);
  will-change: transform, opacity;
}
.otd__card img { width: 100%; aspect-ratio: 0.92; object-fit: cover; filter: saturate(calc(1 - var(--away) * 0.85)); }
.otd__date {
  position: absolute; left: 0; right: 0; bottom: 14px;
  text-align: center;
  font-family: var(--display); font-style: italic;
  font-size: 0.86rem; color: #4a3a2a;
}

/* =========================================================================
   BUILT TO KEEP — two plain columns, no headline/paragraph repeat
   ========================================================================= */

.keep {
  position: relative;
  z-index: 10;
  contain: layout paint;
  background: linear-gradient(180deg, var(--espresso) 0%, var(--black-2) 100%);
  padding-block: clamp(5rem, 11vw, 9rem);
  border-top: 1px solid var(--hair-soft);
}
.keep__title { margin-bottom: clamp(2.5rem, 5vw, 4rem); max-width: 22ch; }
.keep__cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  border-top: 1px solid var(--hair);
  padding-top: 2.2rem;
}
.keep__cols p { color: var(--muted); font-size: 0.98rem; max-width: 42ch; }
@media (max-width: 820px) { .keep__cols { grid-template-columns: 1fr; } }

/* =========================================================================
   PRIVACY
   ========================================================================= */

.privacy {
  contain: layout paint;
  position: relative;
  z-index: 10;
  background: var(--espresso);
  padding-block: clamp(5rem, 11vw, 9rem);
  border-top: 1px solid var(--hair-soft);
  overflow: hidden;
}
.privacy::before {
  content: "";
  position: absolute;
  left: 50%; top: -30%;
  width: 120vw; height: 80vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 40% 50% at 50% 50%, rgba(201, 160, 90, 0.10), transparent 70%);
  pointer-events: none;
}

.privacy__inner { position: relative; max-width: 74ch; }
.privacy__title { margin-bottom: 1.8rem; }
.privacy__body {
  color: var(--ivory-dim);
  font-size: clamp(1rem, 0.96rem + 0.3vw, 1.15rem);
  max-width: 60ch;
}

.tenets {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.tenets li {
  padding: 1.8rem 1.8rem 1.8rem 0;
  border-top: 1px solid var(--gold-deep);
  padding-right: 2rem;
}
.tenets span {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ivory);
  margin-bottom: 0.5rem;
}
.tenets p { color: var(--muted); font-size: 0.92rem; }

/* =========================================================================
   LAUNCH
   ========================================================================= */

.launch {
  contain: layout paint;
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, var(--espresso) 0%, var(--black-2) 100%);
  padding-block: clamp(5rem, 11vw, 9rem);
  text-align: center;
  border-top: 1px solid var(--hair-soft);
}
.launch__inner { max-width: 780px; margin-inline: auto; }
.launch__title { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 4rem); }
.launch__title { margin-bottom: 1.5rem; }
.launch__body { color: var(--ivory-dim); max-width: 46ch; margin-inline: auto; }

.notify {
  margin-top: 2.6rem;
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
}
.notify input {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.95rem 1.4rem;
  min-width: 270px;
  border-radius: 999px;
  border: 1px solid rgba(244, 236, 224, 0.2);
  background: rgba(244, 236, 224, 0.04);
  color: var(--ivory);
  transition: border-color 0.35s var(--ease-soft);
}
.notify input::placeholder { color: var(--faint); }
.notify input:focus { border-color: var(--gold); outline: none; }

/* Honeypot. Off-screen rather than display:none so bots still fill it. */
.notify__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.notify button[disabled] {
  opacity: 0.62;
  cursor: progress;
  filter: none;
}
.notify input[disabled] { opacity: 0.62; }

.notify__note {
  margin-top: 1.2rem;
  font-size: 0.8rem;
  color: var(--faint);
  transition: color 0.4s;
}
.notify__note.is-ok { color: var(--gold-lit); }
.notify__note.is-err { color: #d99a7a; }

/* Status messages sit under the permanent consent line. Height is reserved so
   the page does not jump when a message appears. */
.notify__status { margin-top: 0.5rem; min-height: 1.5em; }
.notify input[aria-invalid="true"] { border-color: #d99a7a; }
.notify input:focus-visible { outline: 1px solid var(--gold-lit); outline-offset: 3px; }
.btn.is-busy { position: relative; }
.btn.is-busy::after {
  content: ""; display: inline-block;
  width: 0.8em; height: 0.8em; margin-left: 0.6em;
  border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- you're on the list ----------------
   Shown only after the server confirms. A small book opens and its ribbon
   settles; the words follow. */
.launch.is-joined .notify,
.launch.is-joined #notifyConsent { display: none; }
.launch.is-joined .notify__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.joined { margin-top: 2.6rem; }
.joined[hidden] { display: none; }
.joined__book {
  position: relative;
  width: 74px; height: 96px;
  margin: 0 auto 2rem;
  perspective: 620px;
}
.joined__block {
  position: absolute; inset: 3px 3px 3px 5px;
  border-radius: 1px 3px 3px 1px;
  background: linear-gradient(90deg, #d9ccb4 0, #f6efe3 14%, #f1e7d6 100%);
  box-shadow: 0 22px 34px -18px rgba(0, 0, 0, 0.9);
}
.joined__cover {
  position: absolute; inset: 0;
  border-radius: 2px 5px 5px 2px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0, transparent 12%),
    linear-gradient(160deg, #7a5233, #4d321f);
  transform-origin: left center;
  box-shadow: inset 0 0 0 1px rgba(230, 196, 137, 0.18);
  animation: joinedOpen 1.5s var(--ease) 0.15s both;
}
.joined__cover::after {
  content: ""; position: absolute; left: 22%; right: 16%; top: 22%; height: 34%;
  background: #f1e7d6; border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(143, 109, 56, 0.6);
}
.joined__ribbon {
  position: absolute; left: 58%; top: 2px;
  width: 7px; height: 118px;
  background: linear-gradient(180deg, var(--gold-lit), var(--gold) 60%, var(--gold-deep));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 6px), 0 100%);
  transform-origin: top center;
  animation: joinedRibbon 1.3s var(--ease) 0.75s backwards;
}
@keyframes joinedOpen { from { transform: rotateY(0deg); } to { transform: rotateY(-152deg); } }
@keyframes joinedRibbon { from { transform: scaleY(0); opacity: 0; } 60% { opacity: 1; } to { transform: scaleY(1); opacity: 1; } }
.joined__title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  line-height: 1.1;
  color: var(--ivory);
  animation: fadeUp 1s var(--ease) 0.9s backwards;
}
.joined__title:focus { outline: none; }
.joined__body {
  margin-top: 0.9rem;
  color: var(--gold-lit);
  animation: fadeUp 1s var(--ease) 1.25s backwards;
}

/* =========================================================================
   CONTACT
   ========================================================================= */

.contact {
  contain: layout paint;
  position: relative;
  z-index: 10;
  background: var(--black-2);
  padding-block: clamp(5rem, 10vw, 8rem);
  border-top: 1px solid var(--hair-soft);
}
.contact__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.contact__title { margin-bottom: 1.2rem; }
.contact__body { color: var(--muted); max-width: 40ch; }

.contact__email {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--display);
  font-size: clamp(1.3rem, 1rem + 1.5vw, 2.2rem);
  color: var(--gold-lit);
  border-bottom: 1px solid rgba(201, 160, 90, 0.35);
  padding-bottom: 0.25rem;
  transition: color 0.35s, border-color 0.35s;
}
.contact__email:hover { color: var(--gold); border-color: var(--gold); }

.contact__card {
  border-left: 1px solid var(--hair);
  padding-left: clamp(1.5rem, 3vw, 2.5rem);
}
.contact__card h3 {
  font-family: var(--display);
  font-size: 1.3rem;
  margin-bottom: 0.9rem;
}
.contact__card p { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.6rem; }
.contact__card a { color: var(--ivory-dim); border-bottom: 1px solid var(--hair); }
.contact__card a:hover { color: var(--gold-lit); }

/* =========================================================================
   FOOTER
   ========================================================================= */

.footer {
  position: relative;
  z-index: 10;
  background: var(--black);
  border-top: 1px solid var(--hair-soft);
  padding-top: clamp(3rem, 6vw, 4rem);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: 2.5rem;
}
.footer__brand {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-family: var(--display); font-size: 1.35rem;
}
.footer__brand img { border-radius: 7px; }
.footer__nav { display: flex; gap: 1.8rem; flex-wrap: wrap; font-size: 0.86rem; color: var(--muted); }
.footer__nav a:hover { color: var(--ivory); }

.footer__base {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.4rem;
  border-top: 1px solid var(--hair-soft);
  font-size: 0.78rem;
  color: var(--faint);
}

/* =========================================================================
   Reveal on scroll
   ========================================================================= */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1s var(--ease-soft), transform 1.2s var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 1000px) {
  .inside__grid { grid-template-columns: 1fr; }
  .studio { position: relative; top: auto; }
  .studio__page { max-width: 400px; }
  .contact__grid { grid-template-columns: 1fr; }
  .contact__card { border-left: 0; border-top: 1px solid var(--hair); padding-left: 0; padding-top: 1.8rem; }
  .tenets { grid-template-columns: 1fr; }
  .tenets li { padding-right: 0; }
}

@media (max-width: 820px) {
  .nav__links { display: none; }
  /* The waitlist stays one tap away on a phone, at every scroll position. */
  .nav__cta { padding: 0.55rem 1.05rem; font-size: 0.78rem; min-height: 40px; }
  .nav__inner { gap: 0.9rem; padding-left: var(--safe-l); padding-right: var(--safe-r); }
  .nav__toggle { display: flex; width: 40px; height: 40px; }
  .stage__skip, .scroll-cue { bottom: calc(1.6vh + var(--safe-b)); }
  .nav.is-stuck { background: rgba(11, 9, 8, 0.88); }

  /* On phones the book owns the upper frame and copy sits beneath it,
     so nothing ever overlaps the 3D. */
  .experience { height: 400vh; }

  .panel--hero { top: max(11vh, 6rem); width: min(92vw, 560px); }
  .panel--hero .panel__title { text-wrap: balance; }

  .panel--side {
    top: auto;
    bottom: 9vh;
    left: var(--gut);
    right: var(--gut);
    width: auto;
    text-align: left;
    transform: translateY(26px);
  }
  .panel--side.is-active { transform: translateY(0); }
  .panel--right { text-align: left; }
  .panel--right .panel__body { margin-left: 0; }
  .panel--side .panel__body { max-width: none; }

  .rail { display: none; }
  .ledger__row { grid-template-columns: 1fr; gap: 0.4rem; }
}

@media (max-width: 520px) {
  /* Forced breaks written for wide screens; let balance decide here. */
  .keep__title br, .privacy__title br { display: none; }
  /* Exactly two lines: "Keep what mattered." / "Make it a book." */
  .panel--hero .panel__title { font-size: clamp(1.9rem, 9.3vw, 2.6rem); letter-spacing: -0.026em; }
  .panel--hero .panel__body { font-size: 0.98rem; max-width: 34ch; }
  .notify { flex-direction: column; align-items: stretch; }
  .notify input { min-width: 0; }
  .panel__actions { gap: 1rem; }
  .footer__base { flex-direction: column; gap: 0.4rem; }
}

/* Short landscape phones: pull the hero copy up so it clears the book */
@media (max-height: 560px) and (orientation: landscape) {
  .panel--hero { top: 4.4rem; }
  .nav__inner { padding-block: 0.55rem; }
  .panel--hero .panel__body { display: none; }
  .panel__actions { margin-top: 1.2rem; }
  .panel__eyebrow { margin-bottom: 0.7rem; }
  .panel__title { font-size: clamp(1.6rem, 4vw, 2.4rem); }
  .panel--side { left: calc(var(--gut) + var(--safe-l)); right: calc(var(--gut) + var(--safe-r)); }
  .panel--side .panel__body { font-size: 0.88rem; }
  .panel__title--sm { font-size: 1.35rem; }
  .panel--side { bottom: 5vh; }
  .scroll-cue { display: none; }
}

/* =========================================================================
   Reduced motion — hold the book in a composed open state, drop the drift
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain { animation: none; }
  .scroll-cue__line::after { animation: none; }
  .curtain { display: none; }
  .finale__copy { transform: none; }
  .curtain__inner { animation: none; }
  .panel__title .line > span, .panel--hero > *, .scroll-cue, .nav,
  .joined__cover, .joined__ribbon, .joined__title, .joined__body { animation: none; }
  .joined__cover { transform: rotateY(-152deg); }
  .stage__canvas { transition: none; }
  .studio__item, .studio__photo img, .studio__tape { transition-duration: 0.01ms; }
  .btn.is-busy::after { animation-duration: 2.4s; }
  .panel {
    transition-duration: 0.01ms;
  }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* Notched phones: keep the bottom-anchored copy clear of the home indicator. */
@media (max-width: 820px) {
  .panel--side { bottom: calc(9vh + var(--safe-b)); }
  .panel.panel--band { bottom: calc(6vh + var(--safe-b)); }
  .footer__base { padding-bottom: calc(1.4rem + var(--safe-b)); }
}

/* Touch targets */
@media (pointer: coarse) {
  .footer__nav a, .nav__mobile a { min-height: 44px; display: inline-flex; align-items: center; }
  .btn--quiet { min-height: 44px; }
}

/* Short phones (iPhone SE, mini): tighten the hero stack so the buttons
   always finish above the book. */
@media (max-width: 520px) and (max-height: 720px) {
  .panel--hero { top: max(8vh, 5.2rem); }
  .panel--hero .panel__eyebrow { margin-bottom: 0.9rem; }
  .panel--hero .panel__body { margin-top: 0.9rem; font-size: 0.92rem; }
  .panel--hero .panel__actions { margin-top: 1.3rem; }
}
