/*
 * Home story, phone layout polish (added 2026-10-13).
 * Self-contained: removing this file's <link> from head.php restores the previous layout.
 * Applies from 621px of screen height; the laptop shrinks on shorter screens so the text always fits.
 */
@media (max-width: 767px) and (min-height: 621px) {
    /* Laptop and text sit together in the middle; spare height is shared above and below instead of opening gaps between them. */
    .adanet-home-filled .adanet-story .adanet-story-grid {
        grid-template-rows: minmax(0, 1fr) auto auto minmax(0, 1.25fr) auto !important;
        row-gap: 0 !important;
        align-content: stretch !important;
    }

    .adanet-home-filled .adanet-story .adanet-device-scene {
        position: relative;
        grid-row: 2;
        justify-self: center;
        width: min(100%, max(190px, calc((100svh - 515px) * 1.4))) !important;
        isolation: isolate;
    }

    /* Soft glow that lifts the laptop off the dark background. */
    .adanet-home-filled .adanet-story .adanet-device-scene::after {
        content: "";
        position: absolute;
        z-index: -1;
        inset: 18% 6% 4%;
        border-radius: 50%;
        background: radial-gradient(closest-side, rgba(8, 124, 255, .34), rgba(110, 92, 255, .12) 60%, transparent);
        filter: blur(34px);
        pointer-events: none;
    }

    .adanet-home-filled .adanet-story .adanet-story-copy {
        display: grid !important;
        grid-row: 3;
        min-height: 0 !important;
        height: auto !important;
        margin-top: 14px;
    }

    /* Steps share one grid cell, so the block is exactly as tall as its text. */
    .adanet-home-filled .adanet-story .adanet-story-step,
    .adanet-home-filled .adanet-story .adanet-story-step:first-of-type {
        position: relative !important;
        inset: auto !important;
        grid-area: 1 / 1;
        justify-content: flex-start !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .adanet-home-filled .adanet-story .adanet-step-no {
        margin-bottom: 16px !important;
        padding-bottom: 14px;
        border-bottom: 1px solid rgba(255, 255, 255, .09);
        font-size: 12px !important;
        line-height: 24px;
    }

    /* Progress bars move up beside the step counter. */
    .adanet-home-filled .adanet-story .adanet-story-dots {
        position: absolute !important;
        inset: 0 0 auto auto !important;
        z-index: 2;
    }

    .adanet-home-filled .adanet-story .adanet-story-step h2 {
        margin-bottom: 14px !important;
        font-size: clamp(34px, 9.6vw, 40px) !important;
        line-height: 1.04 !important;
    }

    .adanet-home-filled .adanet-story .adanet-story-step p {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    .adanet-home-filled .adanet-story .adanet-service-tags {
        margin-top: 18px !important;
    }

    .adanet-home-filled .adanet-story .adanet-story-link {
        margin-top: 22px !important;
    }

    .adanet-home-filled .adanet-story .adanet-hero-partners {
        grid-row: 5;
    }
}

/* Without the partner row (shorter phones) the text still stays clear of the floating buttons. */
@media (max-width: 767px) and (min-height: 621px) and (max-height: 860px) {
    .adanet-home-filled .adanet-story .adanet-story-grid {
        padding-bottom: 76px !important;
    }
}

/* The compact text on short phones leaves more room for the laptop. */
@media (max-width: 767px) and (min-height: 621px) and (max-height: 740px) {
    .adanet-home-filled .adanet-story .adanet-device-scene {
        width: min(100%, max(190px, calc((100svh - 470px) * 1.4))) !important;
    }
}
