/* ============================================================
   Scroll-scrub engine styles — storefront transformation page
   The pinned video scrubs with scroll; chapter copy fades in
   over it at progress ranges. See js/scrub.js.
   ============================================================ */

.scrub-section {
  /* Tall scroll runway; the pin inside stays a viewport tall */
  position: relative;
  height: 450vh;
}

.scrub-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh; /* tracks the real viewport as mobile browser chrome collapses */
  overflow: hidden;
}

.scrub-pin video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Soft gradient so chapter copy stays readable over bright frames */
.scrub-pin::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 15, 0.65), rgba(10, 10, 15, 0.05) 45%);
  pointer-events: none;
}

.scrub-chapter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10vh;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}

.scrub-chapter.active { opacity: 1; transform: none; pointer-events: auto; }

.scrub-chapter h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.5vw, 2.8rem);
  text-transform: uppercase;
  text-shadow: 0 2px 24px rgba(10, 10, 15, 0.9);
}

.scrub-chapter p {
  color: var(--ink);
  max-width: 540px;
  margin: 0.6rem auto 1rem;
  font-size: clamp(1rem, 2vw, 1.15rem);
  text-shadow: 0 1px 14px rgba(10, 10, 15, 0.9);
}

.scrub-progress {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  z-index: 2;
  width: 4px;
  height: 34vh;
  border-radius: 999px;
  background: rgba(244, 244, 248, 0.18);
  overflow: hidden;
}

.scrub-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--rainbow);
  transform-origin: top;
  transform: scaleY(0);
}

.scrub-hint {
  position: absolute;
  bottom: 3vh;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  font-family: var(--font-accent);
  color: var(--ink-dim);
  font-size: 0.95rem;
  transition: opacity 0.4s ease;
}

/* ---------- Mobile: shorter runway, tighter chrome ---------- */

@media (max-width: 768px) {
  .scrub-section { height: 320vh; }
  .scrub-chapter { bottom: 7vh; }
  .scrub-chapter p { font-size: 0.98rem; }
  .scrub-progress { right: 10px; height: 26vh; width: 3px; }
  .scrub-hint { bottom: 2vh; font-size: 0.85rem; }
}

/* ---------- Fallback / reduced motion: static story ---------- */

.scrub-static { display: none; }

.no-scrub .scrub-section { display: none; }
.no-scrub .scrub-static { display: block; }

.scrub-static .static-hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  padding: 3rem 20px;
  background: var(--bg) center / cover no-repeat;
  background-image: var(--static-hero-image, none);
}

@media (prefers-reduced-motion: reduce) {
  .scrub-section { display: none; }
  .scrub-static { display: block; }
}
