/* Pocket Voucher motion: public site (landing, login, legal pages).
   Rules: transform/opacity only, under ~600ms, custom ease-out, reduced-motion safe.
   Scroll reveals are opt-in: assets/js/pv-motion.js adds .js-motion and .reveal, so content is never hidden without JS. */

:root {
    --pv-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }

    @keyframes pv-rise {
        from { opacity: 0; translate: 0 10px; filter: blur(4px); }
        to   { opacity: 1; translate: 0 0;    filter: blur(0); }
    }
    @keyframes pv-card-in {
        from { opacity: 0; translate: 0 18px; }
        to   { opacity: 1; translate: 0 0; }
    }

    /* Hero entrance: one-time, staggered (landing page is visited rarely, so expressive motion is fine) */
    .landing-hero .landing-eyebrow,
    .landing-hero h1,
    .landing-hero .landing-hero-copy,
    .landing-hero .landing-actions,
    .landing-hero .landing-trust-list {
        animation: pv-rise 520ms var(--pv-ease-out) backwards;
    }
    .landing-hero .landing-eyebrow     { animation-delay: 0ms; }
    .landing-hero h1                   { animation-delay: 60ms; }
    .landing-hero .landing-hero-copy   { animation-delay: 140ms; }
    .landing-hero .landing-actions     { animation-delay: 210ms; }
    .landing-hero .landing-trust-list  { animation-delay: 270ms; }
    .landing-hero .reward-preview      { animation: pv-card-in 640ms var(--pv-ease-out) 180ms backwards; }

    /* The tilted preview card settles flat on hover (pointer devices only) */
    .reward-preview { transition: transform 300ms var(--pv-ease-out), translate 300ms var(--pv-ease-out); }
    @media (hover: hover) {
        .reward-preview:hover { transform: rotate(0deg); translate: 0 -4px; }
    }

    /* Press feedback */
    .landing-btn-primary, .landing-btn-secondary, .landing-btn-light {
        transition: background-color 180ms var(--pv-ease-out), border-color 180ms var(--pv-ease-out),
                    color 180ms var(--pv-ease-out), transform 140ms var(--pv-ease-out);
    }
    .landing-btn-secondary:active, .landing-btn-light:active, .btn:active { transform: scale(0.97); }
    .pv-header .nav-link { transition: color 160ms var(--pv-ease-out); }

    /* Scroll reveal (JS-gated) */
    .js-motion .reveal {
        opacity: 0;
        translate: 0 14px;
        transition: opacity 460ms var(--pv-ease-out), translate 460ms var(--pv-ease-out);
    }
    .js-motion .reveal.is-visible { opacity: 1; translate: 0 0; }
    .js-motion .reveal-d1 { transition-delay: 70ms; }
    .js-motion .reveal-d2 { transition-delay: 140ms; }
    .js-motion .reveal-d3 { transition-delay: 210ms; }
    .js-motion .reveal-d4 { transition-delay: 280ms; }
    .js-motion .reveal-d5 { transition-delay: 350ms; }

    /* Demo chart bars grow from the baseline once the card is visible */
    .js-motion .merchant-dashboard .merchant-chart span {
        transform-origin: bottom;
        transform: scaleY(0.12);
        transition: transform 620ms var(--pv-ease-out);
    }
    .js-motion .merchant-dashboard.is-visible .merchant-chart span { transform: scaleY(1); }
    .js-motion .merchant-chart span:nth-child(2) { transition-delay: 50ms; }
    .js-motion .merchant-chart span:nth-child(3) { transition-delay: 100ms; }
    .js-motion .merchant-chart span:nth-child(4) { transition-delay: 150ms; }
    .js-motion .merchant-chart span:nth-child(5) { transition-delay: 200ms; }
    .js-motion .merchant-chart span:nth-child(6) { transition-delay: 250ms; }
    .js-motion .merchant-chart span:nth-child(7) { transition-delay: 300ms; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Existing looping "live" dot on the landing page: static for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .recipient-chat-pulse::after { animation: none; opacity: 0; }
}
