/* ============================================================
   animations.css
   Keyframes, reveal staggered animations, hero pulses.
   ============================================================ */

/* === Reveals === */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(8px);
  animation: reveal 1.4s var(--ease-out-expo) forwards;
}

[data-reveal="1"] { animation-delay: 0.4s; }
[data-reveal="2"] { animation-delay: 0.7s; }
[data-reveal="3"] { animation-delay: 1.2s; }
[data-reveal="4"] { animation-delay: 1.5s; }
[data-reveal="5"] { animation-delay: 1.8s; }

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* === Mark / dot === */
@keyframes mark-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px var(--color-star-glow)); }
  50% { filter: drop-shadow(0 0 14px var(--color-star-mid)); }
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* === Scroll line flow === */
@keyframes scroll-flow {
  0% {
    transform: scaleY(0);
    transform-origin: top;
  }
  50% {
    transform: scaleY(1);
    transform-origin: top;
  }
  51% {
    transform-origin: bottom;
  }
  100% {
    transform: scaleY(0);
    transform-origin: bottom;
  }
}

/* === Transition pulse (karar → tekrar parla) === */
@keyframes transition-pulse {
  0% {
    opacity: 0;
    box-shadow: 0 0 0 0 var(--color-star-core);
    transform: scale(1);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    box-shadow:
      0 0 200px 80px var(--color-star-edge),
      0 0 600px 200px var(--color-star-glow);
    transform: scale(40);
  }
}

/* === Project card reveal on intersect === */
.card {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1s var(--ease-out-expo),
    transform 1s var(--ease-out-expo),
    background 0.5s var(--ease-out-quart);
}

.card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.projects__grid .card:nth-child(1) { transition-delay: 0s; }
.projects__grid .card:nth-child(2) { transition-delay: 0.12s; }
.projects__grid .card:nth-child(3) { transition-delay: 0.24s; }
.projects__grid .card:nth-child(4) { transition-delay: 0.36s; }

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

  [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
