/* ================= Boutons =================
   Même langage que la visionneuse : texte nu en mono, éclat d'étoile devant, filet tendu dessous.
   La couleur suit currentColor (clair sur le noir, encre sur le papier des dictons). */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    min-height: 44px;
    padding: 0.6rem 0.2rem;
    border: 0;
    background: none;
    color: inherit;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
    letter-spacing: 0.14em;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: color var(--dur) var(--ease-out), filter var(--dur) var(--ease-out), scale var(--dur-press) var(--ease-out);
}

/* Dans l'intro du hero (texte gris), les boutons restent en clair pour le contraste */
.hero-card .btn {
    color: var(--paper);
}

/* Filet qui se tend sous le libellé */
.btn::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0.2rem;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, currentColor, transparent);
    transform-origin: left;
    scale: 0.55 1;
    transition: scale var(--dur) var(--ease-out);
}

/* Éclat devant chaque bouton, qui pivote au survol */
.btn::before {
    content: '';
    flex: none;
    width: 0.75em;
    height: 1.1em;
    background: currentColor;
    -webkit-mask: var(--star) center / contain no-repeat;
    mask: var(--star) center / contain no-repeat;
    transition: rotate var(--dur) var(--ease-out), scale var(--dur) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .btn:hover {
        filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 40%, transparent));
    }

    .btn:hover::after {
        scale: 1 1;
    }

    .btn:hover::before {
        rotate: 90deg;
        scale: 1.2;
    }
}

.btn:focus-visible::after {
    scale: 1 1;
}

/* Appui : le bouton s'enfonce à peine, tout de suite */
.btn:active {
    scale: 0.97;
}

/* Boutons nus (visionneuse, langue) : leur étoile au survol est définie avec leur barre */
.icon-btn,
.lang-toggle {
    display: inline-grid;
    place-items: center;
    flex: none;
    min-width: 44px;
    height: 44px;
    padding: 0 0.6rem;
    border: 0;
    background: none;
    color: var(--grey);
    cursor: pointer;
}

.lang-toggle {
    font-family: var(--font-mono);
    font-size: var(--size-label);
    font-weight: 700;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: square;
    stroke-linejoin: miter;
}

.icon-btn[hidden] {
    display: none;
}

.icon-btn[aria-disabled='true'] {
    opacity: 0.25;
    cursor: not-allowed;
}

/* Burger : l'étoile acérée, qui pivote d'un huitième de tour à l'ouverture */
.nav-toggle-dots {
    width: 16px;
    height: 22px;
    background: var(--white);
    -webkit-mask: var(--star) center / contain no-repeat;
    mask: var(--star) center / contain no-repeat;
    transition: transform var(--dur) var(--ease-snap);
}

.nav-toggle[aria-expanded='true'] .nav-toggle-dots {
    transform: rotate(45deg);
}

/* ================= Surfaces halftone ================= */
.ht {
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
}

.ht-source {
    transition: opacity var(--dur);
}

.ht-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--dur);
}

/* Avec JS et WebGL : l'image source reste en place (taille, alt) mais invisible ; le canvas la remplace. */
html.js:not(.no-webgl) .ht:not(.is-fallback):not(.is-revealed):not(.is-broken) .ht-source {
    opacity: 0;
}

.ht.is-live:not(.is-revealed):not(.is-broken) .ht-canvas {
    opacity: 1;
}

/* Repli (sans JS, sans WebGL, contexte perdu) : l'image elle-même passe en trame CSS dure, en N&B. */
html:not(.js) .ht .ht-source,
html.no-webgl .ht:not(.is-revealed):not(.is-broken) .ht-source,
.ht.is-fallback:not(.is-revealed):not(.is-broken) .ht-source {
    -webkit-mask-image: radial-gradient(circle at center, var(--ink) 0 44%, transparent 48%);
    mask-image: radial-gradient(circle at center, var(--ink) 0 44%, transparent 48%);
    -webkit-mask-size: 7px 7px;
    mask-size: 7px 7px;
    filter: grayscale(1) contrast(1.8) brightness(1.5);
}

/* Image introuvable : placeholder tramé + texte alternatif lisible. */
.ht.is-broken {
    min-height: 10rem;
    color: color-mix(in srgb, var(--paper) 30%, transparent);
    background-image: var(--dots);
    background-size: var(--dot-step) var(--dot-step);
}

.ht.is-broken .ht-source {
    opacity: 1;
    color: var(--paper);
    background: var(--ink);
}

.ht.is-broken .ht-canvas {
    display: none;
}

/* ================= Mascotte ================= */
.mascot-button {
    position: relative;
    z-index: 1;
    display: block;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: zoom-in;
}

.mascot .ht-source {
    width: auto;
    height: min(150svh, 1400px);
    object-fit: contain;
}

@media (max-width: 860px) {
    .mascot .ht-source {
        /* Taille liée à la LARGEUR, pas à la hauteur d'écran : dans le navigateur intégré d'une app
           (Safari en fenêtre), la hauteur change pendant le défilement ; une taille en svh faisait
           sauter la mascotte et recalculer sa trame à chaque mouvement. */
        height: min(150vw, 680px);
    }
}

/* Indication discrète : la mascotte s'ouvre en vraies couleurs (seul indice sur écran tactile) */
.mascot-hint {
    /* Téléphone : sous la mascotte, dans le vide (jamais par-dessus les points) */
    position: relative;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    align-items: center;
    gap: 0.5rem;
    color: var(--grey);
    white-space: nowrap;
    pointer-events: none;
    transition: color var(--dur) var(--ease-out), filter var(--dur) var(--ease-out);
}

.mascot-hint::before {
    content: '';
    width: 0.7em;
    height: 1.05em;
    background: currentColor;
    -webkit-mask: var(--star) center / contain no-repeat;
    mask: var(--star) center / contain no-repeat;
    transition: rotate var(--dur) var(--ease-out);
}

.mascot-button:focus-visible .mascot-hint {
    color: var(--paper);
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--paper) 45%, transparent));
}

.mascot-button:focus-visible .mascot-hint::before {
    rotate: 90deg;
}

@media (hover: hover) and (pointer: fine) {
    .mascot-button:hover .mascot-hint {
        color: var(--paper);
        filter: drop-shadow(0 0 6px color-mix(in srgb, var(--paper) 45%, transparent));
    }

    .mascot-button:hover .mascot-hint::before {
        rotate: 90deg;
    }
}

/* Ordinateur : dans le vide à gauche de la tête */
@media (min-width: 861px) {
    .mascot-hint {
        position: absolute;
        top: 18%;
        left: 0;
        margin: 0;
    }
}

.mascot-parallax {
    position: relative;
    transform: translate3d(var(--parallax-x, 0px), var(--parallax-y, 0px), 0);
    transition: transform 0.6s var(--ease-out);
}

.wiggle {
    display: inline-block;
    color: var(--paper);
}

/* ================= Bandeaux défilants ================= */
.marquee {
    position: relative;
    z-index: 2;
    width: 112%;
    margin-left: -6%;
    overflow: hidden;
    background:
        var(--line-fade) top / 100% 1px no-repeat,
        var(--line-fade) bottom / 100% 1px no-repeat,
        var(--ink);
    color: var(--grey);
}

/* Second bandeau : lettres en contour fin */
.marquee--paper .marquee-item {
    color: transparent;
    -webkit-text-stroke: 1px var(--grey);
}

.marquee-track {
    display: flex;
    width: max-content;
    padding-block: 0.9rem;
}

.marquee-item {
    flex: none;
    padding-right: 3rem;
    font-family: var(--font-display);
    font-variation-settings: var(--condensed);
    font-weight: 900;
    font-size: clamp(1.6rem, 3.4vw, 3rem);
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.marquee-item::after {
    content: '';
    display: inline-block;
    width: 0.55em;
    height: 0.8em;
    margin-left: 3rem;
    vertical-align: middle;
    background: var(--paper);
    -webkit-mask: var(--star) center / contain no-repeat;
    mask: var(--star) center / contain no-repeat;
}

/* ================= Dicton monumental ================= */
.dicton-text {
    max-width: 22em;
    margin: 0;
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 100;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.01em;
    text-wrap: balance;
    overflow-wrap: break-word;
}

/* Tailles mesurées : la phrase entière tient toujours à l'écran */
.dicton-text.is-short {
    font-size: clamp(2rem, 5.6vw, 5.2rem);
}

.dicton-text.is-medium {
    font-size: clamp(1.75rem, 4.4vw, 4rem);
}

.dicton-text.is-long {
    font-size: clamp(1.5rem, 3.4vw, 3rem);
}

.dicton-text .word {
    display: inline-block;
}

/* Filet qui se tend jusqu'au prochain dicton (durée posée par js/quotes.js) */
.dicton-progress {
    display: block;
    width: min(22rem, 60%);
    height: 1px;
    margin-top: 1.25rem;
    background: color-mix(in srgb, currentColor 18%, transparent);
}

.dicton-progress::after {
    content: '';
    display: block;
    height: 100%;
    background: currentColor;
    transform-origin: left;
    scale: 0 1;
}

.dicton-progress.is-running::after {
    animation: dicton-progress var(--autoplay, 9s) linear forwards;
}

@keyframes dicton-progress {
    to {
        scale: 1 1;
    }
}

.dicton-source {
    margin-top: 1.5rem;
    font-family: var(--font-body);
    font-size: var(--size-lead);
    font-style: italic;
}

/* ================= Faits du fursona ================= */
.fact {
    padding-top: 1rem;
    color: var(--grey);
    background: var(--line-fade) top / 100% 1px no-repeat;
}

.fact-title,
.fact p {
    color: var(--paper);
}

.fact::before {
    content: counter(fact, decimal-leading-zero);
    display: block;
    margin-bottom: 0.75rem;
    font-family: var(--font-display);
    font-variation-settings: var(--condensed);
    font-weight: 900;
    font-size: clamp(4rem, 9vw, 8rem);
    line-height: 0.8;
    color: transparent;
    -webkit-text-stroke: 1px var(--grey);
}

.fact-title {
    margin: 0 0 0.6rem;
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 100;
    font-weight: 900;
    font-size: clamp(1.6rem, 2.6vw, 2.4rem);
    line-height: 1;
    text-transform: uppercase;
}

.fact p {
    margin: 0;
    font-size: var(--size-lead);
    line-height: 1.4;
}

.block-title {
    margin: 0;
    font-family: var(--font-display);
    font-variation-settings: var(--condensed);
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 0.85;
    text-transform: uppercase;
}

/* ================= Palette : lignes sobres (ref sheet, visionneuse) =================
   Éclat d'étoile à la couleur, nom, code ; un clic copie le code HEX. */
.palette {
    margin: 0;
    padding: 0;
    list-style: none;
}

.swatch {
    --swatch: transparent;
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.35rem 0.4rem;
    border: 0;
    background: none;
    color: var(--paper);
    text-align: left;
    cursor: copy;
    transition: background-color var(--dur) var(--ease-out);
}

.palette li + li .swatch {
    border-top: 1px solid color-mix(in srgb, var(--grey) 25%, transparent);
}

.swatch-chip {
    display: block;
    flex: none;
    width: 22px;
    height: 32px;
    background: var(--swatch);
    -webkit-mask: var(--star) center / contain no-repeat;
    mask: var(--star) center / contain no-repeat;
    transition: rotate var(--dur) var(--ease-out), scale var(--dur) var(--ease-out);
}

.swatch-name {
    font-family: var(--font-display);
    font-variation-settings: var(--wide);
    font-weight: 900;
    font-size: 0.85rem;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.swatch-hex {
    margin-left: auto;
    color: var(--grey);
    font-family: var(--font-mono);
    font-size: var(--size-label);
    font-weight: 700;
    transition: color var(--dur);
}

.swatch:focus-visible {
    background: color-mix(in srgb, var(--paper) 6%, transparent);
    outline: 1px solid var(--paper);
    outline-offset: -1px;
}

.swatch:focus-visible .swatch-chip {
    rotate: 45deg;
    scale: 1.2;
}

.swatch:focus-visible .swatch-hex {
    color: var(--paper);
}

@media (hover: hover) and (pointer: fine) {
    .swatch:hover {
        background: color-mix(in srgb, var(--paper) 6%, transparent);
    }

    .swatch:hover .swatch-chip {
        rotate: 45deg;
        scale: 1.2;
    }

    .swatch:hover .swatch-hex {
        color: var(--paper);
    }
}

/* ================= Ref sheet ================= */
.ref-card {
    position: relative;
    isolation: isolate;
    display: grid;
    gap: 1rem;
    padding: clamp(2rem, 6vw, 4rem);
    color: var(--grey);
    background: var(--corner-marks);
    overflow: hidden;
}

.ref-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    color: color-mix(in srgb, var(--paper) 22%, transparent);
    background-image: var(--dots-fat);
    background-size: var(--dot-step-fat) var(--dot-step-fat);
    -webkit-mask-image: linear-gradient(120deg, transparent 35%, var(--ink));
    mask-image: linear-gradient(120deg, transparent 35%, var(--ink));
}

/* Texte sur un aplat d'encre : jamais posé directement sur la trame */
.ref-card p {
    justify-self: start;
    max-width: 36ch;
    margin: 0;
    padding: 0;
    color: var(--paper);
    font-size: var(--size-lead);
}

.ref-open {
    display: block;
    width: 100%;
    max-width: 52rem;
    padding: 0;
    background: var(--ink-2);
    cursor: zoom-in;
}

.ref-open .ht,
.ref-open .ht-source {
    width: 100%;
    height: auto;
}

/* Ref sheet + colonne d'infos : occupe toute la largeur sur ordinateur */
.ref-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(16rem, 1fr);
    align-items: start;
    gap: clamp(2rem, 5vw, 5rem);
}

@media (max-width: 860px) {
    .ref-layout {
        grid-template-columns: 1fr;
    }
}

.ref-aside {
    padding-top: 1.25rem;
    color: var(--grey);
    background: var(--line-fade) top / 100% 1px no-repeat;
}

.ref-info {
    margin: 1.25rem 0 2.5rem;
    color: var(--paper);
    font-size: var(--size-lead);
    line-height: 1.45;
}

.ref-colors-title,
.ref-hint {
    margin: 0 0 0.75rem;
    color: var(--grey);
}

.ref-hint {
    margin-top: 1rem;
}

.ref-credit {
    margin: 0;
    font-family: var(--font-mono);
    font-size: var(--size-label);
    text-transform: uppercase;
}

/* ================= Galerie ================= */
.gallery-open {
    display: block;
    width: 100%;
    padding: 0;
    background: var(--ink-2);
    cursor: zoom-in;
}

/* Cadres des œuvres (ref, galerie) : pas de boîte, un coin biseauté, un filet fin et des crochets d'angle
   qui s'allument au survol. Le contour est dessiné par-dessus l'image (::before / ::after). */
.ref-open,
.gallery-open {
    --chamfer: 22px;
    position: relative;
    border: 0;
    color: color-mix(in srgb, var(--grey) 70%, transparent);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%);
    transition: color var(--dur) var(--ease-out);
}

.ref-open::before,
.gallery-open::before,
.ref-open::after,
.gallery-open::after {
    content: '';
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

/* Filet fin ; la diagonale du biseau est tracée à part (le clip coupe le bord) */
.ref-open::before,
.gallery-open::before {
    inset: 0;
    border: 1px solid color-mix(in srgb, currentColor 55%, transparent);
    background: linear-gradient(135deg, transparent calc(100% - var(--chamfer) * 0.7071 - 0.5px), color-mix(in srgb, currentColor 55%, transparent) calc(100% - var(--chamfer) * 0.7071 - 0.5px) calc(100% - var(--chamfer) * 0.7071 + 0.5px), transparent calc(100% - var(--chamfer) * 0.7071 + 0.5px)) bottom right / calc(var(--chamfer) * 2) calc(var(--chamfer) * 2) no-repeat;
}

.ref-open::after,
.gallery-open::after {
    inset: 10px;
    background: var(--corner-marks);
}

@media (hover: hover) and (pointer: fine) {
    .ref-open:hover,
    .gallery-open:hover {
        color: var(--paper);
    }
}

/* Le clip couperait le contour de focus : il passe à l'intérieur, sur le filet */
.ref-open:focus-visible,
.gallery-open:focus-visible {
    outline: none;
    color: var(--white);
}

.ref-open:focus-visible::before,
.gallery-open:focus-visible::before {
    border-width: 2px;
}

.gallery-art {
    width: 100%;
    aspect-ratio: 4 / 5;
}

.gallery-art .ht-source {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--focus-x, 50%) var(--focus-y, 50%);
}

.gallery-caption {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1rem;
    margin: 0.9rem 0 0;
}

.gallery-number {
    grid-row: span 2;
    font-family: var(--font-display);
    font-variation-settings: var(--condensed);
    font-weight: 900;
    font-size: 3.2rem;
    line-height: 0.85;
    color: transparent;
    -webkit-text-stroke: 1px var(--grey);
}

.gallery-title {
    font-family: var(--font-display);
    font-variation-settings: 'wdth' 90;
    font-weight: 900;
    font-size: 1.4rem;
    line-height: 1.1;
    text-transform: uppercase;
}

.gallery-credit {
    font-family: var(--font-mono);
    font-size: var(--size-label);
    text-transform: uppercase;
}

.gallery-empty {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(3rem, 10vw, 7rem) clamp(1.5rem, 5vw, 4rem);
    color: var(--grey);
    background: var(--corner-marks);
}

.gallery-empty::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    color: color-mix(in srgb, var(--paper) 30%, transparent);
    background-image: var(--dots-fat);
    background-size: var(--dot-step-fat) var(--dot-step-fat);
    -webkit-mask-image: radial-gradient(ellipse at 100% 0, var(--ink), transparent 70%);
    mask-image: radial-gradient(ellipse at 100% 0, var(--ink), transparent 70%);
}

.gallery-empty p {
    max-width: 18ch;
    margin: 0;
    font-family: var(--font-display);
    font-variation-settings: var(--condensed);
    font-weight: 900;
    font-size: clamp(2.4rem, 7vw, 6.5rem);
    line-height: 0.9;
    color: var(--paper);
    text-transform: uppercase;
}

/* ================= Réseaux : liste typographique ================= */
.social-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.5rem 1.5rem;
    padding: 0.6rem 0.25rem;
    color: inherit;
    text-decoration: none;
    /* Halo immédiat au survol : il doit suivre le pointeur sans attente */
    transition: color var(--dur-fast) var(--ease-out), filter var(--dur-press) var(--ease-out);
}

/* Section claire de séparation : filets et lueur à l'encre */
.section--light .social-list {
    color: color-mix(in srgb, var(--ink) 35%, transparent);
}

.section--light .social-row {
    color: var(--ink);
}

/* Filet tendu au-dessus de chaque réseau (teinte = couleur douce de la liste) */
.social-list > li {
    background: var(--line-fade) top / 100% 1px no-repeat;
}

.social-name {
    font-family: var(--font-display);
    font-variation-settings: var(--condensed);
    font-weight: 900;
    font-size: clamp(2.6rem, 9vw, 8.5rem);
    line-height: 0.95;
    text-transform: uppercase;
    transition: translate var(--dur) var(--ease-out);
}

.social-handle {
    opacity: 0.7;
    font-family: var(--font-mono);
    font-size: clamp(0.8rem, 1.3vw, 1.05rem);
    font-weight: 700;
}

.social-arrow {
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: 1;
    transition: transform var(--dur) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .social-row:hover {
        filter: drop-shadow(0 0 10px color-mix(in srgb, currentColor 30%, transparent));
    }

    /* Le nom glisse (translate : pas de recalcul de mise en page, contrairement à une marge) */
    .social-row:hover .social-name {
        translate: 1.5rem 0;
    }

    .social-row:hover .social-arrow {
        transform: translate(6px, -6px);
    }
}

.social-row:focus-visible {
    outline-offset: -3px;
}

.social-row:focus-visible .social-name {
    translate: 1.5rem 0;
}

@media (max-width: 600px) {
    .social-row {
        grid-template-columns: 1fr auto;
    }

    .social-handle {
        grid-row: 2;
    }

    .social-arrow {
        grid-row: 1 / span 2;
        grid-column: 2;
    }
}

/* ================= Bulle du boop et toast : volet sombre à filet fin, coin biseauté ================= */
.bubble,
.toast {
    --chamfer: 12px;
    border: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: var(--size-label);
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%);
    box-shadow: inset 0 0 0 1px var(--grey);
}

.bubble {
    padding: 0.8rem 1rem 0.8rem 2.2rem;
}

.toast {
    padding: 0.8rem 1.2rem 0.8rem 2.4rem;
}

/* Éclat d'étoile à gauche du texte */
.bubble::before,
.toast::before {
    content: '';
    position: absolute;
    inset: 50% auto auto 0.9rem;
    width: 10px;
    height: 15px;
    translate: 0 -50%;
    background: var(--paper);
    -webkit-mask: var(--star) center / contain no-repeat;
    mask: var(--star) center / contain no-repeat;
}

/* Bulle : collée à gauche du visage, juste au-dessus de l'indice « Ouvrir ». Elle grandit depuis le coin tourné vers la mascotte. */
.bubble {
    position: absolute;
    right: 59.5%;
    bottom: 83.5%;
    z-index: 5;
    width: max-content;
    max-width: 14rem;
    margin: 0;
    opacity: 0;
    transform: translateY(6px) scale(0.96);
    transform-origin: 90% 100%;
    pointer-events: none;
    /* Sortie plus rapide que l'entrée */
    transition: opacity var(--dur-exit) var(--ease-out), transform var(--dur-exit) var(--ease-out);
}

/* Ordinateur : un peu d'air entre la bulle et le visage */
@media (min-width: 861px) {
    .bubble {
        right: calc(59.5% + 1.5rem);
    }
}

/* Téléphone : peu de place à gauche du visage, la bulle passe sur deux lignes si besoin */
@media (max-width: 860px) {
    .bubble {
        max-width: min(14rem, 38vw);
    }
}

.bubble.is-visible {
    opacity: 1;
    transform: none;
    transition-duration: var(--dur);
}

/* Toast : en bas au centre de l'écran */
.toast {
    position: fixed;
    inset: auto auto calc(1.5rem + env(safe-area-inset-bottom, 0px)) 50%;
    z-index: 120;
    margin: 0;
    max-width: min(92vw, 30rem);
    text-align: center;
    opacity: 0;
    transform: translate(-50%, 1rem);
    pointer-events: none;
    /* Sortie plus rapide que l'entrée */
    transition: opacity var(--dur-exit) var(--ease-out), transform var(--dur-exit) var(--ease-out);
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
    transition-duration: var(--dur);
}

/* ---------- Zones de tap : liens isolés à 44 px de haut ---------- */
.footer-links a,
.legal-back a,
.nav-logo {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
