/*
 * How it works page motion (MILESTONES #22), the same as the home page's: assets/js/home-motion.js arms the blocks of
 * the sections below the screen (its list holds the hiw- selectors) 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; the pink lines under the handwritten
 * notes, drawn as the note comes in; the step cards with a link lifting under the pointer. 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. */

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

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

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

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

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

    .hiw-hero-note {
        animation-delay: .46s;
    }

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

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

    /* ---------- The lines under the other notes 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. */

    .hiw-provides-handwritten.amo-in::after,
    .hiw-levels-handwritten.amo-in::after,
    .hiw-control-handwritten.amo-in::after,
    .hiw-cta-handwritten.amo-in::after {
        animation: hiw-underline .75s .15s cubic-bezier(.22, .61, .36, 1) both;
    }

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

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

    /* ---------- The arrows between the What Amerlink Provides cards grow a little under the pointer, as those between
     * the How It Works steps on the home page (scale: translate places them, rotate turns them down on tablets). */

    .hiw-provides-arrow {
        transition: scale .25s ease;
    }

    .hiw-provides-arrow:hover {
        scale: 1.18;
    }

    /* ---------- The step cards (each with its outcome link) lift a little under the pointer, as the home cards do. */

    .hiw-path-step {
        transition: translate .28s ease, box-shadow .28s ease;
    }

    .hiw-path-step:hover,
    .hiw-path-step:focus-within {
        translate: 0 -6px;
        box-shadow: 0 22px 48px rgba(1, 33, 106, .13);
    }
}
