/* ============================================================
   ADAM ENGINEERING — ANIMATIONS CSS
   ============================================================ */

/* ─── KEYFRAME ANIMATIONS ────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@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 lineGrow {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes lineGrowV {
  from { height: 0; }
  to   { height: 100%; }
}

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

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

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

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

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

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

@keyframes progressIn {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(45,168,154,0.4); }
  50%       { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(45,168,154,0); }
}

/* ─── HERO ANIMATIONS ────────────────────────────────────── */
.hero-label { animation: fadeInUp 0.6s ease 0.2s both; }
.hero-title { animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both; }
.hero-subtitle { animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both; }
.hero-actions { animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both; }
.hero-stats-bar { animation: fadeInUp 0.6s ease 1s both; }

/* ─── WORD REVEAL ─────────────────────────────────────────── */
.word-reveal span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.word-reveal.visible span {
  opacity: 1;
  transform: translateY(0);
}

.word-reveal span:nth-child(1)  { transition-delay: 0.05s; }
.word-reveal span:nth-child(2)  { transition-delay: 0.10s; }
.word-reveal span:nth-child(3)  { transition-delay: 0.15s; }
.word-reveal span:nth-child(4)  { transition-delay: 0.20s; }
.word-reveal span:nth-child(5)  { transition-delay: 0.25s; }
.word-reveal span:nth-child(6)  { transition-delay: 0.30s; }
.word-reveal span:nth-child(7)  { transition-delay: 0.35s; }
.word-reveal span:nth-child(8)  { transition-delay: 0.40s; }
.word-reveal span:nth-child(9)  { transition-delay: 0.45s; }
.word-reveal span:nth-child(10) { transition-delay: 0.50s; }

/* ─── FLOATING ELEMENTS ───────────────────────────────────── */
.float-element {
  animation: float 6s ease-in-out infinite;
}

.float-element-slow {
  animation: float 8s ease-in-out infinite;
}

/* ─── SHIMMER BUTTON ─────────────────────────────────────── */
.btn-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-teal) 0%,
    var(--color-teal-light) 50%,
    var(--color-teal) 100%
  );
  background-size: 200% auto;
  animation: shimmer 3s linear infinite;
}

/* ─── COUNTER ANIMATION ───────────────────────────────────── */
.counter-wrap {
  overflow: hidden;
}

.counter-value {
  display: inline-block;
  transition: transform 0.1s ease;
}

/* ─── IMAGE REVEAL ────────────────────────────────────────── */
.img-reveal {
  position: relative;
  overflow: hidden;
}

.img-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-teal);
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.18, 1);
}

.img-reveal.visible::after {
  transform: scaleX(0);
}

/* ─── LINE ANIMATION ──────────────────────────────────────── */
.animated-line {
  width: 0;
  height: 2px;
  background: var(--color-teal);
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.animated-line.visible {
  width: 100%;
}

/* ─── PROCESS DOT PULSE ──────────────────────────────────── */
.process-step-number.pulse {
  animation: dotPulse 2s ease-in-out infinite;
}

/* ─── PAGE TRANSITION ─────────────────────────────────────── */
.page-transition {
  animation: fadeIn 0.5s ease both;
}

/* ─── STAGGER REVEAL ─────────────────────────────────────── */
.stagger-reveal > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-reveal.visible > *:nth-child(1)  { opacity: 1; transform: none; transition-delay: 0.05s; }
.stagger-reveal.visible > *:nth-child(2)  { opacity: 1; transform: none; transition-delay: 0.12s; }
.stagger-reveal.visible > *:nth-child(3)  { opacity: 1; transform: none; transition-delay: 0.19s; }
.stagger-reveal.visible > *:nth-child(4)  { opacity: 1; transform: none; transition-delay: 0.26s; }
.stagger-reveal.visible > *:nth-child(5)  { opacity: 1; transform: none; transition-delay: 0.33s; }
.stagger-reveal.visible > *:nth-child(6)  { opacity: 1; transform: none; transition-delay: 0.40s; }
.stagger-reveal.visible > *:nth-child(7)  { opacity: 1; transform: none; transition-delay: 0.47s; }
.stagger-reveal.visible > *:nth-child(8)  { opacity: 1; transform: none; transition-delay: 0.54s; }
.stagger-reveal.visible > *:nth-child(9)  { opacity: 1; transform: none; transition-delay: 0.61s; }
.stagger-reveal.visible > *:nth-child(10) { opacity: 1; transform: none; transition-delay: 0.68s; }

/* ─── HERO GRID PATTERN FLOAT ────────────────────────────── */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(45,168,154,0.5);
  border-radius: 50%;
  animation: floatParticle var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
  left: var(--x);
  top: var(--y);
}

@keyframes floatParticle {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); opacity: 0.5; }
  33%       { transform: translateY(-30px) translateX(10px) scale(1.2); opacity: 0.8; }
  66%       { transform: translateY(-15px) translateX(-8px) scale(0.9); opacity: 0.4; }
}

/* ─── SCROLL PROGRESS ─────────────────────────────────────── */
.progress-bar-fill {
  animation: progressIn 0.3s ease both;
  transform-origin: left;
}

/* ─── TEAL GLOW ───────────────────────────────────────────── */
.teal-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45,168,154,0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse 4s ease-in-out infinite;
}

/* ─── HOVER CARD TILT ─────────────────────────────────────── */
.tilt-card {
  transition: transform 0.2s ease;
  transform-style: preserve-3d;
}

/* ─── ANIMATED UNDERLINE ─────────────────────────────────── */
.animated-underline {
  position: relative;
}

.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-teal);
  transition: width 0.3s ease;
}

.animated-underline:hover::after { width: 100%; }

/* ─── PREFERS REDUCED MOTION ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .marquee-track {
    animation: none;
  }
}
