/* Individual translate/scale properties preserve carousel and hover transforms. */
@media (prefers-reduced-motion: no-preference) {
    [data-motion-reveal="pending"] {
        opacity: 0;
    }

    .button, .carousel-next, .gallery-controls button, .dialog-close {
        transition: background-color .22s ease, color .22s ease,
            border-color .22s ease, box-shadow .22s ease, scale .16s ease;
    }

    .button:active, .carousel-next:active, .gallery-controls button:active,
    .dialog-close:active {
        scale: .97;
    }

    .button > .arrow-icon, .news-read > .arrow-icon {
        transition: translate .25s cubic-bezier(.22, 1, .36, 1);
    }

    .button:focus-visible > .arrow-icon, .news-read:focus-visible > .arrow-icon {
        translate: 3px 0;
    }

    .info-dialog[open] {
        animation: dialog-appear .24s cubic-bezier(.22, 1, .36, 1) both;
    }

    .info-dialog[open]::backdrop {
        animation: backdrop-appear .24s ease both;
    }

    .form-status {
        animation: status-appear .3s ease both;
    }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) {
    .button:hover > .arrow-icon, .news-read:hover > .arrow-icon {
        translate: 3px 0;
    }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
    [data-motion-floating] {
        animation: illustration-float 7s ease-in-out infinite;
        animation-play-state: paused;
    }

    [data-motion-floating="visible"] {
        animation-play-state: running;
    }

    html[data-motion-paused] [data-motion-floating] {
        animation-play-state: paused;
    }
}

@keyframes illustration-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -6px; }
}

@keyframes dialog-appear {
    from { opacity: 0; translate: 0 12px; scale: .985; }
    to { opacity: 1; translate: 0 0; scale: 1; }
}

@keyframes backdrop-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes status-appear {
    from { opacity: 0; translate: 0 6px; }
    to { opacity: 1; translate: 0 0; }
}
