/* Turn cross-document view-transitions on */
/* Note that this at-rule is all that is needed to create the default cross-fade animation  */
@view-transition {
    navigation: auto;
}

/* Customize the default animation behavior */
::view-transition-group(root) {
    animation-duration: 0.5s;
}

/* Create a custom animation */
@keyframes move-out {
    from {
        opacity: 1;
        translate: 0;
    }
    to {
        opacity: 0;
        translate: 0 -100px;
    }
}

@keyframes move-in {
    from {
        opacity: 0;
        translate: 0 100px;
    }
    to {
        opacity: 1;
        translate: 0;
    }
}

/* Apply the custom animation to the old and new page states */
::view-transition-old(root) {
    animation: 0.4s ease-in both move-out;
}

::view-transition-new(root) {
    animation: 0.4s ease-in both move-in;
}

@media (prefers-reduced-motion) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}
