/* =========================================
   KEYFRAMES
   ========================================= */

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.1); }
}

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

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

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

@keyframes pulseRing {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(2.8); opacity: 0; }
}

@keyframes ripple {
  0%   { transform: scale(0);   opacity: 0.6; }
  100% { transform: scale(4);   opacity: 0; }
}

@keyframes dashFlow {
  to { stroke-dashoffset: -40; }
}

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

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 212, 255, 0.3); }
  50%       { box-shadow: 0 0 24px rgba(0, 212, 255, 0.7); }
}

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

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

/* =========================================
   HERO STAGGER ENTRANCE
   ========================================= */
.stagger-1,
.stagger-2,
.stagger-3,
.stagger-4,
.stagger-5,
.stagger-6 {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeSlideUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stagger-1 { animation-delay: 0.2s; }
.stagger-2 { animation-delay: 0.5s; }
.stagger-3 { animation-delay: 0.8s; }
.stagger-4 { animation-delay: 1.0s; }
.stagger-5 { animation-delay: 1.3s; }
.stagger-6 { animation-delay: 1.6s; }

/* =========================================
   SKILL NODE PULSE (on hover)
   ========================================= */
.leaf-node.pulse {
  animation: glowPulse 0.6s ease-in-out;
}

/* =========================================
   TIMELINE LINE DRAW
   ========================================= */
.timeline-draw .timeline-line {
  animation: none;
}

/* =========================================
   PROJECT CARD ENTRANCE
   ========================================= */
.project-card.reveal {
  transition-delay: 0.1s;
}

.project-card.reveal:nth-child(2) {
  transition-delay: 0.2s;
}

/* =========================================
   NAV LOGO GLOW
   ========================================= */
.nav-logo:hover .logo-bracket {
  text-shadow: 0 0 8px var(--cyan);
}

/* =========================================
   FORM INPUT FOCUS GLOW
   ========================================= */
.form-group input:focus,
.form-group textarea:focus {
  animation: none;
}

/* =========================================
   CANVAS AGENT PULSE RING
   (rendered on canvas but utility class kept)
   ========================================= */
.pulse-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--cyan);
  pointer-events: none;
  animation: pulseRing 0.9s ease-out forwards;
}

/* =========================================
   SECTION LABEL LINE REVEAL
   ========================================= */
.section-label .label-line {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.section.visible .section-label .label-line,
.section-label.visible .label-line {
  transform: scaleX(1);
}

/* =========================================
   SOCIAL LINK STAGGER
   ========================================= */
.social-link {
  transition-delay: calc(var(--i, 0) * 60ms);
}

/* =========================================
   BUTTON RIPPLE
   ========================================= */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn:active::after { opacity: 1; }

/* =========================================
   MOBILE REDUCED MOTION
   ========================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
