/* Motion, Animations & Accessibility */

/* View Transitions API cross-fade */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: fadeOut 0.18s ease-out;
}
::view-transition-new(root) {
  animation: fadeIn 0.22s ease-in;
}

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

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-4px); }
}

/* Staggered card reveal with 60ms steps */
.reveal-item {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Card hover: icon rotate 6 degrees and scale 1.1 */
.card-interactive:hover .brand-icon,
.card-interactive:hover svg {
  transform: scale(1.08) rotate(4deg);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Pulsing overdue badge */
.badge-overdue-pulse {
  animation: overduePulse 1.4s infinite;
}
@keyframes overduePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Respect user preference for 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;
  }
  .marquee-content {
    animation: none !important;
  }
  .reveal-item {
    opacity: 1 !important;
    transform: none !important;
  }
  .floating-circle, .floating-triangle {
    animation: none !important;
  }
}
