/* Home page flip animations (loaded with js/home-flip.js).
   1) Cards flip up into place, one after another, as they scroll into view.
   2) The big numbers in "Why Raynez" flip digit by digit like an airport departure board.
   Both are removed again once finished, so hover effects and layout are exactly as before.
   With "reduce motion" on, or without JavaScript, nothing is hidden or animated. */

html.rzf-on .rzf-pre {
    opacity: 0;
    transform: perspective(1100px) rotateX(-62deg) translateY(26px);
    transform-origin: 50% 0;
    will-change: transform, opacity;
}
html.rzf-on .rzf-go {
    animation: rzfIn .95s cubic-bezier(.16, 1, .3, 1) var(--rzf-d, 0ms) both;
    transform-origin: 50% 0;
    backface-visibility: hidden;
}
@keyframes rzfIn {
    0%   { opacity: 0; transform: perspective(1100px) rotateX(-62deg) translateY(26px); }
    55%  { opacity: 1; }
    80%  { transform: perspective(1100px) rotateX(6deg) translateY(-2px); }
    100% { opacity: 1; transform: perspective(1100px) rotateX(0) translateY(0); }
}

/* departure-board digits */
.rzf-ch { display: inline-block; transform-origin: 50% 100%; backface-visibility: hidden; }
.rzf-flap .rzf-ch { animation: rzfFlap .65s cubic-bezier(.2, .8, .2, 1) calc(var(--i, 0) * 75ms + 180ms) both; }
@keyframes rzfFlap {
    0%   { opacity: 0; transform: perspective(420px) rotateX(-92deg); }
    60%  { opacity: 1; transform: perspective(420px) rotateX(10deg); }
    100% { opacity: 1; transform: perspective(420px) rotateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    html.rzf-on .rzf-pre { opacity: 1; transform: none; }
    html.rzf-on .rzf-go, .rzf-flap .rzf-ch { animation: none; }
}

/* digits wait hidden until the board flips (only when the script is active) */
html.rzf-on .rz-why-stat .rzf-ch { opacity: 0; }
html.rzf-on .rz-why-stat.rzf-flap .rzf-ch { opacity: 1; }
