/* Going between the login and register pages, with the same two beats as the registration steps:
   the form you leave swells a little and dissolves, and only then does the other form come up out of the
   black. The helix behind stays put. Only login.html and register.html load this file, so the tree page
   is left out. A browser without cross-page view transitions simply loads the page as before. */

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

.login { view-transition-name: login-form; }
.login.register { view-transition-name: register-form; }

/* Clicks and typing reach the new page while the forms are still fading. */
::view-transition { pointer-events: none; }

::view-transition-old(login-form),
::view-transition-old(register-form) {
  transform-origin: 50% 40%;
  animation: auth-out 650ms cubic-bezier(0.4, 0, 0.8, 0.6) both;
}
::view-transition-new(login-form),
::view-transition-new(register-form) {
  transform-origin: 50% 40%;
  animation:
    auth-in-fade 1400ms cubic-bezier(0.45, 0, 0.25, 1) 650ms both,
    auth-in-grow 1600ms cubic-bezier(0.2, 0.6, 0.2, 1) 650ms both;
}
@keyframes auth-out { to { opacity: 0; transform: scale(1.05); } }
@keyframes auth-in-fade { from { opacity: 0; } }
@keyframes auth-in-grow { from { transform: scale(0.92); } }

/* The red tree by the name grew when the first page opened. Coming from the other page it is already grown. */
.arrived .sprout .grow,
.arrived .sprout .bud { animation: none; }
