/* ==========================================================================
   Review Scroll Reveal - in-view pop-ins for the review body.
   Loaded by includes/review-scroll-reveal.php. Every hidden state here is
   keyed to a class the script adds, so with no JS nothing is hidden.

   Uses the individual translate/rotate/scale properties, not `transform`:
   the review design tilts its own elements via `transform` (mega title,
   W badge, title poster) and the individual properties compose with that
   instead of wiping it out.
   ========================================================================== */

:root {
    --rv-duration: .55s;
    --rv-stagger: .09s;
    --rv-rise: 2.2em;
    --rv-ease: cubic-bezier(.21, .12, .35, 1.43); /* overshoot */
}

.rv-item,
.rv-stagger > * {
    opacity: var(--rv-alpha, 0);
    translate: var(--rv-x, 0) var(--rv-y, 0);
    rotate: var(--rv-rotate, 0deg);
    scale: var(--rv-scale, 1);
    transition-property: translate, rotate, scale, opacity;
    transition-duration: var(--rv-duration);
    transition-timing-function: var(--rv-ease);
}

.rv-item {
    transition-delay: var(--rv-delay, 0s);
}

.rv-item.is-in,
.rv-stagger.is-in > * {
    --rv-alpha: 1;
    --rv-x: 0;
    --rv-y: 0;
    --rv-rotate: 0deg;
    --rv-scale: 1;
}

/* Motion vocabulary, assigned per element type by the script */
[data-rv="rise"]     { --rv-y: var(--rv-rise); }
[data-rv="scaleUp"]  { --rv-scale: 0; }
[data-rv="popIn"]    { --rv-scale: .55; --rv-y: .6em; }
[data-rv="fromLeft"] { --rv-x: -50%; }

.rv-stagger > :nth-child(2)    { transition-delay: calc(1 * var(--rv-stagger)); }
.rv-stagger > :nth-child(3)    { transition-delay: calc(2 * var(--rv-stagger)); }
.rv-stagger > :nth-child(4)    { transition-delay: calc(3 * var(--rv-stagger)); }
.rv-stagger > :nth-child(5)    { transition-delay: calc(4 * var(--rv-stagger)); }
.rv-stagger > :nth-child(6)    { transition-delay: calc(5 * var(--rv-stagger)); }
.rv-stagger > :nth-child(7)    { transition-delay: calc(6 * var(--rv-stagger)); }
.rv-stagger > :nth-child(n+8)  { transition-delay: calc(7 * var(--rv-stagger)); }

[data-rv-delay="1"] { --rv-delay: .1s; }
[data-rv-delay="2"] { --rv-delay: .2s; }
[data-rv-delay="3"] { --rv-delay: .3s; }

/* The subhead W badge pops in on the overshoot curve once its heading lands.
   `scale` keeps the badge's own rotate(-6deg) tilt intact. */
.wakasm-mega-preview .review-point-title.rv-item::before {
    scale: 0;
    transition: scale var(--rv-duration) var(--rv-ease) .12s;
}

.wakasm-mega-preview .review-point-title.rv-item.is-in::before {
    scale: 1;
}

@media (prefers-reduced-motion: reduce) {
    .rv-item,
    .rv-stagger > *,
    .wakasm-mega-preview .review-point-title.rv-item::before {
        opacity: 1 !important;
        translate: none !important;
        rotate: none !important;
        scale: none !important;
        transition: none !important;
    }
}
