/* ── Page transitions: sign-in → dashboard, and between all staff pages ──────
   Cross-document View Transitions (CSS View Transitions Level 2).
   A page joins by linking this file in its <head>:
     - registration/login.html links it directly;
     - staff/base_staff.html links it for every staff page (dashboard, scans, …).
   The browser animates only when BOTH the page being left and the page arriving
   link it. Browsers without support simply switch pages instantly; nothing breaks.

   What moves:
   - The floating chrome (sidebar + top bar) is NAMED below, so it is captured on its
     own and morphs in place: it stays put while the page changes underneath; only
     the active menu item and the page title cross-fade.
   - The page content (root) dissolves out quickly (fade + slight blur) and the new
     content rises in just behind it. Blend is forced to normal so old and new never
     add up / brighten (the browser default, plus-lighter, is for symmetric fades).
   During the brief moment both are faint, the arriving page's own background shows
   (light grey for staff pages; login.html sets a dark one so login → login never flashes).
   ─────────────────────────────────────────────────────────────────────────── */

@view-transition { navigation: auto; }

/* Chrome that persists across staff pages */
.cv-sidebar          { view-transition-name: cv-sidebar; }
.cv-content > header { view-transition-name: cv-topbar; }

::view-transition-group(cv-sidebar),
::view-transition-group(cv-topbar) { animation-duration: 300ms; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }

/* Page content */
::view-transition-old(root),
::view-transition-new(root) { mix-blend-mode: normal; }

::view-transition-old(root) { animation: cv-out 220ms cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: cv-in  380ms cubic-bezier(.2, .7, .2, 1) 90ms both; }

@keyframes cv-out { to   { opacity: 0; transform: scale(.99); filter: blur(3px); } }
@keyframes cv-in  { from { opacity: 0; transform: translateY(10px); } }
