/* ============================================================
   Hero Scroll-Scrub — Frame-Sequence Playback on Scroll
   Responsive, reduced-motion safe, Canvas-based rendering
   ============================================================ */

/* Main scroll track: 360vh total, stage is pinned to viewport */
.hero-scrub {
  display: block;
  height: 360vh;
  position: relative;
  background: var(--t-bg);
}

/* Sticky stage container: locks to top while scrolling through track */
.hero-scrub__stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--t-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Canvas: fills stage, rendered frames appear here */
.hero-scrub__canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--t-bg);
  image-rendering: high-quality;
}

/* Poster: shown when JS unavailable or reduced-motion + poster fallback */
.hero-scrub__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 1;
  transition: opacity 300ms var(--ease-smooth);
}

/* Canvas-ready: hide poster once canvas has first frame */
.hero-scrub.hero-scrub--ready .hero-scrub__poster {
  pointer-events: none;
  opacity: 0;
}

/* Copy overlay: center text with scrim for contrast */
.hero-scrub__copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 10;
  pointer-events: none;
  padding: clamp(20px, 4vw, 48px);

  /* Scrim for text contrast: dark gradient with transparency */
  background: linear-gradient(
    180deg,
    rgba(10, 10, 11, 0.3) 0%,
    rgba(10, 10, 11, 0.6) 30%,
    rgba(10, 10, 11, 0.7) 50%,
    rgba(10, 10, 11, 0.8) 100%
  );
}

/* Eyebrow label */
.hero-scrub__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--t-accent);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUpDelay 500ms var(--ease-smooth) 400ms forwards;
}

/* Main headline */
.hero-scrub__headline {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(48px, 7vw, 84px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--t-ink);
  margin: 0 0 28px;
  max-width: 22ch;
  opacity: 0;
  animation: fadeUpDelay 500ms var(--ease-smooth) 500ms forwards;
}

/* Headline emphasis color */
.hero-scrub__headline em {
  color: var(--t-accent);
  font-style: italic;
  font-weight: 600;
}

/* Subheading / description */
.hero-scrub__subline {
  font-size: clamp(16px, 1.2vw, 18px);
  color: var(--t-ink-2);
  max-width: 60ch;
  margin: 0 auto 40px;
  line-height: 1.65;
  opacity: 0;
  animation: fadeUpDelay 500ms var(--ease-smooth) 600ms forwards;
}

/* CTA buttons group */
.hero-scrub__ctas {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: fadeUpDelay 500ms var(--ease-smooth) 700ms forwards;
}

/* CTA button */
.hero-scrub__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  background: var(--t-accent-interactive, #2563EB);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 200ms var(--ease-smooth);
  text-decoration: none;
  min-height: 44px;
}

.hero-scrub__cta:hover {
  background: color-mix(in srgb, var(--t-accent) 110%, white);
  transform: translateY(-2px);
}

.hero-scrub__cta:active {
  transform: translateY(0);
}

/* Secondary CTA (voice trigger) */
.hero-scrub__cta--secondary {
  background: transparent;
  color: var(--t-accent);
  border: 1px solid var(--t-accent);
}

.hero-scrub__cta--secondary:hover {
  background: var(--t-accent-surface);
  border-color: var(--t-accent);
  color: var(--t-accent);
}

/* Voice trigger dot indicator */
.vt-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 2px;
}

/* Reduced-motion variant: static poster, no animation */
@media (prefers-reduced-motion: reduce) {
  .hero-scrub {
    height: auto;
  }

  .hero-scrub__stage {
    position: static;
    height: auto;
  }

  .hero-scrub__canvas {
    display: none;
  }

  .hero-scrub__poster {
    position: static;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1440 / 792;
  }

  .hero-scrub__eyebrow,
  .hero-scrub__headline,
  .hero-scrub__subline,
  .hero-scrub__ctas {
    animation: none;
    opacity: 1;
  }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .hero-scrub {
    height: 260vh;
  }

  .hero-scrub__headline {
    font-size: clamp(32px, 5.5vw, 48px);
  }

  .hero-scrub__subline {
    font-size: clamp(14px, 1vw, 16px);
  }

  .hero-scrub__ctas {
    flex-direction: column;
    gap: 10px;
  }

  .hero-scrub__cta {
    width: 100%;
    justify-content: center;
  }
}

/* Animation keyframes */
@keyframes fadeUpDelay {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
