/* Page navigation uses an expanding, asymmetric mark and intentionally no brand colour. */
html.public-page-changing::view-transition-old(root) {
  z-index: 1;
  opacity: 1;
  animation: none;
}

html.public-page-changing::view-transition-new(root) {
  z-index: 2;
  animation: 1.02s cubic-bezier(.76, 0, .24, 1) both orvion-reference-reveal;
}

@keyframes orvion-reference-reveal {
  0% { clip-path: polygon(47% 43%, 53% 43%, 53% 47%, 58% 47%, 58% 53%, 53% 53%, 53% 58%, 47% 58%, 47% 53%, 42% 53%, 42% 47%, 47% 47%); }
  48% { clip-path: polygon(34% 0%, 66% 0%, 66% 27%, 100% 27%, 100% 73%, 66% 73%, 66% 100%, 34% 100%, 34% 73%, 0% 73%, 0% 27%, 34% 27%); }
  100% { clip-path: polygon(-100% -200%, 200% -200%, 200% -100%, 300% -100%, 300% 200%, 200% 200%, 200% 300%, -100% 300%, -100% 200%, -200% 200%, -200% -100%, -100% -100%); }
}

/* Fallback used by browsers without the View Transitions API (including mobile). */
.public-page-snapshot { background: transparent; pointer-events: none !important; }
#orviongo-page-transition { pointer-events: none !important; }
.public-page-snapshot--reveal .public-page-snapshot__hole {
  animation-name: orvion-reference-snapshot-open;
  animation-duration: 1.02s;
  animation-timing-function: cubic-bezier(.76, 0, .24, 1);
}

/* The original fallback jumps from 0 to a scale of 100 immediately, which
 * makes the effect imperceptible. Keeping the mark near the reference scale
 * first makes the transition readable before it clears the old page. */
@keyframes orvion-reference-snapshot-open {
  0% { transform: scale(0); }
  72% { transform: scale(2.15); }
  100% { transform: scale(100); }
}

@media (prefers-reduced-motion: reduce) {
  html.public-page-changing::view-transition-new(root),
  .public-page-snapshot--reveal .public-page-snapshot__hole { animation-duration: .01ms; }
}

/* Independent navigation curtain. It is used before the application changes
 * route, so the effect does not depend on browser View Transitions support. */
.orvion-navigation-curtain {
  pointer-events: none;
  z-index: 2147483646;
  position: fixed;
  inset: 0;
  /* Glass transition: it distorts the outgoing page rather than covering it. */
  background: rgb(255 255 255 / 7%);
  -webkit-backdrop-filter: blur(12px) saturate(108%);
  backdrop-filter: blur(12px) saturate(108%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 10%);
  clip-path: polygon(47% 43%, 53% 43%, 53% 47%, 58% 47%, 58% 53%, 53% 53%, 53% 58%, 47% 58%, 47% 53%, 42% 53%, 42% 47%, 47% 47%);
  will-change: clip-path;
}

.orvion-navigation-curtain--enter {
  animation: .62s cubic-bezier(.76, 0, .24, 1) both orvion-curtain-enter;
}

.orvion-navigation-curtain--exit {
  animation: .62s cubic-bezier(.76, 0, .24, 1) both orvion-curtain-exit;
}

@keyframes orvion-curtain-enter {
  0% { clip-path: polygon(47% 43%, 53% 43%, 53% 47%, 58% 47%, 58% 53%, 53% 53%, 53% 58%, 47% 58%, 47% 53%, 42% 53%, 42% 47%, 47% 47%); }
  58% { clip-path: polygon(32% 0%, 68% 0%, 68% 25%, 100% 25%, 100% 75%, 68% 75%, 68% 100%, 32% 100%, 32% 75%, 0% 75%, 0% 25%, 32% 25%); }
  100% { clip-path: inset(0); }
}

@keyframes orvion-curtain-exit {
  0% { clip-path: inset(0); }
  42% { clip-path: polygon(32% 0%, 68% 0%, 68% 25%, 100% 25%, 100% 75%, 68% 75%, 68% 100%, 32% 100%, 32% 75%, 0% 75%, 0% 25%, 32% 25%); }
  100% { clip-path: polygon(47% 43%, 53% 43%, 53% 47%, 58% 47%, 58% 53%, 53% 53%, 53% 58%, 47% 58%, 47% 53%, 42% 53%, 42% 47%, 47% 47%); }
}

/* Mobile navigates without a page-transition layer. This leaves touch scrolling
 * and navigation responsive, while the full transition remains desktop-only. */
@media (max-width:700px) {
  html.public-page-changing::view-transition-old(root),
  html.public-page-changing::view-transition-new(root) { animation:none!important; }
  .public-page-snapshot { display:none!important; }
  .orvion-navigation-curtain {
    display:none!important;
  }
}
