/*
 * Motion states for the IntersectionObserver module in motion.js. Double
 * gate: html.js-motion (head script, skipped under prefers-reduced-motion)
 * AND the media query, so a mid-session reduce flips everything instantly
 * visible. Hiding starts only when motion.js arms a below-fold target
 * (reveal-armed) — nothing already on screen is ever hidden, so no LCP or
 * CLS regression and no invisible content without JS.
 */

@media (prefers-reduced-motion: no-preference) {

    .js-motion [data-reveal].reveal-armed:not(.is-revealed),
    .js-motion [data-reveal-group].reveal-armed:not(.is-revealed) > * {
        opacity: 0;
        transform: translateY(22px);
    }

    .js-motion [data-reveal].is-revealed,
    .js-motion [data-reveal-group].is-revealed > * {
        animation: anihra-reveal 0.64s var(--ease) backwards;
        animation-delay: var(--reveal-delay, 0ms);
    }

    /* Sticky header settles once the page scrolls. */
    .js-motion .hbar,
    .js-motion .brand img {
        transition:
            min-height 0.3s var(--ease),
            width 0.3s var(--ease),
            box-shadow 0.3s var(--ease);
    }

    .js-motion .site-header.is-scrolled .hbar {
        min-height: 60px;
        box-shadow: 0 12px 32px -20px rgba(16, 42, 38, 0.5);
    }

    .js-motion .site-header.is-scrolled .brand img {
        width: 44px;
    }

    /* Card hover lifts. The pcard rule preserves storefront's own
       border/box-shadow transition and adds the lift; post and centre cards
       have no resting transition of their own. */
    .js-motion .pcard {
        transition:
            border-color .35s var(--ease),
            box-shadow .35s var(--ease),
            transform .3s var(--ease);
    }

    .js-motion .post-card,
    .js-motion .centre-card {
        transition:
            box-shadow var(--anihra-motion-fast) var(--ease),
            transform .3s var(--ease);
    }

    .js-motion .pcard:hover,
    .js-motion .post-card:hover,
    .js-motion .centre-card:hover {
        transform: translateY(-4px);
    }
}

@keyframes anihra-reveal {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
