/* Shared responsive overrides loaded after every page stylesheet. */
html,
body {
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}

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

.inner-header,
.inner-header .header-row,
main,
section,
.container,
.inner-container,
.footer-grid,
.footer-layout {
    min-width: 0;
}

.footer-column,
.footer-links,
.footer-contact,
.footer-contact a,
.footer-contact p,
.contact-column,
.contact-column a,
.contact-column p {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Keep the absolutely positioned About-page metrics centered after reveal. */
.hero-stats.reveal,
.hero-stats.reveal.visible {
    transform: translateX(-50%);
}

@media (max-width: 1080px) {
    .inner-header .inner-nav {
        max-height: calc(100dvh - 82px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .inner-header .inner-nav a {
        min-height: 46px;
        display: flex;
        align-items: center;
        font-size: 14px;
    }
}

@media (max-width: 820px) {
    .inner-header .header-row {
        min-height: 78px;
    }

    .inner-header .inner-logo {
        width: min(178px, calc(100vw - 105px));
    }

    .inner-header .inner-logo img {
        height: 62px;
    }

    /* Homepage */
    .hero,
    .hero-inner {
        min-height: auto;
    }

    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-copy {
        padding: 58px 0 24px;
    }

    .hero-dashboard {
        width: 100%;
        max-width: 100%;
        justify-self: stretch;
        transform: none;
    }

    .dashboard-screen {
        right: 0;
        width: min(92%, 620px);
    }

    .dashboard-base {
        right: 0;
        max-width: 100%;
    }

    .review-row,
    .hero-actions {
        max-width: 100%;
    }

    /* Content-page heroes use a true stacked layout instead of text/image overlap. */
    .content-hero,
    .blog-hero {
        min-height: auto;
    }

    .content-hero-grid,
    .blog-hero .content-hero-grid {
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-top: 48px;
    }

    .content-hero-copy {
        width: 100%;
        padding: 0 0 34px;
    }

    .content-hero-copy h1 {
        font-size: clamp(40px, 8vw, 60px);
    }

    .content-hero-copy > p:not(.page-kicker) {
        max-width: 680px;
        font-size: 14px;
    }

    .content-hero-art,
    .portfolio-hero .content-hero-art,
    .blog-hero .content-hero-art {
        position: relative;
        right: auto;
        bottom: auto;
        width: 100%;
        height: clamp(260px, 54vw, 410px);
        align-self: auto;
        opacity: .82;
    }

    .content-hero-art::after {
        background: linear-gradient(180deg, #050504 0, transparent 22%), linear-gradient(0deg, #050504 0, transparent 18%);
    }

    .services-page .content-hero-art img,
    .blog-page .content-hero-art img {
        object-fit: contain;
    }

    .hero-box-stats {
        position: relative;
        z-index: 3;
    }

    /* Filter controls wrap into usable rows instead of relying on clipped overflow. */
    .team-filters,
    .filter-bar {
        flex-wrap: wrap;
        overflow: visible;
        scrollbar-width: none;
    }

    .team-filters button,
    .filter-bar button {
        flex: 1 1 auto;
        min-height: 42px;
    }

    .filter-bar select {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }

    /* About and contact heroes */
    .hero-stats {
        left: 50%;
        right: auto;
        width: calc(100% - 30px);
        margin: 0;
    }

    .contact-hero {
        min-height: auto;
    }

    .contact-hero .hero-content {
        padding: 54px 0;
    }

    .contact-methods {
        max-width: 100%;
    }

    .footer-layout,
    .footer-grid {
        min-width: 0;
    }
}

@media (max-width: 620px) {
    .container,
    .inner-container,
    .inner-header .inner-container {
        width: calc(100% - 30px);
    }

    .section-pad,
    .inner-section {
        padding-top: 52px;
        padding-bottom: 52px;
    }

    .hero-copy {
        padding-top: 46px;
    }

    .hero-copy h1,
    .hero-content h1,
    .content-hero-copy h1,
    .resource-hero h1 {
        font-size: clamp(38px, 11.5vw, 50px);
        line-height: 1.06;
    }

    .hero-text,
    .hero-content > p:not(.page-kicker),
    .content-hero-copy > p:not(.page-kicker),
    .resource-hero-inner > p:not(.page-kicker) {
        font-size: 14px;
        line-height: 1.7;
    }

    .page-kicker,
    .eyebrow {
        font-size: 10px;
        letter-spacing: .11em;
    }

    .content-hero-grid,
    .blog-hero .content-hero-grid {
        padding-top: 42px;
    }

    .content-hero-art,
    .portfolio-hero .content-hero-art,
    .blog-hero .content-hero-art {
        height: clamp(235px, 78vw, 320px);
    }

    .content-service-card p,
    .team-values p,
    .work-card p,
    .blog-card-copy p,
    .blog-sidebar p,
    .detail-feature-grid p,
    .detail-process p,
    .detail-faqs p {
        font-size: 13px;
    }

    .content-service-card a,
    .work-card a,
    .blog-card-copy a {
        font-size: 12px;
    }

    .content-process-grid p,
    .content-stat-grid span,
    .hero-box-stats span,
    .hero-mini-stats span {
        font-size: 10px;
    }

    .content-stat-grid > div {
        padding: 10px 6px;
    }

    .content-stat-grid strong {
        font-size: 27px;
    }

    .partner-ribbon > .inner-container,
    .brand-ribbon > .inner-container {
        gap: 12px;
        padding: 18px 14px;
    }

    .partner-ribbon span,
    .brand-ribbon span {
        font-size: 14px;
    }

    .filter-bar,
    .team-filters {
        gap: 8px;
    }

    .filter-bar button,
    .team-filters button {
        padding-inline: 14px;
        font-size: 11px;
    }

    .contact-methods small {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .form-panel,
    .office-panel {
        padding: 26px 18px;
    }

    .field input,
    .field select,
    .field textarea,
    .hero-search input,
    .newsletter-form input {
        font-size: 16px;
    }

    .office-address {
        align-items: flex-start;
        padding: 17px;
    }

    .office-address p {
        overflow-wrap: anywhere;
    }

    .map-image {
        height: 280px;
    }

    .policy-document,
    .detail-feature-grid article,
    .blog-notice,
    .post-author {
        overflow-wrap: anywhere;
    }

    .inner-footer,
    .site-footer {
        padding-top: 20px;
    }

    .footer-social a,
    .social-links a {
        width: 38px;
        height: 38px;
    }

    .footer-intro p,
    .footer-links a,
    .footer-links p {
        font-size: 14px;
    }

    .page-top,
    .back-to-top {
        right: 15px;
        bottom: 15px;
    }
}

@media (max-width: 380px) {
    .inner-header .inner-logo {
        width: 155px;
    }

    .inner-header .inner-nav-toggle {
        width: 42px;
    }

    .hero-actions,
    .hero-buttons,
    .detail-actions {
        gap: 11px;
    }

    .hero-actions > a,
    .hero-buttons > a,
    .hero-buttons > button,
    .detail-actions > a {
        width: 100%;
    }

    .review-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .review-badge,
    .rating {
        min-width: 0;
    }

    .dashboard-screen {
        width: 100%;
    }

    .content-stat-grid {
        grid-template-columns: 1fr;
    }

    .content-stat-grid > div,
    .content-stat-grid > div:nth-child(even),
    .content-stat-grid > div:last-child {
        grid-column: auto;
        border-left: 0;
        border-top: 1px solid var(--soft);
    }

    .content-stat-grid > div:first-child {
        border-top: 0;
    }

    .hero-box-stats {
        grid-template-columns: 1fr !important;
    }

    .hero-mini-stats {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }

    .hero-mini-stats span {
        min-width: 0;
    }

    .newsletter-form {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .newsletter-form input,
    .newsletter-form .gold-button {
        width: 100%;
        border: 1px solid rgba(255, 255, 255, .15);
        border-radius: 4px;
    }

    .footer-layout,
    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .footer-intro,
    .footer-brand,
    .footer-contact,
    .contact-column {
        grid-column: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-stats.reveal,
    .hero-stats.reveal.visible {
        transform: translateX(-50%);
    }
}
