:root {
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
    --safe-left: env(safe-area-inset-left);
    --safe-right: env(safe-area-inset-right);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    padding-bottom: var(--safe-bottom);
}

html,
body {
    width: 100%;
    overflow-x: hidden;
}

img,
video {
    max-width: 100%;
    height: auto;
}

a,
button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#hero {
    min-height: 100svh;
}

@media (min-width: 781px) and (max-width: 900px) {
    header {
        padding-top: calc(0.56rem + var(--safe-top));
        padding-bottom: 0.36rem;
    }

    header .container {
        justify-content: space-between;
        padding-left: max(16px, var(--safe-left));
        padding-right: max(16px, var(--safe-right));
    }

    header h1 {
        position: static;
    }

    header nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
    }

    header.is-menu-open nav {
        display: block;
    }

    header nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 20px 20px;
    }

    header nav ul li {
        margin-left: 0;
    }

    header nav ul li a {
        font-size: 1rem;
    }

    .services-nav {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .services-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
        max-width: none;
        max-height: 0;
        padding-top: 0;
        margin-top: 0;
        overflow: hidden;
        transform: translateY(-6px);
        transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.35s ease;
    }

    .services-links.is-open {
        max-height: 240px;
        opacity: 1;
        transform: translateY(0);
    }

    .header-toggle {
        display: inline-flex;
    }

    header.is-menu-open {
        background-color: #ffffff;
        color: #111111;
        border-bottom-color: rgba(0, 0, 0, 0.08);
    }

    header.is-menu-open nav {
        background: #ffffff;
    }

    header.is-menu-open nav ul li a {
        color: #111111;
    }

    header.is-menu-open nav ul {
        background: #f2f2f2;
    }
}

@media (max-width: 900px) {
    #hero,
    body.project-page #projects-hero {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    #hero .container,
    body.project-page #projects-hero .project-hero-grid {
        width: 100%;
        max-width: 100%;
        padding-left: max(16px, var(--safe-left));
        padding-right: max(16px, var(--safe-right));
    }

    .intro-band {
        display: flex;
        flex-direction: column;
        gap: clamp(20px, 6vw, 32px);
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: clamp(24px, 6vw, 40px) 16px;
    }

    .intro-band-reverse {
        padding: clamp(24px, 6vw, 40px) 16px;
    }

    .intro-band-text {
        max-width: 100%;
    }

    #intro-split-secondary .intro-band-text {
        padding-left: 0;
    }

    .intro-band-image {
        width: 100%;
        height: clamp(240px, 60vw, 420px);
        justify-self: stretch;
    }

    #intro-split .intro-band,
    #intro-split-secondary .intro-band {
        display: flex;
        flex-direction: column;
    }

    body.project-page #intro-split-2 .intro-band-text {
        padding-left: 0;
    }

    body.project-page #intro-split-2 .intro-band-image {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        transform: none;
    }
}

@media (max-width: 600px), (hover: none) and (pointer: coarse) {
    footer .footer-cta-row {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    footer .footer-cta {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    footer .footer-social {
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: center;
        align-items: center;
        gap: 14px;
        flex-wrap: nowrap;
    }

    footer .footer-social img {
        width: clamp(96px, 38vw, 140px);
        height: auto;
    }

    footer .footer-social img:not(.footer-social-logo) {
        width: clamp(80.4px, 31.92vw, 117.6px);
    }

    footer .footer-social .footer-social-logo {
        width: clamp(96px, 38vw, 140px);
        height: auto;
        margin-left: 0 !important;
    }
}
