/* ============================================
   PORTFOLIO — animations.css
   Keyframes, transitions, micro-interactions
   ============================================ */

/* ---------- Keyframes ---------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes dotFade {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

@keyframes floatShape {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

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

@keyframes scrollWheel {
  0% { opacity: 1; top: 8px; }
  100% { opacity: 0; top: 22px; }
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes rotateIn {
  from { opacity: 0; transform: rotate(-15deg) scale(0.9); }
  to { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* ---------- Animation Utility Classes ---------- */
.anim-fade-up { animation: fadeInUp 0.8s ease forwards; }
.anim-fade-down { animation: fadeInDown 0.8s ease forwards; }
.anim-scale { animation: scaleIn 0.6s ease forwards; }
.anim-rotate { animation: rotateIn 0.7s ease forwards; }

/* ---------- Animated Gradient Text ---------- */
.text-gradient {
  background-size: 200% auto;
  animation: gradientShift 4s ease infinite;
}

/* ---------- Button Ripple Effect ---------- */
.btn-gradient .ripple,
.btn-outline-gradient .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ---------- Magnetic Button Transition ---------- */
.magnetic {
  transition: transform 0.2s ease-out;
  will-change: transform;
}

/* ---------- Card Hover Lift ---------- */
.service-card,
.pricing-card,
.blog-card,
.stat-card,
.testimonial-card,
.timeline__content {
  will-change: transform;
}

/* ---------- Section Reveal (GSAP compatible) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
}

/* ---------- Image Reveal Mask ---------- */
.img-reveal-wrap { overflow: hidden; position: relative; }
.img-reveal-wrap img {
  transform: scale(1.2);
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.img-reveal-wrap.is-visible img { transform: scale(1); }

/* ---------- Animated Border (gradient) ---------- */
.animated-border {
  position: relative;
  border: 2px solid transparent;
  background-image: linear-gradient(var(--bg-card), var(--bg-card)), var(--gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

/* ---------- Glow Pulse ---------- */
.glow-pulse {
  animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(37, 99, 235, 0.2); }
  50% { box-shadow: 0 0 40px rgba(37, 99, 235, 0.45); }
}

/* ---------- Floating Icon ---------- */
.float-icon {
  animation: floatBadge 4s ease-in-out infinite;
}

/* ---------- Text Reveal (clip) ---------- */
.text-reveal {
  display: inline-block;
  overflow: hidden;
}
.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.text-reveal.is-visible span { transform: translateY(0); }

/* ---------- Hover Scale Utility ---------- */
.hover-scale {
  transition: transform 0.35s ease;
}
.hover-scale:hover { transform: scale(1.05); }

/* ---------- Reduced Motion ---------- */
@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;
  }
}
