:root {
  --bg: #050505;
  --bg-deep: #020202;
  --text: #f3f1eb;
  --muted: rgba(243, 241, 235, 0.62);
  --line: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.03);
  --glow: rgba(255, 255, 255, 0.12);
  --red: rgba(102, 10, 18, 0.42);
  --blue: rgba(15, 22, 40, 0.3);
  --header-strength: 0;
  --story-progress: 0;
  --parallax-y: 0px;
  --display: Inter, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.03), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: var(--display);
  overflow-x: hidden;
}

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

button,
input {
  font: inherit;
}

.page-shell {
  position: relative;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: soft-light;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.24) 0.5px, transparent 0.8px),
    radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.18) 0.5px, transparent 1px);
  background-size: 12px 12px, 14px 14px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0;
  pointer-events: none;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, calc(0.12 + var(--header-strength) * 0.45));
  backdrop-filter: blur(calc(10px * var(--header-strength)));
  border-bottom: 1px solid rgba(255, 255, 255, calc(var(--header-strength) * 0.08));
  opacity: calc(0.18 + var(--header-strength) * 0.82);
}

.brand,
.header-nav a {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.brand-logo {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
  filter:
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.05))
    contrast(1.04)
    brightness(0.96);
}

.header-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.header-nav a {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(243, 241, 235, 0.74);
  transition:
    color 200ms ease,
    transform 200ms ease,
    box-shadow 200ms ease,
    background 200ms ease;
}

.header-nav a:hover,
.header-nav a:focus-visible {
  color: var(--text);
  transform: translateY(-1px);
}

.story {
  position: relative;
  height: 500svh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: clip;
}

.visuals,
.copy-stack {
  position: absolute;
  inset: 0;
}

.visuals {
  transform: translateY(var(--parallax-y));
}

.visual-gradient,
.sequence-shell,
.visual-halo,
.visual-beam,
.visual-shadow,
.visual-fabric,
.visual-vignette {
  position: absolute;
  inset: -12%;
  transition:
    opacity 900ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 1400ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 1200ms ease,
    background 1200ms ease;
}

.sequence-shell {
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.sequence-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.04) 0, transparent 34%, rgba(0, 0, 0, 0.1) 78%, rgba(0, 0, 0, 0.24) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.16));
}

.sequence-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: calc(0.78 + var(--story-progress) * 0.14);
  filter:
    saturate(0.96)
    contrast(1.08)
    brightness(calc(0.88 + var(--story-progress) * 0.12));
  transform: scale(calc(1.04 + (1 - var(--story-progress)) * 0.04));
}

.visual-gradient {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.045), transparent 18%),
    radial-gradient(circle at 60% 80%, var(--red), transparent 32%),
    radial-gradient(circle at 24% 18%, var(--blue), transparent 26%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.36));
  opacity: calc(0.18 + var(--story-progress) * 0.14);
}

.visual-halo {
  border-radius: 50%;
  filter: blur(58px);
}

.visual-halo-one {
  top: 12%;
  left: 50%;
  width: 17rem;
  height: 17rem;
  margin-left: -8.5rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.13), transparent 66%);
  opacity: calc(0.16 + var(--story-progress) * 0.3);
  transform: translate3d(0, calc(var(--story-progress) * -30px), 0) scale(calc(0.9 + var(--story-progress) * 0.22));
}

.visual-halo-two {
  right: -8%;
  bottom: -10%;
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle, rgba(108, 12, 21, 0.3), transparent 70%);
  opacity: calc(0.12 + var(--story-progress) * 0.28);
  transform: translate3d(calc(var(--story-progress) * -18px), calc(var(--story-progress) * -24px), 0);
}

.visual-beam {
  top: -18%;
  left: 50%;
  width: 54vw;
  min-width: 16rem;
  max-width: 34rem;
  height: 140%;
  margin-left: -27vw;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.016) 26%,
    rgba(255, 255, 255, 0) 60%
  );
  clip-path: polygon(47% 0, 53% 0, 67% 100%, 33% 100%);
  opacity: calc(0.14 + var(--story-progress) * 0.3);
  filter: blur(16px);
  transform: translateY(calc(var(--story-progress) * 22px));
}

.visual-shadow-one {
  top: 18%;
  left: -16%;
  width: 72vw;
  height: 72vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.9), transparent 66%);
  opacity: calc(0.3 - var(--story-progress) * 0.08);
  transform: translate3d(calc(var(--story-progress) * 20px), calc(var(--story-progress) * 10px), 0);
}

.visual-shadow-two {
  right: -22%;
  bottom: -20%;
  width: 78vw;
  height: 78vw;
  border-radius: 44% 56% 58% 42%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.94), transparent 70%);
  opacity: calc(0.34 - var(--story-progress) * 0.08);
  transform: translate3d(calc(var(--story-progress) * -16px), calc(var(--story-progress) * -24px), 0);
}

.visual-fabric {
  inset: 6%;
  border-radius: 50% 50% 18% 18%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 24%),
    repeating-linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 2px,
      transparent 2px,
      transparent 14px
    );
  opacity: calc(0.08 + var(--story-progress) * 0.1);
  mix-blend-mode: soft-light;
  transform: scale(calc(0.96 + var(--story-progress) * 0.08));
  filter: blur(calc(1px + (1 - var(--story-progress)) * 3px));
}

.visual-vignette {
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, transparent 0, transparent 32%, rgba(0, 0, 0, 0.12) 62%, rgba(0, 0, 0, 0.48) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.46));
}

.story[data-phase="0"] .visual-fabric,
.story[data-phase="1"] .visual-fabric {
  opacity: 0.06;
}

.story[data-phase="2"] .visual-fabric {
  opacity: 0.11;
}

.story[data-phase="3"] .visual-fabric,
.story[data-phase="4"] .visual-fabric {
  opacity: 0.14;
}

.story[data-phase="3"] .visual-halo-one,
.story[data-phase="4"] .visual-halo-one {
  opacity: calc(0.22 + var(--story-progress) * 0.34);
}

.story[data-phase="4"] .visual-beam {
  opacity: 0.34;
  filter: blur(11px);
}

.copy-stack {
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 4.75rem 1.2rem 2rem;
}

.phase {
  position: absolute;
  width: min(100%, 32rem);
  text-align: center;
  opacity: 0;
  transform: translateY(38px) scale(0.985);
  will-change: opacity, transform;
  pointer-events: none;
  transition:
    opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.phase.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hero-phase h1,
.final-phase h2 {
  margin: 0;
  font-size: clamp(3.6rem, 17vw, 7rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.07em;
  color: #e6e3dd;
  background:
    linear-gradient(180deg, #ffffff 0%, #f2efe8 26%, #d1cbc1 54%, #8d867c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 28px rgba(0, 0, 0, 0.32),
    0 0 22px rgba(255, 255, 255, 0.06);
  filter: drop-shadow(0 0 0.35rem rgba(255, 255, 255, 0.04));
}

.final-phase h2 {
  font-size: clamp(3.1rem, 15vw, 6.1rem);
}

.phase-kicker,
.micro-copy {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.phase-line {
  margin: 1rem 0 0;
  font-size: clamp(1rem, 4.2vw, 1.45rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: rgba(243, 241, 235, 0.88);
  text-wrap: balance;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
}

.text-phase .phase-line {
  font-size: clamp(1.5rem, 7.2vw, 3.2rem);
  font-weight: 650;
}

.final-phase {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
}

.final-phase .phase-line {
  margin: 0;
  color: var(--muted);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13.5rem;
  min-height: 3.35rem;
  padding: 0 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(255, 255, 255, 0.05);
  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease;
}

.cta-button:hover,
.cta-button:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.32),
    0 0 26px rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), transparent),
    rgba(255, 255, 255, 0.07);
}

.micro-copy {
  margin: 0;
}

.scroll-track {
  position: relative;
  z-index: -1;
}

.scroll-step {
  height: 100svh;
}

@media (min-width: 720px) {
  .site-header {
    padding: 1rem 1.5rem 0;
  }

  .brand-logo {
    width: 1.7rem;
    height: 1.7rem;
  }

  .story {
    height: 540svh;
  }

  .copy-stack {
    padding: 5.2rem 2rem 2.4rem;
  }

  .phase {
    width: min(100%, 54rem);
  }

  .phase-line {
    font-size: clamp(1.2rem, 2vw, 1.55rem);
  }

  .text-phase .phase-line {
    font-size: clamp(2.5rem, 5vw, 4.8rem);
  }
}

@media (min-width: 1120px) {
  .site-header {
    padding: 1rem 2rem 0;
  }

  .copy-stack {
    padding-top: 5.6rem;
  }

  .visual-halo-one {
    width: 22rem;
    height: 22rem;
    margin-left: -11rem;
  }

  .visual-halo-two {
    width: 32rem;
    height: 32rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0ms !important;
  }

  .phase {
    transition: none !important;
  }
}
