/* ===========================
   GLITCH EFFECT
   =========================== */
@keyframes glitch {
  0% { transform: translate(0); filter: none; }
  25% { transform: translate(-2px, 1px); filter: hue-rotate(90deg); }
  50% { transform: translate(1px, -1px); filter: hue-rotate(180deg); }
  75% { transform: translate(-1px, -1px); filter: hue-rotate(270deg); }
  100% { transform: translate(0); filter: none; }
}

.is-glitching {
  animation: glitch 0.15s steps(4) 1;
}

/* ===========================
   BLACK HOLE MODE (Easter Egg)
   =========================== */
.black-hole-mode {
  filter: invert(1) hue-rotate(180deg);
  transition: filter 0.3s;
}

/* ===========================
   LETTER ANIMATIONS
   =========================== */
.split-char {
  display: inline-block;
  will-change: transform, opacity;
}

/* ===========================
   SVG CONNECTOR LINES
   =========================== */
.section-connector {
  position: absolute;
  left: 0;
  right: 0;
  height: 200px;
  pointer-events: none;
  overflow: visible;
}

.section-connector path {
  fill: none;
  stroke: rgba(255, 248, 240, 0.06);
  stroke-width: 1;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.section-connector.is-visible path {
  transition: stroke-dashoffset 2s var(--ease-out-quart);
  stroke-dashoffset: 0;
}

/* ===========================
   PARTICLE BURST (cursor click)
   =========================== */
.click-burst {
  position: fixed;
  pointer-events: none;
  z-index: 9997;
}

.click-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--warm-white);
  animation: burst-out 0.6s var(--ease-out-expo) forwards;
}

@keyframes burst-out {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--burst-x), var(--burst-y)) scale(0);
    opacity: 0;
  }
}

/* ===========================
   HOVER ARROW (links)
   =========================== */
.project-link::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 50%;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  opacity: 0;
  transform: translateY(-50%) translateX(-10px);
  transition: opacity 0.3s, transform 0.3s var(--ease-out-expo);
}

.project-link:hover::before {
  opacity: 0.5;
  transform: translateY(-50%) translateX(0);
}

/* ===========================
   LETTER BOUNCE (RaRa Robot)
   =========================== */
.bounce-letter {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#project-rara .project-link:hover .bounce-letter {
  animation: letter-bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes letter-bounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  60% { transform: translateY(-3px); }
}

/* Stagger each letter */
.bounce-letter:nth-child(1) { animation-delay: 0s; }
.bounce-letter:nth-child(2) { animation-delay: 0.03s; }
.bounce-letter:nth-child(3) { animation-delay: 0.06s; }
.bounce-letter:nth-child(4) { animation-delay: 0.09s; }
.bounce-letter:nth-child(5) { animation-delay: 0.12s; }
.bounce-letter:nth-child(6) { animation-delay: 0.15s; }
.bounce-letter:nth-child(7) { animation-delay: 0.18s; }
.bounce-letter:nth-child(8) { animation-delay: 0.21s; }
.bounce-letter:nth-child(9) { animation-delay: 0.24s; }
.bounce-letter:nth-child(10) { animation-delay: 0.27s; }
.bounce-letter:nth-child(11) { animation-delay: 0.30s; }

/* ===========================
   VHS GLITCH (NowStalgia number)
   =========================== */
@keyframes vhs-glitch {
  0%, 100% { text-shadow: none; transform: translate(0); }
  10% { text-shadow: -2px 0 var(--flux-magenta), 2px 0 var(--rara-cyan); transform: translate(1px, 0); }
  20% { text-shadow: 2px 0 var(--flux-magenta), -2px 0 var(--rara-cyan); transform: translate(-1px, 0); }
  30% { text-shadow: none; transform: translate(0); }
}

#project-now .project-number {
  animation: vhs-glitch 4s ease-in-out infinite;
}
