html:has(body > .landing-page) {
    --landing-header-height: 5rem;
    --landing-screen: calc(100svh - var(--landing-header-height));
    --landing-section-padding: clamp(1.25rem, calc(10svh - 3rem), 5rem);
    --landing-heading-gap: clamp(0.75rem, calc(5svh - 1.25rem), 2rem);
    --landing-content-gap: clamp(1rem, calc(7svh - 2rem), 3rem);
    scroll-padding-block-start: var(--landing-header-height);
}

.landing-page {
    padding-block-start: var(--landing-header-height);
}

.landing-page > section {
    min-block-size: var(--landing-screen);
    scroll-margin-block-start: 0;
}

.landing-page > .outstaffing-intake {
    min-block-size: auto;
}

.landing-page > .landing-section,
.landing-end > .landing-section,
.landing-hero {
    padding-block: var(--landing-section-padding);
}

.landing-heading-follow {
    margin-block-start: var(--landing-heading-gap);
}

.landing-heading-before {
    margin-block-end: var(--landing-heading-gap);
}

.landing-content-stack {
    row-gap: var(--landing-content-gap);
}

.landing-content-follow {
    margin-block-start: var(--landing-content-gap);
}

.landing-service-card {
    padding-block: clamp(1rem, 2.5svh, 1.5rem);
    row-gap: clamp(0.75rem, 2svh, 1.25rem);
}

/* Center short sections and let long sections grow with their content. */
.landing-page > section:not(.landing-banner, .landing-hero, .landing-hero-with-strip) {
    align-content: center;
    align-items: center;
}

.landing-banner {
    display: grid;
    grid-template-rows: auto 1fr;
}

.landing-banner-copy {
    display: grid;
    align-content: center;
    justify-items: start;
    gap: clamp(0.75rem, calc((var(--landing-screen) - 18rem) / 10), 2.5rem);
    min-inline-size: 0;
    padding: clamp(1.5rem, 5svh, 4rem) 6vw;
}

.landing-banner-heading {
    font-size: clamp(1.625rem, 5.25svh, 2.25rem);
    overflow-wrap: anywhere;
}

.landing-banner-art {
    min-block-size: clamp(9rem, 30svh, 18rem);
}

.landing-banner-home > .landing-banner-art {
    z-index: 0;
}

.landing-banner-foreground {
    display: none;
}

.landing-banner-art,
.landing-banner-foreground {
    container-type: size;
}

/*
 * Artwork whose background continues 1000 units above and below its 1754 x 897 drawing. It covers its area, and the
 * area shows the background beyond the drawing wherever the drawing itself does not reach.
 */
.landing-banner-bleed {
    position: absolute;
    inset-inline-end: 0;
    inset-block-start: 50%;
    translate: 0 -50%;
    inline-size: max(100cqw, 100cqh * 1754 / 897);
    max-inline-size: none;
    block-size: auto;
    aspect-ratio: 1754 / 2897;
}

@media (min-width: 64rem) {
    /*
     * Beside the copy, which ends at 20% of the artwork's area, the drawing never grows past 117% of the area's width:
     * its leftmost foreground element (x = 589) then always stays clear of the text, at any banner proportion.
     */
    .landing-banner-bleed {
        inline-size: min(max(100cqw, 100cqh * 1754 / 897), 117cqw);
    }
}

@media (max-width: 63.999rem) {
    .landing-banner:not(.landing-banner-home) {
        grid-template-rows: 1fr auto;
    }

    .landing-banner:not(.landing-banner-home) > .landing-banner-art {
        grid-row: 1;
    }
}

.landing-hero {
    display: grid;
    align-items: center;
}

.landing-hero-with-strip {
    display: grid;
    grid-template-rows: 1fr auto;
}

@media (min-width: 64rem) {
    .landing-banner {
        --banner-reveal: clamp(1rem, calc((var(--landing-screen) - 24rem) * .43), 9rem);
        --banner-base: clamp(1.25rem, 12svh, 6rem);
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: var(--banner-reveal) 1fr var(--banner-base);
        isolation: isolate;
    }

    .landing-banner-copy {
        grid-area: 2 / 1 / 4 / 3;
        z-index: 10;
        border-start-end-radius: 1rem;
        padding-block: clamp(1.25rem, 4svh, 3rem) clamp(2rem, 6svh, 4.5rem);
        padding-inline: 11.35vw 10%;
    }

    .landing-banner-rule {
        margin-inline-start: clamp(-6rem, -6.8vw, -3rem);
    }

    .landing-banner-art {
        grid-area: 1 / 2 / 3 / 5;
        min-block-size: 0;
    }

    @supports (clip-path: shape(from 0 0, line to 100% 0, close)) {
        .landing-banner > .landing-banner-copy {
            background: none;
            padding-inline-end: 15%;
        }

        .landing-banner-art:not(:has(.landing-banner-art-mask)),
        .landing-banner-art-mask {
            --art-edge: 28%;
            clip-path: shape(
                from 0 0,
                line to 100% 0,
                line to 100% 100%,
                line to calc(var(--art-edge) + 16%) 100%,
                curve to calc(var(--art-edge) + 3.52%) 92.96%
                    with calc(var(--art-edge) + 14.08%) 100% / calc(var(--art-edge) + 7.04%) 100%,
                curve to var(--art-edge) 68%
                    with var(--art-edge) 85.92% / var(--art-edge) 71.84%,
                line to var(--art-edge) 57%,
                curve to 0 0
                    with var(--art-edge) 19% / 1% 29%,
                close
            );
        }

        .landing-banner:has(> .landing-banner-foreground) > .landing-banner-copy {
            padding-inline-end: 20%;
        }

        .landing-banner-foreground {
            display: block;
            grid-area: 1 / 2 / 3 / 5;
            min-block-size: 0;
            position: relative;
            z-index: 5;
            pointer-events: none;
        }
    }

    .landing-end {
        min-block-size: var(--landing-screen);
        display: flex;
        flex-direction: column;
    }

    .landing-end > section {
        flex: 1 0 auto;
    }
}

@media (min-width: 64rem) and (min-height: 28rem) and (prefers-reduced-motion: no-preference) {
    html:has(body > .landing-page) {
        scroll-snap-type: y mandatory;
    }

    html:has(body > .landing-page > .public-faq) {
        scroll-snap-type: y proximity;
    }

    .landing-page > section,
    .landing-end {
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    .landing-page {
        --landing-transition-space: round(clamp(1.25rem, 3.5svh, 2.5rem), 1px);
    }

    .landing-page > section ~ section {
        --transition-before: var(--landing-transition-space);
    }

    .landing-page > section:has(~ section),
    .landing-page:has(+ .landing-end) > section {
        --transition-after: var(--landing-transition-space);
    }

    /* Extend each section's background and inset its snap area by the same amount. */
    .landing-page > section {
        --transition-before: 0px;
        --transition-after: 0px;
        border-block-start: var(--transition-before) solid transparent;
        border-block-end: var(--transition-after) solid transparent;
        min-block-size: calc(var(--landing-screen) + var(--transition-before) + var(--transition-after));
        scroll-margin-block-start: calc(-1 * var(--transition-before));
        scroll-margin-block-end: calc(-1 * var(--transition-after));
    }

    html:has(body > .landing-page) > body > footer {
        scroll-snap-align: end;
    }
}

@media (prefers-reduced-motion: reduce) {
    html:has(body > .landing-page) {
        scroll-behavior: auto;
    }
}

.landing-end:has(> .closing-cta) {
    min-block-size: auto;
}

.closing-cta {
    background: var(--color-primary, #fc5655);
    color: var(--color-black, #1f2221);
}

.closing-cta-inner {
    width: 90%;
    max-width: 80rem;
    margin-inline: auto;
    padding-block: clamp(1.5rem, 2.75vw, 3rem);
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
}

.closing-cta-copy h2 {
    max-inline-size: 16ch;
    font-size: clamp(2.5rem, 4.8vw, 4.75rem);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.closing-cta-copy p {
    max-inline-size: 46ch;
    margin-block: 1rem 1.5rem;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    line-height: 1.5;
}

.closing-cta-art {
    position: relative;
    width: 100%;
    height: auto;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .closing-cta-art:hover .closing-cta-check {
        stroke-dasharray: 1;
        animation: closing-cta-draw 1.6s ease-out infinite both;
    }

    .closing-cta-art:hover .closing-cta-placement {
        opacity: 1;
        stroke-dasharray: 1 3;
        animation: closing-cta-place 1.4s ease-out infinite both;
    }
}

@keyframes closing-cta-draw {
    from { stroke-dashoffset: 1; }
    25%, to { stroke-dashoffset: 0; }
}

@keyframes closing-cta-place {
    from { stroke-dashoffset: 8; opacity: 0; }
    35% { opacity: 1; }
    to { stroke-dashoffset: 0; opacity: 0; }
}

@media (max-width: 45rem) {
    .closing-cta-inner {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding-block: 2.5rem 1.5rem;
    }

    .closing-cta-art {
        width: min(75%, 18rem);
        justify-self: center;
    }
}

@media (min-width: 64rem) {
    .public-faq-heading {
        position: sticky;
        inset-block-start: calc(var(--landing-header-height, 5rem) + 1.5rem);
    }
}

@media (prefers-reduced-motion: no-preference) {
    @supports selector(details::details-content) and (transition-behavior: allow-discrete) {
        .public-faq-accordion > details::details-content {
            display: grid;
            grid-template-rows: 0fr;
            transition: grid-template-rows 240ms ease, content-visibility 240ms allow-discrete;
        }

        .public-faq-accordion > details[open]::details-content {
            grid-template-rows: 1fr;
        }
    }
}

@media (min-width: 64rem) {
    .service-signup {
        background-image: linear-gradient(to right, var(--color-black) 50%, transparent 50%);
    }
}

.portfolio-carousel {
    --portfolio-carousel-gap: 1.5rem;
    container-type: inline-size;
    overflow: hidden;
}

.portfolio-carousel-track {
    display: flex;
    width: max-content;
    animation: portfolio-carousel-slide 20s linear infinite;
}

.portfolio-carousel-group {
    display: flex;
    flex: none;
    gap: var(--portfolio-carousel-gap);
    padding-inline-end: var(--portfolio-carousel-gap);
}

.portfolio-carousel-tile {
    flex: none;
    width: 25cqw;
}

@keyframes portfolio-carousel-slide {
    to { transform: translateX(-50%); }
}

@media (min-width: 48rem) {
    .portfolio-carousel-tile { width: 20cqw; }
    .portfolio-carousel-track { animation-duration: 40s; }
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-carousel { overflow-x: auto; }
    .portfolio-carousel-track { animation: none; }
    .portfolio-carousel-group[aria-hidden="true"] { display: none; }
}
