/* ============================================================
   HUBLANCE.AI — ANIMATIONS
   Purposeful, restrained motion
   ============================================================ */

/* ── Keyframes ────────────────────────────────────────────── */

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

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

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

@keyframes flowPulse {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -40px; }
}

@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50%       { box-shadow: 0 0 0 8px rgba(79, 98, 217, 0); }
}

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

@keyframes borderGlow {
  0%, 100% { border-color: var(--border); }
  50%       { border-color: var(--primary-dim); }
}

/* ── Scroll Reveal — Base State ───────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

/* Staggered delays for groups */
.reveal-group > *:nth-child(1) { transition-delay: 0s; }
.reveal-group > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-group > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-group > *:nth-child(4) { transition-delay: 0.24s; }

/* ── Diagram Flow Animation ───────────────────────────────── */
.flow-line {
  stroke-dasharray: 6 4;
  animation: flowPulse 2.4s linear infinite;
}

.flow-line--slow {
  animation-duration: 3.2s;
}

.flow-line--fast {
  animation-duration: 1.8s;
}

/* ── AI-Centric Network Diagram Animations ────────────────── */

/* Bidirectional flow: outward from AI core */
@keyframes flowOutward {
  from { stroke-dashoffset: 20; }
  to   { stroke-dashoffset: 0; }
}

/* Bidirectional flow: inward toward AI core */
@keyframes flowInward {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: 20; }
}

/* Slow ring rotation */
@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* AI Core glow pulse */
@keyframes glowPulse {
  0%, 100% { opacity: 0.13; }
  50%       { opacity: 0.24; }
}

/* Outcome labels float in */
@keyframes outcomeFloat {
  0%, 100% { opacity: 0.55; transform: translateY(0); }
  50%       { opacity: 0.75; transform: translateY(-3px); }
}

/* Ring connection flow */
@keyframes ringFlow {
  from { stroke-dashoffset: 40; }
  to   { stroke-dashoffset: 0; }
}

/* Outward flow classes */
.flow-outward {
  animation: flowOutward 2.6s linear infinite;
}
.flow-outward--slow  { animation-duration: 3.8s; }
.flow-outward--fast  { animation-duration: 1.8s; }

/* Inward flow classes (return signal) */
.flow-inward {
  animation: flowInward 2.6s linear infinite;
}
.flow-inward--slow   { animation-duration: 3.8s; }
.flow-inward--fast   { animation-duration: 1.8s; }

/* Orbiting dashed ring */
.orbit-ring {
  transform-origin: 430px 250px;
  animation: orbitSpin 18s linear infinite;
}

/* Outer orbit ring (faster, opposite) */
.orbit-ring-outer {
  transform-origin: 430px 250px;
  animation: orbitSpin 28s linear infinite reverse;
}

/* Core radial glow */
.core-pulse-glow {
  animation: glowPulse 3s ease-in-out infinite;
}

/* Outcome label drift */
.outcome-label {
  animation: outcomeFloat 5s ease-in-out infinite;
}
.outcome-label--2  { animation-delay: 1.2s; }
.outcome-label--3  { animation-delay: 2.4s; }
.outcome-label--4  { animation-delay: 3.6s; }

/* Ring connection */
.ring-flow {
  animation: ringFlow 6s linear infinite;
}
.ring-flow--slow   { animation-duration: 9s; }
.ring-flow--offset { animation-delay: -3s; }

/* Data beam glowing bus */
@keyframes beamPulse {
  0%, 100% { opacity: 0.14; }
  50%       { opacity: 0.28; }
}
.beam-glow {
  animation: beamPulse 2.8s ease-in-out infinite;
}

/* System boundary pulse */
@keyframes boundaryPulse {
  0%, 100% { opacity: 0.38; }
  50%       { opacity: 0.58; }
}
.system-boundary {
  animation: boundaryPulse 4s ease-in-out infinite;
}



/* ── Page Load (first above-fold) ─────────────────────────── */
.load-fade {
  animation: fadeIn 0.5s var(--ease) both;
}

.load-fade--1 { animation-delay: 0.1s; }
.load-fade--2 { animation-delay: 0.2s; }
.load-fade--3 { animation-delay: 0.35s; }
.load-fade--4 { animation-delay: 0.5s; }
