/* ─── KEYFRAMES ──────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--accent); }
  50%       { opacity: 0.5; box-shadow: 0 0 2px var(--accent); }
}

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

@keyframes scrollDown {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

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

@keyframes glitchX {
  0%, 100% { clip-path: inset(0 0 100% 0); transform: translateX(0); }
  10%       { clip-path: inset(8% 0 62% 0); transform: translateX(-4px); }
  30%       { clip-path: inset(43% 0 28% 0); transform: translateX(4px); }
  50%       { clip-path: inset(67% 0 10% 0); transform: translateX(-2px); }
  70%       { clip-path: inset(20% 0 55% 0); transform: translateX(3px); }
  90%       { clip-path: inset(80% 0 5% 0); transform: translateX(-1px); }
}

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

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

/* ─── SCROLL REVEAL ──────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--transition), transform 0.7s var(--transition);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ─── HERO ANIMATION ─────────────────────────────────────────── */
.hero-badge {
  animation: fadeInUp 0.8s var(--transition) 0.1s both;
}

.hero-title {
  animation: fadeInUp 0.8s var(--transition) 0.25s both;
}

.hero-lead {
  animation: fadeInUp 0.8s var(--transition) 0.4s both;
}

.hero-cta-group {
  animation: fadeInUp 0.8s var(--transition) 0.55s both;
}

.hero-stats {
  animation: fadeInUp 0.8s var(--transition) 0.7s both;
}

.terminal-window {
  animation: fadeInUp 0.9s var(--transition) 0.4s both, float 6s ease-in-out 1.3s infinite;
}

/* ─── GLITCH TEXT EFFECT ─────────────────────────────────────── */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.glitch::before {
  color: var(--accent);
  animation: glitchX 4s infinite linear;
  opacity: 0.6;
}

.glitch::after {
  color: var(--accent-alt);
  animation: glitchX 4s infinite linear 0.3s;
  opacity: 0.4;
}

/* ─── TYPING CURSOR (used in terminal) ───────────────────────── */
.typing-line {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 2s steps(30, end) forwards;
}

@keyframes typing {
  from { width: 0; }
  to   { width: 100%; }
}

/* ─── SCANLINE OVERLAY ───────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
}

/* ─── GRID STAGGER ───────────────────────────────────────────── */
.grid-3 .service-card:nth-child(1),
.grid-4 .team-card:nth-child(1),
.grid-2 .project-card:nth-child(1) { transition-delay: 0s; }

.grid-3 .service-card:nth-child(2),
.grid-4 .team-card:nth-child(2),
.grid-2 .project-card:nth-child(2) { transition-delay: 0.1s; }

.grid-3 .service-card:nth-child(3),
.grid-4 .team-card:nth-child(3) { transition-delay: 0.2s; }

.grid-4 .team-card:nth-child(4) { transition-delay: 0.3s; }

/* ─── SECTION DIVIDER ─────────────────────────────────────────  */
.section-divider {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-alt));
  margin: 1.5rem auto;
  border-radius: 1px;
}
