/**
 * Scroll Animations — gano-scroll-animations.css
 * IntersectionObserver-based scroll reveal animations with stagger support
 * Task F3.2 — Sprint 1 Visual SOTA
 */

/* ============================================================================
   Base Animation Setup
   ============================================================================ */

[data-animation] {
  opacity: 0;
  will-change: transform, opacity;
}

[data-animation].reveal-active {
  animation-duration: var(--animation-duration, 600ms);
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  animation-fill-mode: forwards;
  animation-delay: var(--animation-delay, 0ms);
}

/* ============================================================================
   Keyframes — Animation Definitions
   ============================================================================ */

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-left {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes reveal-right {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotate {
  from {
    opacity: 0;
    transform: rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: rotate(0deg);
  }
}

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

/* ============================================================================
   Animation Classes — Tie keyframes to data-animation values
   ============================================================================ */

[data-animation="reveal-up"].reveal-active {
  animation-name: reveal-up;
}

[data-animation="reveal-left"].reveal-active {
  animation-name: reveal-left;
}

[data-animation="reveal-right"].reveal-active {
  animation-name: reveal-right;
}

[data-animation="scale"].reveal-active {
  animation-name: scale;
}

[data-animation="rotate"].reveal-active {
  animation-name: rotate;
}

[data-animation="fade"].reveal-active {
  animation-name: fade;
}

/* ============================================================================
   Accessibility: Respect prefers-reduced-motion
   ============================================================================ */

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