/* The early head script hides the first paint until the visual groups are registered. */
@media (prefers-reduced-motion: no-preference) {
    html.reveal-preparing body,
    .reveal-pending {
        opacity: 0;
    }

    .reveal-pending:not(.work-item) {
        pointer-events: none;
    }

    .is-revealed:not(.is-settled) {
        animation: pageReveal 2.4s cubic-bezier(0.25, 1, 0.5, 1);
        will-change: opacity, translate, filter;
    }

    /* Keep card blur on the thumbnail. The whole card fades and moves without blurring. */
    .work-item.is-revealed:not(.is-settled) {
        animation-name: fadeUp;
        will-change: opacity, translate;
    }

    .work-item.is-revealed:not(.is-settled) .thumb-wrap img {
        animation: blurIn 2.4s cubic-bezier(0.25, 1, 0.5, 1);
        will-change: filter;
    }
}

@keyframes pageReveal {
    from { opacity: 0; translate: var(--reveal-x, 0px) var(--reveal-y, 20px); filter: blur(4px); }
}

@keyframes fadeUp {
    from { opacity: 0; translate: var(--reveal-x, 0px) var(--reveal-y, 20px); }
    to { opacity: 1; translate: 0 0; }
}

@keyframes blurIn {
    from { filter: grayscale(20%) brightness(0.85) blur(4px); }
    to { filter: grayscale(20%) brightness(0.85) blur(0); }
}
