/*
 * Swap Design mobile layer.
 * Loaded only below 768px from includes/header.php.
 * Keep desktop layout and brand tokens in assets/css/style.css.
 */

@media (max-width: 767.98px) {
    html,
    body {
        max-width: 100%;
        overflow-x: clip;
    }

    /* Reduce paint and compositing cost for touch devices. */
    body[data-sd-page="home"] .sd-aurora,
    body[data-sd-page="home"] .sd-about-orb,
    body[data-sd-page="home"] .sd-success-orb {
        animation: none !important;
        filter: blur(42px);
        opacity: .13;
    }

    body[data-sd-page="home"] .sd-hero-grid {
        opacity: .13;
        background-size: 96px 96px;
    }

    body[data-sd-page="home"] .sd-hero {
        padding-bottom: 2.5rem;
    }

    body[data-sd-page="home"] .sd-hero .row {
        --bs-gutter-y: 1.35rem;
    }

    body[data-sd-page="home"] .sd-hero-sub {
        margin-bottom: .75rem;
        font-size: .68rem;
        letter-spacing: .09em;
        line-height: 1.45;
    }

    body[data-sd-page="home"] .sd-hero-lead {
        margin-bottom: .75rem;
        font-size: 1rem;
        line-height: 1.55;
    }

    body[data-sd-page="home"] .sd-hero-proof {
        margin-bottom: 1.25rem;
        font-size: .88rem;
        line-height: 1.55;
    }

    body[data-sd-page="home"] .sd-hero-actions {
        gap: .65rem !important;
    }

    body[data-sd-page="home"] .sd-hero-actions .sd-btn {
        min-height: 46px;
    }

    body[data-sd-page="home"] .sd-hero-trust {
        gap: .7rem;
        margin-top: 1.5rem;
    }

    body[data-sd-page="home"] .sd-hero-trust-item {
        min-width: calc(50% - .7rem);
    }

    /* Keep the phone useful, but remove decorative hover/compositing work on touch. */
    body[data-sd-page="home"] .sd-hero-phone-column {
        margin-top: .25rem;
        padding-bottom: .5rem;
    }

    body[data-sd-page="home"] .sd-hero-phone-stage {
        min-height: 400px;
    }

    body[data-sd-page="home"] .sd-hero-phone-stage::before {
        opacity: .5;
    }

    body[data-sd-page="home"] .sd-hero-phone-stage::after {
        display: none;
    }

    body[data-sd-page="home"] .sd-hero-phone,
    body[data-sd-page="home"] .sd-hero-phone:hover {
        transform: none;
        transition: none;
    }

    /* Reduce section padding while preserving the established visual rhythm. */
    body[data-sd-page="home"] main#content > section:not(.sd-hero) {
        scroll-margin-top: 72px;
    }

    body[data-sd-page="home"] .sd-section {
        padding-top: clamp(3.2rem, 10vw, 4.5rem);
        padding-bottom: clamp(3.2rem, 10vw, 4.5rem);
    }

    body[data-sd-page="home"] .sd-h2 {
        font-size: clamp(1.65rem, 7vw, 2.15rem);
        line-height: 1.12;
    }

    body[data-sd-page="home"] .sd-lead {
        font-size: .94rem;
        line-height: 1.6;
    }

    /* Avoid expensive hover transforms where there is no hover pointer. */
    @media (hover: none), (pointer: coarse) {
        .sd-btn:hover,
        .sd-card:hover,
        .sd-tilt:hover,
        .sd-portfolio .sd-port-item:hover {
            transform: none;
        }
    }

    /* Keep Google reCAPTCHA v2 inside narrow cards and WhatsApp popup. */
    .sd-recaptcha-wrap {
        margin: .75rem 0;
        padding: .55rem;
    }

    /* Minimum comfortable touch target for the primary mobile actions. */
    .sd-btn,
    .wws-send,
    .navbar-toggler {
        min-height: 44px;
    }

    @media (prefers-reduced-motion: reduce) {
        body[data-sd-page="home"] .sd-aurora,
        body[data-sd-page="home"] .sd-about-orb,
        body[data-sd-page="home"] .sd-success-orb {
            filter: none;
            opacity: .1;
        }
    }
}
