/* NxCorp | css/responsive.css
   ALL-DEVICE RULES (phones, foldables, tablets, laptops, big screens, landscape).
   This file loads LAST, so it wins over the other css files.
   To fix something on one screen size, edit only the matching block below.
   Sizes: phone <= 560px | tablet 561-959px | laptop 960-1439px | desktop 1440px+ */

/* ---------- 1. Safe basics for every device ---------- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

h1,
h2,
h3,
p,
li,
a {
    overflow-wrap: break-word;
}

/* phones with a notch: keep content away from the cut-out in landscape */
.wrap {
    padding-left: max(22px, env(safe-area-inset-left));
    padding-right: max(22px, env(safe-area-inset-right));
}

footer {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- 2. Touch screens: comfortable 44px tap targets ---------- */
@media (pointer: coarse) {
    .logo {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    .btn {
        min-height: 44px;
    }

    .sv .sl {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
    }

    footer a {
        display: block;
        padding: .6rem 0;
    }

    #contact a:not(.btn) {
        display: inline-block;
        padding: .5rem 0;
    }

    a[data-wa] {
        min-height: 40px;
        align-items: center;
    }

    .nt-x {
        width: 40px;
        height: 40px;
        display: inline-grid;
        place-items: center;
    }

    .nt-cta {
        display: inline-flex;
        align-items: center;
        min-height: 36px;
        padding: 0 .4rem;
    }

    /* no sticky hover effects on touch */
    .cb:hover {
        transform: none;
        box-shadow: 0 8px 22px -8px rgba(79,70,229,.65);
    }
}

/* ---------- 3. Small phones (320 - 389px) ---------- */
@media (max-width: 389px) {
    .wrap {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .hero h1 {
        font-size: clamp(2rem, 10.5vw, 2.6rem);
        line-height: 1.08;
    }

    .cta {
        flex-direction: column;
        align-items: stretch;
    }

    .cta .btn {
        text-align: center;
        justify-content: center;
    }
}

/* ---------- 4. Phones (up to 560px) ---------- */
@media (max-width: 560px) {
    .sec-h h2 {
        font-size: clamp(1.7rem, 8vw, 2.2rem);
        line-height: 1.12;
    }

    /* forms: no sideways scroll, easy typing (16px stops iPhone auto-zoom) */
    input,
    select,
    textarea {
        font-size: 16px;
        max-width: 100%;
    }

    .cf {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* ---------- 5. Tablets (561 - 959px) ---------- */
@media (min-width: 561px) and (max-width: 959px) {
    .ed {
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero .cta {
        flex-wrap: wrap;
    }
}

/* ---------- 6. Large screens: use the space, never stretch too far ---------- */
@media (min-width: 1440px) {
    .wrap {
        max-width: 1240px;
    }
}

@media (min-width: 1920px) {
    .wrap {
        max-width: 1360px;
    }

    html {
        font-size: 17px;
    }
}

/* ---------- 7. Phones on their side (short screens) ---------- */
@media (max-height: 500px) and (orientation: landscape) {
    /* chatbot uses the whole height, the round icon hides while it is open */
    .cw {
        right: max(12px, env(safe-area-inset-right));
        bottom: 12px;
        width: min(380px, calc(100vw - 24px));
        height: calc(100vh - 24px);
        height: calc(100dvh - 24px);
    }

    .cb[aria-expanded="true"] {
        opacity: 0;
        pointer-events: none;
    }

    .cb-tip {
        display: none;
    }
}

/* ---------- 8. Accessibility: less motion if the device asks ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
