/**
 * Blackford — Motion & Scroll Interactions v2.0
 *
 * Scroll-reveal, kinetic headline, counter, sticky-panel, ticker.
 * Every effect has a reduced-motion fallback (instant/static).
 *
 * @package Blackford
 * @version 2.0.0
 */

/* ─── Scroll reveal ─────────────────────────────────────────────────────────── */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 700ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-reveal][data-revealed="true"] {
  opacity: 1;
  transform: none;
}

[data-reveal][data-reveal-delay="100"] { transition-delay: 100ms; }
[data-reveal][data-reveal-delay="200"] { transition-delay: 200ms; }
[data-reveal][data-reveal-delay="300"] { transition-delay: 300ms; }
[data-reveal][data-reveal-delay="400"] { transition-delay: 400ms; }
[data-reveal][data-reveal-delay="500"] { transition-delay: 500ms; }

/* ─── Kinetic headline ──────────────────────────────────────────────────────── */

[data-kinetic] .bf-kinetic-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 600ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-kinetic].is-revealed .bf-kinetic-word {
  opacity: 1;
  transform: none;
}

[data-kinetic].is-revealed .bf-kinetic-word:nth-child(1)  { transition-delay: 0ms; }
[data-kinetic].is-revealed .bf-kinetic-word:nth-child(2)  { transition-delay: 40ms; }
[data-kinetic].is-revealed .bf-kinetic-word:nth-child(3)  { transition-delay: 80ms; }
[data-kinetic].is-revealed .bf-kinetic-word:nth-child(4)  { transition-delay: 120ms; }
[data-kinetic].is-revealed .bf-kinetic-word:nth-child(5)  { transition-delay: 160ms; }
[data-kinetic].is-revealed .bf-kinetic-word:nth-child(6)  { transition-delay: 200ms; }
[data-kinetic].is-revealed .bf-kinetic-word:nth-child(7)  { transition-delay: 240ms; }
[data-kinetic].is-revealed .bf-kinetic-word:nth-child(8)  { transition-delay: 280ms; }
[data-kinetic].is-revealed .bf-kinetic-word:nth-child(9)  { transition-delay: 320ms; }
[data-kinetic].is-revealed .bf-kinetic-word:nth-child(10) { transition-delay: 360ms; }

/* ─── Sticky storytelling panels ───────────────────────────────────────────── */

[data-panel] {
  opacity: 0.32;
  transition:
    opacity 400ms ease,
    border-color 400ms ease;
  border-left: 1px solid transparent;
  padding-left: 1.5rem;
  margin-left: -1px;
}

[data-panel][data-active="true"] {
  opacity: 1;
  border-left-color: var(--wp--preset--color--lilac-accent, #B5A8D6);
}

/* ─── Archival ticker / marquee ─────────────────────────────────────────────── */

@keyframes bf-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.bf-ticker {
  overflow: hidden;
  border-top: 1px solid var(--wp--preset--color--concrete-200);
  border-bottom: 1px solid var(--wp--preset--color--concrete-200);
  padding: 0.875rem 0;
}

.bf-ticker--dark {
  border-top-color: rgba(255, 255, 255, 0.1);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.bf-ticker__track {
  display: inline-flex;
  gap: 3rem;
  animation: bf-marquee 60s linear infinite;
  white-space: nowrap;
  font-family: var(--wp--preset--font-family--jetbrains-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wp--preset--color--concrete-600);
}

.bf-ticker:hover .bf-ticker__track {
  animation-play-state: paused;
}

.bf-ticker--dark .bf-ticker__track {
  color: var(--wp--preset--color--concrete-400);
}

.bf-ticker__separator {
  opacity: 0.4;
  margin: 0 0.25rem;
}

/* ─── Metrics counter ───────────────────────────────────────────────────────── */

.bf-counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ─── Reduced motion: disable all effects ───────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  [data-kinetic] .bf-kinetic-word {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  [data-panel] {
    opacity: 1 !important;
    transition: none !important;
  }

  .bf-ticker__track {
    animation: none !important;
  }
}
