/* ==========================================================================
   animations.css — Keyframes, scroll-reveal, decorative motion, utilities
   ========================================================================== */

/* ---- Keyframes ------------------------------------------------------------ */
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) translateX(0); }
  33% { transform: translateY(-24px) translateX(14px); }
  66% { transform: translateY(14px) translateX(-10px); }
}

@keyframes blob {
  0%, 100% { border-radius: 42% 58% 63% 37% / 42% 44% 56% 58%; }
  33% { border-radius: 58% 42% 38% 62% / 63% 37% 63% 37%; }
  66% { border-radius: 38% 62% 58% 42% / 45% 63% 37% 55%; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
  to { opacity: 0; transform: translateX(40px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(44, 177, 179, 0.5); }
  70% { box-shadow: 0 0 0 16px rgba(44, 177, 179, 0); }
  100% { box-shadow: 0 0 0 0 rgba(44, 177, 179, 0); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

@keyframes blink { 50% { opacity: 0; } }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(3deg); }
}

@keyframes gridPan {
  from { background-position: 0 0; }
  to { background-position: 60px 60px; }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.15); }
}

/* ---- Hero decorative layers ---------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(3rem, 8vw, 6rem);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 15% 20%, rgba(17, 100, 102, 0.32), transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(44, 177, 179, 0.20), transparent 42%),
    radial-gradient(circle at 50% 90%, rgba(255, 203, 154, 0.16), transparent 45%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at 50% 30%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 10%, transparent 70%);
  animation: gridPan 18s linear infinite;
  opacity: 0.6;
}

.blob {
  position: absolute;
  z-index: -1;
  filter: blur(48px);
  opacity: 0.55;
  background: var(--gradient);
  animation: blob 14s ease-in-out infinite, floatSlow 16s ease-in-out infinite;
}
.blob.b1 { width: 340px; height: 340px; top: -60px; left: -40px; }
.blob.b2 { width: 300px; height: 300px; top: 40px; right: -60px; background: var(--gradient-warm); animation-delay: -4s, -2s; }
.blob.b3 { width: 260px; height: 260px; bottom: -80px; left: 40%; background: linear-gradient(135deg, var(--brand-3), var(--brand-1)); animation-delay: -8s, -6s; }

/* Floating particles */
.particles { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.particles span {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-3);
  opacity: 0.5;
  animation: floatSlow 12s ease-in-out infinite;
}
.particles span:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.particles span:nth-child(2) { top: 70%; left: 25%; background: var(--brand-4); animation-delay: -2s; }
.particles span:nth-child(3) { top: 30%; left: 80%; background: var(--brand-2); animation-delay: -4s; }
.particles span:nth-child(4) { top: 60%; left: 65%; animation-delay: -6s; }
.particles span:nth-child(5) { top: 45%; left: 45%; background: var(--brand-4); animation-delay: -8s; width: 8px; height: 8px; }
.particles span:nth-child(6) { top: 80%; left: 88%; animation-delay: -3s; }

/* ---- Typing effect -------------------------------------------------------- */
.typing::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 3px;
  background: var(--brand-3);
  vertical-align: -0.12em;
  animation: blink 1s step-end infinite;
}

/* ---- Marquee tag strip ---------------------------------------------------- */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---- Scroll reveal -------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }
.reveal.left { transform: translateX(-40px); }
.reveal.right { transform: translateX(40px); }
.reveal.left.in, .reveal.right.in { transform: none; }
.reveal.zoom { transform: scale(0.92); }
.reveal.zoom.in { transform: scale(1); }

/* ---- Utility animation classes ------------------------------------------- */
.anim-float { animation: float 5s var(--ease) infinite; }
.anim-bob { animation: bob 4s var(--ease) infinite; }
.anim-pulse-ring { animation: pulseRing 2.2s var(--ease) infinite; }
.anim-fade-up { animation: fadeInUp 0.7s var(--ease) both; }
.anim-scale-in { animation: scaleIn 0.5s var(--ease-back) both; }

.spinner {
  width: 42px; height: 42px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--brand-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Shimmer skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-strong) 50%, var(--surface) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius-sm);
}

/* Animated underline for links */
.link-underline {
  position: relative;
  color: var(--brand-3);
  font-weight: 600;
}
.link-underline::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}
.link-underline:hover::after { transform: scaleX(1); transform-origin: left; }

/* Gradient border glow card variant */
.glow-hover { transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease); }
.glow-hover:hover { box-shadow: var(--shadow-glow); }

/* Tilt on hover (subtle) */
.tilt { transition: transform 0.4s var(--ease); transform-style: preserve-3d; }
.tilt:hover { transform: perspective(900px) rotateX(4deg) rotateY(-4deg) translateY(-4px); }

/* ---- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
