/* =========================================================
   Animations — keyframes, loader, and motion preferences.
   Scroll and timeline choreography lives in js/animations.js.
   Only transform and opacity are animated for smoothness.
   ========================================================= */

/* ---------- Keyframes ---------- */
@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

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

@keyframes drip {
  0% {
    transform: translateY(-100%);
  }
  60%,
  100% {
    transform: translateY(100%);
  }
}

/* ---------- Page loader ----------
   Shown only once JS confirms animations will run (html.js-ready).
   Without JS or with reduced motion, the loader never appears. */
.loader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.js-ready .loader {
  display: flex;
}

.loader__inner {
  display: grid;
  justify-items: center;
  gap: 28px;
}

.loader__name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text);
}

.loader__bar {
  position: relative;
  width: min(220px, 60vw);
  height: 1px;
  background: var(--border-strong);
  overflow: hidden;
}

.loader__bar span {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}

/* ---------- Hero entrance (initial states set by JS) ---------- */
.hero__title .line > span {
  will-change: transform;
}

/* ---------- Hover micro-interactions ---------- */
.timeline__item {
  transition: opacity 0.4s;
}

/* ---------- Reduced motion ----------
   Stop looping motion, drop transitions and transforms that carry movement.
   Content remains fully visible and usable. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .status__dot::after,
  .terminal__cursor,
  .scroll-cue__line::after {
    animation: none !important;
  }

  .scroll-cue__line::after {
    transform: translateY(0);
  }

  .loader {
    display: none !important;
  }

  .chip:hover,
  .btn:active,
  .btn:hover svg,
  .project-card:hover .pv,
  .back-to-top:hover svg,
  .contact__email:hover svg {
    transform: none;
    translate: none;
  }
}
