/* ========== ANIMATION KEYFRAMES ========== */

/* Reveal animations */
@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Fade animations */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Scale animations */
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scale-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Float animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes float-slow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

/* Pulse animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(14, 165, 233, 0);
  }
}

/* Shimmer animations */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Gradient shift */
@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Blob float */
@keyframes blob-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* Sonar pulse (orb) */
@keyframes sonar-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
  }
  50% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
  }
  100% {
    box-shadow: 0 0 0 20px rgba(14, 165, 233, 0);
  }
}

/* Bar expansion (services cards) */
@keyframes bar-expand {
  from {
    width: 24px;
  }
  to {
    width: 60px;
  }
}

/* Line decoration */
@keyframes line-draw {
  from {
    width: 0;
  }
  to {
    width: 24px;
  }
}

/* Text scramble (optional) */
@keyframes text-shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* ========== UTILITY ANIMATION CLASSES ========== */

/* Reveal on scroll */
.reveal-scroll {
  opacity: 0;
  transform: translateY(30px);
  will-change: opacity, transform;
}

.reveal-scroll.active {
  animation: reveal-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Staggered delays */
.reveal-scroll.delay-1.active {
  animation-delay: 0.1s;
}

.reveal-scroll.delay-2.active {
  animation-delay: 0.2s;
}

.reveal-scroll.delay-3.active {
  animation-delay: 0.3s;
}

.reveal-scroll.delay-4.active {
  animation-delay: 0.4s;
}

.reveal-scroll.delay-5.active {
  animation-delay: 0.5s;
}

/* Fade on scroll */
.fade-scroll {
  opacity: 0;
  will-change: opacity;
}

.fade-scroll.active {
  animation: fade-in 0.6s ease-out forwards;
}

/* Scale on scroll */
.scale-scroll {
  opacity: 0;
  transform: scale(0.95);
  will-change: opacity, transform;
}

.scale-scroll.active {
  animation: scale-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Float effect */
.float {
  animation: float 3s ease-in-out infinite;
}

.float-slow {
  animation: float-slow 4s ease-in-out infinite;
}

/* Pulse effect */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.pulse-glow {
  animation: pulse-glow 2s infinite;
}

/* ========== HOVER ANIMATIONS ========== */

/* Card hover lift */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Button hover glow */
.hover-glow {
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
}

/* Link underline */
.link-underline {
  position: relative;
  transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ========== LOADING STATES ========== */

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-soft) 0%,
    var(--bg) 50%,
    var(--bg-soft) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Pulse loader */
.pulse-loader {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========== RESPONSIVE ANIMATION ADJUSTMENTS ========== */

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

@media (max-width: 768px) {
  /* Reduce animation intensity on mobile */
  .reveal-scroll.active {
    animation-duration: 0.6s;
  }

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