/* Scroll-triggered animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

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

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.8s ease-out;
}

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

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.8s ease-out;
}

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

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s ease-out;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger animations for grid items */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.stagger-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-item:nth-child(6) { transition-delay: 0.6s; }

/* Hover animations */
.hover-lift {
  transition: transform 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-gray);
  border-radius: 50%;
  border-top-color: var(--accent-red);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Pulse animation for CTAs */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(195, 1, 0, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(195, 1, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(195, 1, 0, 0);
  }
}

/* Glow effect */
.glow {
  transition: all 0.3s ease;
}

.glow:hover {
  box-shadow: 0 0 20px rgba(195, 1, 0, 0.5);
}

/* Text reveal animation */
@keyframes textReveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.text-reveal {
  animation: textReveal 1s ease-out forwards;
}

/* Gradient animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-animate {
  background: linear-gradient(-45deg, var(--primary-black), var(--accent-red), var(--dark-gray), var(--accent-sage));
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

/* Number counter animation */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* Parallax effect classes */
.parallax {
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Glitch effect for text */
@keyframes glitch {
  0% {
    text-shadow: 
      0.05em 0 0 var(--accent-red),
      -0.05em -0.025em 0 var(--accent-sage),
      0.025em 0.05em 0 var(--accent-red);
  }
  14% {
    text-shadow: 
      0.05em 0 0 var(--accent-red),
      -0.05em -0.025em 0 var(--accent-sage),
      0.025em 0.05em 0 var(--accent-red);
  }
  15% {
    text-shadow: 
      -0.05em -0.025em 0 var(--accent-red),
      0.025em 0.025em 0 var(--accent-sage),
      -0.05em -0.05em 0 var(--accent-red);
  }
  49% {
    text-shadow: 
      -0.05em -0.025em 0 var(--accent-red),
      0.025em 0.025em 0 var(--accent-sage),
      -0.05em -0.05em 0 var(--accent-red);
  }
  50% {
    text-shadow: 
      0.025em 0.05em 0 var(--accent-red),
      0.05em 0 0 var(--accent-sage),
      0 -0.05em 0 var(--accent-red);
  }
  99% {
    text-shadow: 
      0.025em 0.05em 0 var(--accent-red),
      0.05em 0 0 var(--accent-sage),
      0 -0.05em 0 var(--accent-red);
  }
  100% {
    text-shadow: 
      -0.025em 0 0 var(--accent-red),
      -0.025em -0.025em 0 var(--accent-sage),
      -0.025em -0.05em 0 var(--accent-red);
  }
}

.glitch {
  animation: glitch 0.5s infinite;
}

.glitch:hover {
  animation-duration: 0.2s;
}