/* Apple-Style Pinned Scroll Frame Sequence Layout */
.scroll-runway {
  position: relative;
  height: 560vh;
}
@media (max-width: 767px) {
  .scroll-runway {
    height: 440vh;
  }
}

.sticky-stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.sequence-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Readable editorial scrim: preserves right hero focus while anchoring left typography */
.stage-scrim-dark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(9, 11, 14, 0.90) 0%,
    rgba(9, 11, 14, 0.72) 34%,
    rgba(9, 11, 14, 0.20) 58%,
    rgba(9, 11, 14, 0.08) 100%
  );
}
.stage-scrim-sage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(19, 25, 22, 0.90) 0%,
    rgba(19, 25, 22, 0.68) 34%,
    rgba(19, 25, 22, 0.14) 58%,
    rgba(19, 25, 22, 0.04) 100%
  );
}
.stage-scrim-cafe {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(10, 12, 9, 0.92) 0%,
    rgba(10, 12, 9, 0.72) 35%,
    rgba(10, 12, 9, 0.18) 58%,
    rgba(10, 12, 9, 0.06) 100%
  );
}

@media (max-width: 1023px) {
  .stage-scrim-dark,
  .stage-scrim-sage,
  .stage-scrim-cafe {
    background: linear-gradient(
      180deg,
      rgba(9, 11, 14, 0.35) 0%,
      rgba(9, 11, 14, 0.14) 38%,
      rgba(9, 11, 14, 0.88) 76%,
      rgba(9, 11, 14, 0.96) 100%
    );
  }
}

/* Chapter Stack */
.chapters-container {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: 360px;
  z-index: 20;
}

.scroll-chapter {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(calc(-50% + 22px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.45s;
}
.scroll-chapter.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%);
}

@media (max-width: 1023px) {
  .sticky-stage {
    align-items: flex-end;
    padding-bottom: 5.75rem;
  }
  .chapters-container {
    max-width: 100%;
    min-height: 250px;
  }
  .scroll-chapter {
    top: auto;
    bottom: 0;
    transform: translateY(18px);
  }
  .scroll-chapter.is-active {
    transform: translateY(0);
  }
}

/* Vertical Apple Scrubber HUD */
.chapter-dot {
  transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, width 0.25s ease;
}
.chapter-dot.is-active {
  transform: scale(1.25);
}

/* Bottom Interactive Customer Journey Timeline */
.story-rail {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.story-rail::-webkit-scrollbar {
  display: none;
}
.story-step-btn {
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

/* Guided Story Auto-Play Tour Pill */
.story-tour-btn {
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.story-tour-btn:hover {
  transform: translateY(-1px);
}
.story-tour-btn.is-playing {
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.35);
}

/* Prevent scroll conflict while dragging comparison sliders on touch devices */
#car-slider,
#ba-slider {
  touch-action: none;
}
