/* Smooth page changes (owner, 2026-11-16: "fix the glitching of the pages when switching to other pages,
   make it smooth and natural").
   Same-site page changes cross-fade instead of flashing blank (cross-document View Transitions; browsers
   without them just change page as before). The top bar and the phone tab bars stay still, so only the
   page content changes. Off for people who ask for reduced motion. */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: 120ms ease-out both cx-page-out; }
::view-transition-new(root) { animation: 200ms cubic-bezier(.2, .7, .2, 1) both cx-page-in; }
@keyframes cx-page-out { to { opacity: 0; } }
@keyframes cx-page-in { from { opacity: 0; transform: translateY(6px); } }

.cx-topnav { view-transition-name: cx-topnav; }
.cx-tabbar { view-transition-name: cx-tabbar; }
.cx-bottom { view-transition-name: cx-bottom; }   /* staff and instructor phone tab bar (2026-11-17) */
::view-transition-group(cx-topnav), ::view-transition-group(cx-tabbar), ::view-transition-group(cx-bottom) { animation-duration: 0s; }
::view-transition-old(cx-topnav), ::view-transition-old(cx-tabbar), ::view-transition-old(cx-bottom) { animation: none; opacity: 0; }
::view-transition-new(cx-topnav), ::view-transition-new(cx-tabbar), ::view-transition-new(cx-bottom) { animation: none; }

/* The page colour is there before anything else paints (no white flash), and pages with and without
   a scrollbar line up. */
html { background: var(--bg, #f7f4f2); scrollbar-gutter: stable; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
