/* SPDX-License-Identifier: GPL-2.0-or-later */
@keyframes slowly-motion-frames {
    0% { opacity: var(--slowly-motion-0-opacity); translate: 0 var(--slowly-motion-0-y); scale: var(--slowly-motion-0-scale); }
    50% { opacity: var(--slowly-motion-1-opacity); translate: 0 var(--slowly-motion-1-y); scale: var(--slowly-motion-1-scale); }
    100% { opacity: var(--slowly-motion-2-opacity); translate: 0 var(--slowly-motion-2-y); scale: var(--slowly-motion-2-scale); }
}

@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        .slowly-motion:where(:not(:focus-within)) {
            animation: var(--slowly-motion-scroll) 1ms linear both;
            animation-timeline: view();
            animation-range: entry 0% cover 65%;
        }
    }

    @media (hover: hover) {
        .slowly-motion:where(:hover:not(:focus-within)) {
            animation: var(--slowly-motion-hover) var(--slowly-motion-duration) ease-in-out both;
        }

        @supports (animation-timeline: view()) {
            .slowly-motion:where(:hover:not(:focus-within)) {
                animation-name: var(--slowly-motion-hover-or-scroll);
                animation-timeline: var(--slowly-motion-hover-timeline);
                animation-timing-function: var(--slowly-motion-hover-timing);
                animation-range: entry 0% cover 65%;
            }
        }
    }

    .slowly-motion:focus-within {
        animation: var(--slowly-motion-hover) var(--slowly-motion-duration) ease-in-out both;
    }

    .slowly-motion.slowly-motion-clicking {
        animation: var(--slowly-motion-click) var(--slowly-motion-duration) ease-in-out both;
    }

    @media (pointer: fine) {
        .slowly-motion.slowly-motion-tilting {
            rotate: var(--slowly-tilt-x) var(--slowly-tilt-y) 0 var(--slowly-tilt-angle);
        }
    }
}
