/* The World Scales — native-scroll cinematic hero. */
.cinematic-scroll {
  --cinematic-progress: 0;
  position: relative;
  height: 100svh;
  min-height: 560px;
  background: #050505;
  color: #fff;
  isolation: isolate;
}

.cinematic-scroll[data-cinematic-state="ready"] {
  height: 420vh;
}

.cinematic-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 560px;
  overflow: clip;
  background:
    radial-gradient(circle at 50% 45%, #191713 0, #050505 66%),
    #050505;
}

.cinematic-stage video,
.cinematic-poster,
.cinematic-poster img,
.cinematic-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cinematic-stage video,
.cinematic-poster img {
  object-fit: cover;
}

.cinematic-poster,
.cinematic-stage video {
  transition: opacity 360ms ease;
}

.cinematic-poster {
  z-index: 0;
}

.cinematic-stage video {
  z-index: 1;
  background: #050505;
}

.cinematic-shade {
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(0 0 0 / 0.3) 0%, transparent 28%),
    linear-gradient(90deg, rgb(0 0 0 / 0.74) 0%, rgb(0 0 0 / 0.1) 62%),
    linear-gradient(0deg, rgb(0 0 0 / 0.7) 0%, transparent 42%);
}

.cinematic-copy {
  position: absolute;
  z-index: 3;
  left: clamp(24px, 7vw, 112px);
  bottom: clamp(54px, 10vh, 116px);
  width: min(680px, calc(100% - 48px));
  opacity: clamp(0, calc((var(--cinematic-progress) - 0.76) * 5.5), 1);
  transform: translateY(
    clamp(0px, calc((1 - var(--cinematic-progress)) * 42px), 42px)
  );
  visibility: hidden;
  transition: visibility 0s linear 180ms;
}

[data-cinematic-state="ready"] .cinematic-copy,
[data-cinematic-state="loading"] .cinematic-copy,
[data-cinematic-state="failed"] .cinematic-copy,
[data-cinematic-state="reduced"] .cinematic-copy {
  visibility: visible;
  transition-delay: 0s;
}

.cinematic-eyebrow {
  margin: 0 0 18px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cinematic-copy h1 {
  margin: 0;
  max-width: 760px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(48px, 6vw, 86px);
  font-weight: 500;
  letter-spacing: -0.072em;
  line-height: 0.84;
}

.cinematic-copy h1 span {
  display: block;
}

.cinematic-copy > p:not(.cinematic-eyebrow) {
  max-width: 510px;
  margin: 24px 0 28px;
  color: rgb(255 255 255 / 0.82);
  font-size: clamp(15px, 1.35vw, 19px);
  line-height: 1.6;
}

.cinematic-copy .button:focus-visible {
  outline-color: #fff;
}

.cinematic-cue {
  position: absolute;
  z-index: 3;
  right: clamp(20px, 4vw, 64px);
  bottom: 128px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgb(255 255 255 / 0.66);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: clamp(0, calc((0.7 - var(--cinematic-progress)) * 3), 1);
}

.cinematic-cue i {
  width: 44px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(calc(0.3 + var(--cinematic-progress) * 0.7));
  transform-origin: left;
}

[data-cinematic-state="failed"] [data-cinematic-video],
[data-cinematic-state="reduced"] [data-cinematic-video] {
  opacity: 0;
}

[data-cinematic-state="loading"] [data-cinematic-video],
[data-cinematic-state="ready"] [data-cinematic-video] {
  opacity: 1;
}

[data-cinematic-state="loading"] [data-cinematic-poster],
[data-cinematic-state="ready"] [data-cinematic-poster] {
  opacity: 0;
}

/* The video's room poster is the first shot, including before it can decode.
   Never cross-fade the final world fallback over that opening shot. */
[data-cinematic-state="loading"] [data-cinematic-video],
[data-cinematic-state="loading"] [data-cinematic-poster] {
  transition: none;
}

/* A failed or intentionally absent film must not leave an empty scroll track. */
.cinematic-scroll[data-cinematic-state="failed"],
.cinematic-scroll[data-cinematic-state="reduced"] {
  height: 100svh;
  min-height: 560px;
}

[data-cinematic-state="failed"] .cinematic-copy,
[data-cinematic-state="reduced"] .cinematic-copy {
  opacity: 1;
  transform: none;
}

[data-cinematic-state="loading"] .cinematic-copy {
  opacity: 0;
  transform: none;
  pointer-events: none;
}

/* Keep this after the state rules so keyboard focus always reveals the CTA. */
.cinematic-copy:focus-within {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
}

[data-cinematic-state="loading"] .cinematic-cue,
[data-cinematic-state="failed"] .cinematic-cue,
[data-cinematic-state="reduced"] .cinematic-cue {
  display: none;
}

.cinematic-scroll + .services {
  position: relative;
  z-index: 4;
  margin-top: 0;
}

@media (max-width: 700px) {
  .cinematic-stage video,
  .cinematic-poster img {
    object-fit: contain;
  }

  .cinematic-scroll {
    min-height: 500px;
  }

  .cinematic-scroll[data-cinematic-state="ready"] {
    height: 300vh;
  }

  .cinematic-stage {
    min-height: 500px;
  }

  .cinematic-scroll[data-cinematic-state="failed"],
  .cinematic-scroll[data-cinematic-state="reduced"] {
    min-height: 500px;
  }

  .cinematic-shade {
    background:
      linear-gradient(180deg, rgb(0 0 0 / 0.38) 0%, transparent 32%),
      linear-gradient(0deg, rgb(0 0 0 / 0.82) 0%, transparent 64%);
  }

  .cinematic-copy {
    left: 22px;
    bottom: max(62px, 9svh);
    width: calc(100% - 44px);
  }

  .cinematic-copy h1 {
    font-size: clamp(34px, 10.5vw, 64px);
    letter-spacing: -0.068em;
  }

  .cinematic-copy > p:not(.cinematic-eyebrow) {
    margin: 18px 0 22px;
    font-size: 14px;
  }

  .cinematic-cue {
    right: 20px;
    bottom: 112px;
  }
}

@media (max-height: 620px) and (min-width: 701px) {
  .cinematic-copy {
    bottom: 34px;
  }

  .cinematic-copy h1 {
    font-size: clamp(48px, 9vh, 78px);
  }

  .cinematic-copy > p:not(.cinematic-eyebrow) {
    margin-block: 14px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cinematic-scroll,
  .cinematic-scroll[data-cinematic-state="ready"] {
    height: 100svh;
  }

  [data-cinematic-video] {
    display: none;
  }

  .cinematic-scroll .cinematic-copy {
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
  }

  .cinematic-scroll [data-cinematic-poster] {
    opacity: 1;
    transition: none;
  }

  .cinematic-cue {
    display: none;
  }
}
