/* ============================================================
   Wonderland — scroll-driven 3D world
   ============================================================ */

:root {
  --ink:    #0a1224;   /* midnight blue — surface & verdict      */
  --earth:  #160e07;   /* rabbit-hole umber                       */
  --teal:   #0d2126;   /* hall of doors                           */
  --amber:  #1d1409;   /* tea-party lamplight                     */
  --plum:   #200d16;   /* queen's garden dusk                     */
  --cream:  #f2e9d8;
  --gold:   #d9a441;
  --rose:   #c22f43;

  --font-display: "IM Fell English", serif;
  --font-caps:    "IM Fell English SC", serif;
  --font-body:    "Cormorant Garamond", serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1.25rem;
  line-height: 1.55;
  overflow-x: hidden;
}

/* ---------- fixed WebGL canvas ---------- */

#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ---------- progress bar ---------- */

.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 40;
  background: rgba(242, 233, 216, 0.08);
}
.progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--rose));
}

/* ---------- chapter nav ---------- */

.chapter-nav {
  position: fixed;
  right: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.chapter-nav a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--cream);
}
.chapter-nav i {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: transparent;
  transition: background 0.3s, transform 0.3s;
  flex: none;
}
.chapter-nav em {
  font-family: var(--font-caps);
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
}
.chapter-nav a:hover em,
.chapter-nav a.active em { opacity: 0.9; transform: none; }
.chapter-nav a.active i { background: var(--gold); transform: scale(1.35); }

@media (max-width: 900px) { .chapter-nav { display: none; } }

/* ---------- chapters ---------- */

main { position: relative; z-index: 10; }

.chapter { position: relative; }
.chapter--hero    { min-height: 100vh; min-height: 100dvh; }
.chapter--fall    { min-height: 220vh; }
.chapter--doors   { min-height: 160vh; }
.chapter--tea     { min-height: 160vh; }
.chapter--roses   { min-height: 160vh; }
.chapter--verdict { min-height: 200vh; }

.copy-wrap {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  padding: 0 clamp(1.4rem, 6vw, 6rem);
}

.copy {
  max-width: 34rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.9);
}
.copy--left   { margin-right: auto; }
.copy--right  { margin-left: auto; text-align: right; }
.copy--center { margin: 0 auto; text-align: center; max-width: 44rem; }

/* reveal */
.copy > * {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.copy > *:nth-child(2) { transition-delay: 0.12s; }
.copy > *:nth-child(3) { transition-delay: 0.24s; }
.copy > *:nth-child(4) { transition-delay: 0.36s; }
.is-inview .copy > * { opacity: 1; transform: none; }

/* type */
.kicker {
  font-family: var(--font-caps);
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  letter-spacing: 0.32em;
  color: var(--gold);
  margin-bottom: 1rem;
}
.brand {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.4rem, 13vw, 9.5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin-bottom: 1.4rem;
}
.copy h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.08;
  margin-bottom: 1.1rem;
}
.lede {
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  opacity: 0.92;
}
.lede em { color: var(--gold); font-style: italic; }

.cta-row { margin-top: 2.2rem; }
.cta {
  display: inline-block;
  font-family: var(--font-caps);
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  color: var(--cream);
  text-decoration: none;
  border: 1px solid var(--gold);
  padding: 0.85rem 2rem;
  transition: background 0.3s, color 0.3s;
}
.cta:hover { background: var(--gold); color: var(--ink); }

/* ---------- no-WebGL fallback ---------- */

body.no-webgl #world { display: none; }
body.no-webgl .chapter--hero    { background: radial-gradient(ellipse at 50% 110%, #23345c 0%, var(--ink) 62%); }
body.no-webgl .chapter--fall    { background: radial-gradient(ellipse at 50% 50%, #33220f 0%, var(--earth) 70%); }
body.no-webgl .chapter--doors   { background: radial-gradient(ellipse at 50% 60%, #1c4048 0%, var(--teal) 70%); }
body.no-webgl .chapter--tea     { background: radial-gradient(ellipse at 50% 40%, #453214 0%, var(--amber) 70%); }
body.no-webgl .chapter--roses   { background: radial-gradient(ellipse at 50% 60%, #4a1c2e 0%, var(--plum) 70%); }
body.no-webgl .chapter--verdict { background: radial-gradient(ellipse at 50% 0%, #23345c 0%, var(--ink) 62%); }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .copy > * { transition: none; opacity: 1; transform: none; }
}
