/* Animated moves between limcore.org's pages (cross-document View Transitions); transitions.js
   names the kind of move. Browsers without them, and reduced motion, just change the page. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  /* The two pictures are whole pages: no additive blending between them. */
  ::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; }

  /* Any other move: the old page steps back, the new one rises into place. */
  ::view-transition-old(root) { animation: vt-leave 240ms cubic-bezier(.4, 0, 1, 1) both; }
  ::view-transition-new(root) { animation: vt-arrive 460ms cubic-bezier(.2, .8, .2, 1) 80ms both; }

  /* Into a project: the page opens as a circle from where it was clicked. */
  html:active-view-transition-type(deeper)::view-transition-old(root) { animation: vt-sink 650ms cubic-bezier(.6, 0, .2, 1) both; }
  html:active-view-transition-type(deeper)::view-transition-new(root) { animation: vt-open 650ms cubic-bezier(.6, 0, .2, 1) both; }

  /* Back to all projects: it closes into the same spot. */
  html:active-view-transition-type(up)::view-transition-old(root) { z-index: 1; animation: vt-close 580ms cubic-bezier(.6, 0, .2, 1) both; }
  html:active-view-transition-type(up)::view-transition-new(root) { animation: vt-surface 580ms cubic-bezier(.6, 0, .2, 1) both; }

  /* Between LimCore's sections: the content slides the way the menu goes, the header stays. */
  html:active-view-transition-type(next)::view-transition-old(root) { animation: vt-out-left 260ms cubic-bezier(.4, 0, 1, 1) both; }
  html:active-view-transition-type(next)::view-transition-new(root) { animation: vt-in-right 480ms cubic-bezier(.2, .8, .2, 1) 90ms both; }
  html:active-view-transition-type(prev)::view-transition-old(root) { animation: vt-out-right 260ms cubic-bezier(.4, 0, 1, 1) both; }
  html:active-view-transition-type(prev)::view-transition-new(root) { animation: vt-in-left 480ms cubic-bezier(.2, .8, .2, 1) 90ms both; }
  ::view-transition-group(site-header) { z-index: 2; animation-duration: 420ms; }

  /* The other language: the same page, so only a soft change. */
  html:active-view-transition-type(lang)::view-transition-old(root) { animation: vt-blur-out 260ms ease both; }
  html:active-view-transition-type(lang)::view-transition-new(root) { animation: vt-blur-in 360ms ease 100ms both; }
}

@keyframes vt-leave { to { opacity: 0; transform: scale(.97); } }
@keyframes vt-arrive { from { opacity: 0; transform: translateY(28px); } }
@keyframes vt-sink { to { opacity: .35; transform: scale(.94); } }
@keyframes vt-open {
  from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 40%)); }
  to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 40%)); }
}
@keyframes vt-close {
  from { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 40%)); }
  to { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 40%)); }
}
@keyframes vt-surface { from { opacity: .35; transform: scale(.94); } }
@keyframes vt-out-left { to { opacity: 0; transform: translateX(-56px); } }
@keyframes vt-out-right { to { opacity: 0; transform: translateX(56px); } }
@keyframes vt-in-right { from { opacity: 0; transform: translateX(72px); } }
@keyframes vt-in-left { from { opacity: 0; transform: translateX(-72px); } }
@keyframes vt-blur-out { to { opacity: 0; filter: blur(10px); } }
@keyframes vt-blur-in { from { opacity: 0; filter: blur(10px); } }
