@media (max-width: 1020px) {
    html,
    body {
        overflow-x: hidden;
    }

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

    .site-header {
        grid-template-columns: auto auto;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .menu-toggle {
        display: block;
        justify-self: end;
    }

    .header-contact {
        display: none;
    }

    .main-nav {
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 20px 70px var(--shadow);
        max-height: min(72dvh, 560px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav a {
        padding: 18px;
        border-bottom: 1px solid var(--line);
        color: var(--text);
    }

    .main-nav a:last-child {
        border-bottom: 0;
    }

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

    .hero {
        align-items: start;
        gap: 42px;
    }

    .hero-stats {
        position: static;
        width: 100%;
        grid-template-columns: repeat(3, 1fr);
    }

    .service-grid,
    .timeline {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline-step:nth-child(2) {
        border-right: 1px solid var(--line);
    }

    .work-item,
    .service-card,
    .timeline-step,
    .about-copy,
    .local-seo-card,
    .price-tool,
    .contact-card,
    .contact-form,
    .faq-item {
        min-width: 0;
    }
}

@media (max-width: 720px) {
    body::before {
        background-size: 44px 44px;
    }

    .site-header {
        top: 10px;
        width: min(calc(100% - 20px), 680px);
    }

    .brand {
        font-size: 0.78rem;
        min-width: 0;
    }

    .section-panel {
        width: min(calc(100% - 24px), 680px);
        padding: clamp(58px, 14vw, 74px) 0;
    }

    .hero {
        min-height: auto;
        padding-top: clamp(108px, 20svh, 150px);
        padding-bottom: 58px;
    }

    .hero-copy {
        position: relative;
        top: auto;
        height: auto;
        min-height: auto;
        justify-content: start;
    }

    .hero-title,
    .section-heading h2 {
        font-size: clamp(2.35rem, 13vw, 4.7rem);
        line-height: 0.92;
    }

    .hero-title {
        font-size: clamp(2.55rem, 13.5vw, 4.8rem);
    }

    .hero-actions,
    .site-footer,
    .price-result {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-reveal {
        position: static;
        max-width: none;
        margin-top: 28px;
        padding: 20px;
        opacity: 1;
        transform: none;
    }

    .hero .hero-text {
        margin-top: 0;
        font-size: 1rem;
    }

    .hero .hero-actions {
        margin-top: 20px;
    }

    .button {
        width: 100%;
        min-width: 0;
        padding-inline: 14px;
        text-align: center;
    }

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

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

    .work-visual {
        min-height: 210px;
    }

    .service-grid,
    .timeline {
        grid-template-columns: 1fr;
    }

    .timeline-step,
    .timeline-step:nth-child(2),
    .timeline-step:last-child {
        border-right: 1px solid var(--line);
    }

    .price-result {
        display: grid;
        gap: 14px;
    }

    .contact-card h2 {
        font-size: clamp(2.3rem, 14vw, 4rem);
    }

    .site-footer {
        display: grid;
        gap: 12px;
        width: min(calc(100% - 24px), 680px);
    }

    .hero-stats div,
    .work-content,
    .service-card,
    .timeline-step,
    .about-copy,
    .local-seo-card,
    .price-tool,
    .contact-card,
    .contact-form,
    .faq-item summary,
    .faq-item p,
    .site-footer,
    .contact-links {
        overflow-wrap: anywhere;
    }

    .price-tool label {
        height: auto;
        min-height: 56px;
        align-items: flex-start;
        padding: 14px;
        line-height: 1.35;
    }

    .price-tool input {
        flex: 0 0 18px;
        margin-top: 0.1em;
    }

    .faq-item summary {
        min-height: 66px;
        padding: 16px 18px;
    }
}

@media (max-width: 430px) {
    .brand span:last-child {
        display: none;
    }

    .hero-title,
    .section-heading h2 {
        font-size: clamp(2rem, 12.5vw, 3.25rem);
    }

    .hero-title {
        font-size: clamp(2.15rem, 13.5vw, 3.35rem);
    }

    .hero-text,
    .estimator-copy p,
    .contact-card p {
        font-size: 1rem;
    }

    .work-content,
    .service-card,
    .timeline-step,
    .about-copy,
    .local-seo-card,
    .contact-card,
    .contact-form {
        padding: 20px;
    }

    .price-tool {
        padding: 12px;
    }

    .hero {
        padding-top: 98px;
    }

    .hero-reveal {
        margin-top: 22px;
        padding: 16px;
    }

    .hero .button {
        min-height: 50px;
    }

    .work-visual {
        min-height: 180px;
        padding: 18px;
    }

    .faq-item summary::after {
        flex-basis: 30px;
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 360px) {
    .site-header,
    .section-panel,
    .site-footer {
        width: calc(100% - 18px);
    }

    .brand-mark {
        width: 32px;
        height: 32px;
    }

    .menu-toggle {
        width: 40px;
    }

    .hero-title,
    .section-heading h2 {
        font-size: clamp(1.85rem, 11.5vw, 2.55rem);
    }

    .hero .hero-text,
    .hero-text,
    .estimator-copy p,
    .contact-card p,
    .about-copy p,
    .faq-item p {
        font-size: 0.96rem;
        line-height: 1.58;
    }

    .work-content h3,
    .service-card h3,
    .timeline-step h3,
    .contact-card h2,
    .local-seo-card h3 {
        font-size: clamp(1.55rem, 10vw, 2.35rem);
        line-height: 1;
    }
}

@media (max-width: 720px) and (orientation: landscape) {
    .hero {
        padding-top: 92px;
    }

    .main-nav {
        max-height: calc(100dvh - 86px);
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3.35rem);
    }

    .hero-reveal {
        margin-top: 18px;
    }

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
