/* =========================================================================
   Stulworth — Motion layer (Webflow-style): Lenis, progress, band blends,
   scroll-driven reveals, hero parallax. Lightweight, a11y-guarded.
   ========================================================================= */

/* ---- Hero word split reveal (staggered on load) ---- */
.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(16px);
  animation: word-in 0.5s var(--ease) forwards;
}
.hero-word:nth-child(1) { animation-delay: 0.05s; }
.hero-word:nth-child(2) { animation-delay: 0.12s; }
.hero-word:nth-child(3) { animation-delay: 0.19s; }
.hero-word:nth-child(4) { animation-delay: 0.26s; }
.hero-word:nth-child(5) { animation-delay: 0.33s; }
.hero-word:nth-child(6) { animation-delay: 0.40s; }
.hero-word:nth-child(7) { animation-delay: 0.47s; }
.hero-word:nth-child(8) { animation-delay: 0.54s; }
@keyframes word-in {
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Clip-path image reveals ---- */
.slide:first-child {
  clip-path: inset(0 100% 0 0);
  animation: slide-reveal 1s var(--ease) 0.2s forwards;
}
@keyframes slide-reveal {
  to { clip-path: inset(0 0 0 0); }
}
.ins-lead img {
  animation: ins-fade-in 1.2s var(--ease) 0.3s both;
}
@keyframes ins-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Sticky horizontal scroll ---- */
.horiz-section { position: relative; }
.horiz-sticky {
  position: sticky; top: var(--header-h, 70px);
  height: 100vh; overflow: hidden;
  display: flex; align-items: center;
}
.horiz-track {
  display: flex; gap: 0;
  will-change: transform;
}
.horiz-panel {
  flex: 0 0 100vw;
  min-height: 60vh;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(32px, 5vw, 80px);
}
.horiz-panel-inner {
  max-width: 720px;
}
.horiz-panel .ghost-num {
  position: static;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.85;
  opacity: 0.2;
}
.horiz-panel h3 { font-size: clamp(1.6rem, 3.4vw, 2.8rem); margin: var(--s-4) 0 var(--s-3); line-height: 1.08; }
.horiz-panel p { font-size: var(--fs-lead); color: var(--muted); max-width: 540px; }

/* ---- Pin-stack process (vertical slide) ---- */
.pin-sticky {
  position: sticky; top: var(--header-h, 70px);
  height: 100vh; overflow: hidden;
}
.pin-track {
  position: relative;
  width: 100%; height: 100vh;
}
.pin-slide {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100vh;
  background-size: cover; background-position: center;
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; align-items: center;
  padding: clamp(32px, 5vw, 80px);
  z-index: calc(var(--i, 0) + 1);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}
.pin-slide::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.35) 100%);
  z-index: 0;
  pointer-events: none;
}
.pin-slide-inner {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; gap: var(--s-7);
  max-width: 800px;
  clip-path: inset(0 100% 0 0);
}
.pin-slide.active-slide .pin-slide-inner {
  animation: clip-reveal 0.9s var(--ease) forwards;
}

@keyframes clip-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
.pin-slide .circle {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  font-size: 2rem; color: var(--ink);
  flex-shrink: 0;
}
.pin-slide-body h4 {
  font-size: clamp(2.4rem, 4.8vw, 4rem);
  margin-bottom: var(--s-3);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.pin-slide-body p {
  color: rgba(255,255,255,0.88);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  max-width: 600px;
  font-weight: 500;
  line-height: 1.4;
}

/* ---- Number counter ---- */
.counter-wrap { display: inline-flex; align-items: baseline; gap: 4px; }
.counter-num { font-variant-numeric: tabular-nums; }

/* ---- Velocity micro-parallax ---- */
.par-layer {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ---- Page color interpolator ---- */
.color-blend {
  transition: background-color 0.8s var(--ease);
}

/* ---- Cursor preview extended ---- */
[data-card-preview] {
  cursor: crosshair;
}

/* ---- Lenis required CSS ---- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

/* ---- Scroll progress bar ---- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 200;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
  will-change: transform;
}

/* ---- Band section base ---- */
.band { position: relative; }
.band > .container { position: relative; z-index: 1; }

/* ---- Hero parallax (subtle, scroll-driven) ---- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .hero-slides {
      animation: hero-par linear both;
      animation-timeline: scroll(root);
      animation-range: 0 90vh;
    }
    @keyframes hero-par { to { transform: translateY(70px); } }
  }
}

/* ---- All reveals handled by IntersectionObserver in reveal.js ---- */
.reveal--io .reveal {
  opacity: 0; transform: translateY(42px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal--io .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .pin-slide-inner { clip-path: none !important; }
}

/* Dark bands — no fade-in/opacity/transition */
.band--dark.reveal { opacity: 1; transform: none; transition: none !important; animation: none !important; }
