/* Keyframe Definitions */
@keyframes pulse-beacon {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.65;
  }
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 25px -5px rgba(152, 19, 78, 0.35);
  }
  50% {
    box-shadow: 0 0 45px 0px rgba(152, 19, 78, 0.65);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollFadeIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll-Driven Animations: Modern Baseline View-Timeline */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .section-header,
    .bento-card,
    .metric-card,
    .paper-item,
    .tab-bar,
    .terminal-box {
      animation: scrollFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }
  }
}

/* Fallback for browsers without native view-timeline */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Accessibility: Prefers Reduced Motion */
@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;
  }
}
