/* Motion definitions kept separate from component geometry. */

@keyframes pulseAnim {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

@keyframes floatBadge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

/* Scroll reveals are opt-in from JavaScript so content remains visible without JS. */
.motion-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow);
  transition-delay: var(--motion-delay, 0ms);
}

.motion-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

main {
  transition: opacity 180ms ease;
}

body.is-language-switching main {
  opacity: 0.72;
}

.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity var(--hero-word-duration, 350ms) ease,
    transform var(--hero-word-duration, 350ms) ease;
  transition-delay: var(--hero-word-delay, 0ms);
}

.hero-word.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.text-gradient .hero-word {
  background: var(--gradient-accent);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-copy-is-animating .hero-actions,
.hero-copy-is-animating .hero-badge-pill,
.hero-copy-is-animating .hero-socials {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 350ms ease,
    transform 350ms ease;
}

.hero-copy-is-ready .hero-actions,
.hero-copy-is-ready .hero-badge-pill,
.hero-copy-is-ready .hero-socials {
  opacity: 1;
  transform: translateY(0);
}

html.is-theme-switching body,
html.is-theme-switching .site-header,
html.is-theme-switching .page-section,
html.is-theme-switching .key-facts-card,
html.is-theme-switching .skill-card,
html.is-theme-switching .project-card-body,
html.is-theme-switching .timeline-card,
html.is-theme-switching .cert-card,
html.is-theme-switching .contact-method-card {
  transition:
    background-color 220ms ease,
    color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

html.motion-reduced,
html.motion-reduced body {
  scroll-behavior: auto;
}

html.motion-reduced .motion-reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .motion-reveal {
    opacity: 1;
    transform: none;
  }

  .hero-word,
  .hero-word.is-visible,
  .hero-copy-is-animating .hero-badge-pill,
  .hero-copy-is-animating .hero-actions,
  .hero-copy-is-animating .hero-socials {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .skill-card:hover {
    transform: none;
  }

  .projects-grid .project-card:hover,
  .projects-grid .project-card.is-pointer-active {
    transform: none;
    will-change: auto;
  }

  .project-card::before {
    opacity: 0;
    transition: none;
  }

  .timeline::after {
    transform: scaleY(1);
  }

  .timeline-marker {
    box-shadow: 0 0 16px var(--primary-glow);
    transition: none;
  }

  .timeline-marker::after {
    opacity: 1;
    transition: none;
  }
}

@media print {
  .hero-word,
  .hero-word.is-visible,
  .hero-copy-is-animating .hero-badge-pill,
  .hero-copy-is-animating .hero-actions,
  .hero-copy-is-animating .hero-socials {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
