/* mobile.css — chargé uniquement sous 1000px (media= sur le <link>), après main.css */

/* l'ancien dispositif desktop/mobile est remplacé par .m-app */
.projects,
.bottom-strip,
.intro-tunnel3d {
    display: none !important;
}

/* la bio (existante) reste sous .m-app et n'a plus sa bande blanche */
.scene {
    z-index: 50;
}

.scene .bio-links::after {
    display: none;
}

.m-app {
    --m-ink: #111;
    --m-ink-2: #6b6b6b;
    --m-ink-3: #b8b8b8;
    --m-line: rgba(0, 0, 0, 0.14);
    --m-edge: 16px;
    --m-th: 40px;
    --m-frise-h: 52px;
    --m-foot-h: 40px;
    --m-ui: "Martian Mono", ui-monospace, monospace;
    --m-text: "Instrument Sans", "Helvetica Neue", Helvetica, sans-serif;

    position: fixed;
    inset: 0;
    z-index: 100;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: var(--m-ink);
    font-family: var(--m-ui);
    font-weight: 300;
    font-size: 13px;
    font-variation-settings: "wdth" 100;
    letter-spacing: -0.02em;
}

/* ---------- en-tête ---------- */
.m-head {
    flex: 0 0 auto;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 14px var(--m-edge) 10px;
}

.m-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
    font-weight: 400;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.m-cat {
    flex: 0 0 auto;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--m-ink-2);
    white-space: nowrap;
}

/* ---------- corps : image + fiche ---------- */
.m-body {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

.m-body::-webkit-scrollbar,
.m-track::-webkit-scrollbar,
.m-frise::-webkit-scrollbar {
    display: none;
}

.m-stage {
    flex: 1 1 0;
    min-height: max(220px, 32dvh);
    display: flex;
    flex-direction: column;
}

.m-track {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.m-slide {
    position: relative;
    flex: 0 0 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.m-slide>img,
.m-slide>video {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--m-edge);
    width: calc(100% - var(--m-edge) * 2);
    height: 100%;
    object-fit: contain;
    display: block;
}

.m-count {
    flex: 0 0 auto;
    text-align: right;
    padding: 6px var(--m-edge) 0;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.04em;
    color: var(--m-ink-2);
}

/* ---------- fiche ---------- */
.m-fiche {
    flex: 0 0 auto;
    padding: 10px var(--m-edge) 12px;
}

.m-desc,
.m-teaser,
.m-full p {
    font-family: var(--m-text);
    font-size: 15px;
    line-height: 1.45;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--m-ink);
}

.m-teaser {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.m-full p {
    margin: 0;
}

.m-full p+p {
    margin-top: 0.6em;
}

.m-fiche:not(.is-open) .m-full,
.m-fiche.is-open .m-teaser {
    display: none;
}

.m-more {
    appearance: none;
    background: none;
    border: 0;
    padding: 10px 0 0;
    font-family: var(--m-ui);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--m-ink-2);
    text-align: left;
    cursor: pointer;
}

.m-more[hidden] {
    display: none;
}

.m-specs {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 40% 1fr;
    column-gap: 8px;
}

.m-specs>div {
    border-top: 1px solid var(--m-line);
    padding: 6px 0;
    font-size: 12px;
    line-height: 1.35;
}

.m-sl {
    color: var(--m-ink-2);
}

.m-sv {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
}

/* ---------- frise ---------- */
.m-frise {
    flex: 0 0 auto;
    position: relative;
    height: var(--m-frise-h);
    display: flex;
    align-items: center;
    gap: 3px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    border-top: 1px solid var(--m-line);
}

.m-frise::before,
.m-frise::after {
    content: "";
    flex: 0 0 calc(50% - var(--m-th) / 2 - 3px);
}

.m-th {
    position: relative;
    flex: 0 0 var(--m-th);
    width: var(--m-th);
    height: var(--m-th);
    padding: 0;
    border: 0;
    background: #eee;
    opacity: 0.4;
    overflow: hidden;
    cursor: pointer;
}

.m-th.on {
    opacity: 1;
}

.m-th>img,
.m-th>video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.m-slide.is-off,
.m-th.is-off {
    display: none;
}

/* ---------- pied de page ---------- */
.m-foot {
    flex: 0 0 auto;
    position: relative;
    box-sizing: border-box;
    height: calc(var(--m-foot-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 var(--m-edge) env(safe-area-inset-bottom, 0px);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background: #fff;
}

.m-name {
    font-size: 13px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--m-ink);
}

.m-btn {
    appearance: none;
    background: none;
    border: 0;
    padding: 10px 0;
    font-family: var(--m-ui);
    font-size: 11px;
    line-height: 1;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--m-ink-2);
    cursor: pointer;
    justify-self: start;
}

.m-bio-btn {
    justify-self: end;
}

.m-filters {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 18px;
    padding: 10px var(--m-edge);
    background: #fff;
    border-top: 1px solid var(--m-line);
}

.m-filters[hidden] {
    display: none;
}

.m-chip {
    appearance: none;
    background: none;
    border: 0;
    padding: 8px 0;
    font-family: var(--m-ui);
    font-size: 12px;
    line-height: 1;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--m-ink-3);
    cursor: pointer;
}

.m-chip::before,
.m-chip::after {
    width: auto;
    letter-spacing: 0;
    opacity: 0;
}

.m-chip::before {
    content: "[";
}

.m-chip::after {
    content: "]";
}

.m-chip.is-active {
    color: var(--m-ink);
}

.m-chip.is-active::before,
.m-chip.is-active::after {
    opacity: 1;
}

/* ---------- bio ouverte : on laisse voir la bio, seul le pied de page reste ---------- */
body.bio-is-open .m-app {
    background: transparent;
    pointer-events: none;
}

body.bio-is-open .m-head,
body.bio-is-open .m-body,
body.bio-is-open .m-frise,
body.bio-is-open .m-filters {
    visibility: hidden;
}

body.bio-is-open .m-foot {
    pointer-events: auto;
}

.m-specs[hidden] {
    display: none;
}

/* specs au-delà de SPEC_MAX : visibles seulement quand la fiche est dépliée */
.m-fiche:not(.is-open) .m-specs .is-extra {
    display: none;
}

/* aucune icône native de lecture sur les vidéos (iOS / mode économie d'énergie) */
.m-app video::-webkit-media-controls,
.m-app video::-webkit-media-controls-start-playback-button,
.m-app video::-webkit-media-controls-overlay-play-button {
    display: none !important;
    -webkit-appearance: none;
}

/* loader vidéo : fin cercle, n'apparaît qu'après 300 ms */
.m-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 1px solid var(--m-ink-3);
    border-top-color: var(--m-ink);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    animation: m-spin 0.8s linear infinite, m-loader-in 0.2s ease 0.3s forwards;
}

.m-slide:not(.is-loading) .m-loader {
    display: none;
}

@keyframes m-spin {
    to { transform: rotate(360deg); }
}

@keyframes m-loader-in {
    to { opacity: 1; }
}
