/* A theme switch is one viewport crossfade, including wallpaper and gradients.
   Disable underlying color tweens so the new snapshot is the finished theme. */
html.ui-theme-transition *,
html.ui-theme-transition *::before,
html.ui-theme-transition *::after {
    transition: none !important;
}
html.ui-theme-transition::view-transition-group(root) { animation-duration: 280ms; }
html.ui-theme-transition::view-transition-old(root),
html.ui-theme-transition::view-transition-new(root) {
    animation-duration: 280ms;
    animation-timing-function: ease-in-out;
}
html.ui-theme-transition::view-transition { pointer-events: none; }

/* Feature-detected fallback uses the same deadline as the wallpaper fade. */
html.ui-theme-fallback *,
html.ui-theme-fallback *::before,
html.ui-theme-fallback *::after {
    transition-property: background-color, border-color, color, box-shadow, fill, stroke !important;
    transition-duration: 280ms !important;
    transition-timing-function: ease-in-out !important;
}

/* Keep native requests immediate and menus stable. Only content fades, as a
   single surface; the blur remains static rather than rerasterizing per frame. */
html.ui-content-loading .content-frame > .page-shell { opacity: .45; }
html.ui-navigation-arrival:not(.ui-content-loading) .content-frame > .page-shell {
    animation: ui-navigation-reveal 220ms var(--ui-motion-ease) backwards;
}
@keyframes ui-navigation-reveal {
    from { opacity: .45; }
    to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    html.ui-navigation-arrival:not(.ui-content-loading) .content-frame > .page-shell { animation: none; }
    html.ui-content-loading .content-frame > .page-shell { opacity: 1; }
    html.ui-theme-fallback *, html.ui-theme-fallback *::before, html.ui-theme-fallback *::after {
        transition: none !important;
    }
}
