/* ============================================
   ANIMATIONS - V5
   ============================================ */

/* Smooth fade-in once each image finishes loading.
   JS adds the .loaded class on the image's load event; the .js gate keeps
   images visible when JavaScript is disabled. The transform transition is
   preserved so hover zoom still animates. */
.js .card-image img,
.js .grid-item img,
.js .gallery-item img {
  opacity: 0;
  transition: opacity 0.6s ease, transform var(--transition-slow);
}

.js .card-image img.loaded,
.js .grid-item img.loaded,
.js .gallery-item img.loaded {
  opacity: 1;
}

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes logoPopIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(-45px) rotate(-8deg);
    filter: drop-shadow(0 0 0 rgba(55, 64, 245, 0));
  }
  55% {
    opacity: 1;
    transform: scale(1.12) translateY(7px) rotate(3deg);
    filter: drop-shadow(0 8px 26px rgba(55, 64, 245, 0.75));
  }
  72% {
    transform: scale(0.95) translateY(0) rotate(-1.5deg);
  }
  88% {
    transform: scale(1.03) rotate(0.5deg);
    filter: drop-shadow(0 4px 14px rgba(55, 64, 245, 0.35));
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(0);
    filter: drop-shadow(0 0 0 rgba(55, 64, 245, 0));
  }
}

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(55, 64, 245, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(55, 64, 245, 0.8);
  }
}

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

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.fade-in-down {
  animation: fadeInDown 0.6s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

.zoom-in {
  animation: zoomIn 0.6s ease-out;
}

.glow-animation {
  animation: glow 2s ease-in-out infinite;
}

.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}
