/* =========================================================
   SCROLL REVEAL
   js/animations.js adds .visible when a section enters view.
   ========================================================= */
.section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* The hero should be visible immediately while the rest of the page reveals. */
.hero {
  opacity: 1;
  transform: none;
}

/* =========================================================
   HERO MOTION
   ========================================================= */
.cursor {
  color: var(--accent);
  animation: blink 0.7s infinite;
  margin-left: 2px;
}

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

  51%,
  100% {
    opacity: 0;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 #00ff8855;
  }

  50% {
    opacity: 0.8;
    transform: scale(1.15);
    box-shadow: 0 0 0 5px #00ff8800;
  }
}

/* =========================================================
   FEEDBACK MOTION
   ========================================================= */
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

/* =========================================================
   GITHUB SKELETON MOTION
   ========================================================= */
@keyframes gh-shimmer {
  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.7;
  }
}

/* =========================================================
   ACCESSIBILITY: REDUCED MOTION
   Respect user preferences for vestibular and motion comfort.
   ========================================================= */
@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;
  }

  .section {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .cursor {
    animation: none !important;
    opacity: 1 !important;
  }
}
