/*
 * Programs & Pricing page motion (MILESTONES #23), the same as the home and How it works pages': assets/js/home-motion.js
 * arms the blocks of the sections below the screen and assets/css/home-motion.css, loaded before this file, holds the
 * entrances and the keyframes used here (amo-hero-rise, amo-fade). Here: the hero, which is on screen from the first
 * paint and comes in without the script, as the home hero does, and the pink lines under the handwritten notes, drawn
 * as the note comes in. Only when motion is welcome.
 */

@media (prefers-reduced-motion: no-preference) {

    /* ---------- Hero on load. Filled backwards only: after the entrance nothing holds these properties. The heading
     * only glides (no fade): it may be the LCP element, which a fade would hold back. The photo is not animated. */

    .prc-hero-eyebrow,
    .prc-hero-subtitle,
    .prc-hero-description,
    .prc-hero-actions {
        animation: amo-hero-rise .9s cubic-bezier(.25, 1, .5, 1) backwards, amo-fade .6s linear backwards;
    }

    .prc-hero-title {
        animation: amo-hero-rise 1s .08s cubic-bezier(.25, 1, .5, 1) backwards;
    }

    .prc-hero-subtitle {
        animation-delay: .16s;
    }

    .prc-hero-description {
        animation-delay: .26s;
    }

    .prc-hero-actions {
        animation-delay: .36s;
    }

    .prc-hero-handwritten {
        animation: amo-fade .8s .85s linear backwards;
    }

    .prc-hero-handwritten::after {
        animation: prc-underline .9s 1.3s cubic-bezier(.22, .61, .36, 1) both;
    }

    /* ---------- The lines under the notes of the sections draw themselves while the note comes in (home-motion.js
     * gives it .amo-in for its entrance). Clipped, not scaled: their rotation keeps its pivot. */

    .prc-programs-handwritten.amo-in::after,
    .prc-noticed-handwritten.amo-in::after,
    .prc-cta-handwritten.amo-in::after {
        animation: prc-underline .75s .15s cubic-bezier(.22, .61, .36, 1) both;
    }

    @keyframes prc-underline {
        from {
            clip-path: inset(0 100% 0 0);
        }

        to {
            clip-path: inset(0 0 0 0);
        }
    }

    /* ---------- The steps card rises with the hero, its steps one after another (on wider screens, where the card is
     * on screen at once; on phones it stays as it is). */

    @media (min-width: 781px) {
        .prc-hero-steps {
            animation: amo-hero-rise .9s .42s cubic-bezier(.25, 1, .5, 1) backwards, amo-fade .6s .42s linear backwards;
        }

        .prc-hero-step-body {
            animation: amo-hero-rise .8s cubic-bezier(.25, 1, .5, 1) backwards, amo-fade .5s linear backwards;
        }

        .prc-hero-step:nth-child(1) .prc-hero-step-body {
            animation-delay: .55s;
        }

        .prc-hero-step:nth-child(2) .prc-hero-step-body {
            animation-delay: .65s;
        }

        .prc-hero-step:nth-child(3) .prc-hero-step-body {
            animation-delay: .75s;
        }

        .prc-hero-step:nth-child(4) .prc-hero-step-body {
            animation-delay: .85s;
        }
    }
}
