html[data-route-phase]::after {
  content: "";
  position: fixed;
  z-index: 100;
  inset: 0;
  background: #080a0c url("assets/polvecta-przejscie.webp") center / min(92vw, 132vh, 75rem) auto no-repeat;
  clip-path: var(--route-open, inset(0));
}

html[data-route-phase="cover"]::after {
  animation: route-cover 380ms cubic-bezier(.24, .65, .28, 1) both;
}

html[data-route-phase="reveal"]::after {
  animation: route-reveal 650ms cubic-bezier(.45, .05, .25, 1) both;
}

@keyframes route-cover {
  from { clip-path: var(--route-start, inset(0)); opacity: var(--route-fade, 1); }
  to { clip-path: var(--route-open, inset(0)); opacity: 1; }
}

@keyframes route-reveal {
  from { clip-path: var(--route-open, inset(0)); opacity: 1; }
  to { clip-path: var(--route-end, inset(0)); opacity: var(--route-fade, 1); }
}

html[data-route-effect="diagonal"] {
  --route-start: polygon(-24% 0, 0 0, -24% 100%, -48% 100%);
  --route-open: polygon(-24% 0, 124% 0, 100% 100%, -48% 100%);
  --route-end: polygon(124% 0, 124% 0, 100% 100%, 100% 100%);
}

html[data-route-effect="horizontal"] {
  --route-start: inset(0 100% 0 0);
  --route-end: inset(0 0 0 100%);
}

html[data-route-effect="vertical"] {
  --route-start: inset(100% 0 0 0);
  --route-end: inset(0 0 100% 0);
}

html[data-route-effect="panoramic"] {
  --route-start: inset(50% 0 50% 0);
  --route-end: inset(50% 0 50% 0);
}

html[data-route-effect="iris"] {
  --route-start: ellipse(0% 0% at 50% 50%);
  --route-open: ellipse(76% 76% at 50% 50%);
  --route-end: ellipse(0% 0% at 50% 50%);
}

html[data-route-effect="dissolve"] { --route-fade: 0; }

@media (prefers-reduced-motion: no-preference) {
  :is(.hero-button, .home-link, .site-footer__action) .arrow {
    transition: translate .2s ease;
  }

  :is(.hero-button, .home-link, .site-footer__action):is(:hover, :focus-visible) .arrow {
    translate: 4px 0;
  }
}

@media (min-width: 981px) and (prefers-reduced-motion: no-preference) {
  .site-nav > a:not([aria-current]) { position: relative; }

  .site-nav > a:not([aria-current])::after {
    content: "";
    position: absolute;
    inset: auto 0 2px;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .22s ease;
  }

  .site-nav > a:not([aria-current]):is(:hover, :focus-visible)::after {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-route-phase]::after { content: none; }
}
