/*
 * Scroll reveal.
 * Active only when <html> has .has-reveal (set inline in header.php,
 * skipped when IntersectionObserver is missing or prefers reduced motion).
 * Transition lives on .is-visible so hiding is instant (no fade-out flash).
 */

.has-reveal .rv {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
}

.has-reveal .rv.is-visible {
    opacity: 1;
    transform: none;
    transition:
        opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1) var(--rv-delay, 0s),
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) var(--rv-delay, 0s);
}

.has-reveal .rv--h1 {
    transform: translate3d(0, 54px, 0);
}

.has-reveal .rv--h1.is-visible {
    transition-duration: 1.05s, 1.05s;
}

.has-reveal .rv--media {
    transform: translate3d(0, 40px, 0) scale(1.05);
}

.has-reveal .rv--media.is-visible {
    transition-duration: 1.1s, 1.1s;
}

.has-reveal .rv--fade {
    transform: none;
}

.has-reveal .rv--fade.rv--slow.is-visible {
    transition-duration: 1.4s, 1.4s;
}

/* dots: container stays static, dots pop in one by one */
.has-reveal .rv--dots {
    opacity: 1;
    transform: none;
}

.has-reveal .rv--dots span {
    opacity: 0;
    transform: scale(0.25);
}

.has-reveal .rv--dots.is-visible span {
    opacity: 1;
    transform: scale(1);
    transition:
        opacity 0.45s ease var(--rv-delay, 0s),
        transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) var(--rv-delay, 0s);
}

.has-reveal .rv--dots.is-visible span:nth-child(2) {
    transition-delay: calc(var(--rv-delay, 0s) + 0.09s);
}

.has-reveal .rv--dots.is-visible span:nth-child(3) {
    transition-delay: calc(var(--rv-delay, 0s) + 0.18s);
}

@media (prefers-reduced-motion: reduce) {
    .has-reveal .rv,
    .has-reveal .rv.is-visible,
    .has-reveal .rv--dots span,
    .has-reveal .rv--dots.is-visible span {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
