/* House Lights screen changes (4.0).
   ----------------------------------
   Moving from one page to the next plays the event system's transition: the
   old page drifts up 8px and fades, the new one rises 14px into place, in
   320ms. The top bar and the section bars have names of their own, so they
   hold still while only the page under them moves. Only opacity and
   transform animate, which a Chromebook's compositor handles without layout.

   Browsers without cross-document view transitions simply change page as
   before. A device that asks for less motion gets an instant change.

   Both pages in a navigation must load this file for the move to play, so
   a kiosk, a check-in screen or a TV board leaves it out (base.html's
   page_motion block) and keeps its instant change. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

.topbar { view-transition-name: hl-top; }
.hl-tabbar { view-transition-name: hl-nav; }
.portal-tabs { view-transition-name: hl-portal-nav; }
main { view-transition-name: hl-main; }

::view-transition-old(hl-top), ::view-transition-old(hl-nav), ::view-transition-old(hl-portal-nav) { display: none; }
::view-transition-new(hl-top), ::view-transition-new(hl-nav), ::view-transition-new(hl-portal-nav) { animation: none; }
::view-transition-old(hl-main) { animation: hl-leave calc(var(--dur-screen, 320ms) * .6) var(--ease, ease) both; }
::view-transition-new(hl-main) { animation: hl-enter var(--dur-screen, 320ms) var(--ease, ease) both; }
/* The root (anything without a name) cross-fades quickly rather than
   doubling up behind the page. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 120ms; }

@keyframes hl-leave { to { opacity: 0; transform: translateY(-8px); } }
@keyframes hl-enter { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
