@media (max-width: 1100px) {
    body.has-open-menu {
        overflow: hidden;
    }

    .site-nav,
    .site-header__cta {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-menu .site-nav {
        display: flex;
    }

    .card-grid--four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .about-section .about-grid {
        grid-template-areas:
            "heading"
            "media"
            "copy";
        grid-template-columns: minmax(0, 1fr);
        gap: clamp(24px, 6vw, 44px);
    }

    .about-section__media,
    .about-section__heading,
    .about-section__copy {
        min-width: 0;
        width: 100%;
    }

    .about-section__copy,
    .about-section__copy p {
        max-width: calc(100vw - (var(--page-gutter) * 2));
        overflow-wrap: break-word;
    }

    .about-section .section-heading__meta,
    .about-section__title,
    .about-section__copy,
    .about-section__copy p,
    .about-section__copy .tag-row {
        width: 100%;
        max-width: 100%;
    }

    .about-section .section-heading__meta {
        display: flex;
        margin-bottom: 0;
    }

    .about-section__title {
        margin-bottom: 0;
    }

    .about-section .about-portrait {
        width: min(100%, 540px);
        max-width: 540px;
        justify-self: start;
    }

    .about-section__copy .tag-row {
        margin-top: var(--space-6);
    }

    .about-section__copy .about-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        max-width: 100%;
        overflow: visible;
        white-space: normal;
    }

    .about-section__copy .about-tags > span {
        flex: 0 1 auto;
        max-width: 100%;
        overflow-wrap: anywhere;
        text-overflow: clip;
        white-space: normal;
    }

    .hero__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-10);
    }
}

@media (max-width: 980px) {
    .hero__grid,
    .featured-project > .content-card__shell,
    .featured-project.content-card > .content-card__shell,
    .about-grid,
    .experience-layout,
    .faq-layout,
    .contact-grid,
    .case-bento,
    .case-bento--split {
        grid-template-columns: 1fr;
    }

    .featured-project > .content-card__shell,
    .featured-project.content-card > .content-card__shell {
        gap: clamp(18px, 3vw, 28px);
        align-items: stretch;
    }

    .hero__grid {
        gap: var(--space-10);
    }

    .hero-collage {
        width: min(100%, 620px);
    }

    .featured-project--reverse .visual-frame {
        order: 0;
    }

    .featured-project .content-card__visual,
    .featured-project .content-card__content {
        min-width: 0;
        width: 100%;
    }

    .featured-project .content-card__visual {
        min-height: clamp(220px, 46vw, 320px);
        aspect-ratio: 16 / 10;
    }

    .featured-project .content-card__content {
        padding: 0;
    }

    .featured-project .content-card__meta,
    .featured-project .tag-row {
        width: 100%;
        min-width: 0;
    }

    .featured-project .text-link {
        white-space: nowrap;
    }

    .card-grid--three,
    .card-grid--projects,
    .studio-section .bento-grid,
    .skills-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-meta dl,
    .case-meta__story,
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .case-cover {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .case-cover__main,
    .case-cover__side {
        grid-row: auto;
        aspect-ratio: 16 / 10;
    }

    .case-full-image__frame {
        min-height: clamp(280px, 58vw, 520px);
        aspect-ratio: 16 / 10;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .studio-card,
    .studio-card:nth-child(1),
    .studio-card:nth-child(2),
    .studio-card:nth-child(3),
    .studio-card:nth-child(4) {
        grid-column: auto;
        grid-row: auto;
        min-height: 320px;
    }

    .faq-heading {
        position: static;
    }

    .site-footer__top {
        grid-template-columns: repeat(2, minmax(128px, max-content)) minmax(0, 1fr);
        gap: var(--space-10) clamp(36px, 8vw, 72px);
    }

    .site-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    :root {
        --work-media-section-space: clamp(10px, 1vh, 24px);
    }

    .home-page {
        --section-space: clamp(42px, 5vh, 60px);
    }

    /* Mobile only: re-enable the lightbox/zoom for full-width image blocks.
       On desktop/tablet these display inline (pointer-events disabled in
       main.css). */
    .case-block-image__media {
        pointer-events: auto;
        cursor: zoom-in;
    }

    .hero__actions,
    .cta-panel,
    .site-footer__bottom {
        align-items: stretch;
        flex-direction: column;
    }

    .timeline__item {
        display: block;
    }

    .featured-project > .content-card__shell,
    .featured-project.content-card > .content-card__shell {
        gap: var(--space-5);
        padding: clamp(18px, 4vw, 24px);
    }

    .featured-project .content-card__visual {
        min-height: clamp(200px, 52vw, 280px);
        border-radius: calc(var(--radius-lg) - 2px);
    }

    .featured-project .content-card__meta {
        margin-bottom: 0.85rem;
    }

    .featured-project.content-card h3,
    .featured-project h3 {
        margin-bottom: 0.9rem;
        font-size: clamp(1.5rem, 7vw, 2rem);
        line-height: 1.08;
    }

    .featured-project p {
        margin: 0 0 var(--space-5);
        max-width: none;
    }

    .featured-project .text-link {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hero__inner {
        padding-block: clamp(88px, 12vh, 104px) clamp(52px, 7vh, 72px);
    }

    .audience-tabs {
        margin-bottom: var(--space-6);
        padding-bottom: var(--space-3);
        scroll-snap-type: x mandatory;
    }

    .hero__grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-6);
        min-width: 0;
    }

    .hero__copy {
        display: contents;
    }

    .hero h1,
    .hero__summary,
    .hero__actions,
    .hero-stats {
        width: calc(100vw - clamp(20px, 5vw, 64px) - clamp(20px, 5vw, 64px));
        max-width: calc(100vw - clamp(20px, 5vw, 64px) - clamp(20px, 5vw, 64px));
        min-width: 0;
        justify-self: start;
    }

    .hero h1 {
        order: 1;
        margin: 0;
    }

    .hero-collage {
        order: 2;
        width: min(100%, 500px);
        margin-block: var(--space-1) var(--space-4);
        justify-self: center;
        transform: scale(1.1);
        transform-origin: center;
    }

    .hero__summary {
        order: 3;
        min-height: 0;
        overflow-wrap: break-word;
    }

    .hero__actions {
        order: 4;
        margin-top: var(--space-2);
    }

    .hero__actions .button {
        width: 100%;
        min-height: 56px;
    }

    .hero-stats {
        order: 5;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: clamp(8px, 2.5vw, 16px);
        margin-top: var(--space-6);
        padding-top: var(--space-6);
    }

    .hero-stats div + div {
        margin-top: 0;
    }

    .hero-stats dd {
        max-width: 9ch;
        line-height: 1.35;
    }

    .timeline time {
        display: block;
        margin-bottom: var(--space-3);
    }

    .experience-section .timeline__item {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .experience-section .timeline time {
        margin-bottom: 0;
    }

    .experience-cta {
        margin-top: var(--space-6);
    }

    .article-list .content-card__visual {
        min-height: 180px;
    }

    .products-section__header {
        align-items: flex-start;
        flex-direction: column;
        gap: var(--space-4);
    }

    .products-section__all {
        margin-bottom: 0;
    }

    .articles-section__header {
        align-items: flex-start;
        flex-direction: column;
        gap: var(--space-4);
    }

    .articles-section__all {
        margin-bottom: 0;
    }

    .studio-section__header {
        align-items: flex-start;
        flex-direction: column;
        gap: var(--space-4);
    }

    .studio-section__all {
        margin-bottom: 0;
    }

    .card-grid--three,
    .card-grid--projects,
    .card-grid--four,
    .card-grid--products,
    .studio-section .bento-grid,
    .skills-columns,
    .case-meta dl,
    .case-meta__story,
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .case-meta dl div,
    .case-meta__story div {
        border-right: 0;
        border-bottom: 1px solid var(--color-line);
    }

    .case-meta__story div:last-child,
    .case-meta dl div:last-child {
        border-bottom: 0;
    }

    .site-footer__top {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .site-footer__brand {
        grid-column: auto;
    }

    .site-footer__brand .brand-mark__name {
        display: inline;
    }

    .site-footer__bottom {
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    .brand-mark__name {
        display: none;
    }

    .site-footer .brand-mark__name {
        display: inline;
    }

    .hero h1 {
        font-size: clamp(2.25rem, 9.5vw, 3.2rem);
    }

    .page-hero h1,
    .case-hero h1 {
        font-size: clamp(3rem, 5vw, 3rem);
    }

    /* Tight viewports: let the back/next links wrap onto separate lines rather
       than crowd together, while keeping comfortable spacing below the row. */
    .case-hero__nav {
        flex-wrap: wrap;
        gap: var(--space-3);
        margin-bottom: var(--space-10);
    }

    .next-link {
        margin-left: 0;
    }

    .hero-collage {
        width: min(100%, 430px);
        transform: scale(1.12);
    }

    .hero h1,
    .hero__summary,
    .hero__actions,
    .hero-stats {
        width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
    }

    .hero__summary,
    .hero__actions,
    .hero-stats {
        width: calc(100vw - 64px);
        max-width: calc(100vw - 64px);
    }

    .experience-accordion__header {
        flex-wrap: wrap;
        gap: var(--space-3);
    }

    .experience-accordion__heading {
        order: 2;
        flex-basis: 100%;
    }

    .experience-accordion__meta {
        order: 1;
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
        margin-bottom: var(--space-2);
        padding-top: 0;
    }

    .case-full-image__frame {
        min-height: clamp(220px, 72vw, 360px);
        aspect-ratio: 4 / 3;
        border-radius: var(--radius-lg);
    }

    .image-viewer__toolbar {
        /* Keep the zoom controls [-] [100%] [+] grouped at top center; the
           close button is lifted out of this row and pinned to the corner. */
        justify-content: center;
        gap: 0.45rem;
        padding: max(14px, env(safe-area-inset-top)) 14px 0;
    }

    .image-viewer__control {
        min-width: 44px;
        height: 44px;
        padding-inline: 0.7rem;
    }

    .image-viewer__control--close {
        /* Always immediately visible in the top-right corner, clear of device
           notches / Dynamic Island via safe-area insets. */
        position: fixed;
        top: max(14px, env(safe-area-inset-top));
        right: max(14px, env(safe-area-inset-right));
        z-index: 3;
        min-width: 44px;
    }

    .image-viewer__stage {
        padding-inline: 14px;
    }

    .project-facts div {
        grid-template-columns: 1fr;
        gap: var(--space-1);
    }

    .featured-project > .content-card__shell,
    .featured-project.content-card > .content-card__shell {
        padding: 18px;
    }

    .featured-project .content-card__meta {
        gap: 0.4rem;
    }

    .featured-project .tag-row > span:not(.tag-overflow),
    .featured-project .tag-overflow__button,
    .featured-project .status {
        max-width: 100%;
    }

    .button {
        width: 100%;
    }

    .contact-section {
        padding-bottom: 0;
    }

    .contact-section__title {
        max-width: 100%;
        font-size: clamp(2.7rem, 14vw, 4rem);
    }

    .contact-section__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: clamp(28px, 7vw, 44px);
    }

    .contact-section__visual {
        justify-content: flex-start;
    }

    .contact-section__visual img {
        width: min(100%, 520px);
    }

    .contact-section__actions {
        flex-direction: column;
    }
}

/* Tablet: dedicated stacked layout so the contact section never renders as a
   squeezed desktop two-column. Desktop (>=1101px) and mobile (<=560px) are
   intentionally untouched. */
@media (min-width: 561px) and (max-width: 1100px) {
    .contact-section__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: clamp(28px, 5vw, 44px);
        align-items: start;
    }

    .contact-section__meta {
        margin-bottom: var(--space-6);
    }

    .contact-section__title {
        max-width: 24ch;
        font-size: clamp(2.8rem, 5.5vw, 3.8rem);
        line-height: 1.04;
        text-wrap: balance;
    }

    .contact-section__copy {
        max-width: 56ch;
        margin-top: var(--space-6);
    }

    .contact-section__actions {
        gap: var(--space-4);
        margin-top: var(--space-8);
    }

    .contact-section__visual {
        justify-content: flex-start;
    }

    .contact-section__visual img {
        width: min(100%, 600px);
    }
}
