/* ==========================================================================
   Page transition: the page you leave folds into a card and lifts away over
   a cobalt tile field with a low Sundown glow; the next page rises from below
   as a card and opens to full screen. The nav stays put the whole time.
   Cross-document View Transitions (Chromium, Safari 18.2+); other browsers
   simply navigate.
   ========================================================================== */
@view-transition { navigation: auto; }

.nav { view-transition-name: lido-nav; }

/* the ground between the two pages: cobalt tiles, the sun just below the horizon */
::view-transition {
  background: radial-gradient(70% 55% at 50% 118%, rgba(255, 90, 31, .75), rgba(255, 180, 138, .3) 42%, rgba(255, 180, 138, 0) 72%),
              url(case-ams.svg?v=2) 50% 50% / cover no-repeat,
              #1F4BFF;
}

::view-transition-old(root),
::view-transition-new(root) {
  mix-blend-mode: normal;
  transform-origin: 50% 50%;
  animation-duration: 1.15s;
  animation-fill-mode: both;
}
::view-transition-old(root) { animation-name: lido-leave; }
::view-transition-new(root) { animation-name: lido-arrive; box-shadow: 0 -30px 80px rgba(6, 14, 70, .35); }

@keyframes lido-leave {
  0%   { transform: none; clip-path: inset(0 round 0); opacity: 1; animation-timing-function: cubic-bezier(.7, 0, .25, 1); }
  36%  { transform: scale(.88); clip-path: inset(0 round 44px); opacity: 1; animation-timing-function: cubic-bezier(.55, 0, .45, 1); }
  82%  { transform: translateY(-16%) scale(.8); clip-path: inset(0 round 48px); opacity: 0; }
  100% { transform: translateY(-16%) scale(.8); clip-path: inset(0 round 48px); opacity: 0; }
}
@keyframes lido-arrive {
  0%   { transform: translateY(108%) scale(.88); clip-path: inset(0 round 44px); }
  30%  { transform: translateY(108%) scale(.88); clip-path: inset(0 round 44px); animation-timing-function: cubic-bezier(.3, 0, .2, 1); }
  72%  { transform: translateY(0) scale(.88); clip-path: inset(0 round 44px); animation-timing-function: cubic-bezier(.65, 0, .2, 1); }
  100% { transform: none; clip-path: inset(0 round 0); }
}

/* the nav holds its place above it all and simply settles into the new page's state */
::view-transition-group(lido-nav) { z-index: 2; animation-duration: .5s; animation-delay: .65s; }
::view-transition-old(lido-nav), ::view-transition-new(lido-nav) { animation-duration: .35s; animation-delay: .7s; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
