/* ═══════════════════════════════════════════
   Animations — Grain, transitions, effects
   ═══════════════════════════════════════════ */

/* Entry animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideRight {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

.anim-fade-up {
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-expo) forwards;
}

.anim-fade-in {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.4s; }
.stagger > *:nth-child(9) { animation-delay: 0.45s; }
.stagger > *:nth-child(10) { animation-delay: 0.5s; }

/* Preloader chromatic animation */
@keyframes chromaShift {
  0% { transform: translate(-4px, 2px); }
  25% { transform: translate(-2px, -1px); }
  50% { transform: translate(-5px, 1px); }
  75% { transform: translate(-3px, 3px); }
  100% { transform: translate(-4px, 2px); }
}

@keyframes chromaShift2 {
  0% { transform: translate(4px, -2px); }
  25% { transform: translate(2px, 1px); }
  50% { transform: translate(5px, -1px); }
  75% { transform: translate(3px, -3px); }
  100% { transform: translate(4px, -2px); }
}

.preloader-logo-layer.cyan {
  animation: chromaShift 1.5s ease-in-out infinite;
}

.preloader-logo-layer.magenta {
  animation: chromaShift2 1.5s ease-in-out infinite;
}

/* Scroll indicator bounce */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.bounce { animation: bounce 1.5s ease-in-out infinite; }

/* Link underline sweep */
.link-hover {
  position: relative;
  display: inline-block;
}

.link-hover::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-expo);
}

.link-hover:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Project row hover highlight animation */
.proj-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent-copper);
  transform: scaleY(0);
  transition: transform 0.35s var(--ease-expo);
}

.proj-row { position: relative; }

.proj-row:hover::before {
  transform: scaleY(1);
}

/* Window entrance animation */
@keyframes winEnter {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.win-entering {
  animation: winEnter 0.9s var(--ease-expo) forwards;
}
