/* ====================================================
   Webwing Soft - Animations CSS
   ==================================================== */

/* Stagger delays for grid items */
.service-card:nth-child(1) { transition-delay: 0.05s; }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.15s; }
.service-card:nth-child(4) { transition-delay: 0.2s; }
.service-card:nth-child(5) { transition-delay: 0.25s; }
.service-card:nth-child(6) { transition-delay: 0.3s; }

.portfolio-card:nth-child(1) { transition-delay: 0.05s; }
.portfolio-card:nth-child(2) { transition-delay: 0.1s; }
.portfolio-card:nth-child(3) { transition-delay: 0.15s; }
.portfolio-card:nth-child(4) { transition-delay: 0.2s; }
.portfolio-card:nth-child(5) { transition-delay: 0.25s; }
.portfolio-card:nth-child(6) { transition-delay: 0.3s; }

/* Particle dots */
@keyframes particleFloat {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-80px) rotate(360deg); opacity: 0; }
}

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

/* Text shimmer */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.shimmer-text {
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent), var(--primary));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

/* Typewriter cursor */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.cursor { animation: blink 1s infinite; }

/* Bounce */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}
.bounce { animation: bounce 2s ease-in-out infinite; }

/* Spin slow */
@keyframes spinSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin-slow { animation: spinSlow 20s linear infinite; }

/* Ping / pulsing ring */
@keyframes ping {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}
.ping { animation: ping 1.5s ease-out infinite; }

/* Card flip (used in team page hover) */
.flip-card { perspective: 1000px; }
.flip-card-inner { transition: transform 0.6s; transform-style: preserve-3d; position: relative; }
.flip-card:hover .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back {
  backface-visibility: hidden; position: absolute; inset: 0;
  border-radius: inherit;
}
.flip-card-back {
  transform: rotateY(180deg);
  background: var(--bg-card2);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}

/* Ripple effect for buttons */
.btn { isolation: isolate; }
.btn .ripple {
  position: absolute; border-radius: 50%;
  transform: scale(0); animation: rippleEffect 0.6s linear;
  background: rgba(255,255,255,0.3); pointer-events: none;
}
@keyframes rippleEffect { to { transform: scale(4); opacity: 0; } }

/* Counting animation trigger */
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.counting { animation: countUp 0.4s ease forwards; }

/* Scroll indicator */
.scroll-indicator {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  color: var(--text-muted); font-size: 0.78rem;
}
.scroll-line {
  width: 1px; height: 50px; background: linear-gradient(to bottom, var(--primary), transparent);
  animation: scrollLine 1.5s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Glitch effect (decorative) */
@keyframes glitch1 {
  0% { clip-path: inset(20% 0 60% 0); transform: translate(-3px,0); }
  25% { clip-path: inset(50% 0 30% 0); transform: translate(3px,0); }
  50% { clip-path: inset(10% 0 80% 0); transform: translate(-3px,0); }
  75% { clip-path: inset(70% 0 10% 0); transform: translate(3px,0); }
  100% { clip-path: inset(20% 0 60% 0); transform: translate(-3px,0); }
}

/* Progress bars */
.skill-bar-track {
  height: 6px; background: rgba(255,255,255,0.08);
  border-radius: 99px; overflow: hidden; margin-top: 0.35rem;
}
.skill-bar-fill {
  height: 100%; background: var(--gradient-primary);
  border-radius: 99px; width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Toast notification */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast {
  animation: toastIn 0.3s ease forwards;
  position: fixed; bottom: 5rem; right: 2rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  z-index: 3000; max-width: 320px;
}
