/* Mobile/tablet fallback: normal scrolling, no pinned/scaled project stack.
   Breakpoint matches the `isDesktop` check in assets/js/main.js (900px). */
@media (max-width: 900px) {
    :root {
        --page-x: 1.125rem;
        --nav-h: 58px;
    }

    .site-nav {
        left: 50%;
        right: auto;
        width: min(calc(100% - 1rem - var(--safe-left) - var(--safe-right)), 520px);
        top: calc(.55rem + var(--safe-top));
        height: 46px;
        grid-template-columns: 1fr auto;
        gap: .6rem;
        padding: 0 .34rem 0 .45rem;
        border-radius: 999px;
        justify-content: initial;
    }
    .site-nav__mark {
        height: 100%;
        padding: 0 .65rem;
        border-right: 0;
    }
    .site-nav__mark img {
        height: 22px;
        max-width: 108px;
    }
    .site-nav__links { display: none; }
    .site-nav__toggle {
        display: inline-flex;
        height: 100%;
        padding: 0 .55rem 0 .7rem;
        border-left: 0;
    }
    .site-nav__toggle-icon,
    .site-nav__toggle-icon::before,
    .site-nav__toggle-icon::after { width: 21px; }

    .hero {
        min-height: 100svh;
        align-items: end;
        padding:
            calc(var(--nav-h) + 1.15rem)
            calc(var(--page-x) + var(--safe-right))
            calc(2.2rem + var(--safe-bottom))
            calc(var(--page-x) + var(--safe-left));
    }
    .hero::before {
        background:
            linear-gradient(90deg, rgba(247, 242, 232, .05) 1px, transparent 1px),
            linear-gradient(rgba(247, 242, 232, .045) 1px, transparent 1px);
        background-size: 42px 42px;
        opacity: .36;
    }
    .hero-stage {
        grid-template-columns: 1fr;
        min-block-size: calc(100svh - var(--nav-h) - 4.2rem - var(--safe-bottom));
        gap: 1rem;
        padding: .55rem 0 0;
        align-content: end;
        text-align: left;
        justify-items: start;
        width: 100%;
        max-width: 100%;
    }
    .hero-stage::before { display: none; }
    .hero-copy {
        gap: .66rem;
        justify-items: start;
        width: min(calc(100vw - 2rem - var(--safe-left) - var(--safe-right)), 420px);
        max-width: calc(100vw - 2rem - var(--safe-left) - var(--safe-right));
        justify-self: stretch;
        margin-inline: 0;
    }
    .hero-copy > * {
        max-width: 100%;
    }
    .hero-word {
        width: 100%;
        max-inline-size: 100%;
        font-size: clamp(2.32rem, 12vw, 4rem);
        line-height: .9;
        letter-spacing: 0;
        overflow-wrap: anywhere;
    }
    .hero-subtitle {
        font-size: .92rem;
        max-width: 36ch;
        line-height: 1.46;
    }
    .hero-statement {
        font-size: clamp(1rem, 4.3vw, 1.18rem);
        max-width: 34ch;
        line-height: 1.2;
    }
    .hero-kicker {
        font-size: .58rem;
        max-width: 100%;
        min-height: 28px;
        padding: .34rem .62rem;
    }
    .hero-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem;
        justify-content: stretch;
    }
    .hero-action {
        min-width: 0;
        min-height: 40px;
        width: 100%;
        flex: none;
        padding: .78rem .7rem;
        font-size: .68rem;
        white-space: nowrap;
    }
    .hero-meta {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1px;
        width: 100%;
        justify-self: stretch;
        margin-top: .15rem;
        border-radius: var(--radius-ui);
    }
    .hero-meta span {
        padding: .52rem .45rem;
        font-size: .58rem;
    }
    .hero::after {
        background:
            linear-gradient(180deg, rgba(8, 8, 6, .22) 0%, rgba(8, 8, 6, .48) 34%, rgba(8, 8, 6, .94) 100%);
        opacity: 1;
    }
    .hero-scroll-cue { display: none; }

    .project-panel {
        position: sticky;
        top: 0;
        height: 100svh;
        min-height: 100dvh;
        padding:
            calc(var(--nav-h) + .8rem)
            calc(var(--page-x) + var(--safe-right))
            calc(1.1rem + var(--safe-bottom))
            calc(var(--page-x) + var(--safe-left));
        border-top: 1px solid var(--line);
        background: var(--bg);
        overflow: hidden;
        display: grid;
        align-items: end;
    }

    .project-panel__media {
        position: absolute;
        inset: 0;
        height: 100%;
        aspect-ratio: auto;
        overflow: hidden;
        border: 0;
        border-radius: 0;
    }
    .project-panel__media picture {
        opacity: .34;
        filter: blur(16px) saturate(.82) brightness(.74);
        transform: scale(1.08);
    }
    .project-panel__media::after {
        background:
            linear-gradient(180deg, rgba(8, 8, 6, .28) 0%, rgba(8, 8, 6, .38) 36%, rgba(8, 8, 6, .9) 78%, rgba(8, 8, 6, .98) 100%),
            linear-gradient(90deg, rgba(8, 8, 6, .48), rgba(8, 8, 6, .08));
    }
    .project-panel__media img,
    .project-panel__media video {
        object-position: center top;
    }
    .project-panel__media video {
        position: absolute;
        inset: 0;
        z-index: 1;
        width: 100%;
        height: 100%;
        max-height: none;
        aspect-ratio: auto;
        object-fit: cover;
        transform: none;
        border-radius: 0;
        border: 0;
        box-shadow: none;
    }
    .project-panel__copy {
        position: relative;
        z-index: 2;
        align-self: end;
        padding: 0 0 clamp(1rem, 4svh, 2rem) 0;
        max-width: none;
        gap: clamp(.45rem, 1.5svh, .72rem);
        overflow: hidden;
    }
    .project-panel__number { font-size: .68rem; }
    .project-panel__title {
        font-size: clamp(1.75rem, 7.5vw, 2.55rem);
        line-height: 1;
        color: var(--ink);
        text-shadow: 0 16px 50px rgba(0, 0, 0, .7);
        max-width: 100%;
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
    }
    .project-panel__description { font-size: .94rem; max-width: 34ch; line-height: 1.48; }
    .project-panel__meta { flex-wrap: wrap; font-size: .72rem; }
    .project-panel__link {
        width: 100%;
        justify-content: center;
        min-height: 42px;
        margin-top: .35rem;
        font-size: .68rem;
        color: var(--ink);
        border-color: rgba(247, 242, 232, .34);
        background: rgba(8, 8, 6, .28);
    }

    .home-positioning,
    .home-showreel,
    .home-capabilities,
    .home-impact,
    .home-process,
    .home-about-preview,
    .home-insights-preview {
        padding:
            clamp(4rem, 18vw, 6rem)
            calc(var(--page-x) + var(--safe-right))
            clamp(4rem, 18vw, 6rem)
            calc(var(--page-x) + var(--safe-left));
    }

    .home-proof {
        grid-template-columns: 1fr;
        padding:
            1rem
            calc(var(--page-x) + var(--safe-right))
            3.2rem
            calc(var(--page-x) + var(--safe-left));
    }
    .home-proof article {
        min-height: 160px;
        padding: 1rem;
    }

    .home-positioning,
    .home-about-preview {
        background: var(--bg);
        color: var(--ink);
        border-top: 1px solid var(--line);
    }
    .home-positioning .section-kicker,
    .home-about-preview .section-kicker {
        color: var(--accent);
    }
    .home-positioning__copy,
    .home-about-preview div {
        color: var(--muted);
    }
    .home-about-preview strong {
        color: var(--ink);
    }

    .home-positioning__grid,
    .home-about-preview,
    .home-capabilities__intro,
    .home-process__header,
    .home-insights-preview__header {
        grid-template-columns: 1fr;
        gap: 1.4rem;
    }

    .home-positioning h2,
    .home-capabilities h2,
    .home-impact h2,
    .home-process h2,
    .home-about-preview h2,
    .home-insights-preview h2 {
        font-size: clamp(1.75rem, 8.5vw, 2.7rem);
        line-height: 1.04;
        max-width: 17ch;
    }

    .home-live-media {
        grid-template-columns: 1fr;
        gap: .85rem;
        margin-top: 2rem;
    }
    .home-live-media__item,
    .home-live-media__item--wide {
        min-height: 0;
        aspect-ratio: 16 / 10;
    }
    .home-live-media__item figcaption {
        left: .8rem;
        bottom: .8rem;
        font-size: .62rem;
    }

    .home-showreel {
        min-height: auto;
        padding:
            clamp(4rem, 18vw, 6rem)
            calc(var(--page-x) + var(--safe-right))
            clamp(4rem, 18vw, 6rem)
            calc(var(--page-x) + var(--safe-left));
    }

    .home-showreel__stage {
        position: relative;
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 1.4rem;
        padding: 0;
    }

    .home-showreel__stage::before {
        background-size: 42px 42px;
        opacity: .14;
    }

    .home-showreel__copy h2 {
        font-size: clamp(2.35rem, 12vw, 4.2rem);
        line-height: .92;
        max-width: 10ch;
    }

    .home-showreel__copy p:not(.section-kicker) {
        font-size: .95rem;
        max-width: 32ch;
    }

    .home-showreel__chapters {
        margin-top: .6rem;
    }

    .home-showreel__chapters li {
        padding: .66rem 0;
        font-size: .66rem;
    }

    .home-showreel__frames {
        min-height: 0;
        aspect-ratio: 4 / 5;
    }

    .home-showreel__frame {
        position: absolute;
        inset: 0;
        border-radius: var(--radius-ui);
    }

    .capability-row {
        grid-template-columns: 2.5rem minmax(0, 1fr);
        gap: .55rem 1rem;
        align-items: start;
        padding: 1.25rem 0;
    }
    .capability-row h3 {
        font-size: clamp(1.25rem, 6.2vw, 1.8rem);
        line-height: 1.05;
    }
    .capability-row p {
        grid-column: 2;
        font-size: .94rem;
        line-height: 1.48;
    }

    .home-impact ul,
    .home-insights-preview__list {
        grid-template-columns: 1fr;
    }

    .home-impact li,
    .home-insights-preview article {
        min-height: auto;
        padding: 1.15rem;
    }

    .home-process__steps {
        grid-template-columns: 1fr;
        overflow-x: visible;
    }

    .home-process__steps li {
        min-height: auto;
        padding: 1.15rem 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .home-process__steps strong {
        max-width: none;
    }
    .home-process__steps {
        border-inline: 0;
    }

    .services__intro { flex-direction: column; gap: .5rem; }
    .services__word { font-size: clamp(2.6rem, 16vw, 5rem); }

    .about__headline { font-size: clamp(1.9rem, 8vw, 3rem); }

    /* Final CTA has no pinned scrub on mobile (normal scrolling) — lay the
       headline, button and mark out as a static stacked sequence instead
       of the desktop overlapping dissolve. */
    .final-cta__stage { min-height: 82dvh; padding-top: calc(4rem + var(--safe-top)); }
    .final-cta__mark { grid-area: auto; margin-top: 0; }
    .final-cta__mark img { width: clamp(104px, 32vw, 140px); }

    .site-footer {
        grid-template-columns: 1fr;
        gap: .6rem;
        text-align: left;
    }

    .global-footer {
        grid-template-columns: 1fr;
    }

    .case-hero h1 { font-size: clamp(2.4rem, 11vw, 5rem); }
    .case-hero picture, .case-hero img { height: 42vh; }
    .case-grid, .case-grid-editorial { grid-template-columns: 1fr; }
    .case-gallery { grid-template-columns: 1fr; }
    .case-gallery picture, .case-gallery img { height: 44vh; }
    .case-next strong { font-size: clamp(1.8rem, 10vw, 3.4rem); }

    .contact-hero h1 { font-size: clamp(2.15rem, 9.2vw, 3.35rem); line-height: 1; }
    .contact-form { grid-template-columns: 1fr; }
}

@media (min-width: 901px) and (max-width: 1180px) {
    .site-nav__links a {
        padding: 0 .55rem;
        font-size: .62rem;
    }

    .home-showreel__stage {
        grid-template-columns: minmax(280px, .72fr) minmax(420px, 1fr);
        gap: clamp(1.6rem, 4vw, 3rem);
    }

    .home-showreel__copy h2 {
        font-size: clamp(3rem, 5.8vw, 5.5rem);
        max-width: 7.6ch;
    }

    .home-showreel__copy p:not(.section-kicker) {
        max-width: 31ch;
    }

    .home-showreel__chapters li {
        font-size: .68rem;
    }
}

@media (max-width: 480px) {
    .site-menu__list a { font-size: clamp(2rem, 11vw, 3rem); }
    .hero-word { max-inline-size: 100%; font-size: clamp(2.2rem, 11.5vw, 3.45rem); }
    .project-panel__title { font-size: clamp(2.2rem, 12vw, 3.4rem); }
    .services__word { font-size: clamp(2.2rem, 15vw, 3.6rem); }
    .button { width: 100%; text-align: center; justify-content: center; }
    .site-footer { font-size: .76rem; }
}

@media (max-width: 600px) {
    .hero-copy,
    .hero-stage {
        width: min(calc(100vw - 2rem - var(--safe-left) - var(--safe-right)), 360px);
        max-width: calc(100vw - 2rem - var(--safe-left) - var(--safe-right));
    }
    .hero-word {
        font-size: clamp(2.1rem, 11vw, 3.15rem);
        line-height: .92;
    }
    .hero-statement {
        font-size: .98rem;
    }
    .hero-subtitle {
        font-size: .84rem;
    }
}

@media (max-width: 900px) {
    body.projects-page .projects-intro,
    body.services-page .services-intro,
    body.process-page .process-intro,
    body.about-page .about-hero,
    body.insights-page .journal-intro,
    body.contact-page .contact-main {
        padding-top: calc(var(--nav-h) + 3.1rem);
        overflow-x: clip;
    }

    body.projects-page main,
    body.services-page main,
    body.process-page main,
    body.about-page main,
    body.insights-page main,
    body.contact-page main {
        overflow-x: clip;
    }

    body.projects-page .projects-intro h1,
    body.services-page .services-intro h1,
    body.process-page .process-intro h1,
    body.about-page .about-hero__headline,
    body.insights-page .journal-intro h1,
    body.contact-page .contact-hero h1 {
        font-size: clamp(1.95rem, 8.8vw, 2.95rem);
        line-height: 1;
        max-width: min(100%, 13.5ch);
        overflow-wrap: normal;
        word-break: normal;
        text-wrap: balance;
    }

    body.projects-page .projects-intro {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-bottom: 2rem;
    }

    body.projects-page .projects-intro__count {
        justify-self: start;
    }

    body.projects-page .project-index__title {
        font-size: clamp(1.65rem, 8vw, 2.35rem);
        line-height: 1.03;
    }

    body.services-page .services-intro,
    body.contact-page .contact-hero {
        grid-template-columns: 1fr;
    }

    body.services-page .services-intro__body,
    body.process-page .process-intro span,
    body.about-page .about-hero__body,
    body.contact-page .contact-hero span {
        max-width: 34ch;
        font-size: .98rem;
        line-height: 1.5;
    }

    body.projects-page .project-filters,
    body.insights-page .journal-tools {
        top: calc(var(--nav-h) + .55rem);
    }

    body.services-page .services-list__row,
    body.process-page .process-stage {
        padding-block: 1.65rem;
    }

    body.services-page .services-list__title,
    body.process-page .process-stage__body h2,
    body.about-page .about-founder__quote,
    body.insights-page .journal-featured h2,
    body.insights-page .journal-list__title {
        font-size: clamp(1.38rem, 6.4vw, 2.05rem);
        line-height: 1.03;
        overflow-wrap: anywhere;
    }

    body.process-page .process-stage__meta {
        grid-template-columns: 1fr;
    }

    body.about-page .about-values {
        grid-template-columns: 1fr;
    }

    body.contact-page .contact-layout {
        grid-template-columns: 1fr;
        inline-size: 100%;
        max-inline-size: calc(100vw - (var(--page-x) * 2) - var(--safe-left) - var(--safe-right));
        overflow: hidden;
    }

    body.contact-page .contact-form,
    body.contact-page .contact-form label,
    body.contact-page .contact-form input,
    body.contact-page .contact-form textarea,
    body.contact-page .contact-form select {
        min-width: 0;
        max-width: 100%;
    }

    body.contact-page .contact-form {
        inline-size: 100%;
        max-inline-size: calc(100vw - (var(--page-x) * 2) - var(--safe-left) - var(--safe-right));
        overflow: hidden;
    }

    body.contact-page .contact-sidebar {
        position: static;
    }

    body.insights-page .journal-featured p,
    body.insights-page .journal-list__excerpt {
        max-width: 30ch;
        overflow-wrap: normal;
    }
}

@media (max-width: 420px) {
    :root {
        --page-x: .95rem;
    }

    .site-nav {
        width: min(calc(100% - .7rem - var(--safe-left) - var(--safe-right)), 420px);
    }

    .hero-word,
    body.projects-page .projects-intro h1,
    body.services-page .services-intro h1,
    body.process-page .process-intro h1,
    body.about-page .about-hero__headline,
    body.insights-page .journal-intro h1,
    body.contact-page .contact-hero h1 {
        font-size: clamp(1.9rem, 8.8vw, 2.65rem);
        line-height: 1.02;
    }

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

    .hero-action {
        white-space: normal;
    }

    .hero-meta span {
        font-size: .54rem;
    }

    .project-panel__title {
        font-size: clamp(2rem, 10.5vw, 3rem);
        line-height: .98;
    }

    .project-panel__description,
    .project-panel__meta {
        font-size: .82rem;
    }
}

/* Hard guard: the full-screen mobile menu must be unreachable on
   desktop widths regardless of JS state (e.g. .is-open left over
   from a resize that skipped the auto-close listener) — display:none
   removes it from paint entirely, unlike the transform-only hiding
   used below 900px, which previously let it render on top of the
   desktop pill nav and look like a duplicated navigation bar. */
@media (min-width: 901px) {
    .site-menu {
        display: none !important;
    }
}
