/* Global animations for pages and cards */

/* Keyframes */
@keyframes pageFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes cardIn {
  0%   { opacity: 0; transform: translateY(14px) scale(0.98); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gentleFloat {
  0%   { transform: translateY(0) scale(1); }
  50%  { transform: translateY(-4px) scale(1.005); }
  100% { transform: translateY(0) scale(1); }
}

/* Page container enter */
.page-enter {
  animation: pageFadeUp 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Nav + Footer on first paint */
.animated-nav { 
  animation: slideDown 420ms cubic-bezier(0.22, 1, 0.36, 1) both; 
}

.animated-footer {
  animation: footerRise 520ms 120ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Cards reveal + stagger inside grids */
.reveal-card { 
  will-change: transform, opacity; 
  animation: cardIn 600ms cubic-bezier(0.22, 1, 0.36, 1) both; 
}

/* Stagger using nth-child on common grids */
.cards-grid > *:nth-child(1)  { animation-delay: 40ms; }
.cards-grid > *:nth-child(2)  { animation-delay: 90ms; }
.cards-grid > *:nth-child(3)  { animation-delay: 140ms; }
.cards-grid > *:nth-child(4)  { animation-delay: 190ms; }
.cards-grid > *:nth-child(5)  { animation-delay: 240ms; }
.cards-grid > *:nth-child(6)  { animation-delay: 290ms; }
.cards-grid > *:nth-child(7)  { animation-delay: 340ms; }
.cards-grid > *:nth-child(8)  { animation-delay: 390ms; }

/* Gentle floating effect on media inside cards */
.floating-img {
  animation: gentleFloat 6s ease-in-out infinite;
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
