/* ==========================================================================
   Mobile layer: loaded LAST (style → ui → cases → motion → responsive → here).
   Phones 320–430px portrait, landscape phones up to ~932px, touch input.

   Sections: touch basics · hover-less devices · header & menu sheet ·
             hero · sections & cards · timeline · pricing & FAQ ·
             case study (fitted mockups + swipe canvas) · contact &
             dropdown sheet · CTA & footer · small phones · landscape ·
             reduced motion
   ========================================================================== */

/* ------------------------------------------------------------ Touch basics */
html { -webkit-tap-highlight-color: transparent; }
a, button, summary, label, select, textarea, input, [role="button"], .dd-opt, .filter {
    touch-action: manipulation; /* no double-tap-to-zoom delay */
}
/* the header's own padding doubled the safe-area inset already in .wrap */
.site-header { padding-inline: 0; }

/* menu CTA block only exists in the phone sheet */
.nav-foot { display: none; }

/* timeline dot sits above the progress line */
.tl-dot { z-index: 1; }

/* ------------------------------------------------------ Hover-less devices
   On touch screens :hover sticks after a tap (and comes back from the
   back/forward cache). Undo the hover looks there and give every tappable
   thing a short :active press instead. */
@media (hover: none) {
    .tilt, .btn { will-change: auto; }

    .btn:hover::before { transform: translateY(101%); }
    .btn:hover .arrow, .link-arrow:hover .arrow, a:hover > .link-arrow .arrow { transform: none; }
    .btn-primary:hover { color: #fff; box-shadow: none; }
    .btn-ghost:hover { color: var(--ink); background: transparent; }
    .section-dark .btn-ghost:hover { color: #fff; border-color: rgba(255, 255, 255, 0.7); }

    .logo:hover .logo-mark { transform: none; border-radius: 11px; }
    .icon-btn:hover { border-color: var(--line); background: transparent; }
    .chips li:hover { transform: none; border-color: var(--line); color: var(--muted); }
    .marquee li:hover { color: #ecebea; }

    .service-card:hover { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: none; }
    .service-card:hover p { color: var(--muted); }
    .service-card:hover .service-num, .service-card:hover .link-arrow { color: var(--accent); }
    .service-card:hover .mini-list { border-color: var(--line); }
    .service-card:hover .mini-list li::before { background: var(--accent-2); }
    .service-card:hover .service-icon { background: var(--bg); border-color: var(--line); color: var(--ink); transform: none; }

    .project-card:hover { border-color: var(--line); box-shadow: none; }
    .project-card:hover .mock { transform: none; }
    .project-card:hover .project-title { background-size: 0 2px; }
    .project-card:hover .m-bars b { transform: none; }

    .svc-block:hover, .step:hover, .tl-card:hover, .principle:hover, .feature:hover,
    .quote:hover, .pager-link:hover, .contact-card:hover, .badge:hover,
    .shots img:hover, .screen:hover .phone, .screen:hover .desk { transform: none; }
    .principle:hover, .feature:hover, .tier:hover, .contact-card:hover { box-shadow: none; }
    .badge:hover .badge-mark { transform: none; }
    .step:hover::before { transform: scaleX(0); }
    .contact-card:hover .cc-icon { background: transparent; border-color: var(--line); color: inherit; transform: none; }
    .contact-card--ink:hover .cc-icon { background: var(--accent); border-color: var(--accent); color: #fff; }
    .footer-mail:hover .footer-mail-icon { transform: none; background: var(--accent); color: #fff; }
    .footer-mail:hover .footer-mail-addr { background-size: 0 3px, 100% 3px; }
    .filter:not(.is-active):hover { background: transparent; }
    .faq-item summary:hover .faq-q { color: inherit; }
    .dd-btn:hover, .field input:hover, .field textarea:hover { border-color: var(--line); }

    /* "View project" chip: no hover on touch, so it is always shown */
    .project-chip { transform: none; opacity: 1; padding: 0.45rem 0.8rem; font-size: 0.8rem; box-shadow: 0 10px 20px -12px rgba(11, 11, 12, 0.55); }

    /* press feedback */
    .btn { transition: color 0.3s, border-color 0.3s, transform 0.18s var(--ease), box-shadow 0.3s, background-color 0.2s; }
    .btn:active { transform: scale(0.97); }
    .btn-primary:active { background-color: color-mix(in srgb, var(--accent) 84%, #000); }
    .cta-inner .btn-primary:active, .header-cta:active { background-color: #26262a; }
    .btn-ghost:active { background-color: color-mix(in srgb, var(--ink) 8%, transparent); }
    .section-dark .btn-ghost:active { background-color: rgba(255, 255, 255, 0.14); }
    .project-card:active, .service-card:active, .contact-card:active, .pager-link:active,
    .tier:active, .quote:active, .principle:active, .feature:active {
        transform: scale(0.985);
        transition-duration: 0.15s;
    }
    .project-card:active { border-color: var(--ink); }
    .service-card:active { border-color: var(--ink); }
    .icon-btn:active { background: var(--surface); border-color: var(--ink); transform: scale(0.94); }
    .filter:active { transform: scale(0.96); }
    .faq-item summary:active .faq-q, .footer-links a:active, .crumbs a:active, .to-top:active, .nav-mail:active { color: var(--accent); }
    .site-footer .footer-links a:active, .site-footer .to-top:active { color: var(--accent-on-dark); }
    .faq-item summary:active .faq-icon { transform: scale(0.9); }
    .footer-mail:active .footer-mail-icon { transform: scale(0.92); }
    .logo:active .logo-mark { transform: scale(0.92); }
    .dd-opt:active { background: #ebe8e3; }
}

/* ===================================================== Header & menu sheet */
@media (max-width: 899px) {
    .logo { min-height: 44px; }
    .menu-btn { width: 46px; height: 46px; background: var(--surface); border-color: var(--line); }
    .menu-btn[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

    /* page underneath does not scroll while the sheet is open */
    html.menu-open { overflow: hidden; }   /* html only: overflow on body would un-stick the header */
    html.menu-open .site-header { background: var(--bg); border-bottom-color: var(--line); box-shadow: none; }

    /* full-screen sheet under the (sticky) header */
    .nav {
        position: absolute;
        inset: var(--header-h) 0 auto 0;
        height: calc(100vh - var(--header-h));
        height: calc(100dvh - var(--header-h));
        max-height: none;
        display: flex;
        flex-direction: column;
        padding: 0.6rem max(1.25rem, env(safe-area-inset-right, 0px)) max(1.4rem, env(safe-area-inset-bottom, 0px)) max(1.25rem, env(safe-area-inset-left, 0px));
        background: var(--bg);
        border-bottom: 0;
        box-shadow: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: none;
        transition: opacity 0.3s var(--ease), visibility 0s 0.35s;
    }
    .nav.is-open { transition: opacity 0.25s var(--ease), visibility 0s; }
    .nav::before {
        /* faint drafting grid behind the links */
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background-image: radial-gradient(circle, rgba(11, 11, 12, 0.13) 1px, transparent 1.4px);
        background-size: 24px 24px;
        -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%, #000);
        mask-image: linear-gradient(to bottom, transparent, #000 40%, #000);
        pointer-events: none;
    }
    .nav ul { flex-direction: column; gap: 0; }
    .nav li {
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.2s, transform 0.2s;
    }
    .nav.is-open li {
        opacity: 1;
        transform: none;
        transition: opacity 0.45s var(--ease) calc(var(--i, 0) * 45ms + 40ms), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i, 0) * 45ms + 40ms);
    }
    .nav li > a {
        display: flex;
        align-items: baseline;
        gap: 0.2rem;
        min-height: 0;
        padding: clamp(0.55rem, 1.9vh, 0.95rem) 0.1rem;
        font-family: var(--font-display);
        font-weight: 700;
        font-size: clamp(1.75rem, 8.6vw, 2.5rem);
        line-height: 1.1;
        letter-spacing: -0.035em;
        color: var(--ink);
        border-bottom: 1px solid var(--line);
    }
    .nav .nav-num { align-self: center; min-width: 2.6rem; font-family: var(--font-mono); font-weight: 400; font-size: 0.75rem; letter-spacing: 0; color: var(--accent); }
    .nav li > a.is-active { color: var(--accent); }
    .nav li > a.is-active::after {
        content: "";
        display: block;
        position: static;
        align-self: center;
        width: 8px;
        height: 8px;
        margin-inline-start: auto;
        border-radius: 50%;
        background: var(--accent);
        transform: none;
    }
    .nav li > a:active { color: var(--accent); }

    .nav-foot {
        display: grid;
        gap: 0.4rem;
        margin-top: auto;
        padding-top: 1.6rem;
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.2s, transform 0.2s;
    }
    .nav.is-open .nav-foot {
        opacity: 1;
        transform: none;
        transition: opacity 0.45s var(--ease) 0.3s, transform 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
    }
    /* undo the big-link styles .nav a gives every anchor in the sheet */
    .nav .nav-foot a { border: 0; letter-spacing: 0; }
    .nav .nav-foot a::after { content: none; }
    .nav .nav-foot .nav-cta {
        display: inline-flex;
        width: 100%;
        min-height: 56px;
        justify-content: space-between;
        padding: 1rem 1.5rem;
        border: 1.5px solid transparent;
        font-family: var(--font-body);
        font-weight: 500;
        font-size: 1.1rem;
        color: #fff;
    }
    .nav .nav-foot .nav-mail {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0.4rem 0;
        font-family: var(--font-mono);
        font-weight: 400;
        font-size: 0.85rem;
        color: var(--muted);
        text-decoration: none;
    }
}

@media (pointer: coarse) {
    .crumbs a { padding: 0.75rem 0.15rem; margin: -0.75rem -0.15rem; }
}

/* ===================================================================== Hero */
@media (max-width: 640px) {
    .hero--studio { padding-top: 1.3rem; }
    .hero-top { gap: 0.7rem 1rem; padding-bottom: 1rem; margin-bottom: 1.5rem; }
    .status-pill { font-size: 0.7rem; }

    /* stays huge, but sized so the longest word always fits the line */
    .hero--studio h1.hero-title {
        font-size: clamp(2.75rem, 13.2vw, 3.9rem);
        line-height: 0.93;
        max-width: none;
    }
    .sel-h { width: 9px; height: 9px; }
    .sel-h:nth-of-type(1), .sel-h:nth-of-type(2) { top: -4px; }
    .sel-h:nth-of-type(3), .sel-h:nth-of-type(4) { bottom: -4px; }
    .sel-h:nth-of-type(1), .sel-h:nth-of-type(3) { left: -4px; }
    .sel-h:nth-of-type(2), .sel-h:nth-of-type(4) { right: -4px; }

    .hero-body { gap: 2.4rem; margin-top: 1.8rem; }
    .hero--studio .lead { font-size: 1.08rem; line-height: 1.6; }
    .hero--studio .hero-cta { flex-direction: column; gap: 0.7rem; margin-top: 1.7rem; }
    .hero--studio .hero-cta .btn { width: 100%; min-height: 56px; }
    .hero--studio .chips { gap: 0.4rem; margin-top: 1.4rem; }
    .hero--studio .chips li { font-size: 0.74rem; padding: 0.28rem 0.65rem; }

    /* artefacts: terminal, swatch card tucked over its corner, cursor
       pointing at the swatches */
    .hero-art { padding: 3rem 0.5rem 1.4rem; }
    .hero-art .art-swatches { margin-top: -2.4rem; width: min(196px, 60%); }
    .hero-art .art-cursor { left: auto; right: calc(min(196px, 60%) + 2.8rem); bottom: 3.6rem; }
    .hero--studio .terminal-body { min-height: 12.5rem; padding-bottom: 2.4rem; }

    .hero-facts { margin-top: 2.6rem; }
    .hero-facts > div { padding: 0.95rem 0.8rem 0.55rem 0; }
    .hero-facts dd { font-size: 0.98rem; }
}
@media (min-width: 360px) and (max-width: 559px) {
    .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
    .hero-facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ======================================================= Sections & cards */
@media (max-width: 640px) {
    .section { padding-block: clamp(3.6rem, 15vw, 4.5rem); }
    .section-head { margin-bottom: 2rem; }
    .section-head h2 { font-size: clamp(2.2rem, 10.6vw, 2.9rem); }
    .section-head .lead { font-size: 1.05rem; margin-top: 1rem; }
    .section-row { gap: 0; }
    .section-row .section-head { margin-bottom: 1.6rem; }
    .section-row > .btn { margin-bottom: 2rem; }
    .process-intro .btn { margin-bottom: 0.4rem; }

    .marquee { padding-block: 1rem; }

    .service-card { padding: 1.5rem 1.4rem 1.6rem; }
    .service-card-top { margin-bottom: 0.8rem; }
    .service-icon { width: 48px; height: 48px; border-radius: 14px; }

    .project-thumb { padding: 2.7rem 1.1rem 1.2rem; }
    .project-meta { padding: 1.2rem 1.25rem 1.35rem; }
    .project-title { font-size: 1.45rem; }

    .principle { padding: 1.4rem 1.35rem 1.5rem; }
    .principle .service-num { font-size: 2.3rem; margin-bottom: 0.9rem; }
    .principles--two .principle h2 { font-size: 1.55rem; }

    .page-head h1 { font-size: clamp(2.7rem, 12.6vw, 3.7rem); max-width: none; }
    .ph-top { margin-bottom: 2rem; }
    .ph-index { display: none; }   /* the big outlined number already says it */
    .ph-bignum { top: 3.2rem; font-size: clamp(6rem, 30vw, 8rem); }
    .ph-bottom { gap: 1.6rem; }
    .ph-bottom .lead { font-size: 1.05rem; }

    .svc { gap: 1.8rem; }
    .svc-block { padding: 1.4rem 1.3rem; border-radius: 20px; }
    .stack-group { padding: 1.5rem 1.3rem; }
    .quote { padding: 1.5rem 1.35rem; }
    .quote blockquote p { font-size: 1.1rem; }
    .feature, .case-step { padding: 1.4rem 1.3rem; }
}

/* ================================================================ Timeline */
@media (max-width: 640px) {
    .tl-card { padding: 1.3rem 1.2rem 1.35rem; border-radius: 18px; }
    .tl-card h2, .tl-card h3 { font-size: 1.4rem; }
    .tl-card > p { font-size: 1rem; margin-bottom: 0.7rem; }
    .ticks li { font-size: 0.98rem; }
    /* the desktop "current" nudge pushed the card past the gutter */
    .tl-item.is-current .tl-card { transform: none; }
    .timeline { gap: 1.2rem; }
}

/* ========================================================= Pricing & FAQ */
@media (max-width: 640px) {
    .tier { padding: 1.5rem 1.35rem 1.4rem; }
    .tier-top { margin-bottom: 1rem; }
    .tier .btn { justify-content: space-between; white-space: nowrap; padding-inline: 1.3rem; font-size: 1rem; min-height: 52px; }
    .tier.is-featured { margin-top: 0.6rem; }

    .faq-item summary { padding-block: 1.15rem; gap: 0.8rem; }
    .faq-num { width: 1.7rem; }
    .faq-icon { width: 34px; height: 34px; }
    .faq-icon::before, .faq-icon::after { inset-inline: 10px; }
    .faq-item p { padding-inline: 2.5rem 0; }
    .faq-intro .btn { margin-top: 0; }
}

/* ============================================ Case study: fitted mockups
   main.js zooms a .desk laid out at this design width down to its frame,
   so it reads like a scaled screenshot (620 = DESK_W in main.js). */
.desk.is-fit { width: 620px; max-width: none; flex: none; }
.desk.is-fit .desk-body { min-height: 300px; }

.case-stage-swipe, .screens-dots { display: none; }
/* equal phone frames in a grid row (their width used to follow the caption) */
@media (min-width: 560px) {
    .screens:not(.screens--wide) > .screen:has(.phone) { width: min(100%, 240px); }
}

/* ---------------------------------------- Phones: swipeable screens canvas */
@media (max-width: 559px) {
    .case-stage-head { flex-wrap: nowrap; align-items: center; }
    .case-stage-meta { display: none; }
    .case-stage-swipe {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        font-family: var(--font-mono);
        font-size: 0.72rem;
        color: var(--accent);
        white-space: nowrap;
    }
    .case-stage-swipe svg { width: 15px; height: 15px; }

    .screens,
    .screens--wide,
    .screens:not(.screens--wide),
    .screens--wide:has(.phone) {
        --pz: 0.8;            /* phone mockup scale */
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0.9rem;
        padding: 1.5rem 1rem 1.3rem;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 1rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        border-radius: 24px;
    }
    .screens::-webkit-scrollbar { display: none; }
    /* mixed sets: a short desktop frame floats mid-canvas beside tall phones */
    .screens:has(.desk):has(.phone) { align-items: center; }
    .screens > .screen,
    .screens--wide .screen,
    .screens:not(.screens--wide) .screen:has(.desk),
    .screens--wide .screen:has(.phone),
    .screens--wide:has(.phone) .screen:has(.desk) {
        flex: 0 0 auto;
        width: auto;
        grid-column: auto;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        justify-items: start;
    }
    .screens .screen .frame-tag,
    .screens--wide .screen .frame-tag { justify-self: start; }
    .screens .screen figcaption { max-width: 22ch; text-align: start; font-size: 0.86rem; line-height: 1.45; }

    /* phones: the 250px mockup, zoomed so the next frame peeks in */
    .screens .phone,
    .screens:not(.screens--wide) .phone,
    .screens--wide .screen:has(.phone) .phone { width: 250px; zoom: var(--pz); }
    .screens .screen:has(.phone) { max-width: calc(250px * var(--pz)); }

    /* desktops: almost the full canvas width, zoomed by main.js */
    .screens .screen:has(.desk),
    .screens:not(.screens--wide) .screen:has(.desk),
    .screens--wide .screen:has(.desk),
    .screens--wide:has(.phone) .screen:has(.desk) { flex: 0 0 calc(100% - 1.9rem); width: calc(100% - 1.9rem); }
    .screens .screen:has(.desk) figcaption { max-width: 34ch; }

    /* every frame is visible immediately (no rise-in inside a sideways track) */
    .js .screens[data-stagger] > .screen.will-reveal:not(.is-in) { opacity: 1; transform: none; }

    .screens-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-top: 0.9rem;
    }
    .screens-dots i {
        width: 6px;
        height: 6px;
        border-radius: 99px;
        background: #cfccc6;
        transition: width 0.35s var(--ease), background 0.25s;
    }
    .screens-dots i.is-on { width: 20px; background: var(--accent); }
    .demo-note { margin-top: 0.7rem; font-size: 0.82rem; }
}
@media (min-width: 375px) and (max-width: 559px) {
    .screens, .screens--wide, .screens:not(.screens--wide), .screens--wide:has(.phone) { --pz: 0.9; }
}

@media (max-width: 640px) {
    .project-detail { padding-top: 2.2rem; }
    .detail-hero { padding: 1.2rem; border-radius: 22px; }
    .detail-grid { margin-top: 3rem; gap: 2rem; }
    .detail-intro { font-size: 1.28rem; }
    .detail-side { padding: 1.4rem 1.3rem; }
    .story-block, .results-block, .case-process-block, .features-block { margin-top: 3.2rem; }
    .story { gap: 1.8rem; }
    .story-num { font-size: 2.2rem; margin-bottom: 0.6rem; }
    .result { padding: 1.4rem 1.35rem; }
    .result dd { font-size: 2.5rem; }
    .pager { margin-top: 3.4rem; gap: 0.8rem; }
    .pager-link { padding: 1.3rem 1.35rem; }
    .pager-link--next { padding-block: 1.6rem; }
    .pager-link--next .pager-title { font-size: 1.9rem; }
}

/* ============================================= Contact & dropdown sheet */
@media (max-width: 640px) {
    .contact-grid { gap: 2.4rem; }
    .contact-card { min-height: 64px; padding: 1rem 1rem 1.05rem 1.2rem; }
    .contact-card--ink { padding-block: 1.3rem; }
    .contact-card--ink .cc-value { font-size: clamp(1.25rem, 5.6vw, 1.6rem); }
    .contact-card--ink .cc-icon { width: 44px; height: 44px; }
    .next-steps { padding: 1.3rem 1.2rem; }
    .form { padding: 1.35rem 1.2rem 1.4rem; border-radius: 22px; }
    .form-title { font-size: 1.65rem; }
    .form .btn, #form-submit { width: 100%; justify-self: stretch; min-height: 56px; }
}

@media (max-width: 559px) {
    html.dd-open { overflow: hidden; }
    .dd.is-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 210;
        background: rgba(11, 11, 12, 0.46);
        animation: m-fade 0.25s var(--ease);
    }
    @keyframes m-fade { from { opacity: 0; } }
    .dd-list {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 211;
        max-height: min(72vh, 32rem);
        max-height: min(72dvh, 32rem);
        padding: 0 max(0.6rem, env(safe-area-inset-right, 0px)) max(0.9rem, env(safe-area-inset-bottom, 0px)) max(0.6rem, env(safe-area-inset-left, 0px));
        border: 0;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -24px 60px -24px rgba(11, 11, 12, 0.55);
        overscroll-behavior: contain;
        opacity: 1;
        transform: translateY(105%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s 0.4s;
    }
    .dd.is-open .dd-list { transform: none; transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s; }
    .dd-list::before {
        content: attr(data-title);
        position: sticky;
        top: 0;
        z-index: 1;
        display: block;
        margin-inline: -0.6rem;
        padding: 1.55rem 1.4rem 0.85rem;
        background: linear-gradient(#d6d3cd, #d6d3cd) 50% 0.6rem / 40px 4px no-repeat, var(--surface);
        border-bottom: 1px solid var(--line);
        margin-bottom: 0.4rem;
        font-family: var(--font-display);
        font-weight: 700;
        font-size: 1.2rem;
        letter-spacing: -0.02em;
    }
    .dd-opt { min-height: 52px; display: flex; align-items: center; padding: 0.85rem 2.8rem 0.85rem 1rem; font-size: 1.05rem; border-radius: 12px; }
    .dd-opt.is-active { background: transparent; }
    .dd-opt.is-selected { background: color-mix(in srgb, var(--accent) 8%, #fff); }
}

/* ==================================================== CTA band & footer */
@media (max-width: 640px) {
    .cta-band { padding-block: 1rem 3.6rem; }
    .cta-inner { padding: 2.3rem 1.5rem 1.6rem; gap: 1.6rem; }
    .cta-inner h2 { font-size: clamp(2.2rem, 10.8vw, 3rem); max-width: none; }
    .cta-eyebrow { margin-bottom: 0.8rem; }
    .cta-inner p, .cta-side p { font-size: 1.05rem; }
    .cta-side { gap: 1.3rem; justify-items: stretch; }
    .cta-side .btn { width: 100%; min-height: 56px; }

    .site-footer { padding-top: 3.6rem; }
    .footer-hero { padding-bottom: 2.6rem; margin-bottom: 2.2rem; }
    .footer-statement { font-size: clamp(2.3rem, 11.4vw, 3.2rem); margin-block: 1rem 2rem; max-width: none; }
    .footer-mail { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.4rem 0.9rem; width: 100%; }
    .footer-mail-addr { font-size: clamp(1.15rem, calc((100vw - 2.5rem - 4.4rem) / 12.2), 1.9rem); overflow-wrap: normal; }
    .footer-mail-icon { width: 52px; height: 52px; }

    .site-footer .footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 0; }
    .footer-links li { margin-block: 0; }
    .footer-title { margin-bottom: 0.3rem; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.2rem; margin-top: 2rem; padding-top: 1.2rem; }
    .to-top { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; }

    /* the big wordmark fits the screen instead of being cut off */
    .footer-word { margin-top: 1.6rem; font-size: calc((100vw - 2rem) / 6.45); line-height: 0.78; }
    .footer-word span { transform: translateY(0.08em); }
}

/* ============================================================ Small phones */
@media (max-width: 374px) {
    .logo { gap: 0.5rem; font-size: 1.06rem; }
    .logo-mark { width: 34px; height: 34px; }
    .header-inner { gap: 0.6rem; }
    .wrap { width: min(100% - 2.25rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px), var(--wrap)); }
    .tier .btn { padding-inline: 1.1rem; font-size: 0.96rem; }
    .project-chip { inset-inline-end: 0.75rem; bottom: 0.75rem; }
    .filter { font-size: 0.9rem; }
}

/* ======================================== Landscape phones (short screens) */
@media (orientation: landscape) and (max-height: 520px) {
    :root { --header-h: 58px; }
    .logo-mark { width: 32px; height: 32px; }
    .menu-btn { width: 44px; height: 44px; }

    /* sheet: two columns of links + a CTA row, all on one screen */
    .nav { padding-top: 0.8rem; }
    .nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
    .nav li > a { font-size: clamp(1.35rem, 3.6vw, 1.8rem); padding-block: 0.55rem; }
    .nav-foot { grid-template-columns: auto 1fr; align-items: center; gap: 1rem; padding-top: 1rem; }
    .nav .nav-foot .nav-cta { width: auto; min-height: 50px; gap: 1.2rem; }
    .nav .nav-foot .nav-mail { justify-content: flex-end; }

    .hero--studio { padding-top: 1rem; }
    .hero--studio h1.hero-title { font-size: clamp(2.6rem, 6.6vw, 4.6rem); max-width: 17ch; }
    .page-head h1 { font-size: clamp(2.5rem, 6.6vw, 4.4rem); }
    .page-head--404 { min-height: 0; }
    .hero-cta .btn { width: auto; }
}

/* ========================================================== Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .nav li, .nav-foot { opacity: 1 !important; transform: none !important; }
    .dd-list { transform: none !important; }
    .dd:not(.is-open) .dd-list { visibility: hidden; }
    .dd.is-open::after { animation: none; }
    .screens-dots i { transition: none; }
}
