.lb-scroll-story {
  --lb-video-opacity: 1;
  --lb-opening-opacity: 1;
  height: 500svh;
  min-height: 2700px;
}

.lb-scroll-story__stage {
  isolation: isolate;
  background: #111a13;
}

.lb-scroll-story__plate,
.lb-scroll-story__assembly-canvas,
.lb-scroll-story__opening-grade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lb-scroll-story__plate {
  z-index: 0;
  object-fit: cover;
  opacity: var(--lb-hero-opacity);
  filter: saturate(0.72) brightness(0.64) contrast(1.08);
  transform: scale(1.012);
}

.lb-scroll-story__assembly-canvas {
  z-index: 1;
  display: block;
  opacity: 0;
  pointer-events: none;
}

.lb-scroll-story[data-exploded-ready="true"] .lb-scroll-story__assembly-canvas {
  opacity: var(--lb-hero-opacity);
}

.lb-scroll-story .lb-scroll-story__video {
  z-index: 2;
}

.lb-scroll-story .lb-scroll-story__video.is-active {
  opacity: 1;
}

.lb-scroll-story .lb-scroll-story__detail-loop {
  z-index: 3;
}

.lb-scroll-story .lb-scroll-story__detail-loop.is-active {
  opacity: 1;
}

/*
 * The authored park frame is the only visible construction image while a
 * phase is stopped. Keep both seekable direction videos composited and ready
 * underneath it, but never let a decoder seek/prime frame bleed through the
 * stop. The detail loop intentionally remains visible above the park frame.
 */
.lb-scroll-story[data-media-presentation="parked"] .lb-scroll-story__video[data-lb-scroll-video] {
  opacity: 0;
  visibility: hidden;
}

.lb-scroll-story[data-media-presentation="parked"] .lb-scroll-story__park-frame.is-active {
  z-index: 2;
}

/*
 * Before motion resumes, restore the hardware video layer behind the still and
 * give it two paint frames to become composited. The park frame remains the
 * only visible construction image until the controller commits the handoff.
 */
.lb-scroll-story[data-media-presentation="motion-ready"] .lb-scroll-story__video[data-lb-scroll-video] {
  visibility: visible;
}

.lb-scroll-story[data-media-presentation="motion-ready"] .lb-scroll-story__park-frame.is-active {
  z-index: 3;
  opacity: 1;
}

.lb-scroll-story__opening-grade {
  z-index: 4;
  opacity: var(--lb-opening-opacity);
  transition: opacity 120ms linear;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4, 10, 6, 0.84), rgba(4, 10, 6, 0.32) 36%, transparent 60%),
    linear-gradient(180deg, rgba(3, 8, 5, 0.28), transparent 26%, transparent 70%, rgba(3, 8, 5, 0.62)),
    radial-gradient(circle at 64% 48%, rgba(157, 222, 165, 0.08), transparent 30%);
}

.lb-scroll-story__opening-grade::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.lb-scroll-story__assembly-hud {
  position: absolute;
  z-index: 5;
  inset: 0;
  opacity: var(--lb-hero-opacity);
  pointer-events: none;
}

.lb-scroll-story__assembly-brand {
  position: absolute;
  top: clamp(24px, 4vw, 58px);
  left: clamp(24px, 5vw, 80px);
  display: grid;
  gap: 7px;
  color: #f4f1e7;
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.lb-scroll-story__assembly-brand small {
  color: rgba(229, 239, 222, 0.5);
  font-size: 0.52rem;
  font-weight: 650;
}

.lb-scroll-story__assembly-reticle {
  position: absolute;
  top: 31%;
  left: 66%;
  width: min(44vw, 680px);
  aspect-ratio: 2.35 / 1;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(204, 232, 197, 0.12);
}

.lb-scroll-story__assembly-reticle::before,
.lb-scroll-story__assembly-reticle::after {
  content: "";
  position: absolute;
  background: rgba(194, 232, 185, 0.25);
}

.lb-scroll-story__assembly-reticle::before {
  top: 50%;
  left: -18px;
  width: calc(100% + 36px);
  height: 1px;
}

.lb-scroll-story__assembly-reticle::after {
  top: -18px;
  left: 50%;
  width: 1px;
  height: calc(100% + 36px);
}

.lb-scroll-story__assembly-reticle i {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(213, 238, 206, 0.58);
  border-style: solid;
}

.lb-scroll-story__assembly-reticle i:nth-child(1) { inset: -1px auto auto -1px; border-width: 1px 0 0 1px; }
.lb-scroll-story__assembly-reticle i:nth-child(2) { inset: -1px -1px auto auto; border-width: 1px 1px 0 0; }
.lb-scroll-story__assembly-reticle i:nth-child(3) { inset: auto auto -1px -1px; border-width: 0 0 1px 1px; }
.lb-scroll-story__assembly-reticle i:nth-child(4) { inset: auto -1px -1px auto; border-width: 0 1px 1px 0; }

.lb-scroll-story__assembly-readout {
  position: absolute;
  top: 31%;
  right: clamp(22px, 3.4vw, 54px);
  display: grid;
  gap: 8px;
  width: 178px;
  padding-left: 18px;
  transform: translateY(-50%);
  border-left: 1px solid rgba(201, 232, 194, 0.28);
  color: rgba(235, 242, 226, 0.64);
  font-size: 0.56rem;
  letter-spacing: 0.13em;
  line-height: 1.5;
  text-transform: uppercase;
}

.lb-scroll-story__assembly-readout b {
  color: #e8f2df;
  font-size: 0.66rem;
}

.lb-scroll-story__intro,
.lb-scroll-story__status,
.lb-scroll-story__timeline,
.lb-scroll-story__progress,
.lb-scroll-story__xray,
.lb-scroll-story__continue {
  z-index: 7;
}

.lb-scroll-story__continue {
  position: absolute;
  right: 50%;
  bottom: 24px;
  margin: 0;
  color: rgba(242, 238, 229, 0.66);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transform: translate(50%, 10px);
  transition: opacity 320ms ease, transform 380ms ease;
  pointer-events: none;
}

.lb-scroll-story__continue span {
  display: inline-block;
  margin-left: 9px;
  color: #dfb36d;
}

.lb-scroll-story[data-phase="4"] .lb-scroll-story__continue {
  opacity: 1;
  transform: translate(50%, 0);
}

body.lb-scroll-story-standalone .lb-scroll-story__continue {
  display: none;
}

.lb-scroll-story__intro[data-lb-phase-intro="0"] {
  top: auto;
  bottom: clamp(88px, 12vh, 146px);
  width: min(860px, calc(100vw - 48px));
  max-width: min(860px, calc(100vw - 48px));
}

.lb-scroll-story__intro[data-lb-phase-intro="0"] .lb-scroll-story__headline {
  max-width: 13em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.9rem, 5.3vw, 6.2rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.91;
  text-transform: none;
}

.lb-scroll-story__intro[data-lb-phase-intro="0"] .lb-scroll-story__eyebrow {
  color: #b8d8ae;
}

.lb-scroll-story__intro[data-lb-phase-intro="0"]::before {
  opacity: 0.48;
}

@media (min-width: 721px) {
  .lb-scroll-story__intro:not([data-lb-phase-intro="0"]) {
    width: min(860px, calc(100vw - 48px));
  }

  .lb-scroll-story__intro .lb-scroll-story__headline {
    max-width: 820px;
  }

  .lb-scroll-story__intro .lb-scroll-story__lede {
    max-width: 720px;
  }
}

.lb-scroll-story[data-phase="0"] .lb-scroll-story__status,
.lb-scroll-story[data-phase="0"] .lb-scroll-story__timeline {
  color: rgba(238, 243, 231, 0.72);
}

@media (max-width: 720px) {
  .lb-scroll-story {
    min-height: 2400px;
  }

  .lb-scroll-story__assembly-brand {
    top: 22px;
    left: 22px;
  }

  .lb-scroll-story__assembly-readout {
    display: none;
  }

  .lb-scroll-story__assembly-reticle {
    top: 36%;
    left: 50%;
    width: 82vw;
  }

  .lb-scroll-story__intro[data-lb-phase-intro="0"] {
    bottom: max(20px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 58px);
  }

  .lb-scroll-story__intro[data-lb-phase-intro="0"] .lb-scroll-story__headline {
    font-size: clamp(2.25rem, 11vw, 3.7rem);
  }

  .lb-scroll-story__continue {
    right: auto;
    bottom: 18px;
    left: 22px;
    transform: translateY(10px);
  }

  .lb-scroll-story[data-phase="4"] .lb-scroll-story__continue {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lb-scroll-story {
    height: 100svh;
    min-height: 540px;
  }

  .lb-scroll-story__opening-grade,
  .lb-scroll-story__assembly-hud {
    opacity: 1;
  }
}
