/* =========================================================
   Aube Research & Analytics — Animations
   ========================================================= */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fade-up {
  animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes pulse-soft {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
.animate-pulse-soft {
  animation: pulse-soft 2.4s ease-in-out infinite;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(12px, -10px);
  }
}
.animate-drift {
  animation: drift 8s ease-in-out infinite;
}

/* ---------- Radar sweep (hero) ---------- */
@keyframes radar-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes node-pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.45);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(61, 220, 151, 0);
  }
}

/* ---------- Glitch (hero headline word) ---------- */
@keyframes glitch-sequence {
  0% {
    opacity: 1;
    transform: translateX(0);
    text-shadow: none;
    filter: none;
  }
  6% {
    transform: translate3d(-3px, 0, 0);
    text-shadow: 3px 0 #ff5c8a, -3px 0 #5cc9ff;
  }
  12% {
    transform: translate3d(3px, 0, 0);
    text-shadow: -3px 0 #ff5c8a, 3px 0 #5cc9ff;
  }
  18% {
    transform: translate3d(0, 0, 0);
    text-shadow: none;
    clip-path: inset(0 0 55% 0);
  }
  22% {
    clip-path: inset(38% 0 0 0);
  }
  26% {
    clip-path: inset(0 0 0 0);
  }
  33% {
    transform: translate3d(-2px, 0, 0);
    text-shadow: 2px 0 #ff5c8a, -2px 0 #5cc9ff;
  }
  38% {
    transform: translate3d(2px, 0, 0);
    text-shadow: -2px 0 #ff5c8a, 2px 0 #5cc9ff;
    clip-path: inset(60% 0 0 0);
  }
  43% {
    transform: translate3d(0, 0, 0);
    text-shadow: none;
    clip-path: inset(0 0 0 0);
  }
  55% {
    text-shadow: 0 0 16px rgba(61, 220, 151, 0.9), 0 0 32px rgba(61, 220, 151, 0.5);
  }
  80% {
    text-shadow: 0 0 20px rgba(61, 220, 151, 0.75);
  }
  100% {
    text-shadow: none;
    transform: none;
  }
}
@keyframes glitch-scanline {
  0%,
  14% {
    transform: translateY(-130%);
    opacity: 0;
  }
  26% {
    opacity: 0.9;
  }
  40%,
  60% {
    transform: translateY(130%);
    opacity: 0;
  }
  64% {
    transform: translateY(-130%);
    opacity: 0.7;
  }
  78%,
  100% {
    transform: translateY(130%);
    opacity: 0;
  }
}
@keyframes glitch-char {
  0%,
  40%,
  100% {
    opacity: 1;
    transform: none;
    color: inherit;
  }
  46% {
    opacity: 0.3;
    transform: translateY(-3px);
    color: #5cc9ff;
  }
  51% {
    opacity: 1;
    transform: translateX(3px);
    color: #ff5c8a;
  }
  57% {
    transform: none;
    color: inherit;
  }
  64% {
    opacity: 0.4;
    transform: translateY(2px);
    color: #ff5c8a;
  }
  69% {
    opacity: 1;
    transform: translateX(-2px);
    color: #5cc9ff;
  }
  75% {
    transform: none;
    color: inherit;
  }
}

/* ---------- Knowledge ticker ---------- */
@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Count-up tick (subtle glow while animating) ---------- */
@keyframes count-glow {
  0% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

/* ---------- Icon microinteraction ---------- */
@keyframes icon-pulse {
  0% {
    transform: scale(1) rotate(0deg);
  }
  40% {
    transform: scale(1.14) rotate(5deg);
  }
  100% {
    transform: scale(1.06) rotate(5deg);
  }
}

/* Nav dropdown quick fade */
@keyframes dropdown-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Scroll reveal ---------- */
/* Elements start hidden and are revealed by animations.js via IntersectionObserver */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Staggered reveal groups: children get incremental delay via inline style set by JS */

/* ---------- Animated counters ---------- */
[data-counter] {
  font-variant-numeric: tabular-nums;
}

/* ---------- Hover elevation ---------- */
.card,
.stat-card {
  will-change: transform;
}
.card--interactive:hover,
.card--link:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 44px -20px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(61, 220, 151, 0.18), 0 0 24px -6px rgba(61, 220, 151, 0.25);
}

/* ---------- Glitch word (hero headline, replays each time it scrolls into view) ---------- */
.glitch-word {
  position: relative;
  display: inline-block;
}
.glitch-word.is-active {
  animation: glitch-sequence 1.05s ease-out both;
}
.glitch-word::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  top: -20%;
  height: 140%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: translateY(-130%);
  mix-blend-mode: overlay;
  pointer-events: none;
  opacity: 0;
}
.glitch-word.is-active::after {
  animation: glitch-scanline 1.05s ease-out both;
}
.glitch-char {
  display: inline-block;
}
.glitch-word.is-active .glitch-char {
  animation: glitch-char 1.05s steps(1) both;
}
@media (prefers-reduced-motion: reduce) {
  .glitch-word.is-active,
  .glitch-word.is-active::after,
  .glitch-word.is-active .glitch-char {
    animation: none !important;
  }
}

/* ---------- Underline animation ---------- */
.underline-fx {
  position: relative;
}
.underline-fx::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}
.underline-fx:hover::after {
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
