/* QuizHub global page/content entrance motion.
   Presentation-only: no DOM, layout, data, routing, or application logic changes. */
@keyframes qh-page-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes qh-content-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes qh-header-enter {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Shared header and main page containers across student, admin, quiz and auth pages. */
body > .topbar {
  animation: qh-header-enter 420ms cubic-bezier(.2,.7,.25,1) both;
}
body > main.page-wrap,
body > main.results-wrap,
body.auth-page > main.auth-shell {
  animation: qh-page-enter 520ms cubic-bezier(.2,.7,.25,1) both;
}

/* Direct content sections animate when they are first rendered or inserted after data loads. */
main.page-wrap > *,
main.results-wrap > *,
body.auth-page > main.auth-shell > * {
  animation: qh-content-enter 460ms cubic-bezier(.2,.7,.25,1) both;
}
main.page-wrap > :nth-child(2),
main.results-wrap > :nth-child(2),
body.auth-page > main.auth-shell > :nth-child(2) { animation-delay: 45ms; }
main.page-wrap > :nth-child(3),
main.results-wrap > :nth-child(3),
body.auth-page > main.auth-shell > :nth-child(3) { animation-delay: 85ms; }
main.page-wrap > :nth-child(4),
main.results-wrap > :nth-child(4),
body.auth-page > main.auth-shell > :nth-child(4) { animation-delay: 125ms; }
main.page-wrap > :nth-child(5),
main.results-wrap > :nth-child(5),
body.auth-page > main.auth-shell > :nth-child(5) { animation-delay: 165ms; }

/* Keep all motion gentle and respect the visitor's reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
  body > .topbar,
  body > main.page-wrap,
  body > main.results-wrap,
  body.auth-page > main.auth-shell,
  main.page-wrap > *,
  main.results-wrap > *,
  body.auth-page > main.auth-shell > * {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
