:root {
  --obsidian: #030405;
  --cream: #F2EDE1;
  --cream-dim: #F2EDE1a6;
  --gold: #D4AF37;
  --gold-soft: #D4AF3799;
  --gold-brand: #c8a668; /* matches the lockup's star + rule */
  --gold-brand-soft: #c8a66899;
  --scroll-length: 340vh; /* hero rotation scroll distance */
  --narrative-scroll: 720vh; /* narrative scroll distance — ~1 screen per beat */
}

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

html, body {
  background: var(--obsidian);
  color: var(--cream);
  font-family: -apple-system, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  /* NOTE: do not set overflow-x/overflow-y here. Any overflow value other than
     `visible` on html/body makes the root a scroll container and breaks
     position:sticky on the pinned hero. */
}

/* ---------- hero label + scroll cue (overlaid on the pinned hero) ---------- */

.hero-label {
  position: absolute;
  top: 34px;
  z-index: 2; /* sits above the canvas, which is later in the DOM */
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-lockup {
  width: 106px;
  height: auto;
  display: block;
}

.scroll-cue {
  position: absolute;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.8;
  transition: opacity 0.4s ease;
}

.scroll-cue span {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.scroll-cue svg {
  width: 14px;
  height: 20px;
  animation: cue-bob 1.8s ease-in-out infinite;
}

@keyframes cue-bob {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ---------- pinned scrubber ---------- */

.pin-wrap {
  position: relative;
  height: var(--scroll-length);
}

.pin-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh; /* mobile: svh ignores the collapsing address bar, so the
                     pinned viewport doesn't resize mid-scroll */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* pin-sticky is the positioning context for .hero-label and .scroll-cue above */

.canvas-stage {
  position: relative;
  width: min(78vw, 900px);
  aspect-ratio: 1 / 1;
}

#scrubber-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* blends the frame's studio backdrop into the page — the render's background is
   a dark blue-grey, not true black, so the canvas edge would otherwise show as
   a hard square seam. Stops use explicit rgba of --obsidian (3,4,5) because
   fading to `transparent` greys out mid-gradient in some browsers. */
.stage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom,
      rgba(3, 4, 5, 1) 0%,
      rgba(3, 4, 5, 0.92) 10%,
      rgba(3, 4, 5, 0.45) 26%,
      rgba(3, 4, 5, 0) 46%),
    radial-gradient(ellipse 78% 70% at 50% 55%,
      rgba(3, 4, 5, 0) 55%,
      rgba(3, 4, 5, 0.75) 82%,
      rgba(3, 4, 5, 1) 100%);
}

.loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--obsidian);
  transition: opacity 0.5s ease;
}

.loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-soft);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}

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


/* ---------- narrative (Descent) — pinned, cross-fading beats ---------- */

.narrative-pin {
  position: relative;
  height: var(--narrative-scroll);
}

.narrative-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh; /* mobile: svh ignores the collapsing address bar, so the
                     pinned viewport doesn't resize mid-scroll */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

/* beats are stacked on the same centre point; only opacity changes, so text
   never travels up the screen — scroll just cross-fades between them */
.beat {
  position: absolute;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(21px, 2.9vw, 34px);
  line-height: 1.55;
  color: var(--cream-dim);
  text-align: center;
  max-width: 22ch;
  opacity: 0;
  will-change: opacity;
}

/* everything before the turn stays muted, so the lift to full cream lands
   once — on "Coming soon" — rather than creeping in earlier */

.beat-wait .dots span {
  opacity: 0;
}

.beat-soon {
  font-size: clamp(24px, 3.6vw, 40px);
  color: var(--cream);
  max-width: 26ch;
}

/* the payoff: wordmark fades up in the exact spot "Coming soon" vacates */
.beat-mark {
  font-size: clamp(30px, 5vw, 56px);
  color: var(--gold-brand);
  white-space: nowrap;
  max-width: none;
}

/* ---------- footer ---------- */

/* endcap sits inside the pinned viewport, below the held wordmark, and fades
   up on scroll instead of travelling in from below */
/* the mark from the site header, reunited with the wordmark for the closing
   frame. Absolutely placed so it sits above the type without shifting the
   wordmark off centre; its opacity is driven with the endcap, not the beat. */
.final-mark {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 20px;
  width: 54px;
  height: 54px;
  opacity: 0;
  will-change: opacity;
}

.endcap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  opacity: 0;
  will-change: opacity;
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(17px, 2vw, 22px);
  color: var(--gold-brand);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease, color 0.4s ease;
}

.contact-icon {
  width: 19px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
}

.contact:hover,
.contact:focus-visible {
  color: var(--cream);
  border-bottom-color: var(--gold-brand-soft);
}

.footer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--cream-dim);
  text-align: center;
}

/* the first two phrases stay bound together; "Building the Future" drops to its
   own line on narrow screens, and the separator that joined them is hidden so
   no orphan pipe is left dangling */
.footer-row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .footer-line {
    flex-direction: column;
    gap: 10px;
    font-size: 10px;
    letter-spacing: 0.16em;
  }

  .footer-row {
    gap: 10px;
  }

  .sep-mid {
    display: none;
  }
}

@media (max-width: 360px) {
  .footer-line {
    font-size: 9px;
    letter-spacing: 0.12em;
  }
}

.footer-line .sep {
  color: var(--gold-soft);
}
