/* Acceleratd page transitions
   The new page slides up from the bottom while the old one sinks back: scales to 95%, drifts up 10% and fades to 10%.
   Native: cross-document View Transitions. Fallback: ink panel on <html>.
   Tweak from the theme: :root { --acxpt-dur: 1.2s; --acxpt-ink: #111; } */
:root {
    --acxpt-ink: #000;
    --acxpt-dur: 1.5s;
    --acxpt-ease: cubic-bezier(.6, 0, .05, 1);
}

/* ---------- native (Chrome / Edge / Safari 18.2+) ---------- */
@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }
}

::view-transition {
    background: var(--acxpt-ink);
}

::view-transition-group(root) {
    animation-duration: var(--acxpt-dur);
    animation-timing-function: var(--acxpt-ease);
}

::view-transition-old(root),
::view-transition-new(root) {
    mix-blend-mode: normal;
    animation-duration: var(--acxpt-dur);
    animation-timing-function: var(--acxpt-ease);
    animation-fill-mode: both;
}

::view-transition-old(root) {
    animation-name: acxpt-old;
}

::view-transition-new(root) {
    animation-name: acxpt-new;
}

@keyframes acxpt-new {
    from {
        transform: translate3d(0, 100%, 0);
    }

    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes acxpt-old {
    from {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
    }

    to {
        transform: translate3d(0, -10%, 0) scale(.95);
        opacity: .1;
    }
}

/* ---------- fallback (Firefox and others): ink panel slides up over the page, then lifts away ---------- */
html.acxpt-leave::before,
html.acxpt-in::before,
html.acxpt-out::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: var(--acxpt-ink);
    pointer-events: none;
}

html.acxpt-leave::before {
    animation: acxpt-cover .8s var(--acxpt-ease) both;
}

/* covered on arrival; if the script never shows up, it lifts away on its own after 2.2s */
html.acxpt-in::before {
    animation: acxpt-uncover 1s var(--acxpt-ease) 2.2s both;
}

html.acxpt-out::before {
    animation: acxpt-uncover 1s var(--acxpt-ease) both;
}

@keyframes acxpt-cover {
    from {
        transform: translate3d(0, 100%, 0);
    }

    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes acxpt-uncover {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(0, -100%, 0);
    }
}

@media (max-width: 767px) {
    :root {
        --acxpt-dur: 1.2s;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.acxpt-leave::before,
    html.acxpt-in::before,
    html.acxpt-out::before {
        display: none;
    }
}
