/* ───────────────────────────────────────────────────────────
   Jesus NYE — Cinematic Scrollytelling
   ─────────────────────────────────────────────────────────── */

:root {
  --bg:           #04060c;
  --ink:          #f5f0e1;
  --ink-dim:      rgba(245,240,225,0.62);
  --gold:         #f6c66a;
  --gold-bright:  #ffd58a;
  --gold-soft:    #b88a3c;
  --royal:        #6da6ff;
  --vapor:        rgba(255,255,255,0.08);
  --serif:        "Cormorant Garamond", "EB Garamond", Georgia, "Times New Roman", serif;
  --sans:         "Inter", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --eyebrow:      0.62rem;
  --pad:          clamp(20px, 4vw, 56px);
}

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500;600&family=Inter:wght@300;400;500;600&display=swap');

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ── WebGL stage ────────────────────────────────────────── */
#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
  background:
    radial-gradient(120% 80% at 50% 40%, #0a1124 0%, #04060c 60%, #02030a 100%);
}

/* ── Loader ─────────────────────────────────────────────── */
#loader {
  position: fixed; inset: 0;
  z-index: 100;
  background: #03040a;
  display: grid; place-items: center;
  transition: opacity 1.1s ease 0.2s, visibility 0s linear 1.4s;
}
#loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { width: min(420px, 76vw); text-align: center; }
.loader-mark {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.28em;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 22px;
}
.loader-bar {
  height: 1px;
  background: rgba(255,255,255,0.10);
  overflow: hidden;
  position: relative;
}
.loader-fill {
  position: absolute; inset: 0 100% 0 0;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  transition: right 0.35s ease;
}
.loader-sub {
  margin-top: 18px;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

/* ── Top bar / nav ──────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  padding: 22px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  mix-blend-mode: screen;
}
.topbar > * { pointer-events: auto; }
.brand {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.28em;
  font-size: 0.95rem;
  color: var(--ink);
}
.brand span { color: var(--gold); margin: 0 6px; }
.topnav { display: flex; align-items: center; gap: 26px; }
.topnav a {
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.3s ease;
}
.topnav a:hover { color: var(--ink); }
.cta-pill {
  padding: 9px 18px;
  border: 1px solid rgba(246,198,106,0.5);
  border-radius: 999px;
  color: var(--gold-bright) !important;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.cta-pill:hover {
  background: rgba(246,198,106,0.12);
  border-color: var(--gold-bright);
}

/* ── Scroll cue (hero only) ─────────────────────────────── */
.scroll-cue {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-cue.hide { opacity: 0; transform: translateX(-50%) translateY(20px); }
.cue-line {
  width: 1px; height: 42px;
  background: linear-gradient(180deg, rgba(246,198,106,0.6), transparent);
  margin: 12px auto 0;
  animation: cuePulse 2.4s ease-in-out infinite;
}
@keyframes cuePulse {
  0%, 100% { transform: scaleY(0.4); opacity: 0.4; transform-origin: top; }
  50%      { transform: scaleY(1);   opacity: 1;   transform-origin: top; }
}

/* ── Chapters indicator (right rail) ────────────────────── */
.chapters {
  position: fixed;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  z-index: 20;
}
.chapters ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 16px;
}
.chapters li {
  display: flex; align-items: center; gap: 14px;
  justify-content: flex-end;
}
.chapters li span {
  width: 22px; height: 1px;
  background: rgba(255,255,255,0.25);
  transition: width 0.5s ease, background 0.5s ease;
}
.chapters li em {
  font-style: normal;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  /* fade out fast, fade in slow + delayed → only ever one label visible */
  transition: opacity 0.12s ease;
  opacity: 0;
}
.chapters li.active span {
  width: 42px;
  background: var(--gold-bright);
}
.chapters li.active em {
  opacity: 1;
  transition: opacity 0.32s ease 0.14s;
}
@media (max-width: 760px) { .chapters { display: none; } }

/* ── Scrollytelling sections ────────────────────────────── */
#scroller {
  position: relative;
  z-index: 10;
}
.scene {
  position: relative;
  min-height: 100vh;
  padding: var(--pad);
  display: flex;
  pointer-events: none;
}
.scene-copy {
  pointer-events: auto;
  max-width: 640px;
  opacity: 0;                      /* driven per-frame by main.js */
  transition: opacity 0.18s linear;
  will-change: opacity, transform;
}

.align-bottom-left   { margin: auto auto 12vh 0; }
.align-bottom-center { margin: auto auto 14vh auto; text-align: center; }
.align-center        { margin: auto; text-align: center; }
.align-top-left      { margin: 14vh auto auto 0; }
.align-top-right     { margin: 14vh 0 auto auto; text-align: right; }

.eyebrow {
  font-family: var(--sans);
  font-size: var(--eyebrow);
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 18px;
}
.eyebrow.gold { color: var(--gold-bright); }

.scene-copy h1,
.scene-copy h2,
.finale h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.005em;
  margin: 0 0 22px;
  color: var(--ink);
  text-wrap: balance;
}
.scene-copy h1 { font-size: clamp(2.4rem, 6vw, 5.4rem); }
.scene-copy h2 { font-size: clamp(2rem, 4.6vw, 4rem); }
.scene-copy h1.display, .finale .display { font-size: clamp(2.8rem, 7vw, 6.4rem); }

.lede {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.5vw, 1.5rem);
  line-height: 1.45;
  color: var(--ink-dim);
  margin: 0;
  font-weight: 300;
  text-wrap: balance;
}

/* ── Finale / CTA ───────────────────────────────────────── */
.finale {
  position: relative;
  min-height: 100vh;
  padding: 14vh var(--pad) 8vh;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(246,198,106,0.10) 0%, transparent 60%),
    linear-gradient(180deg, rgba(4,6,12,0) 0%, rgba(4,6,12,0.6) 30%, #04060c 70%);
}
.finale-inner {
  max-width: 1180px;
  margin: 0 auto;
}
.finale .lede { max-width: 720px; }

.cta-grid {
  margin: 64px 0 80px;
  display: grid;
  /* Wide view → 3 across × 2 rows  (3·3) */
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
/* Medium → 2 across × 3 rows  (2·2·2) */
@media (max-width: 980px) {
  .cta-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Skinny → single column × 6 rows */
@media (max-width: 600px) {
  .cta-grid { grid-template-columns: 1fr; }
}
.cta-card {
  position: relative;
  padding: 28px 26px 26px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1),
              border-color 0.4s ease,
              background 0.4s ease;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 220px;
  overflow: hidden;
}
.cta-card::after {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 18px;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 80% 0%, rgba(246,198,106,0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.cta-card:hover {
  transform: translateY(-4px);
  border-color: rgba(246,198,106,0.4);
  background: linear-gradient(180deg, rgba(246,198,106,0.06), rgba(255,255,255,0.00));
}
.cta-card:hover::after { opacity: 1; }
.cta-num {
  font-family: var(--serif);
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: var(--gold);
}
.cta-title {
  font-family: var(--serif);
  font-size: 1.75rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.cta-sub {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink-dim);
  line-height: 1.45;
  margin-top: 4px;
  flex: 1;
}
.cta-arrow {
  align-self: flex-end;
  font-size: 1.4rem;
  color: var(--gold);
  transition: transform 0.4s ease;
}
.cta-card:hover .cta-arrow { transform: translateX(6px); }

/* Legacy / Part 1 callout */
.legacy {
  margin: 40px 0 50px;
  padding: 36px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(109,166,255,0.10), transparent 50%);
  display: grid;
  gap: 12px;
}
.legacy h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  margin: 0;
}
.ghost-btn {
  align-self: start;
  margin-top: 14px;
  padding: 14px 22px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  transition: border-color 0.3s ease, background 0.3s ease;
  display: inline-flex; align-items: center; gap: 10px;
}
.ghost-btn:hover {
  border-color: var(--gold-bright);
  background: rgba(246,198,106,0.08);
}
.play-dot {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold-bright);
  color: #0a0e1c;
  font-size: 0.6rem;
}

/* Footer */
.foot {
  margin-top: 60px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  flex-wrap: wrap;
  gap: 10px;
}
.foot-mark { color: var(--gold); letter-spacing: 0.34em; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cue-line { animation: none; }
  * { transition-duration: 0.2s !important; }
}

/* Small screens: ease text */
@media (max-width: 760px) {
  .topnav a:not(.cta-pill) { display: none; }
  .scene-copy { max-width: 92vw; }
  .align-top-right { margin: 12vh auto auto auto; text-align: center; }
  .align-bottom-left { margin: auto auto 10vh auto; text-align: center; }
}
