/* ==========================================================================
   CarExpress — Konto Page Transition (TRANS-01)
   Cross-document View Transitions opt-in for the customer account area.
   Deliberately NOT imported by css/main.css — main.css is loaded by public
   pages too, and this effect must stay scoped to konto/-to-konto navigation.
   Scoping is achieved entirely by which pages link this file, not by any
   page-type branching in code.
   ========================================================================== */

/* Cross-document opt-in. Both the outgoing and the incoming document must
   carry this rule for a transition to run between them — one konto/ page
   missing this stylesheet silently disables the crossfade for every
   navigation that touches it, in both directions. Same-origin only, by
   specification; browsers without support ignore this rule entirely (no
   feature detection needed, Firefox degrades to instant navigation). */
@view-transition {
  navigation: auto;
}

/* Root-level crossfade only — no view-transition-name on any element and no
   @keyframes; the browser's default crossfade is the effect UI-SPEC
   specifies.
   CHECKPOINT-DISCOVERED FIX (Phase 96, TRANS-02 Task 3): duration was
   previously bound directly to var(--transition-view), i.e.
   "animation-duration: var(--transition-view);" which substitutes to
   "animation-duration: 200ms ease;". animation-duration is a <time>#-only
   longhand — it does not accept a trailing timing-function keyword. Per the
   CSS Custom Properties spec, a var() substitution that is invalid for the
   property it lands in makes the WHOLE declaration invalid at
   computed-value time, which resets animation-duration to its initial
   value (0s) rather than erroring visibly. The crossfade has therefore
   always run with a 0s duration — an instant snap, not a fade — since this
   file shipped in Phase 91. This was reported during Phase 96's Task 3
   human-verify checkpoint as "the page pops up, no real transition," and
   is the actual root cause (the reveal mechanism this phase built was
   correctly waiting on the crossfade's completion signal, which fired
   instantly because there was nothing to wait for). Split into the two
   longhands below so both compute to valid, non-zero values. --transition-
   view (css/tokens.css) still declares the intended "200ms ease" pair as a
   single token for documentation/consistency with the other --transition-*
   tokens, but animation-duration/animation-timing-function cannot consume
   a combined duration+easing custom property directly — keep these two
   literals in sync with --transition-view by hand if that token's value
   ever changes again. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 200ms;
  animation-timing-function: ease;
}

/* Accessibility: respect user motion preference */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}
