/* =====================================================
   CHONRY - Animations & Scroll Effects
   ===================================================== */

/* ─── Keyframes ─────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.15); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── Scroll Animations ─────────────────────────────── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.delay-5 { transition-delay: 0.5s; }
.animate-on-scroll.delay-6 { transition-delay: 0.6s; }

/* Fade in from sides */
.animate-fade-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-fade-left.animated { opacity: 1; transform: translateX(0); }

.animate-fade-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-fade-right.animated { opacity: 1; transform: translateX(0); }

/* Scale in */
.animate-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.animate-scale.animated { opacity: 1; transform: scale(1); }

/* Hero entrance animations */
.hero-badge { animation: slideInDown 0.6s ease both; animation-delay: 0.1s; }
.hero-title { animation: fadeInUp 0.7s ease both; animation-delay: 0.2s; }
.hero-description { animation: fadeInUp 0.7s ease both; animation-delay: 0.3s; }
.hero-actions { animation: fadeInUp 0.7s ease both; animation-delay: 0.4s; }
.hero-stats { animation: fadeInUp 0.7s ease both; animation-delay: 0.5s; }
.hero-visual { animation: scaleIn 0.8s ease both; animation-delay: 0.3s; }

/* Section headers */
.section-header { animation: fadeInUp 0.6s ease both; }

/* Stagger grid children */
.products-grid .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.products-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.products-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.products-grid .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.products-grid .animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.products-grid .animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

.features-grid .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.features-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.features-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }

.solutions-grid .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.solutions-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.solutions-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.solutions-grid .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.solutions-grid .animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.solutions-grid .animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-subtle) 25%, var(--color-bg-deep) 50%, var(--color-bg-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-md);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .animate-on-scroll,
  .animate-fade-left,
  .animate-fade-right,
  .animate-scale {
    opacity: 1;
    transform: none;
  }
}
