/* ==========================================================================
   RIVAL Shoes - Animations & Scroll Reveals
   ========================================================================== */

/* ---- Reveal Animations ---- */

.reveal-up,
.reveal-left,
.reveal-right,
.reveal-scale {
  opacity: 0;
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.reveal-up {
  transform: translateY(60px);
}

.reveal-left {
  transform: translateX(-60px);
}

.reveal-right {
  transform: translateX(60px);
}

.reveal-scale {
  transform: scale(0.85);
}

.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible,
.reveal-scale.visible {
  opacity: 1;
  transform: none;
}

/* ---- Stagger Children Animation ---- */

.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-out);
}

.stagger-children.visible > *:nth-child(1)  { transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2)  { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3)  { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(4)  { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(5)  { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(6)  { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(7)  { transition-delay: 0.6s; }
.stagger-children.visible > *:nth-child(8)  { transition-delay: 0.7s; }
.stagger-children.visible > *:nth-child(9)  { transition-delay: 0.8s; }
.stagger-children.visible > *:nth-child(10) { transition-delay: 0.9s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: none;
}

/* ---- SVG Line Drawing Animation ---- */

.svg-draw path,
.svg-draw line,
.svg-draw circle,
.svg-draw polyline {
  stroke-dasharray: var(--path-length, 1000);
  stroke-dashoffset: var(--path-length, 1000);
  transition: stroke-dashoffset 2s var(--ease-out);
}

.svg-draw.visible path,
.svg-draw.visible line,
.svg-draw.visible circle,
.svg-draw.visible polyline {
  stroke-dashoffset: 0;
}

/* ---- Scroll Arrow Bounce ---- */

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

.scroll-arrow {
  animation: bounceDown 2s ease-in-out infinite;
}

/* ---- Parallax ---- */

.parallax {
  will-change: transform;
}

/* ---- Fade In Keyframe ---- */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn var(--duration-slow) var(--ease-out) forwards;
}

/* ---- Slide Up Keyframe ---- */

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp var(--duration-slow) var(--ease-out) forwards;
}

/* ---- Width Grow (for divider lines) ---- */

@keyframes widthGrow {
  from {
    width: 0;
  }
  to {
    width: 80px;
  }
}

/* ---- Counter Animation ---- */

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Reduced Motion ---- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1;
    transform: none;
  }

  .stagger-children > * {
    opacity: 1;
    transform: none;
  }

  .svg-draw path,
  .svg-draw line,
  .svg-draw circle,
  .svg-draw polyline {
    stroke-dashoffset: 0;
  }

  .parallax {
    will-change: auto;
  }
}
