/* ═══════════════════════════════════════════════════════════
   EMMA SINCLAIR — Continuous Cinematic Scroll
   One space. One canvas. Everything flows.
═══════════════════════════════════════════════════════════ */

:root {
  --c-ink:    #08111f;
  --c-deep:   #0d1b38;
  --c-ocean:  #142850;
  --c-ivory:  #FBFAF8;
  --c-mist:   rgba(215, 228, 250, 0.80);
  --c-ghost:  rgba(250, 248, 244, 0.30);
  --c-gold:   #C9A96E;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-serif:   'Cormorant', Georgia, serif;
  --font-sans:    'Jost', system-ui, sans-serif;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; }
body {
  background: var(--c-ink);
  color: var(--c-ivory);
  font-family: var(--font-sans);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: default;
}
* { cursor: default !important; }
img { display: block; max-width: 100%; }

/* ─── Scroll track — provides scroll distance ───────────── */
#scroll-track {
  /* Total scroll height: tightened from 600vh for faster pacing */
  height: 450vh;
  position: relative;
  z-index: 0;
}

/* ─── Stage — fixed viewport canvas ────────────────────── */
#stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}
/* Soft bottom fade — dissolves the dark navy into transparency */
#stage::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 220px;
  background: linear-gradient(to bottom, rgba(8,17,31,0) 0%, rgba(8,17,31,0.85) 60%, rgba(8,17,31,1) 100%);
  z-index: 50;
  pointer-events: none;
}

/* ─── Background ────────────────────────────────────────── */
#bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 80% at 55% 45%, rgba(30,60,120,0.55) 0%, transparent 70%),
    radial-gradient(ellipse 60% 60% at 20% 75%, rgba(15,40,90,0.45) 0%, transparent 60%),
    linear-gradient(165deg, #08111f 0%, #0d1b38 35%, #142850 65%, #0a1528 100%);
}
.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 25%, rgba(8,17,31,0.72) 100%);
}

/* Orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}
.orb-a {
  width: clamp(320px, 55vw, 720px);
  height: clamp(320px, 55vw, 720px);
  top: -15%; left: 25%;
  background: radial-gradient(circle, rgba(44,80,160,0.32) 0%, transparent 70%);
  animation: orbA 20s ease-in-out infinite;
}
.orb-b {
  width: clamp(220px, 38vw, 520px);
  height: clamp(220px, 38vw, 520px);
  bottom: 0; right: -8%;
  background: radial-gradient(circle, rgba(20,50,110,0.28) 0%, transparent 70%);
  animation: orbB 25s ease-in-out infinite;
}
.orb-c {
  width: clamp(160px, 28vw, 400px);
  height: clamp(160px, 28vw, 400px);
  top: 35%; left: -8%;
  background: radial-gradient(circle, rgba(60,100,180,0.18) 0%, transparent 70%);
  animation: orbC 30s ease-in-out infinite;
}
@keyframes orbA {
  0%,100% { transform: translate(0,0) scale(1); }
  40%      { transform: translate(28px,22px) scale(1.04); }
  70%      { transform: translate(-18px,32px) scale(0.97); }
}
@keyframes orbB {
  0%,100% { transform: translate(0,0) scale(1); }
  45%      { transform: translate(-22px,-28px) scale(1.06); }
}
@keyframes orbC {
  0%,100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(18px,-22px) scale(1.05); }
}

/* ─── Layers — all stacked in the same space ────────────── */
#layer-hero,
#layer-stamps,
#layer-text,
#layer-arrival {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

/* ═══════════════════════════════════════════════════════════
   LAYER 1 — HERO
═══════════════════════════════════════════════════════════ */
#layer-hero {
  flex-direction: column;
  gap: clamp(1rem, 2.5vh, 2rem);
  text-align: center;
  padding: 0 clamp(24px, 6vw, 80px);
}

.hero-logo {
  width: clamp(52px, 9vw, 88px);
  /* Animated in by JS */
  opacity: 0;
  transform: translateY(-8px);
  will-change: opacity, transform;
}
.hero-logo img { width: 100%; height: auto; }

.hero-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(3rem, 9.5vw, 8rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--c-ivory);
  text-shadow: 0 4px 60px rgba(44,80,160,0.35);
  opacity: 0;
  transform: translateY(18px);
  will-change: opacity, transform;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.95rem, 2vw, 1.35rem);
  color: var(--c-mist);
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(10px);
  will-change: opacity, transform;
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: clamp(28px, 5vh, 52px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--c-ghost);
  font-family: var(--font-sans);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0;
  animation: cueIn 1s ease 2.6s forwards;
}
.scroll-cue__line {
  width: 1px;
  height: 34px;
  background: currentColor;
  animation: cueLinePulse 2.8s ease-in-out infinite;
  transform-origin: top;
  order: -1;
}
@keyframes cueIn {
  to { opacity: 1; }
}
@keyframes cueLinePulse {
  0%,100% { transform: scaleY(1); opacity: 0.3; }
  50%      { transform: scaleY(0.35); opacity: 0.85; }
}

/* ═══════════════════════════════════════════════════════════
   LAYER 2 — STAMPS
═══════════════════════════════════════════════════════════ */
#layer-stamps {
  /* Stamps positioned absolutely within this layer */
  position: absolute;
}

/* ═══════════════════════════════════════════════════════════
   STAMP — Exact match to screenshot:
   Large rectangular card, navy semi-transparent bg,
   PNG image tinted blue (not grey), POSTE top, value bottom,
   double inner border, perforated edge, slight tilt
═══════════════════════════════════════════════════════════ */
.stamp {
  position: absolute;
  opacity: 0;
  will-change: opacity, transform;
}

/* No frame — image floats freely in space */
.stamp__body {
  position: relative;
  display: block;
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  -webkit-mask: none;
  mask: none;
}

.stamp__body::before { display: none; }

/* Labels hidden — no frame, no text */
.stamp__label,
.stamp__value { display: none; }

/* PNG image — blue monochrome tint, floats freely */
.stamp__art {
  width: 100%;
  height: auto;
  display: block;
  /* Blue monochrome matching the screenshot */
  filter:
    grayscale(1)
    brightness(0.65)
    sepia(0.4)
    hue-rotate(185deg)
    saturate(1.8)
    opacity(0.68);
  /* Soft depth shadow on the image itself */
  filter:
    grayscale(1)
    brightness(0.65)
    sepia(0.4)
    hue-rotate(185deg)
    saturate(1.8)
    opacity(0.68)
    drop-shadow(0 8px 24px rgba(0,0,0,0.5));
}

/* ─── Stamp float animations (CSS, always running when visible) ─── */
@keyframes stampFloatA {
  0%   { transform: translateY(0px)   rotate(-4deg); }
  30%  { transform: translateY(-10px) rotate(-2.5deg); }
  60%  { transform: translateY(-5px)  rotate(-5.5deg); }
  100% { transform: translateY(0px)   rotate(-4deg); }
}
@keyframes stampFloatB {
  0%   { transform: translateY(0px)   rotate(4deg); }
  40%  { transform: translateY(-12px) rotate(5.5deg); }
  70%  { transform: translateY(-4px)  rotate(2.5deg); }
  100% { transform: translateY(0px)   rotate(4deg); }
}
@keyframes stampFloatC {
  0%   { transform: translateY(0px)   rotate(6deg); }
  45%  { transform: translateY(-9px)  rotate(8deg); }
  80%  { transform: translateY(-3px)  rotate(5deg); }
  100% { transform: translateY(0px)   rotate(6deg); }
}
/* Tighter float durations — more alive */
.stamp-a.is-floating { animation: stampFloatA 3.8s ease-in-out infinite; }
.stamp-b.is-floating { animation: stampFloatB 5.0s ease-in-out infinite; }
.stamp-c.is-floating { animation: stampFloatC 3.5s ease-in-out infinite; }

/* Stamp A — large, upper-left, main stamp (like in screenshot) */
.stamp-a {
  top: 14%;
  left: clamp(4%, 7vw, 12%);
  transform: translateY(-120px) rotate(-8deg);
}
.stamp-a .stamp__body { width: clamp(120px, 18vw, 220px); }

/* Stamp B — medium, lower-right */
.stamp-b {
  bottom: 14%;
  right: clamp(4%, 7vw, 12%);
  transform: translateY(100px) rotate(6deg);
}
.stamp-b .stamp__body { width: clamp(100px, 14vw, 180px); }

/* Stamp C — small accent, upper right */
.stamp-c {
  top: 20%;
  right: clamp(4%, 6vw, 10%);
  transform: translateY(-80px) rotate(10deg);
}
.stamp-c .stamp__body { width: clamp(80px, 11vw, 140px); }


/* ═══════════════════════════════════════════════════════════
   LAYER 3 — POEM TEXT
═══════════════════════════════════════════════════════════ */
#layer-text {
  flex-direction: column;
  text-align: center;
  padding: 0 clamp(24px, 6vw, 80px);
}

.poem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.35rem, 1.2vh, 0.8rem);
}

.poem-line {
  display: block;
  opacity: 0;
  transform: translateY(10px);
  will-change: opacity, transform;
  line-height: 1.2;
}

.poem-line--large {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4.8vw, 3.6rem);
  color: var(--c-ivory);
}
.poem-line--large.poem-line--italic {
  font-style: italic;
  color: var(--c-mist);
}
.poem-line--small {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  color: var(--c-mist);
  margin-top: clamp(0.3rem, 0.8vh, 0.6rem);
}
.poem-line--coda {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.85rem, 1.6vw, 1.15rem);
  color: var(--c-gold);
  letter-spacing: 0.06em;
  margin-top: clamp(0.5rem, 1.5vh, 1rem);
}

/* ═══════════════════════════════════════════════════════════
   LAYER 4 — ARRIVAL
═══════════════════════════════════════════════════════════ */
#layer-arrival {
  flex-direction: column;
  text-align: center;
}
.arrival-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  /* Smaller, more intimate than the poem — like a whispered conclusion */
  font-size: clamp(1.4rem, 3.2vw, 2.8rem);
  color: var(--c-mist);
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

/* ─── Flight Progress Indicator ────────────────────────── */
#flight-progress {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  height: 55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  animation: flightFadeIn 1s ease 2.8s forwards;
}
@keyframes flightFadeIn {
  to { opacity: 1; }
}
.flight-track {
  position: relative;
  width: 1px;
  flex: 1;
  margin-bottom: 6px;
}
.flight-track__line {
  position: absolute;
  inset: 0;
  width: 1px;
  background: rgba(201,169,110,0.15);
}
.flight-track__line--fill {
  background: rgba(201,169,110,0.55);
  transform-origin: top center;
  transform: scaleY(0);
  will-change: transform;
}
.flight-plane {
  position: absolute;
  right: 10px;
  top: 0;
  width: 13px;
  height: 13px;
  color: var(--c-gold);
  transform: translateY(0);
  will-change: transform;
  filter: drop-shadow(0 0 5px rgba(201,169,110,0.6));
}
.flight-plane svg {
  width: 100%;
  height: 100%;
  transform: rotate(180deg);
}
@media (max-width: 600px) {
  #flight-progress { display: none; }
}

/* ─── Transition overlay ─────────────────────────────────── */
#transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--c-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
#transition-overlay.active {
  visibility: visible;
  pointer-events: all;
}
#transition-overlay img {
  width: clamp(52px, 9vw, 88px);
  opacity: 0;
  transform: scale(0.88);
  filter: blur(6px);
  will-change: opacity, transform, filter;
}

/* ─── Responsive — mobile-only refinements ───────────────── */
@media (max-width: 600px) {

  /* ══════════════════════════════════════════════════════════
     STAMPS — Postcard composition around the poem text
     Positioned to float *around* the text, not stacked below.
     Each stamp sits at a different corner of the poem area
     with subtle rotation for a natural "placed on paper" feel.
     Sizes are small enough to never block readability.
  ══════════════════════════════════════════════════════════ */

  /* Stamp A — top-left, slightly above and left of poem */
  .stamp-a {
    top: 28%;
    left: 3%;
    right: auto;
    bottom: auto;
    transform: translateY(-80px) rotate(-5deg);
  }
  .stamp-a .stamp__body { width: 66px; }

  /* Stamp C — top-right, slightly above and right of poem */
  .stamp-c {
    top: 26%;
    left: auto;
    bottom: auto;
    right: 4%;
    transform: translateY(-60px) rotate(7deg);
  }
  .stamp-c .stamp__body { width: 54px; }

  /* Stamp B — bottom-right, below and right of poem */
  .stamp-b {
    top: auto;
    left: auto;
    bottom: 26%;
    right: 6%;
    transform: translateY(80px) rotate(4deg);
  }
  .stamp-b .stamp__body { width: 60px; }

  /* ══════════════════════════════════════════════════════════
     ARRIVAL TEXT — "let's see where we end up."
     Main emotional focal point on mobile.
     Noticeably larger, generous line-height, breathing room.
  ══════════════════════════════════════════════════════════ */
  .arrival-text {
    font-size: clamp(2.2rem, 9.5vw, 3rem);
    line-height: 1.55;
    padding: 0 clamp(24px, 7vw, 52px);
    letter-spacing: 0.04em;
  }

  /* ══════════════════════════════════════════════════════════
     POEM — breathable, centered, editorial spacing
  ══════════════════════════════════════════════════════════ */
  .poem {
    gap: clamp(0.5rem, 1.6vh, 1rem);
  }

  #layer-text {
    padding: 0 clamp(32px, 8vw, 68px);
  }

  /* Hero tagline — "Collect the moments worth keeping" */
  .hero-tagline {
    font-size: clamp(1.15rem, 3.8vw, 1.5rem);
  }

  /* Scroll cue — "scroll" label */
  .scroll-cue {
    font-size: 0.72rem;
    letter-spacing: 0.25em;
  }

  /* Poem lines — slightly more generous size on mobile */
  .poem-line--large {
    font-size: clamp(1.55rem, 5.5vw, 2.4rem);
  }
  .poem-line--small {
    font-size: clamp(1.3rem, 4.5vw, 1.6rem);
    margin-top: clamp(0.1rem, 0.4vh, 0.25rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none !important; }
  .scroll-cue, .scroll-cue__line { animation: none !important; opacity: 0.4 !important; }
}
