/* ============================================
   MOEX/OI ANALYST — ANIMATIONS
   ============================================ */

/* ---------- KEYFRAMES ---------- */

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

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

@keyframes pulse-icon {
  0%, 100% {
    text-shadow: 0 0 10px rgba(0,255,255,0.5), 0 0 30px rgba(0,255,255,0.2);
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 20px rgba(0,255,255,0.9), 0 0 60px rgba(0,255,255,0.4);
    transform: scale(1.05);
  }
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50% { opacity: 0.3; transform: scaleY(0.7); }
}

@keyframes ticker-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

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

@keyframes neon-flicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.5; }
  97% { opacity: 0.9; }
  98% { opacity: 0.3; }
  99% { opacity: 0.8; }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(0,255,255,0.3), 0 0 20px rgba(0,255,255,0.1);
  }
  50% {
    box-shadow: 0 0 20px rgba(0,255,255,0.6), 0 0 60px rgba(0,255,255,0.2);
  }
}

@keyframes data-stream {
  0% { transform: translateY(-100%); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translateY(100%); opacity: 0; }
}

@keyframes border-glow {
  0%, 100% { border-color: rgba(0,255,255,0.2); }
  50% { border-color: rgba(0,255,255,0.6); }
}

@keyframes scan-line {
  0% { top: -5%; }
  100% { top: 105%; }
}

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

/* ---------- APPLIED ANIMATIONS ---------- */

/* Hero entrance */
.hero-badge {
  animation: fade-in-up 0.6s ease both;
  animation-delay: 0.2s;
  opacity: 0;
}
.hero-title {
  animation: fade-in-up 0.6s ease both;
  animation-delay: 0.4s;
  opacity: 0;
}
.hero-sub {
  animation: fade-in-up 0.6s ease both;
  animation-delay: 0.6s;
  opacity: 0;
}
.hero-desc {
  animation: fade-in-up 0.6s ease both;
  animation-delay: 0.7s;
  opacity: 0;
}
.hero-cta {
  animation: fade-in-up 0.6s ease both;
  animation-delay: 0.85s;
  opacity: 0;
}
.hero-stats {
  animation: fade-in-up 0.6s ease both;
  animation-delay: 1s;
  opacity: 0;
}

/* Post cards entrance — staggered via JS inline style */
.post-card {
  animation: fade-in-up 0.5s ease both;
}
.blog-post-item {
  animation: slide-in-right 0.4s ease both;
}

/* Nav glow on scroll — class added via JS */
.nav-main.scrolled {
  box-shadow: 0 2px 30px rgba(0,255,255,0.08);
}

/* Active neon link underline */
.nav-link.active::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--neon-cyan);
  margin-top: 2px;
  box-shadow: 0 0 8px var(--neon-cyan);
  animation: fade-in 0.3s ease;
}

/* Neon flicker for hero title on load */
.title-line-2 {
  animation: neon-flicker 8s ease infinite;
  animation-delay: 3s;
}

/* Data stream decorative element */
.about-data-stream {
  width: 1px;
  height: 100px;
  background: linear-gradient(to bottom, var(--neon-cyan), transparent);
  animation: data-stream 3s ease-in-out infinite;
  margin: 0 auto;
}

/* Floating avatar */
.about-avatar { animation: float 4s ease-in-out infinite; }

/* Loading pulse */
.loading-state span {
  animation: blink 2s ease-in-out infinite;
}

/* Glow pulse on primary buttons */
.btn-primary {
  animation: glow-pulse 3s ease-in-out infinite;
}

/* Card border slow glow */
.post-card:not(:hover) {
  animation: border-glow 4s ease-in-out infinite;
}

/* Scroll-triggered reveal class (added by IntersectionObserver in JS) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Badge dot live indicator */
.badge-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--neon-green);
  animation: spin 2s linear infinite;
  opacity: 0.5;
}
.badge-dot { position: relative; }

/* Neon text typing cursor */
.typing-cursor::after {
  content: '|';
  color: var(--neon-cyan);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

/* Page transition */
.page-transition-out {
  animation: fade-in 0.3s ease reverse both;
}

/* Scan line effect overlay */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, transparent, var(--neon-cyan), transparent);
  opacity: 0.3;
  animation: scan-line 8s linear infinite;
  pointer-events: none;
  z-index: 999;
}
