/* ============================================================
   CHAIN — Webflow-style Scroll FX System
   Scroll-driven animations, stagger reveals, parallax,
   counters, text splits, magnetic hover, and layout fx.
   ============================================================ */

/* ── 1. BASE: All wf-* elements start hidden ─────────────── */
[class*="wf-"],
[data-wf] {
  will-change: transform, opacity;
}

/* Reduced-motion: skip everything */
@media (prefers-reduced-motion: reduce) {
  [class*="wf-"],
  [data-wf],
  .wf-stagger > *,
  .wf-split .wf-word,
  .wf-split .wf-char {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
    clip-path: none !important;
  }
}

/* ── 2. FADE IN (base) ───────────────────────────────────── */
.wf-fade {
  opacity: 0;
  transition:
    opacity 0.7s var(--ease-out);
}
.wf-fade.wf-visible { opacity: 1; }

/* ── 3. SLIDE UP ─────────────────────────────────────────── */
.wf-up {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.75s var(--ease-out),
    transform 0.75s var(--ease-out);
}
.wf-up.wf-visible { opacity: 1; transform: translateY(0); }

/* ── 4. SLIDE DOWN ───────────────────────────────────────── */
.wf-down {
  opacity: 0;
  transform: translateY(-32px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}
.wf-down.wf-visible { opacity: 1; transform: translateY(0); }

/* ── 5. SLIDE LEFT ───────────────────────────────────────── */
.wf-left {
  opacity: 0;
  transform: translateX(-40px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}
.wf-left.wf-visible { opacity: 1; transform: translateX(0); }

/* ── 6. SLIDE RIGHT ──────────────────────────────────────── */
.wf-right {
  opacity: 0;
  transform: translateX(40px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}
.wf-right.wf-visible { opacity: 1; transform: translateX(0); }

/* ── 7. SCALE UP ─────────────────────────────────────────── */
.wf-scale {
  opacity: 0;
  transform: scale(0.93);
  transition:
    opacity 0.65s var(--ease-out),
    transform 0.65s var(--ease-out);
}
.wf-scale.wf-visible { opacity: 1; transform: scale(1); }

/* ── 8. ZOOM IN FROM BELOW (Webflow signature) ───────────── */
.wf-zoom {
  opacity: 0;
  transform: scale(0.88) translateY(20px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.wf-zoom.wf-visible { opacity: 1; transform: scale(1) translateY(0); }

/* ── 9. CLIP REVEAL (curtain wipe) ───────────────────────── */
.wf-clip {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
.wf-clip.wf-visible { clip-path: inset(0 0 0% 0); }

/* ── 10. CLIP REVEAL LEFT-TO-RIGHT ──────────────────────── */
.wf-clip-lr {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.wf-clip-lr.wf-visible { clip-path: inset(0 0% 0 0); }

/* ── 11. STAGGER CHILDREN ────────────────────────────────── */
/* Parent: .wf-stagger; children get auto-indexed delays */
.wf-stagger > * {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out);
}
.wf-stagger.wf-visible > * { opacity: 1; transform: translateY(0); }

/* JS sets --wf-i on each child; fallback for static CSS */
.wf-stagger > *:nth-child(1)  { transition-delay: calc(var(--wf-i, 0)  * 0.08s); }
.wf-stagger > *:nth-child(2)  { transition-delay: calc(var(--wf-i, 1)  * 0.08s); }
.wf-stagger > *:nth-child(3)  { transition-delay: calc(var(--wf-i, 2)  * 0.08s); }
.wf-stagger > *:nth-child(4)  { transition-delay: calc(var(--wf-i, 3)  * 0.08s); }
.wf-stagger > *:nth-child(5)  { transition-delay: calc(var(--wf-i, 4)  * 0.08s); }
.wf-stagger > *:nth-child(6)  { transition-delay: calc(var(--wf-i, 5)  * 0.08s); }
.wf-stagger > *:nth-child(7)  { transition-delay: calc(var(--wf-i, 6)  * 0.08s); }
.wf-stagger > *:nth-child(8)  { transition-delay: calc(var(--wf-i, 7)  * 0.08s); }
.wf-stagger > *:nth-child(9)  { transition-delay: calc(var(--wf-i, 8)  * 0.08s); }
.wf-stagger > *:nth-child(10) { transition-delay: calc(var(--wf-i, 9)  * 0.08s); }
.wf-stagger > *:nth-child(11) { transition-delay: calc(var(--wf-i, 10) * 0.08s); }
.wf-stagger > *:nth-child(12) { transition-delay: calc(var(--wf-i, 11) * 0.08s); }
.wf-stagger > *:nth-child(13) { transition-delay: calc(var(--wf-i, 12) * 0.08s); }
.wf-stagger > *:nth-child(14) { transition-delay: calc(var(--wf-i, 13) * 0.08s); }
.wf-stagger > *:nth-child(15) { transition-delay: calc(var(--wf-i, 14) * 0.08s); }
.wf-stagger > *:nth-child(16) { transition-delay: calc(var(--wf-i, 15) * 0.08s); }
.wf-stagger > *:nth-child(17) { transition-delay: calc(var(--wf-i, 16) * 0.08s); }
.wf-stagger > *:nth-child(18) { transition-delay: calc(var(--wf-i, 17) * 0.08s); }

/* ── 12. DELAY MODIFIERS ─────────────────────────────────── */
.wf-delay-0   { transition-delay: 0ms !important; }
.wf-delay-50  { transition-delay: 50ms !important; }
.wf-delay-100 { transition-delay: 100ms !important; }
.wf-delay-150 { transition-delay: 150ms !important; }
.wf-delay-200 { transition-delay: 200ms !important; }
.wf-delay-250 { transition-delay: 250ms !important; }
.wf-delay-300 { transition-delay: 300ms !important; }
.wf-delay-400 { transition-delay: 400ms !important; }
.wf-delay-500 { transition-delay: 500ms !important; }
.wf-delay-600 { transition-delay: 600ms !important; }
.wf-delay-700 { transition-delay: 700ms !important; }
.wf-delay-800 { transition-delay: 800ms !important; }

/* ── 13. DURATION MODIFIERS ─────────────────────────────── */
.wf-dur-fast   { transition-duration: 0.4s !important; }
.wf-dur-normal { transition-duration: 0.7s !important; }
.wf-dur-slow   { transition-duration: 1.1s !important; }
.wf-dur-xslow  { transition-duration: 1.5s !important; }

/* ── 14. TEXT SPLIT REVEAL ───────────────────────────────── */
/* JS splits text into .wf-word or .wf-char spans */
.wf-split {
  overflow: hidden;
}
.wf-split .wf-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(1.1em) rotate(2deg);
  transition:
    opacity 0.55s var(--ease-out),
    transform 0.55s var(--ease-out);
}
.wf-split.wf-visible .wf-word {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

.wf-split .wf-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(60%) scale(0.9);
  transition:
    opacity 0.45s var(--ease-out),
    transform 0.45s var(--ease-out);
}
.wf-split.wf-visible .wf-char {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── 15. LINE REVEAL (headline underline draw) ───────────── */
.wf-underline {
  position: relative;
  display: inline;
}
.wf-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.wf-visible .wf-underline::after,
.wf-underline.wf-visible::after {
  transform: scaleX(1);
}

/* ── 16. COUNTER NUMBERS ─────────────────────────────────── */
.wf-counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
/* The JS animates the textContent; no CSS needed beyond display */

/* ── 17. SECTION EYEBROW FLOAT ───────────────────────────── */
.wf-eyebrow {
  opacity: 0;
  transform: translateX(-16px);
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
}
.wf-eyebrow.wf-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ── 18. SCROLL-PROGRESS LINE (top of viewport) ──────────── */
.wf-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--amber-400), var(--sienna-400));
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── 19. PARALLAX HOST ────────────────────────────────────── */
/* JS sets --wf-prl on the element; CSS applies it */
[data-parallax] {
  will-change: transform;
  /* transform is set by JS via inline style */
}

/* ── 20. MAGNETIC CARD HOVER ─────────────────────────────── */
.wf-magnetic {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
/* JS handles the mousemove-driven tilt inline */

/* ── 21. FLOAT (continuous idle animation) ────────────────── */
@keyframes wf-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}
.wf-float-idle {
  animation: wf-float 4s ease-in-out infinite;
}

/* ── 22. RIPPLE BUTTON ───────────────────────────────────── */
.wf-ripple {
  position: relative;
  overflow: hidden;
}
.wf-ripple .wf-ripple__ink {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: scale(0);
  animation: wf-ripple-out 0.6s var(--ease-out) forwards;
  pointer-events: none;
}
@keyframes wf-ripple-out {
  to { transform: scale(4); opacity: 0; }
}

/* ── 23. HORIZONTAL SCROLL STRIP ─────────────────────────── */
.wf-hscroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: var(--col-gap, 1.5rem);
  padding-block: var(--space-4);
  scrollbar-width: none;
}
.wf-hscroll::-webkit-scrollbar { display: none; }
.wf-hscroll > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
}

/* ── 24. SECTION FLOATING LABEL ──────────────────────────── */
.wf-section-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--type-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-6);
}
.wf-section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--color-accent);
  flex-shrink: 0;
}
.wf-section-label--light {
  color: rgba(255,255,255,0.5);
}
.wf-section-label--light::before {
  background: var(--amber-300);
}

/* ── 25. DIVIDER DRAW ─────────────────────────────────────── */
.wf-divider {
  height: 1px;
  background: var(--color-border);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.wf-divider.wf-visible { transform: scaleX(1); }

/* ── 26. STAT CARD REVEAL (pop + glow) ───────────────────── */
.wf-stat-pop {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out),
    box-shadow 0.6s var(--ease-out);
}
.wf-stat-pop.wf-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  box-shadow: 0 0 0 0 transparent;
}

/* ── 27. FLIP CARD (3D) ───────────────────────────────────── */
.wf-flip {
  opacity: 0;
  transform: rotateX(-20deg) translateY(30px);
  transform-style: preserve-3d;
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}
.wf-flip.wf-visible {
  opacity: 1;
  transform: rotateX(0deg) translateY(0);
}

/* ── 28. TILT HOST ────────────────────────────────────────── */
/* JS drives the inline transform; CSS only sets perspective */
.wf-tilt {
  transform-style: preserve-3d;
  perspective: 800px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.wf-tilt:hover {
  /* JS overrides; this ensures smooth reset on mouseout */
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── 29. STICKY SECTION LABEL ────────────────────────────── */
.wf-sticky-label {
  position: sticky;
  top: calc(var(--nav-total, 108px) + var(--space-4));
  align-self: flex-start;
  font-size: var(--type-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-accent-dark);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  user-select: none;
  pointer-events: none;
  opacity: 0.6;
}

/* ── 30. KINETIC HEADLINE (blur-in) ──────────────────────── */
.wf-blur {
  opacity: 0;
  filter: blur(12px);
  transform: translateY(10px);
  transition:
    opacity 0.8s var(--ease-out),
    filter 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
}
.wf-blur.wf-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* ── 31. MARQUEE (infinite scroll ticker) ────────────────── */
.wf-marquee {
  overflow: hidden;
  white-space: nowrap;
}
.wf-marquee__inner {
  display: inline-flex;
  gap: var(--space-8);
  animation: wf-marquee-scroll var(--marquee-duration, 30s) linear infinite;
}
.wf-marquee:hover .wf-marquee__inner {
  animation-play-state: paused;
}
@keyframes wf-marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── 32. GRID REVEAL (used on big grids) ─────────────────── */
/* Same as stagger but specialized for grid children */
.wf-grid-reveal > * {
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition:
    opacity 0.55s var(--ease-out),
    transform 0.55s var(--ease-out);
}
.wf-grid-reveal.wf-visible > * {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.wf-grid-reveal > *:nth-child(1)  { transition-delay: 0.00s; }
.wf-grid-reveal > *:nth-child(2)  { transition-delay: 0.07s; }
.wf-grid-reveal > *:nth-child(3)  { transition-delay: 0.14s; }
.wf-grid-reveal > *:nth-child(4)  { transition-delay: 0.21s; }
.wf-grid-reveal > *:nth-child(5)  { transition-delay: 0.28s; }
.wf-grid-reveal > *:nth-child(6)  { transition-delay: 0.35s; }
.wf-grid-reveal > *:nth-child(7)  { transition-delay: 0.42s; }
.wf-grid-reveal > *:nth-child(8)  { transition-delay: 0.49s; }
.wf-grid-reveal > *:nth-child(9)  { transition-delay: 0.56s; }
.wf-grid-reveal > *:nth-child(10) { transition-delay: 0.63s; }
.wf-grid-reveal > *:nth-child(11) { transition-delay: 0.70s; }
.wf-grid-reveal > *:nth-child(12) { transition-delay: 0.77s; }

/* ── 33. FLEX ROW UTILITIES ───────────────────────────────── */
/* Used for section headers, label+link rows, stat rows */
.wf-row {
  display: flex;
  align-items: center;
  gap: var(--col-gap, 1.5rem);
}
.wf-row--between {
  justify-content: space-between;
}
.wf-row--start {
  align-items: flex-start;
}
.wf-row--wrap {
  flex-wrap: wrap;
}
.wf-row--col-mobile {
  /* becomes column on mobile — JS or media query adjusts */
}
@media (max-width: 639px) {
  .wf-row--col-mobile {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── 34. STICKY PROGRESS SIDEBAR ────────────────────────── */
.wf-progress-sidebar {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-raised, 10);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
}
.wf-progress-sidebar.wf-visible {
  opacity: 1;
  pointer-events: auto;
}
.wf-progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border);
  transition:
    background 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
  cursor: pointer;
  pointer-events: auto;
}
.wf-progress-dot.wf-active {
  background: var(--color-accent);
  transform: scale(1.5);
}

/* ── 35. SPOTLIGHT EFFECT (card hover glow) ───────────────── */
.wf-spotlight {
  position: relative;
  overflow: hidden;
}
.wf-spotlight::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(224,122,0,.06) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
  z-index: 0;
}
.wf-spotlight:hover::before {
  opacity: 1;
}
/* Ensure children sit above the glow */
.wf-spotlight > * {
  position: relative;
  z-index: 1;
}
