:root {
  --espresso: #2c1810;
  --roast: #3d2317;
  --mocha: #5c3a21;
  --amber: #d4a574;
  --honey: #e8b86d;
  --cream: #faf0e6;
  --foam: #f5e6d3;
  --latte: #e8d5c0;
  --ink: #1a100c;
  --muted: rgba(250, 240, 230, 0.68);
  --glow: rgba(232, 184, 109, 0.22);
  --radius: 18px;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--cream);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(212, 165, 116, 0.16), transparent 60%),
    radial-gradient(900px 500px at 90% 20%, rgba(92, 58, 33, 0.5), transparent 55%),
    linear-gradient(165deg, #1a100c 0%, var(--espresso) 42%, #24140e 100%);
  line-height: 1.6;
  overflow-x: hidden;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.ambient {
  pointer-events: none;
  position: fixed;
  width: 42vw;
  height: 42vw;
  max-width: 540px;
  max-height: 540px;
  right: -10vw;
  bottom: 8vh;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 70%);
  filter: blur(22px);
  animation: drift 18s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-4vw, -3vh) scale(1.08); }
}

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  backdrop-filter: blur(14px);
  background: rgba(44, 24, 16, 0.5);
  border-bottom: 1px solid rgba(212, 165, 116, 0.1);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--cream);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.logo-mark { color: var(--amber); }

.nav {
  display: flex;
  gap: clamp(0.75rem, 2.5vw, 1.75rem);
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 400;
  transition: color 0.25s var(--ease);
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--honey);
}

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

/* - Hero - */
.hero {
  display: grid;
  place-items: center;
  min-height: 88vh;
  padding: clamp(5.5rem, 12vh, 7rem) clamp(1.25rem, 4vw, 3rem) 3rem;
  text-align: center;
}

.hero-copy {
  max-width: 36rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 165, 116, 0.35);
  color: var(--amber);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.8rem, 8vw, 4.8rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--cream);
}

.hero h1 em {
  font-style: italic;
  color: var(--honey);
}

.lede {
  margin: 0 auto 2.5rem;
  max-width: 32ch;
  color: var(--muted);
  font-size: 1.12rem;
}

.scroll-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  color: rgba(250, 240, 230, 0.45);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.scroll-hint-line {
  display: block;
  width: 1px;
  height: 42px;
  background: linear-gradient(to bottom, var(--amber), transparent);
  animation: hint-pulse 2.2s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.85); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

/* - Journey pin - */
.journey {
  position: relative;
}

.journey-pin {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  grid-template-rows: 1fr auto;
  gap: 0 1.25rem;
  align-items: center;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 5.5rem clamp(1rem, 3vw, 2.5rem) 2rem;
  min-height: 100vh;
  box-sizing: border-box;
}

.journey-stage {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: min(78vh, 680px);
  border-radius: 0;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 42%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 50%, #000 42%, transparent 72%);
}

#story-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.journey-copy {
  grid-column: 2;
  grid-row: 1;
  padding: 0.5rem 0.25rem 0.5rem 0.5rem;
  max-width: 22rem;
}

.stage-kicker {
  margin: 0 0 0.55rem;
  color: var(--amber);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}

.stage-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.85rem, 3.5vw, 2.55rem);
  line-height: 1.12;
  color: var(--foam);
}

.stage-body {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 28ch;
}

.progress-rail {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  justify-content: center;
}

.progress-rail li button {
  appearance: none;
  border: 1px solid rgba(212, 165, 116, 0.2);
  background: rgba(26, 16, 12, 0.35);
  color: rgba(250, 240, 230, 0.45);
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.progress-rail li.is-active button,
.progress-rail li button:hover,
.progress-rail li button:focus-visible {
  color: var(--honey);
  border-color: rgba(232, 184, 109, 0.55);
  background: rgba(92, 58, 33, 0.45);
}

.journey-spacer {
  height: 0; /* ScrollTrigger pin end drives scroll length */
}

/* - Panels - */
.panel {
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem);
}

.panel-inner {
  max-width: 640px;
  margin: 0 auto;
}

.panel h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.15;
  color: var(--foam);
}

.mood {
  background: linear-gradient(180deg, transparent, rgba(61, 35, 23, 0.4), transparent);
}

.mood p,
.hello-copy {
  color: var(--muted);
  font-size: 1.05rem;
}

.hello {
  background:
    radial-gradient(600px 280px at 50% 100%, rgba(212, 165, 116, 0.14), transparent 70%),
    transparent;
}

.waitlist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.waitlist input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.9rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 165, 116, 0.28);
  background: rgba(26, 16, 12, 0.55);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.waitlist input::placeholder {
  color: rgba(250, 240, 230, 0.4);
}

.waitlist input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.18);
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}

.btn.primary {
  background: linear-gradient(135deg, var(--honey), var(--amber));
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(232, 184, 109, 0.22);
}

.btn.primary:hover,
.btn.primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(232, 184, 109, 0.32);
}

.loader-btn .btn-loader {
  display: none;
  color: var(--ink);
}

.loader-btn.is-loading .btn-label {
  opacity: 0.55;
}

.loader-btn.is-loading .btn-loader {
  display: inline-flex;
}

.loader-ring {
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-note {
  min-height: 1.4em;
  margin: 0.85rem 0 0;
  color: var(--amber);
  font-size: 0.92rem;
}

.foot {
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
  text-align: center;
  color: rgba(250, 240, 230, 0.45);
  font-size: 0.88rem;
  border-top: 1px solid rgba(212, 165, 116, 0.1);
}

.logo-mini {
  font-family: var(--font-display);
  color: var(--latte);
  font-weight: 600;
}

.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;
}

.static-story {
  padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 3rem);
}

.static-steps {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.static-steps li {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  background: rgba(250, 240, 230, 0.04);
  border: 1px solid rgba(212, 165, 116, 0.14);
  color: var(--muted);
}

.static-steps strong {
  color: var(--honey);
  font-weight: 500;
}

.fallback-note {
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

/* - Responsive - */
@media (max-width: 900px) {
  .journey-pin {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    min-height: auto;
    padding-top: 5rem;
    gap: 1.25rem;
  }

  .journey-stage {
    grid-column: 1;
    grid-row: 1;
    max-height: min(56vh, 440px);
    aspect-ratio: 1 / 1;
  }

  .journey-copy {
    grid-column: 1;
    grid-row: 2;
    max-width: none;
    text-align: center;
  }

  .stage-body {
    margin-inline: auto;
  }

  .progress-rail {
    grid-column: 1;
    grid-row: 3;
  }
}

@media (max-width: 560px) {
  .top { padding-inline: 1rem; }
  .progress-rail li button {
    font-size: 0.62rem;
    padding: 0.35rem 0.55rem;
  }
}

/* - Reduced motion - */
@media (prefers-reduced-motion: reduce) {
  .ambient,
  .scroll-hint-line,
  .loader-ring {
    animation: none !important;
  }

  .journey-pin {
    position: relative !important;
  }

  .static-story[hidden] {
    display: block !important;
  }

  html.reduce-motion .journey-spacer {
    display: none;
  }
}
