/* Présentation réservée aux petits écrans. La composition grand écran reste dans scene.css. */
@media (max-width: 700px) {
    :root {
        --pad: clamp(1rem, 5.5vw, 2rem);
        --bar-height: 6rem;
    }

    .bar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-items: start;
        gap: 0;
        min-height: 0;
        padding: .4rem var(--pad) .15rem;
        background: var(--coal);
    }

    .brand {
        max-width: 100%;
        min-height: 2.75rem;
        font-size: clamp(1.35rem, 5.8vw, 1.85rem);
        line-height: 1;
    }

    .brand img {
        width: clamp(2.6rem, 11vw, 3.5rem);
        margin-right: .25rem;
    }

    .bar nav {
        width: 100%;
        justify-content: space-between;
        align-items: center;
        gap: .5rem;
        flex-wrap: nowrap;
    }

    .bar nav a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        font-size: clamp(.78rem, 3.2vw, .9rem);
        letter-spacing: 0;
    }

    /* Le luminaire est visible avant le titre, sans texte sur l'ampoule. */
    .hero {
        /* Le paysage source contient deux bandes noires : agrandir le cliché
           sans agrandir la scène, puis fondre son bas derrière le fond charbon. */
        --photo-height: min(125vw, 64svh, 36rem);
        --photo-window: min(104vw, 49svh, 30rem);
        --photo-x: 50%;
        min-height: 0;
        grid-template-rows: max(0px, calc(var(--photo-window) - 2.5rem)) auto;
        align-items: start;
    }

    .hero-inner {
        grid-row: 2;
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 2.8rem var(--pad) 1.9rem;
        background: linear-gradient(180deg, transparent, var(--coal) 2.8rem);
    }

    .hero .eyebrow {
        font-size: clamp(.62rem, 2.7vw, .72rem);
        letter-spacing: .09em;
        margin-bottom: .55rem;
    }

    .hero h1 {
        font-size: clamp(2.7rem, 11.8vw, 4.8rem);
        line-height: .94;
    }

    .hero-inner .entry-link,
    .hero-inner .expo-entry {
        display: inline-flex;
        align-items: center;
        width: fit-content;
        max-width: 100%;
        min-height: 44px;
        font-size: .81rem;
        white-space: nowrap;
        vertical-align: middle;
    }

    .hero-inner .entry-link {
        justify-content: space-between;
        gap: .55rem;
        margin: 1rem .7rem 0 0;
        padding-bottom: 0;
    }

    .hero-inner .expo-entry {
        gap: .4rem;
        margin: 1rem 0 0;
        padding-inline: .65rem;
    }

    /* Une seule colonne, des marges constantes et des interrupteurs faciles à toucher. */
    .room {
        padding-block: 2.6rem 4rem;
    }

    .heading {
        gap: .85rem;
        margin-bottom: 2.5rem;
    }

    .heading .eyebrow,
    .story .eyebrow {
        margin-bottom: .8rem;
    }

    .heading h2,
    .story h2 {
        font-size: clamp(2.75rem, 12vw, 4.5rem);
        line-height: .98;
    }

    .room-tools {
        max-width: 29rem;
        font-size: .9rem;
    }

    .room-tools a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        margin-top: .1rem;
    }

    .hang {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 2.65rem;
    }

    .hang .piece,
    .hang .piece:nth-child(even) {
        width: min(90%, 22.5rem);
        margin: 0;
        justify-self: center;
    }

    .rail {
        min-width: 0;
        gap: .65rem;
        margin-top: .75rem;
        padding-top: 0;
        border-top: 0;
    }

    .rail > div {
        min-width: 0;
    }

    .rail h3 {
        font-size: clamp(1.3rem, 5.1vw, 1.9rem);
        line-height: 1.15;
    }

    .rail .etat {
        display: block;
        margin-top: .3rem;
        font-size: .62rem;
    }

    .rocker {
        width: 3rem;
        height: 3rem;
        flex: none;
    }

    /* Le décor de l'atelier reste présent, mais ne gêne plus la lecture. */
    .atelier {
        background: #151310;
    }

    .atelier-wall {
        position: absolute;
        inset: 0 0 auto;
        height: min(76vw, 23rem);
    }

    .atelier-wall::after {
        background:
            linear-gradient(180deg, rgba(21, 19, 16, .42), #151310),
            linear-gradient(90deg, rgba(16, 15, 14, .62), rgba(16, 15, 14, .22));
    }

    .story {
        margin-top: 0;
        padding-block: 3.5rem 3.9rem;
    }

    .story header {
        padding-bottom: 1.4rem;
    }

    .passage {
        padding: 1.15rem 0;
    }

    .passage h3,
    .films h3 {
        font-size: clamp(1.8rem, 7.8vw, 2.65rem);
        margin-bottom: 1rem;
    }

    .passage p {
        font-size: 1rem;
        line-height: 1.7;
    }

    .watch .passage {
        opacity: 1;
        transition: none;
    }

    .vue-exposition {
        width: min(100%, 30rem);
        margin-bottom: 1.1rem;
    }

    .vue-exposition img {
        max-height: 27rem;
    }

    .films {
        padding-top: 1.7rem;
    }

    .films-liste {
        grid-template-columns: minmax(0, 1fr);
        max-width: 28rem;
    }

    .film-image img {
        aspect-ratio: 480 / 390;
    }

    .film-play {
        width: 2.75rem;
        height: 2.75rem;
    }

    .film-legende {
        flex-direction: row;
        align-items: center;
        gap: .5rem;
    }

    .film-titre {
        font-size: 1.5rem;
    }

    #film-lecteur {
        width: calc(100% - 1rem);
        max-height: calc(100dvh - 1rem);
        padding: .7rem;
        overflow-y: auto;
    }

    .film-entete h2 {
        font-size: clamp(1.35rem, 5.5vw, 1.75rem);
        line-height: 1.1;
    }

    .film-fermer {
        min-height: 44px;
        white-space: nowrap;
    }

    #film-lecteur video {
        max-height: calc(100dvh - 5.75rem);
    }

    .visit-card {
        min-width: 0;
        margin-block: 2.6rem;
    }

    .ed-visit-card {
        min-width: 0;
        padding: clamp(1.15rem, 5vw, 2rem);
    }

    .ed-visit-card h2 {
        font-size: clamp(2.6rem, 10vw, 3.75rem);
        line-height: 1;
        margin: .6rem 0 1.2rem;
    }

    .ed-contact-links,
    .ed-courriel {
        min-width: 0;
        max-width: 100%;
    }

    .ed-courriel img {
        display: block;
        max-width: 100%;
    }

    footer {
        gap: 1rem;
        padding-block: 1.3rem;
        font-size: .85rem;
    }

    /* Projection et commandes utilisables en portrait sans rogner les œuvres. */
    .projection,
    #projection-v3[open] {
        width: 100%;
        height: 100dvh;
    }

    .expo-intro {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, auto);
        align-items: end;
        gap: .7rem;
        padding: .75rem max(var(--pad), env(safe-area-inset-right)) max(.8rem, env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
    }

    .expo-intro h1 {
        font-size: clamp(1.55rem, 5.5vw, 2.1rem);
        line-height: 1.02;
    }

    .expo-signature {
        max-width: 7.5rem;
        font-size: clamp(.86rem, 3.3vw, 1.15rem);
        text-align: right;
        line-height: 1.2;
    }

    .expo-controls {
        left: max(.35rem, env(safe-area-inset-left));
        right: max(.35rem, env(safe-area-inset-right));
        justify-content: center;
        flex-direction: row;
    }

    .expo-tools {
        flex-wrap: wrap;
        justify-content: center;
        margin-inline: auto;
        gap: 0;
    }

    .expo-tools button {
        font-size: .8rem;
        min-width: 44px;
        min-height: 44px;
        padding: .4rem .38rem;
    }

    .expo-tools button[id="expo-exit"] {
        margin-left: 0;
    }
}

@media (max-width: 700px) and (orientation: portrait) {
    html {
        scroll-padding-top: 6rem;
    }

    .bar {
        position: sticky;
        top: 0;
        z-index: 30;
    }

    html:has(.bar.menu-ready) {
        scroll-padding-top: 3.6rem;
    }

    .bar.menu-ready {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: .25rem;
        min-height: 3.6rem;
        padding-block: .25rem;
    }

    .menu-ready .brand {
        font-size: clamp(1.25rem, 5.25vw, 1.85rem);
        gap: .16em;
    }

    .menu-ready .brand img {
        width: clamp(2.4rem, 10vw, 3.25rem);
        margin-right: .15rem;
    }

    .menu-ready .mobile-menu-toggle {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        color: var(--ivory);
        background: transparent;
    }

    .mobile-menu-toggle span {
        position: relative;
        width: 1.3rem;
        height: 1rem;
    }

    .mobile-menu-toggle span::before,
    .mobile-menu-toggle span::after {
        content: "";
        position: absolute;
        left: 0;
        width: 100%;
        height: 1px;
        background: currentColor;
        transition: transform .2s ease;
    }

    .mobile-menu-toggle span::before { top: .25rem; }
    .mobile-menu-toggle span::after { bottom: .25rem; }

    .menu-open .mobile-menu-toggle span::before { transform: translateY(.25rem) rotate(45deg); }
    .menu-open .mobile-menu-toggle span::after { transform: translateY(-.25rem) rotate(-45deg); }

    .bar.menu-ready nav {
        display: none;
        position: absolute;
        inset: 100% 0 auto;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: .25rem var(--pad) .85rem;
        border-bottom: 1px solid var(--fine);
        background: var(--coal);
    }

    .bar.menu-ready.menu-open nav {
        display: flex;
    }

    .bar.menu-ready nav a {
        min-height: 46px;
        font-size: .95rem;
    }

    .bar.menu-ready nav a + a {
        border-top: 1px solid #463e3250;
    }
}

/* Un téléphone tourné à l'horizontale retrouve une composition plus compacte. */
@media (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
    .bar {
        position: static;
        display: flex;
        flex-wrap: nowrap;
        min-height: 3.25rem;
        padding: .25rem var(--pad);
        gap: .75rem;
    }

    .bar nav {
        width: auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: .7rem;
    }

    .brand {
        font-size: clamp(1.2rem, 3.1vw, 1.7rem);
    }

    .brand img {
        width: 3.2rem;
        height: auto;
    }

    .hero {
        --photo-height: 100%;
        --photo-x: 67%;
        min-height: calc(100svh - 3.25rem);
        grid-template-rows: auto;
        align-items: center;
    }

    .wall,
    .lamp-dust-anchor {
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .hero .beam {
        background-position: var(--photo-x) center;
    }

    .hero-inner {
        grid-row: 1;
        width: fit-content;
        max-width: 65%;
        padding: 1.5rem var(--pad) 2rem;
        background: linear-gradient(90deg, #0d0c0be8, transparent);
    }

    .hero h1 {
        font-size: clamp(2.5rem, 6.8vw, 4.2rem);
    }

    .hero-inner .entry-link,
    .hero-inner .expo-entry {
        margin: .6rem 0 0;
    }

    .expo-intro {
        padding-block: .4rem max(.4rem, env(safe-area-inset-bottom));
        align-items: center;
    }

    .expo-intro h1 {
        font-size: clamp(1.4rem, 3.5vw, 2rem);
    }

    .expo-signature {
        font-size: 1.05rem;
    }
}
