/* ===== Keyframes ===== */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

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

@keyframes progress-fill {
  from { width: 0; }
  to { width: 100%; }
}

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

@keyframes scan-line {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

@keyframes glitch-clip-1 {
  0%, 100% { clip-path: inset(0 0 95% 0); transform: translate(-2px, 0); }
  20% { clip-path: inset(40% 0 50% 0); transform: translate(2px, 0); }
  40% { clip-path: inset(70% 0 20% 0); transform: translate(-1px, 0); }
  60% { clip-path: inset(10% 0 85% 0); transform: translate(2px, 0); }
  80% { clip-path: inset(55% 0 35% 0); transform: translate(-2px, 0); }
}

@keyframes glitch-clip-2 {
  0%, 100% { clip-path: inset(80% 0 5% 0); transform: translate(2px, 0); }
  20% { clip-path: inset(15% 0 70% 0); transform: translate(-2px, 0); }
  40% { clip-path: inset(60% 0 30% 0); transform: translate(1px, 0); }
  60% { clip-path: inset(5% 0 90% 0); transform: translate(-2px, 0); }
  80% { clip-path: inset(35% 0 55% 0); transform: translate(2px, 0); }
}

@keyframes tps-flicker {
  0%, 90%, 100% { opacity: 1; }
  91%, 93%, 95%, 97%, 99% { opacity: 0.6; }
  92%, 94%, 96%, 98% { opacity: 1; }
}

/* ===== Applied Animations ===== */
.hero-visual .terminal-window {
  animation: float-terminal 6s ease-in-out infinite;
}

/* Glitch effect on hero title accent */
.glitch-text {
  position: relative;
}
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: var(--c-accent);
}
.glitch-text::before {
  color: var(--c-primary);
  animation: glitch-clip-1 4s infinite steps(1, end);
  animation-delay: 2s;
}
.glitch-text::after {
  color: var(--c-error);
  animation: glitch-clip-2 4s infinite steps(1, end);
  animation-delay: 2.5s;
}

/* TPS number flicker */
.anim-tps {
  animation: tps-flicker 3s ease-in-out infinite;
}

/* Scan line overlay on hero */
.hero-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-primary-glow), transparent);
  animation: scan-line 8s linear infinite;
  pointer-events: none;
  opacity: 0.4;
}

/* Staggered card reveal delays */
.services-grid .service-card:nth-child(1) { transition-delay: 0.05s; }
.services-grid .service-card:nth-child(2) { transition-delay: 0.1s; }
.services-grid .service-card:nth-child(3) { transition-delay: 0.15s; }
.services-grid .service-card:nth-child(4) { transition-delay: 0.2s; }
.services-grid .service-card:nth-child(5) { transition-delay: 0.25s; }
.services-grid .service-card:nth-child(6) { transition-delay: 0.3s; }

.stats-grid .stat-block:nth-child(1) { transition-delay: 0.05s; }
.stats-grid .stat-block:nth-child(2) { transition-delay: 0.12s; }
.stats-grid .stat-block:nth-child(3) { transition-delay: 0.19s; }
.stats-grid .stat-block:nth-child(4) { transition-delay: 0.26s; }

/* Background grid pattern on hero */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(64, 200, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 200, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}
.hero-container { position: relative; z-index: 1; }
.hero-ascii { position: relative; z-index: 1; }
