/* Shell-only styles. */
/* Page changes (UX rules › Motion): only the page plane takes part; the rail, the tab bar and the
   waves stay exactly where they are, and the active-tab pill glides on its own. The kind of move
   (fade, zoom out to More's level, zoom back in) is set on <html> by the router (data-motion-kind). */
.wfw-page { view-transition-name: wfw-page; }
.wfw-nav-pill { view-transition-name: wfw-nav-pill; view-transition-class: nav-pill; }
::view-transition-old(root),
::view-transition-new(root) { animation: none; }
::view-transition-group(wfw-page) { animation: none; }
::view-transition-old(wfw-page),
::view-transition-new(wfw-page) { transform-origin: 50% 12rem; }

/* Fade: the old page goes quickly, the new one comes in. */
::view-transition-old(wfw-page) { animation: var(--duration-fast) ease-out both wfw-fade-out; }
::view-transition-new(wfw-page) { animation: var(--duration-base) ease-out both wfw-fade-in; }

/* Up to More's level: the work shrinks away and the overview settles into place. */
:root[data-motion-kind="out"]::view-transition-old(wfw-page) { animation: 260ms var(--ease-out) both wfw-zoom-away; }
:root[data-motion-kind="out"]::view-transition-new(wfw-page) { animation: 320ms var(--ease-out) both wfw-zoom-settle-down; }
/* Back down to the work: the overview grows past you and the page comes up into place. */
:root[data-motion-kind="in"]::view-transition-old(wfw-page) { animation: 260ms var(--ease-out) both wfw-zoom-past; }
:root[data-motion-kind="in"]::view-transition-new(wfw-page) { animation: 320ms var(--ease-out) both wfw-zoom-settle-up; }

@keyframes wfw-zoom-away { to { opacity: 0; transform: scale(0.92); } }
@keyframes wfw-zoom-settle-down { from { opacity: 0; transform: scale(1.05); } }
@keyframes wfw-zoom-past { to { opacity: 0; transform: scale(1.06); } }
@keyframes wfw-zoom-settle-up { from { opacity: 0; transform: scale(0.94); } }

/* More › Customize: tiles wobble a little while they can be moved (none when motion is reduced). */
@keyframes wfw-wobble { from { transform: rotate(-0.6deg); } to { transform: rotate(0.6deg); } }
.wfw-wobble { animation: wfw-wobble 0.32s ease-in-out infinite alternate; }
.wfw-wobble:nth-child(2n) { animation-delay: -0.16s; }
@media (prefers-reduced-motion: reduce) { .wfw-wobble { animation: none; } }
:root[data-motion="reduced"] .wfw-wobble { animation: none; }
