/* ============================================================
   NeuAnalytics 2026, Animation System
   Scroll-triggered reveals + Motion Design
   Brand Guide v3.0 Section 18
   ============================================================ */

/* ---- Respect reduced motion preferences ---- */
@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;
  }

  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---- Scroll Reveal Base ---- */
/* Elements start hidden and animate in when they enter the viewport */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

/* ---- Reveal Variants ---- */
/* Fade up (default) */
.reveal-up {
  transform: translateY(30px);
}

/* Fade down */
.reveal-down {
  transform: translateY(-30px);
}

/* Fade left */
.reveal-left {
  transform: translateX(30px);
}

/* Fade right */
.reveal-right {
  transform: translateX(-30px);
}

/* Scale up */
.reveal-scale {
  transform: scale(0.95);
}

/* Fade only (no movement) */
.reveal-fade {
  transform: none;
}

/* ---- Staggered Children ---- */
/* Apply to parent; children get sequential delays */
.stagger-children > .animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.stagger-children > .animate-on-scroll:nth-child(2) { transition-delay: 100ms; }
.stagger-children > .animate-on-scroll:nth-child(3) { transition-delay: 200ms; }
.stagger-children > .animate-on-scroll:nth-child(4) { transition-delay: 300ms; }
.stagger-children > .animate-on-scroll:nth-child(5) { transition-delay: 400ms; }
.stagger-children > .animate-on-scroll:nth-child(6) { transition-delay: 500ms; }

/* ---- Keyframe Animations ---- */

/* Gentle float (for decorative elements) */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Pulse glow (for CTAs, active elements) */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(4, 152, 254, 0.3); }
  50% { box-shadow: 0 0 20px 5px rgba(4, 152, 254, 0.15); }
}

.animate-pulse {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* Gradient shift (for hero backgrounds) */
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 15s ease infinite;
}

/* Counter number roll */
@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typing cursor blink */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Arrow slide in from left */
@keyframes arrow-enter {
  from {
    opacity: 0;
    transform: translateX(-40px) rotate(-90deg);
  }
  to {
    opacity: 0.08;
    transform: translateX(0) rotate(-90deg);
  }
}

/* ---- Hover Animations ---- */

/* Card lift */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

/* Icon rotate on hover */
.hover-rotate:hover .icon {
  transform: rotate(5deg);
  transition: transform var(--transition-base);
}

/* Link underline slide */
.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--neu-blue);
  transition: width var(--transition-base);
}

.link-underline:hover::after {
  width: 100%;
}

/* ---- Loading / Skeleton States ---- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--glass-light-bg) 25%,
    var(--glass-medium-bg) 50%,
    var(--glass-light-bg) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--border-radius-sm);
}

/* ---- Page Transition ---- */
.page-enter {
  opacity: 0;
  transform: translateY(10px);
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ---- Gradient Accent Line Animation ---- */
@keyframes line-draw {
  from { width: 0; }
  to { width: 100%; }
}

.gradient-line--animated {
  width: 0;
  transition: width 0.8s ease;
}

.gradient-line--animated.is-visible {
  width: 100%;
}
