/* ============================================================
   ANIMATIONS.CSS — Keyframes & Micro-interactions
   ============================================================ */

/* ── Keyframes ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

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

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

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

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

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

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

@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

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

@keyframes particleDrift {
  0%   { transform: translateY(0px) translateX(0px); opacity: 0.6; }
  33%  { transform: translateY(-20px) translateX(10px); opacity: 0.9; }
  66%  { transform: translateY(-10px) translateX(-10px); opacity: 0.7; }
  100% { transform: translateY(0px) translateX(0px); opacity: 0.6; }
}

@keyframes borderGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(0,188,212,0.3); }
  50%       { box-shadow: 0 0 24px rgba(0,188,212,0.7); }
}

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

@keyframes typingCursor {
  0%, 100% { border-color: var(--c-accent); }
  50%       { border-color: transparent; }
}

@keyframes drawLine {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

/* ── Animation Utility Classes ────────────────────────────── */
.anim-fade-in  { animation: fadeIn 0.5s ease forwards; }
.anim-fade-up  { animation: fadeUp 0.6s ease forwards; }
.anim-scale-in { animation: scaleIn 0.4s ease forwards; }
.anim-float    { animation: float 4s ease-in-out infinite; }
.anim-pulse    { animation: pulse 2.5s ease-in-out infinite; }

/* ── Hero Particles ───────────────────────────────────────── */
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-accent);
  opacity: 0.5;
  animation: particleDrift linear infinite;
  pointer-events: none;
}

/* ── Floating element in hero ─────────────────────────────── */
.hero-img-wrap {
  animation: float 5s ease-in-out infinite;
}

/* ── Gradient animated background ────────────────────────── */
.gradient-animated {
  background: linear-gradient(270deg, #0D1B2A, #1565C0, #0097A7, #112240);
  background-size: 300% 300%;
  animation: gradientShift 10s ease infinite;
}

/* ── Shimmer loading effect ───────────────────────────────── */
.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0) 100%
  );
  background-size: 200% auto;
  animation: shimmer 2s linear infinite;
}

/* ── Glow border ──────────────────────────────────────────── */
.glow-border {
  animation: borderGlow 2.5s ease-in-out infinite;
}

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

/* ── Hover lift ───────────────────────────────────────────── */
.hover-lift {
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

/* ── Smooth underline link ────────────────────────────────── */
.link-underline {
  position: relative;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--c-accent);
  transition: width var(--t-base);
}
.link-underline:hover::after { width: 100%; }

/* ── Ping indicator ───────────────────────────────────────── */
.ping {
  position: relative;
}
.ping::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 8px; height: 8px;
  background: var(--c-success);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

/* ── Page transition ──────────────────────────────────────── */
body {
  animation: fadeIn 0.4s ease;
}
