/* ═══════════════════════════════════════════════════════════
   AP Digital – animations.css
   Scroll Fade-in, Count-Up, Keyframes
   ═══════════════════════════════════════════════════════════ */

/* ─── Scroll Fade-in Base State ─── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.fade-in--delay-1 { transition-delay: 0.1s; }
.fade-in--delay-2 { transition-delay: 0.2s; }
.fade-in--delay-3 { transition-delay: 0.3s; }
.fade-in--delay-4 { transition-delay: 0.4s; }
.fade-in--delay-5 { transition-delay: 0.5s; }

/* Fade from left */
.fade-in--left {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in--left.is-visible { opacity: 1; transform: translateX(0); }

/* Fade from right */
.fade-in--right {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in--right.is-visible { opacity: 1; transform: translateX(0); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .fade-in--left,
  .fade-in--right {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─── Scroll Indicator Pulse ─── */
@keyframes scrollPulse {
  0%, 100% { opacity: 0.35; transform: scaleY(1); }
  50%       { opacity: 0.85; transform: scaleY(0.75); }
}

.hero__scroll-line {
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ─── Hamburger Toggle ─── */
.nav__hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__hamburger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav__hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav__hamburger span {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ─── Module Dot Active State (JS driven) ─── */
.module__dot.is-active {
  width: 20px;
  border-radius: var(--radius-full);
  background: var(--color-text-muted);
}

/* ─── Hero Badge Dot Pulse ─── */
@keyframes badgePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ─── CTA Button Glow Pulse ─── */
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 197, 24, 0); }
  50%       { box-shadow: 0 0 32px rgba(245, 197, 24, 0.22); }
}

.hero__cta {
  animation: ctaGlow 3.5s ease-in-out infinite;
}

.hero__cta:hover,
.hero__cta:focus-visible {
  animation: none;
}

/* ─── Hero Particles Float ─── */
@keyframes floatA {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

@keyframes floatB {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(6px); }
}

.hero__particle--1 { animation: floatA 6s ease-in-out infinite; }
.hero__particle--2 { animation: floatB 8s ease-in-out infinite; }
.hero__particle--3 { animation: floatA 7s ease-in-out infinite 1s; }
.hero__particle--4 { animation: floatB 5s ease-in-out infinite 0.5s; }

@media (prefers-reduced-motion: reduce) {
  .hero__particle { animation: none; }
  .hero__scroll-line { animation: none; }
}

/* ─── Timeline Dot Pulse (active step) ─── */
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(55, 98, 124, 0); }
  50%       { box-shadow: 0 0 0 6px rgba(55, 98, 124, 0.15); }
}

.timeline__dot.is-active {
  border-color: var(--color-accent-blue);
  animation: dotPulse 2s ease-in-out infinite;
}

/* ─── Module Ticker / Marquee ─── */
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.module__ticker-wrapper {
  overflow: hidden;
  width: 100%;
  position: relative;
  padding: 8px 0 24px;
}

.module__ticker-wrapper::before,
.module__ticker-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}

.module__ticker-wrapper::before {
  left: 0;
  background: linear-gradient(to right, var(--color-bg), transparent);
}

.module__ticker-wrapper::after {
  right: 0;
  background: linear-gradient(to left, var(--color-bg), transparent);
}

.module__ticker-track {
  display: flex;
  gap: 24px;
  animation: marquee 28s linear infinite;
  width: max-content;
}

.module__ticker-wrapper:hover .module__ticker-track {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .module__ticker-track {
    animation: none;
  }
}


/* ─── Hero Cell Click Ripple ─── */
@keyframes heroRipple {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(18); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__cell-ripple { display: none; }
}

/* ─── Count-Up Number ─── */
[data-count-up] {
  display: inline-block;
  transition: color 0.2s ease;
}

[data-count-up].is-counting {
  color: #ffffff;
}

[data-count-up].flash-gold {
  color: var(--color-accent-gold);
  transition: color 0s;
}
