/* ==================================================
   POLICES
================================================== */

@font-face { font-family: '3800'; src: url('fonts/TuskerGrotesk-3800Super.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: '4800'; src: url('fonts/TuskerGrotesk-4800Super.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: '6800'; src: url('fonts/TuskerGrotesk-6800Super.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'desirable'; src: url('fonts/DesirableCalligraphy.ttf') format('truetype'); font-display: swap; }

/* ==================================================
   VARIABLES
================================================== */

:root {
    --color-bg: #fff6e0;
    --color-primary: #111827;
    --color-jaune: #ffde21;
    --color-light-jaune: #ffeb79;
    --color-violet: #7f00ff;
    --color-light-violet: #b469ff;
    --color-border: #111827;

    --font-main: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
    --font-description: Georgia, 'Times New Roman', Times, serif;

    --space-s: 16px;
    --space-l: 64px;

    --radius-md: 16px;
    --radius-lg: 24px;

    /* Protège Lenis quoi qu'il arrive */
    scroll-behavior: auto !important;
}

/* ==================================================
   RESET
================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--color-bg);
    color: var(--color-primary);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, li { list-style: none; }

a:focus-visible,
.carte-comp:focus-visible,
.card-univers:focus-visible {
    outline: 3px solid var(--color-violet);
    outline-offset: 4px;
}

/* CSS requis par Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

/* ==================================================
   NAVIGATION
================================================== */

nav {
    width: 100%;
    position: fixed;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6vw;
    font-family: '3800', var(--font-main);
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary);
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ==================================================
   SECTIONS — BASE
================================================== */

section {
    min-height: 100vh;
    padding-top: 10vh;
}

#qui, #univers, #competences, #projets, #contact {
    position: relative;
    z-index: 1;
}

/* ==================================================
   ACCUEIL
================================================== */

#accueil {
    background-image: url(img/img-fond-hero.webp);
    background-position: center;
    background-size: cover;
    position: sticky;
    top: 0;
    height: 100vh;
}

#hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#raphael {
    font-family: '4800', var(--font-main);
    font-size: 30vw;
    color: var(--color-jaune);
}

#lecrosnier {
    font-family: 'desirable', cursive;
    color: var(--color-violet);
    font-size: 9.4vw;
    margin-top: -30.3vw;
    padding-left: 40vw;
}

/* ==================================================
   PHOTO
================================================== */

#bloc-img {
    position: fixed;
    bottom: -10vh;
    left: 12vw;
    transform: translateY(var(--dy, 0px));
    z-index: 50;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    height: 65vh;
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    padding-right: 7rem;
    will-change: transform;
    transition: opacity 0.4s ease;
}

/* Masquée quand le footer arrive à l'écran (sinon elle recouvre les liens) */
#bloc-img.cache-pied { opacity: 0; }

#img-hero {
    height: 70vh;
    width: auto;
    aspect-ratio: 206 / 370;
    border-radius: var(--radius-lg);
}

/* ==================================================
   QUI SUIS-JE ?
================================================== */

#qui {
    background-color: var(--color-light-violet);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#bloc-qui {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 40vw;
    width: 40vw;
    flex: 1;
}

#titre-qui {
    color: var(--color-jaune);
    font-family: '6800', var(--font-main);
    font-size: 10vh;
    font-weight: normal;
}

/* Photo affichée en haut de Qui suis-je sur mobile uniquement */
.img-qui-mobile { display: none; }

#description-qui {
    width: 100%;
    margin: 18vh 0 0;
    text-align: center;
    color: var(--color-bg);
    font-family: var(--font-description);
    font-size: 1.5rem;
}

/* ==================================================
   MON UNIVERS
================================================== */

/* La section fait 300vh : le bloc #univers-pin reste collé à l'écran
   pendant 200vh de défilement, le temps que le bus traverse */
#univers {
    height: 300vh;
    padding-top: 0;
}

#univers-pin {
    position: sticky;
    top: 0;
    height: 100vh;
    padding-top: 10vh;
    overflow: hidden;
}

.video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 56.25vw;
    min-width: 177.78vh;
    min-height: 100vh;
    z-index: 0;
    border: 0;
    pointer-events: none;
    object-fit: cover;
    filter: blur(4px) brightness(0.7);
}

#bus-univers {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;               /* le bus passe devant les cartes */
    pointer-events: none;
}

#main-univers {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5vh;
    pointer-events: none;     /* ne bloque jamais le survol des cartes */
}

#titre-univers {
    color: transparent;
    -webkit-text-stroke: 3px var(--color-bg);
    letter-spacing: 5px;
    font-family: '6800', var(--font-main);
    font-size: 10vh;
    font-weight: normal;
}

/* ----- Cartes révélées après le passage du bus ----- */

#cartes-univers {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    justify-content: space-evenly;
    align-items: flex-end;
    padding: 0 4vw 6vh;
    pointer-events: none;     /* seules les cartes visibles captent la souris */
}

.card-univers {
    width: min(28vw, 440px);
    height: 62vh;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px) brightness(1.3);
    -webkit-backdrop-filter: blur(10px) brightness(1.3);
    color: var(--color-bg);

    /* état caché : le bus n'est pas encore passé */
    opacity: 0;
    transform: translateY(60px) scale(0.92);
    pointer-events: none;
    transition: opacity 0.6s ease,
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                background-color 0.3s ease;
}

.card-univers.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.card-titre-univers {
    font-family: 'desirable', cursive;
    font-size: clamp(1.6rem, 2.4vw, 2.4rem);
    font-weight: bold;
    color: var(--color-jaune);
}

.card-indice {
    margin-top: 0.8rem;
    max-height: 2rem;
    font-family: var(--font-description);
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
}

/* Texte caché au départ, déployé au survol / focus clavier / tap */
.card-texte {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    font-family: var(--font-description);
    font-size: clamp(0.72rem, min(0.95vw, 1.9vh), 1rem);
    line-height: 1.45;
    transition: max-height 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s ease,
                margin 0.4s ease;
}

.card-texte p + p { margin-top: 0.8em; }

.card-univers.visible:hover,
.card-univers.visible:focus {
    background-color: rgba(17, 24, 39, 0.75);
}

.card-univers:hover .card-texte,
.card-univers:focus .card-texte {
    max-height: 46vh;
    opacity: 1;
    margin-top: 1rem;
}

.card-univers:hover .card-indice,
.card-univers:focus .card-indice {
    opacity: 0;
    max-height: 0;
    margin: 0;
}

/* ==================================================
   COMPÉTENCES
================================================== */

/* La section fait 150vh : #competences-pin reste collé à l'écran pendant 50vh
   de défilement (2-3 coups de molette), le temps que le petit bus traverse.
   Pour un trajet plus long ou plus court, change le 150vh. */
#competences {
    background-color: var(--color-bg);
    height: 150vh;
    min-height: 0;
    padding-top: 0;
}

#competences-pin {
    position: sticky;
    top: 0;
    height: 100vh;
    padding-top: 10vh;
    overflow-x: clip;
}

/* Petit bus en bas de la section, devant les cartes */
#bus-competences {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 26vh;
    z-index: 5;
    pointer-events: none;
}

#main-competences {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#titre-competences {
    color: var(--color-violet);
    font-family: '6800', var(--font-main);
    font-size: 10vh;
    font-weight: normal;
    margin-bottom: 5vh;
}

/* ----- Carrousel de cartes ----- */

#carrousel {
    position: relative;
    width: 100%;
    height: 640px;
    perspective: 1400px;
}

.carte-comp {
    position: absolute;
    top: 0;
    left: 50%;
    width: min(480px, 78vw);
    height: 600px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--color-light-jaune);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.7s ease,
                box-shadow 0.7s ease;
    will-change: transform;
}

.carte-comp[data-pos="centre"] {
    transform: translateX(-50%) scale(1);
    z-index: 3;
    box-shadow: 10px 10px 0 var(--color-border);
}

.carte-comp[data-pos="gauche"] {
    transform: translateX(-105%) scale(0.85) rotateY(14deg);
    z-index: 1;
    filter: brightness(0.82);
}

.carte-comp[data-pos="droite"] {
    transform: translateX(5%) scale(0.85) rotateY(-14deg);
    z-index: 1;
    filter: brightness(0.82);
}

/* Position de passage : la carte qui change de côté se glisse derrière celle du centre */
.carte-comp[data-pos="derriere"] {
    transform: translateX(-50%) scale(0.6);
    z-index: 0;
    filter: brightness(0.7);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.35s ease,
                box-shadow 0.35s ease;
}

.carte-titre {
    font-family: '6800', var(--font-main);
    font-size: 3.5rem;
    font-weight: normal;
    color: var(--color-violet);
    margin-bottom: 20px;
}

.competences-grille {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.competence {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 20px;
    margin-bottom: 10px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);

    /* animation d'apparition (décalée via --i) */
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--i, 0) * 100ms);
}

.competence.visible {
    opacity: 1;
    transform: translateY(0);
}

.outil {
    font-family: '6800', var(--font-main);
    font-size: 1.6rem;
    color: var(--color-violet);
}

.preuve {
    font-family: var(--font-description);
    font-size: 0.95rem;
}

/* ==================================================
   MES PROJETS — scroll horizontal
================================================== */

/* La hauteur de la section est recalculée en JS (écran + distance horizontale).
   #projets-pin reste collé à l'écran pendant que la piste défile vers la gauche. */
#projets {
    background-color: var(--color-light-violet);
    height: 600vh;
    min-height: 0;
    padding-top: 0;
}

#projets-pin {
    --pad: 6vw;
    --gap: 2vw;
    --carte: calc((100vw - 2 * var(--pad) - 2 * var(--gap)) / 3);   /* 3 cartes à l'écran */

    position: sticky;
    top: 0;
    height: 100vh;
    padding-top: 10vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}

.projets-fenetre {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: stretch;
    margin: 2vh 0;
}

#piste-projets {
    display: flex;
    align-items: stretch;
    width: max-content;
    position: relative;
    padding: 4px var(--pad) 14px;
    will-change: transform;
}

.groupe-projets {
    display: flex;
    gap: var(--gap);
}

/* espace supplémentaire entre deux catégories */
.groupe-projets + .groupe-projets { margin-left: 6vw; }

.groupe-projets[data-groupe="affiches"]      { --visuel: var(--color-light-violet); }
.groupe-projets[data-groupe="court-metrage"] { --visuel: var(--color-jaune); }
.groupe-projets[data-groupe="web"]           { --visuel: var(--color-primary); }
.groupe-projets[data-groupe="3d"]            { --visuel: var(--color-violet); }

.card-projet {
    flex: 0 0 var(--carte);
    width: var(--carte);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 8px 8px 0 var(--color-border);
    transition: transform 0.3s ease;
}

.card-projet:hover { transform: translateY(-6px); }

.projet-visuel {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: var(--visuel);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
}

.projet-visuel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.projet-visuel img.img-pleine {
    object-fit: contain;
}

.projet-titre {
    font-family: '6800', var(--font-main);
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    font-weight: normal;
    color: var(--color-violet);
}

/* ----- Titres du bas ----- */

#projets-onglets {
    display: flex;
    justify-content: center;
    gap: 6vw;
    padding: 1vh 0 4vh;
}

.onglet {
    position: relative;
    padding: 0 0.2em 0.15em;
    background: none;
    border: 0;
    font-family: '6800', var(--font-main);
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    color: var(--color-primary);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.onglet::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.onglet.actif { opacity: 1; }
.onglet.actif::after { transform: scaleX(1); }

.onglet:focus-visible {
    outline: 3px solid var(--color-violet);
    outline-offset: 4px;
}

/* ==================================================
   TITRES DE SECTION
================================================== */

.titre-provisoire {
    text-align: center;
    font-family: '6800', var(--font-main);
    font-size: 10vh;
    font-weight: normal;
    color: var(--color-violet);
}

/* Titre de Mes projets en couleur crème (le fond est violet clair) */
#titre-projets { color: var(--color-bg); }

/* ==================================================
   CONTACT
================================================== */

#contact {
    background-color: var(--color-light-jaune);
    padding-bottom: 10vh;
}

.contact-grille {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 4vw;
    width: min(1100px, 88vw);
    margin: 6vh auto 0;
}

/* ----- Réseaux ----- */

.contact-infos {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
}

.contact-intro {
    font-family: var(--font-description);
    font-size: clamp(1.2rem, 1.8vw, 1.7rem);
    line-height: 1.4;
    color: var(--color-primary);
}

.contact-liens {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-lien {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 6px 6px 0 var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-lien:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 var(--color-border);
}

.contact-icone {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-violet);
    color: var(--color-bg);
}

.contact-icone svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.contact-texte {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.contact-nom {
    font-family: '6800', var(--font-main);
    font-size: clamp(1.3rem, 1.7vw, 1.7rem);
    color: var(--color-violet);
}

.contact-detail {
    font-family: var(--font-description);
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

/* ----- Formulaire ----- */

.contact-form {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 10px 10px 0 var(--color-border);
}

.champ {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.champ label {
    font-family: '6800', var(--font-main);
    font-size: 1.3rem;
    color: var(--color-violet);
}

.champ input,
.champ textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-description);
    font-size: 1rem;
    color: var(--color-primary);
    background: #fff;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: none;
}

.champ textarea {
    min-height: 140px;
    resize: vertical;
}

.champ input:focus-visible,
.champ textarea:focus-visible {
    outline: 3px solid var(--color-violet);
    outline-offset: 2px;
}

.bouton-envoyer {
    align-self: flex-start;
    padding: 12px 28px;
    font-family: '6800', var(--font-main);
    font-size: 1.5rem;
    color: var(--color-bg);
    background: var(--color-violet);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 5px 5px 0 var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bouton-envoyer:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--color-border);
}

.bouton-envoyer:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 4px;
}

.contact-statut {
    min-height: 1.4em;
    font-family: var(--font-description);
    font-size: 0.95rem;
}

/* ==================================================
   FOOTER
================================================== */

footer {
    background-color: var(--color-primary);
    color: var(--color-bg);
    padding: 20px;
}

.footer-contenu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 30px 80px;
}

.footer-contenu a:hover { color: var(--color-light-jaune); }
.footer-contenu strong { color: var(--color-jaune); }
.footer-contenu p { margin: 5px 0 0; }

/* Toute la ligne du lien est cliquable (pas seulement le texte) */
.footer-contenu li a {
    display: block;
    padding: 2px 0;
}

.footer-bas {
    text-align: center;
    margin: 20px 0 0;
}

/* ==================================================
   CURSEUR PERSONNALISÉ
================================================== */

body, a, .card-univers, .carte-comp, .card-projet, .onglet, .bouton-envoyer {
    cursor: none;
}

/* .cursor = boîte centrée sur la souris.
   Le rond est dessiné par ::before, la flèche par le <svg> : chacun s'anime à part. */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, color 0.2s, opacity 0.3s;
    z-index: 9999;
    opacity: 0;
}

/* Le rond : noir par défaut, blanc avec la classe .blanc */
.cursor::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #000;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.2s ease 0.05s,
                background 0.2s;
}

.cursor.blanc { color: #000; }
.cursor.blanc::before { background: #fff; }

.cursor.visible { opacity: 1; }

.cursor span {
    position: relative;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
}

.cursor.hover {
    width: 90px;
    height: 90px;
}

.cursor.hover span { opacity: 1; }

/* ----- Flèche (liens du menu et du footer, titres du bas de Mes projets) -----
   La pointe de la flèche est posée sur la position réelle de la souris
   (left/top = centre moins le décalage de la pointe dans le dessin). */
.cursor svg {
    position: absolute;
    left: calc(50% - 1.8px);
    top: calc(50% - 1.8px);
    width: 20px;
    height: 25px;
    overflow: visible;
    opacity: 0;
    transform: scale(0.3) rotate(-35deg);
    transform-origin: 9% 7%;          /* la pointe : le dessin pivote et grandit autour d'elle */
    transition: transform 0.18s ease-in,
                opacity 0.12s ease 0.06s;
}

/* Le rond rétrécit et disparaît vite... */
.cursor.fleche::before {
    transform: scale(0.2);
    opacity: 0;
    transition: transform 0.15s ease-in,
                opacity 0.12s ease;
}

/* ...pendant que la flèche se déplie en pivotant, avec un petit rebond */
.cursor.fleche svg {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.12s ease;
}

.cursor.fleche span { opacity: 0; }

/* Écran tactile : pas de faux curseur */
@media (hover: none) {
    .cursor { display: none; }
    body, a, .card-univers, .carte-comp, .card-projet, .onglet, .bouton-envoyer,
    .champ input, .champ textarea { cursor: auto; }
}

/* ==================================================
   RESPONSIVE
================================================== */

@media (max-width: 1024px) {
    nav {
        gap: 3vw 4vw;
        font-size: 1.5rem;
    }

    #bloc-img {
        left: 6vw;
        height: 55vh;
        padding-right: 4rem;
    }

    #img-hero { height: 58vh; }

    #bloc-qui {
        margin-left: 34vw;
        width: 44vw;
    }

    #description-qui {
        left: 34vw;
        width: 44vw;
    }

    .carte-comp {
        width: min(420px, 80vw);
        height: 560px;
    }

    #carrousel { height: 600px; }
}

@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.5vh 4vw;
        padding: 10px var(--space-s);
        font-size: 1.15rem;
    }

    #hero { padding-top: 12vh; }

    #lecrosnier {
        padding-left: 20vw;
        margin-top: -28vw;
    }

    /* La photo fixe recouvrirait le texte : on la masque et on met
       une photo en haut de section + le texte en bas */
    #bloc-img { display: none; }

    /* Sur mobile : display:contents permet de réordonner titre / photo / texte
       directement dans le flex de #qui */
    #bloc-qui { display: contents; }

    #titre-qui { order: 1; }

    /* Photo plus petite, même fond crème que la version PC */
    .img-qui-mobile {
        display: block;
        order: 2;
        width: min(38vw, 170px);
        height: auto;
        aspect-ratio: 372 / 670;
        margin: 0 auto;
        padding: 10px;
        background: var(--color-bg);
        border-radius: var(--radius-lg);
        box-sizing: border-box;
    }

    /* Texte en bas de section */
    #description-qui {
        order: 3;
        width: 90vw;
        margin: auto 0 6vh;
        font-size: 1.1rem;
    }

    #titre-qui,
    #titre-univers,
    #titre-competences,
    .titre-provisoire { font-size: 8vh; }

    #bloc-qui {
        margin-left: 0;
        width: 90vw;
    }

    #description-qui {
        width: 100%;
        margin-top: 12vh;
        font-size: 1.1rem;
    }

    /* Cartes de Mon univers : empilées en bas de l'écran */
    #cartes-univers {
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 1.5vh;
        padding-bottom: 4vh;
    }

    .card-univers {
        width: 86vw;
        height: auto;
        min-height: 16vh;
        padding: 1rem;
    }

    .card-univers:hover .card-texte,
    .card-univers:focus .card-texte { max-height: 30vh; }

    #bus-competences { height: 20vh; }

    /* Carrousel compétences : hauteur réduite pour des cartes plus petites */
    #carrousel {
        height: min(540px, 56vh);
    }
    .carte-comp {
        height: 100%;
        width: min(320px, 84vw);
        padding: 16px 12px;
    }
    .carte-titre { font-size: 2rem; margin-bottom: 10px; }
    .competence { padding: 6px 10px; margin-bottom: 6px; }
    .outil { font-size: 1.15rem; }
    .preuve { font-size: 0.85rem; }

    /* Mes projets : cartes élargies, un peu plus d'une à l'écran */
    #projets-pin {
        --pad: 6vw;
        --gap: 4vw;
        --carte: 84vw;
    }
    .groupe-projets + .groupe-projets { margin-left: 8vw; }
    #projets-onglets {
        flex-wrap: wrap;
        gap: 1vh 4vw;
    }
    .onglet { font-size: 1.2rem; }

    /* Contact : réseaux au-dessus, formulaire en dessous */
    .contact-grille {
        flex-direction: column;
        width: 90vw;
        gap: 32px;
    }
    .contact-form { padding: 20px; }

    .carte-comp[data-pos="gauche"] { transform: translateX(-85%) scale(0.8) rotateY(14deg); }
    .carte-comp[data-pos="droite"] { transform: translateX(-15%) scale(0.8) rotateY(-14deg); }
}

/* Téléphone : titres centrés + cartes compétences compactes */
@media (max-width: 600px) {
    #main-univers,
    #main-competences {
        align-items: center;
    }

    #titre-univers,
    #titre-competences {
        align-self: center;
        text-align: center;
        margin-inline: auto;
    }

    #carrousel { height: min(460px, 46vh); }

    .carte-comp {
        width: min(260px, 90vw);
        padding: 10px 8px;
    }
    .carte-titre { font-size: 1.45rem; margin-bottom: 6px; }
    .competence { padding: 3px 8px; margin-bottom: 4px; }
    .outil { font-size: 0.95rem; }
    .preuve { font-size: 0.75rem; }
}

@media (max-width: 480px) {
    nav {
        font-size: 1rem;
        gap: 1vh 3vw;
    }

    #lecrosnier { font-size: 8.6vw; }

    #titre-qui,
    #titre-univers,
    #titre-competences,
    .titre-provisoire { font-size: 6.5vh; }

    .card-titre-univers { font-size: 1.4rem; }

    #projets-onglets { gap: 1vh 3vw; }
    .onglet { font-size: 1.05rem; }

    .carte-titre { font-size: 1.7rem; }
    .outil { font-size: 1rem; }
    .preuve { font-size: 0.8rem; }
    .competence { padding: 5px 8px; margin-bottom: 5px; }

    .bouton-envoyer { font-size: 1.2rem; padding: 10px 20px; }

    .contact-icone { width: 40px; height: 40px; }
    .contact-icone svg { width: 20px; height: 20px; }

    .modal-content h2 { font-size: 22px; }
}

/* ==================================================
   MOUVEMENT RÉDUIT
================================================== */

@media (prefers-reduced-motion: reduce) {
    .carte-comp { transition: none; }

    .competence {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .card-univers,
    .card-texte,
    .card-indice,
    .card-projet,
    .onglet,
    .onglet::after,
    .cursor::before,
    .cursor svg,
    .contact-lien,
    .bouton-envoyer { transition: none; }
}

/* ==================================================
   MODALS PROJETS
================================================== */

body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    overflow: auto;
    box-shadow: 8px 8px 0 var(--color-border);
}

.modal-centrer {
    display: flex;
    gap: 50px;
    align-items: center;
}

.modal-image {
    display: flex;
    align-items: center;
}

.modal-image img,
.modal-image iframe {
    width: 400px;
    height: 600px;
    display: block;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    object-fit: contain;
    background: #fff;
}

.modal-image iframe {
    border: none;
}

.modal-lien {
    display: block;
}

.modal-lien img {
    transition: opacity 0.2s ease;
}

.modal-lien:hover img {
    opacity: 0.85;
}

.modal-image iframe.modal-video {
    width: min(800px, 80vw);
    height: auto;
    aspect-ratio: 16 / 9;
    background: #000;
}

.modal-image iframe.modal-site {
    width: min(800px, 80vw);
    height: 70vh;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
}

.modal-site-indispo {
    width: min(800px, 80vw);
    height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 20px;
    font-family: var(--font-description);
    color: var(--color-primary);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
}

.lien-site {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: var(--color-jaune);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: '6800', var(--font-main);
    color: var(--color-primary);
    text-decoration: none;
}

.lien-site:hover {
    background: var(--color-violet);
    color: #fff;
}

.modal-image video {
    width: min(800px, 80vw);
    display: block;
    border-radius: var(--radius-md);
}

.modal-infos {
    width: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-content h2 {
    text-align: center;
    font-family: '6800', var(--font-main);
    font-size: 40px;
    font-weight: normal;
    color: var(--color-primary);
}

.modal-infos p {
    font-family: var(--font-description);
    color: var(--color-primary);
}

.modal-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 0 var(--radius-lg) 0 0;
    background: var(--color-jaune);
    font-family: '6800', var(--font-main);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

.modal-btn:hover {
    background: var(--color-violet);
    color: #fff;
}

@media (max-width: 900px) {
    .modal-content {
        padding: 24px;
        gap: 20px;
    }

    .modal-centrer {
        flex-direction: column;
        gap: 20px;
    }

    .modal-image img,
    .modal-image iframe {
        width: min(400px, 80vw);
        height: 60vh;
    }

    .modal-infos {
        width: min(320px, 85vw);
    }

    .modal-content h2 {
        font-size: 28px;
    }
}