/* Content is visible by default, even if JavaScript fails midway.
 * Only a bounded entrance animation temporarily changes opacity. */
.reveal, .reveal-up, .reveal-left, .reveal-right,
.reveal-scale, .reveal-fade, .stagger-item {
    --reveal-from: translateY(30px);
    --reveal-delay: 0ms;
}
.reveal-left { --reveal-from: translateX(-30px); }
.reveal-right { --reveal-from: translateX(30px); }
.reveal-scale { --reveal-from: scale(.96); }
.reveal-fade { --reveal-from: none; }
[data-reveal-hero-image] { --reveal-delay: 340ms; }

@keyframes tp-reveal {
    from { opacity: 0; transform: var(--reveal-from, translateY(30px)); }
    to { opacity: 1; transform: none; }
}
/* Backwards fill covers the stagger only, never pinning a transform afterwards. */
.reveal-animate {
    animation: tp-reveal 650ms cubic-bezier(.22, 1, .36, 1) var(--reveal-delay, 0ms) backwards;
}

/* The shared reveal replaces the old impact entrance and decorative motion. */
.home .impact .stats.is-visible > div,
.home .impact .stats.is-visible .stat-icon,
.home .impact .stats.is-visible > div + div::before { animation: none; }
.home .impact .stats > .reveal-animate {
    animation: tp-reveal 650ms cubic-bezier(.22, 1, .36, 1) var(--reveal-delay, 0ms) backwards;
}
.home .impact .stats div::after { display: none; }

/* Preserve the existing card geometry from the previous animation stylesheet. */
.who-values__grid article, .who-objectives ol li {
    position: relative;
    overflow: hidden;
    border-top: 3px solid transparent;
}

.reveal-card { transition: transform 250ms ease, box-shadow 250ms ease; }
.button { transition-property: transform, background-color, border-color, color; }
@media (hover: hover) and (pointer: fine) {
    .reveal-card:not(.reveal-animate):hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 26px rgba(67, 16, 59, .10);
    }
    .challenge-card:hover img, .work-card:hover img,
    .course-card:hover figure img { transform: scale(1.02); }
}
@media (hover: none), (pointer: coarse) {
    .reveal-card:hover, .program-card:hover, .challenge-card:hover,
    .work-card:hover, .course-card:hover, .who-credentials__grid article:hover,
    .contact-enquiries__grid a:hover, .home-resources__grid a:hover, .button:hover,
    .home .impact .stats div:hover, .home .impact .stats div:focus-within,
    .challenge-card:hover img, .work-card:hover img,
    .course-card:hover figure img { transform: none; }
}
@media (max-width: 960px) {
    .reveal:not(.reveal-scale):not(.reveal-fade), .reveal-up, .reveal-left, .reveal-right,
    .stagger-item { --reveal-from: translateY(18px); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }
    .reveal, .reveal-up, .reveal-left, .reveal-right,
    .reveal-scale, .reveal-fade, .stagger-item {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .reveal-card:hover, .program-card:hover, .challenge-card:hover,
    .work-card:hover, .course-card:hover, .who-credentials__grid article:hover,
    .contact-enquiries__grid a:hover, .home-resources__grid a:hover, .button:hover,
    .home .impact .stats div:hover, .home .impact .stats div:focus-within,
    .challenge-card:hover img, .work-card:hover img,
    .course-card:hover figure img { transform: none !important; }
}
