/* ============================================================
   SA Digital Labs — Micro-animations & Keyframes
   ============================================================ */

/* Animated gradient border */
@keyframes border-glow {
  0%, 100% { border-color: rgba(0,188,212,0.3); box-shadow: 0 0 10px rgba(0,188,212,0.1); }
  50%       { border-color: rgba(0,188,212,0.7); box-shadow: 0 0 25px rgba(0,188,212,0.3); }
}

/* Shimmer effect */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

/* Typed cursor blink */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Particle float */
@keyframes particle-float {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-120px) translateX(40px) rotate(360deg); opacity: 0; }
}

/* Pulse ring */
@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Slide in from left */
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Slide in from right */
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

/* Wave */
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25%       { transform: rotate(10deg); }
  75%       { transform: rotate(-10deg); }
}

/* ─── Animated Hero Title ─────────────────────────────────── */
.hero__title .line {
  overflow: hidden;
  display: block;
}
.hero__title .line span {
  display: block;
  animation: slide-in-left 0.8s cubic-bezier(0.4,0,0.2,1) both;
}
.hero__title .line:nth-child(2) span { animation-delay: 0.15s; }
.hero__title .line:nth-child(3) span { animation-delay: 0.3s; }

/* ─── Typed text cursor ───────────────────────────────────── */
.typed-cursor {
  display: inline-block;
  width: 3px;
  background: var(--accent);
  animation: cursor-blink 0.8s ease-in-out infinite;
  vertical-align: baseline;
  margin-left: 2px;
}

/* ─── Counter animation ───────────────────────────────────── */
.counter-value {
  display: inline-block;
  transition: all 0.1s ease;
}

/* ─── Particle canvas ─────────────────────────────────────── */
#particles-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* ─── Glow pulse on elements ──────────────────────────────── */
.glow-on-hover:hover {
  animation: border-glow 2s ease-in-out infinite;
}

/* ─── Shimmer loading skeleton ─────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-2) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ─── Service icon float ─────────────────────────────────── */
.service-card__icon { animation: none; }
.card:hover .service-card__icon { animation: float 3s ease-in-out infinite; }

/* ─── Stagger children ───────────────────────────────────── */
.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.2s; }
.stagger > *:nth-child(4) { animation-delay: 0.3s; }
.stagger > *:nth-child(5) { animation-delay: 0.4s; }
.stagger > *:nth-child(6) { animation-delay: 0.5s; }
.stagger > *:nth-child(7) { animation-delay: 0.6s; }
.stagger > *:nth-child(8) { animation-delay: 0.7s; }

/* ─── Pulse CTA button ────────────────────────────────────── */
.btn--pulse {
  position: relative;
}
.btn--pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: pulse-ring 2s cubic-bezier(0.4,0,0.6,1) infinite;
}

/* ─── Scroll progress bar ─────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--grad-accent);
  z-index: 1001;
  width: 0%;
  transition: width 0.1s linear;
}

/* ─── Hero floating shapes ────────────────────────────────── */
.hero-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.hero-shape--1 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0,188,212,0.05) 0%, transparent 70%);
  top: 20%; right: 10%;
  animation: float 6s ease-in-out infinite;
}
.hero-shape--2 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(27,58,92,0.15) 0%, transparent 70%);
  bottom: 30%; left: 5%;
  animation: float 8s ease-in-out infinite reverse;
}

/* ─── Navbar link underline animation ─────────────────────── */
.navbar__link {
  position: relative;
}
.navbar__link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: all var(--duration) var(--ease);
  transform: translateX(-50%);
}
.navbar__link:hover::after,
.navbar__link.active::after {
  width: 70%;
}

/* ─── Image hover tilt effect ─────────────────────────────── */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform var(--duration) var(--ease);
}
