/* ===== VARIABLES ===== */
:root {
    --title: "Orbitron", sans-serif;
    --body: "Roboto Mono", monospace;

    --black: #060708;
    --white: #f2f2f2;
    --accent: #AD91E4;
    --accent-half: #ad91e478;
    --accent-none: #ad91e400;
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--accent) var(--black);
}

body {
    background-color: var(--black);
    background-image:
        radial-gradient(circle 700px at 100% 0%, var(--accent-half), transparent),      /* haut droit : accent */
        radial-gradient(circle 600px at 0% 100%, rgb(242 242 242 / .15), transparent);  /* bas gauche : lumière */
    color: var(--white);
}

strong { color: var(--accent); }

/* Les attributs width/height des images servent à réserver la place au chargement
   (pas de décalage de mise en page) ; la hauteur réelle reste gérée par le CSS */
img { height: auto; }

/* Masqué à l'écran, mais lu par les lecteurs d'écran et les moteurs de recherche */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

a,
p {
    font-family: var(--body);
    font-size: 1rem;
    font-weight: lighter;
    color: var(--white);
    text-decoration: none;
}

h1, h2, h3 {
    font-family: var(--title);
    font-weight: bold;
}

h1 { font-size: 5rem; font-weight: bolder; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* ===== COINS COUPÉS : haut droit + bas gauche =====
   (--coupe est défini sur chaque élément) */
.links .important,
.list-competences .categorie,
.list-competences .categorie::before {
    clip-path: polygon(0 0,
            calc(100% - var(--coupe)) 0,
            100% var(--coupe),
            100% 100%,
            var(--coupe) 100%,
            0 calc(100% - var(--coupe)));
}

/* ===== HEADER ===== */
header {
    position: relative;
    display: flex;
    flex-direction: column;
    /* svh = hauteur stable : ne change pas quand la barre d'adresse mobile
       apparaît ou disparaît au scroll (dvh, lui, faisait tout sauter) */
    min-height: 100vh;
    min-height: 100svh;
    padding-top: 20px;
}

header svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 10px;
    z-index: -10;
}

header .header-main {
    padding: 75px 100px;
}

/* Header compact (pages autres que l'accueil) :
   le contenu de la page est visible dès l'arrivée */
/* Cadre en morceaux de taille fixe (ne se déforme jamais) :
   header des pages internes, et header de l'accueil sur mobile */
header .cadre {
    inset: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    padding: 0;
    overflow: visible;
}

.cadre-etiquette {
    font-family: var(--body);
    font-size: 10px;
    letter-spacing: .08em;
    fill: var(--white);
    opacity: .6;
}

.cadre-compact { display: none; }

@media (max-width: 1500px) {
    .cadre-large { display: none; }
    .cadre-compact { display: inline; }
}

/* Version mobile du cadre de l'accueil, masquée sur grand écran */
.cadre-mobile { display: none; }

header.header-page {
    min-height: 0;
    height: clamp(340px, 48svh, 460px);

    .header-main {
        display: flex;
        align-items: center;
        flex: 1;
        padding: 40px 100px;
    }

    .info { width: 100%; }
    .info p { width: auto; max-width: 60ch; }

    .deco { display: none; }
}

@media (max-width: 700px) {
    header.header-page {
        height: auto;
        min-height: 320px;

        .cadre-deco { display: none; }

        .header-main { padding: 40px 30px; }
    }
}

/* Nav */
nav {
    display: flex;
    gap: 30px;
    align-self: center;

    a {
        --coupe: 10px;

        position: relative;
        font-size: 16px;

        &::after {
            content: "";
            position: absolute;
            top: -10px;
            left: -10px;
            width: calc(100% + 20px);
            height: 10px;
            background-color: var(--accent-half);
            clip-path: polygon(0 0,
                    100% 0,
                    100% calc(100% - var(--coupe)),
                    calc(100% - var(--coupe)) 100%,
                    var(--coupe) 100%,
                    0 calc(100% - var(--coupe)));
            transform: scaleX(0);
            transition: transform .5s cubic-bezier(.2, .8, .2, 1);
        }

        &:hover::after,
        &.activ::after {
            transform: scaleX(1);
        }

        &.activ {
            color: var(--accent);
            font-weight: bold;
        }

        &.activ::after {
            background-color: var(--accent);
        }
    }
}

/* Boutons d'action (accueil, à propos…) */
.links {
    display: flex;
    gap: 30px;
}

.links a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--accent);
    isolation: isolate; /* garde les ::after derrière le texte */
    transition: color .3s, background-color .3s;

    img { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }

    /* trait dégradé sous le bouton secondaire */
    &::before {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 2px;
        background-image: linear-gradient(90deg, var(--accent-none), var(--accent), var(--accent-none));
        transition: transform .4s cubic-bezier(.2, .8, .2, 1), filter .3s;
    }

    /* fond qui monte depuis le trait au survol */
    &::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: linear-gradient(0deg, rgb(173 145 228 / .18), transparent);
        opacity: 0;
        transition: opacity .3s;
    }

    &:hover,
    &:focus-visible {
        color: var(--white);

        img { transform: translateX(5px); }

        &::before {
            transform: scaleX(1.15);
            filter: brightness(1.3) drop-shadow(0 0 4px var(--accent));
        }

        &::after { opacity: 1; }
    }

    &.important {
        --coupe: 10px;

        background-color: var(--accent);
        color: var(--black);
        font-weight: bold;

        &::after {
            /* reflet qui balaie le bouton */
            background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / .45) 50%, transparent 70%);
            opacity: 1;
            transform: translateX(-120%);
            transition: transform .6s ease;
            pointer-events: none;
        }

        &:hover,
        &:focus-visible {
            background-color: #c3adef;
            color: var(--black);

            &::after { transform: translateX(120%); }
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .links a,
    .links a img,
    .links a::before,
    .links a::after { transition: none; }
}

/* Présentation */
.info {
    display: flex;
    flex-direction: column;
    gap: 20px;

    h1 {
        display: flex;
        flex-direction: column;
        line-height: 5rem;
    }

    p { width: 40%; }

    .social {
        display: flex;
        gap: 20px;
        margin-top: 100px;

        * { height: 40px; }
    }
}

/* Planète 3D et fond d'étoiles */
#planete {
    position: absolute;
    right: 100px;
    top: 50%;
    transform: translateY(-50%);
    width: 500px;
    aspect-ratio: 1;

    canvas {
        display: block;
        width: 100%;
        height: 100%;
    }
}

/* Trou noir 3D (accueil) : plus large que haut, à cause du disque */
#trou-noir {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: min(55vw, 820px);
    aspect-ratio: 4 / 3;
    pointer-events: none;

    canvas {
        display: block;
        width: 100%;
        height: 100%;
    }
}

#etoiles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -15; /* devant le dégradé, derrière le contour svg */
}

/* ===== SECTIONS (hors header) ===== */
main {
    padding: 20px;
}

main > section {
    margin-top: 150px;
}

.title {
    position: relative;
    display: flex;

    h2 {
        position: absolute;
        align-self: center;
        left: 100px;
    }
}

/* ===== PROJETS ===== */
.list-projets {
    overflow: hidden;
    touch-action: pan-y; /* glisser horizontal géré en JS, scroll vertical laissé au navigateur */
    margin: 30px 0;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); /* fondu sur les bords */

    .piste {
        display: flex;
    width: max-content;
    animation: defile var(--duree, 30s) linear infinite;
    }

    a {
        --coupe: 20px;

        flex: 0 0 640px;
        display: grid;
        grid-template-columns: 1fr 260px;
        gap: 20px;
        margin-right: 40px; /* et non "gap" : sinon la boucle saute */
        opacity: .5;
        transition: .5s ease;
        transition-property: opacity, transform;

        &:hover {
            opacity: 1;
            transform: scale(1.02);
        }

        > img {
            width: 100%;
            height: 180px;
            object-fit: cover;
            background-color: #d9d9d9;
            clip-path: polygon(0 0,
                    100% 0,
                    100% calc(100% - var(--coupe)),
                    calc(100% - var(--coupe)) 100%,
                    0 100%);
        }

        .text {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        p {
            font-size: .9rem;
            opacity: .8;
        }

        .techs {
            display: flex;
            gap: 20px;
            margin-top: auto;

            img { height: 30px; }
        }
    }
}

@keyframes defile {
    to { transform: translateX(calc(-1 * var(--boucle, 50%))); }
}

/* ===== COMPÉTENCES ===== */
.competences .title {
    justify-self: end;

    img { transform: rotateY(180deg); }

    h2 {
        left: unset;
        right: 100px;
    }
}

.carousel-competences {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 460px;
    margin-top: 30px;
    overflow: hidden;
}

.list-competences {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 440px;

    .categorie {
        --coupe: 30px;
        --epaisseur: 1px;

        position: absolute;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 380px;
        min-height: 330px;
        padding: 30px 28px;
        text-align: center;
        background: var(--accent); /* sert de bordure */
        isolation: isolate;
        opacity: .4;
        transform: translateX(0) scale(.65);
        z-index: 1;
        cursor: pointer;
        transition: transform .9s ease, opacity 1s ease, filter .5s ease;

        /* fond intérieur */
        &::before {
            content: "";
            position: absolute;
            inset: var(--epaisseur);
            background: var(--black);
            z-index: 0;
            pointer-events: none;
        }

        > * {
            position: relative;
            z-index: 1;
        }

        &.active {
            transform: translateX(0) scale(1);
            opacity: 1;
            z-index: 5;
            filter: drop-shadow(0 0 10px #ad91e430);
            cursor: default;
        }

        &.gauche {
            transform: translateX(-310px) scale(.75);
            opacity: .65;
            z-index: 3;
        }

        &.droite {
            transform: translateX(310px) scale(.75);
            opacity: .65;
            z-index: 3;
        }

        &.cache-gauche,
        &.cache-droite {
            transform: translateX(0) scale(.3);
            opacity: 0;
            z-index: 0;
            pointer-events: none;
        }
    }
}

.categorie-desc {
    margin-top: 10px;
    font-size: .8rem;
    line-height: 1.5;
    opacity: .75;
}

.categorie ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 10px;
    margin: 22px 0 0;
    list-style: none;
}

/* Icône + nom de la techno */
.categorie li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 56px;

    img {
        display: block;
        width: 35px;
        height: 35px;
        object-fit: contain;
    }

    span {
        font-family: var(--body);
        font-size: .65rem;
        opacity: .8;
    }
}

/* Technos sans icône */
.categorie-plus {
    margin-top: 18px;
    font-size: .75rem;
    color: var(--accent);
}

/* Projets où la compétence a servi */
.categorie-projets {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--accent-half);
    font-size: .7rem;
    opacity: .7;

    a {
        font-size: inherit;
        color: var(--accent);
        pointer-events: none; /* cliquables seulement sur la carte active */

        &:hover { text-decoration: underline; }
    }
}

.categorie.active .categorie-projets a { pointer-events: auto; }

/* Flèches de navigation */
.carousel-btn {
    position: absolute;
    z-index: 10;
    width: 38px;
    height: 38px;
    border: 1px solid var(--accent);
    background: var(--black);
    color: var(--accent);
    cursor: pointer;
    transition: background .5s, color .2s;

    &:hover {
        background: var(--accent);
        color: var(--black);
    }

    &.precedent { left: 20px; }
    &.suivant { right: 20px; }
}

/* ===== BARRE DE SCROLL ===== */
#scroll-indicator {
    position: fixed;
    top: 0;
    right: 3px;
    width: 100px;
    height: 100vh;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease;

    &.visible { opacity: 1; }
}

#scroll-thumb {
    position: absolute;
    top: 0;
    right: 2px;
    width: 4px;
    min-height: 30px;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-half);
    transition: height .1s linear, top .1s linear;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .list-competences .categorie {
        width: min(300px, calc(100vw - 90px));
        padding: 24px 18px;

        &.gauche { transform: translateX(-150px) scale(.65); }
        &.droite { transform: translateX(150px) scale(.65); }
        &.cache-gauche { transform: translateX(-240px) scale(.45); }
        &.cache-droite { transform: translateX(240px) scale(.45); }
    }

    .carousel-btn.precedent { left: 5px; }
    .carousel-btn.suivant { right: 5px; }
}

/* ===== ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .list-projets .piste { animation: none; }
    .list-competences .categorie { transition: none; }
}

/* ===== PAGE PROJETS : liste ===== */
.grille-projets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 40px;
    margin: 40px 100px 100px;

    a {
        --coupe: 20px;

        display: flex;
        flex-direction: column;
        gap: 15px;
        opacity: .7;
        transition: .5s ease;
        transition-property: opacity, transform;

        &:hover,
        &:focus-visible {
            opacity: 1;
            transform: scale(1.02);
        }

        > img {
            width: 100%;
            aspect-ratio: 16 / 9;
            object-fit: cover;
            clip-path: polygon(0 0,
                    100% 0,
                    100% calc(100% - var(--coupe)),
                    calc(100% - var(--coupe)) 100%,
                    0 100%);
        }

        .text {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        p {
            font-size: .9rem;
            opacity: .8;
        }

        .techs {
            display: flex;
            gap: 20px;

            img { height: 30px; }
        }
    }
}

/* ===== PAGE D'UN PROJET ===== */
.page-projet {
    padding: 40px 100px 100px;

    .retour {
        color: var(--accent);
    }
}

/* Deux colonnes : fiche résumé (fixe au scroll) + sections détaillées */
.projet-contenu {
    --coupe: 20px;

    display: grid;
    grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
    gap: 80px;
    align-items: start;
    margin-top: 40px;

    p { line-height: 1.7; }

    code {
        color: var(--accent);
        font-family: var(--body);
    }

    .text {
        display: flex;
        flex-direction: column;
        gap: 70px;
    }

    .techs {
        display: flex;
        flex-wrap: wrap;
        gap: 18px;

        img { height: 30px; }
    }

    .techs-texte {
        font-size: .85rem;
        opacity: .7;
    }
}

/* Fiche résumé */
.projet-fiche {
    position: sticky;
    top: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;

    > img {
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        clip-path: polygon(0 0,
                100% 0,
                100% calc(100% - var(--coupe)),
                calc(100% - var(--coupe)) 100%,
                0 100%);
    }

    dl {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 12px 20px;
        padding: 20px 0;
        border-block: 1px solid var(--accent-half);
        font-family: var(--body);
        font-size: .85rem;
    }

    dt {
        color: var(--accent);
        font-size: .7rem;
        letter-spacing: .1em;
        text-transform: uppercase;
        padding-top: 2px;
    }

    dd { font-weight: lighter; }

    .liens {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;

        a,
        .lien-indisponible {
            --coupe: 10px;

            padding: 10px 20px;
            border-bottom: 2px solid var(--accent);
            color: var(--accent);
            font-family: var(--body);
        }

        a.important {
            background-color: var(--accent);
            color: var(--black);
            font-weight: bold;
            clip-path: polygon(0 0,
                    100% 0,
                    100% calc(100% - var(--coupe)),
                    calc(100% - var(--coupe)) 100%,
                    0 100%);
        }

        .lien-indisponible {
            border-bottom-style: dashed;
            opacity: .45;
            cursor: not-allowed;
        }
    }
}

/* Sections détaillées */
.projet-section {
    display: flex;
    flex-direction: column;
    gap: 18px;

    h2 { margin-bottom: 4px; }
}

.projet-statut {
    color: var(--accent);
    font-family: var(--body);
    font-size: .75rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.projet-points {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-left: 0;
    list-style: none;

    li {
        position: relative;
        padding-left: 26px;
        font-family: var(--body);
        font-weight: lighter;
        line-height: 1.7;

        &::before {
            content: "//";
            position: absolute;
            left: 0;
            color: var(--accent);
        }
    }

    strong { font-weight: bold; }
}

/* Équipe : prénom + rôle */
.projet-equipe {
    display: grid;
    grid-template-columns: auto 1fr;
    font-family: var(--body);

    dt,
    dd {
        padding: 14px 0;
        border-bottom: 1px solid var(--accent-half);
    }

    dt {
        padding-right: 30px;
        color: var(--accent);
        font-family: var(--title);
    }

    dd {
        font-weight: lighter;
        line-height: 1.6;
    }
}

@media (max-width: 1000px) {
    .projet-contenu { grid-template-columns: 1fr; gap: 60px; }
    .projet-fiche { position: static; max-width: 560px; }
}

@media (max-width: 700px) {
    .grille-projets { margin: 40px 0; }
    .page-projet { padding: 40px 20px; }
    .projet-equipe { grid-template-columns: 1fr; }
    .projet-equipe dt { padding-bottom: 0; border-bottom: none; }
}

/* ===== À PROPOS ===== */
.a-propos { font-family: var(--body); }

.apropos-contenu {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 70px;
    align-items: start;
    margin: 40px 100px 0;
}

.apropos-texte {
    > p {
        max-width: 62ch;
        line-height: 1.7;
        opacity: .85;
    }

    > p + p { margin-top: 16px; }

    > p a {
        color: var(--accent);
        border-bottom: 1px solid var(--accent-half);
        transition: border-color .2s;

        &:hover,
        &:focus-visible { border-color: var(--accent); }
    }

    .reference {
        display: block;
        margin-bottom: 14px;
        color: var(--accent);
        font-size: .75rem;
        letter-spacing: .12em;
    }
}

.apropos-texte > p.apropos-accroche {
    margin-bottom: 24px;
    font-family: var(--title);
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    font-weight: 600;
    line-height: 1.3;
    opacity: 1;
}

/* Trois piliers : concevoir / développer / déployer */
.apropos-piliers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 36px 0;
    padding: 0;
    list-style: none;

    li {
        position: relative;
        padding: 18px 16px 16px;
        border-top: 1px solid var(--accent-half);
        background: linear-gradient(180deg, rgb(173 145 228 / .07), transparent);
        transition: background .3s, border-color .3s;

        /* petit trait d'accent sur le bord haut */
        &::before {
            content: "";
            position: absolute;
            top: -1px;
            left: 0;
            width: 30px;
            height: 3px;
            background: var(--accent);
            transition: width .4s cubic-bezier(.2, .8, .2, 1);
        }

        &:hover {
            border-color: var(--accent);
            background: linear-gradient(180deg, rgb(173 145 228 / .14), transparent);
        }

        &:hover::before { width: 100%; }
    }

    span {
        color: var(--accent);
        font-size: .7rem;
        letter-spacing: .12em;
    }

    h3 {
        margin: 8px 0 6px;
        font-size: 1rem;
    }

    p {
        font-size: .8rem;
        line-height: 1.5;
        opacity: .7;
    }
}

/* Boutons : mêmes que l'accueil (.links) */
.apropos-actions { flex-wrap: wrap; }

/* Fiche profil : panneau à angles coupés (même technique que le formulaire de contact) */
.apropos-fiche {
    --coupe: 25px;
    --bordure: 1px;

    position: relative;
    isolation: isolate;
    padding: 28px 30px 30px;
    background: var(--accent-half);
    clip-path: polygon(0 0,
            calc(100% - var(--coupe)) 0,
            100% var(--coupe),
            100% 100%,
            var(--coupe) 100%,
            0 calc(100% - var(--coupe)));

    &::before {
        --coupe-int: calc(var(--coupe) - var(--bordure) * 0.414);

        content: "";
        position: absolute;
        inset: var(--bordure);
        z-index: -1;
        background:
            radial-gradient(circle 260px at 100% 0%, rgb(173 145 228 / .12), transparent),
            var(--black);
        clip-path: polygon(0 0,
                calc(100% - var(--coupe-int)) 0,
                100% var(--coupe-int),
                100% 100%,
                var(--coupe-int) 100%,
                0 calc(100% - var(--coupe-int)));
    }
}

.fiche-entete {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgb(242 242 242 / .15);
    font-size: .7rem;
    letter-spacing: .12em;
    color: var(--accent);
}

.fiche-statut {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    opacity: .8;

    /* voyant qui pulse */
    &::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #7be0a8;
        box-shadow: 0 0 8px #7be0a8;
        animation: voyant 2s ease-in-out infinite;
    }
}

@keyframes voyant {
    50% { opacity: .35; }
}

.fiche-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 22px 0 26px;

    div {
        padding: 0 14px;
        border-left: 1px solid rgb(242 242 242 / .1);

        &:first-child {
            padding-left: 0;
            border-left: none;
        }
    }

    dt {
        font-size: .65rem;
        letter-spacing: .1em;
        text-transform: uppercase;
        opacity: .55;
    }

    dd {
        margin: 6px 0 0;
        font-family: var(--title);
        font-size: 2rem;
        font-weight: 700;
        color: var(--accent);

        sup { font-size: .5em; }
    }
}

.fiche-label {
    display: block;
    margin-bottom: 16px;
    font-size: .7rem;
    letter-spacing: .12em;
    opacity: .55;
}

/* Parcours : frise verticale */
.fiche-parcours {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;

    li {
        position: relative;
        display: grid;
        padding: 0 0 20px 26px;

        /* trait vertical */
        &::before {
            content: "";
            position: absolute;
            top: 6px;
            bottom: -6px;
            left: 4px;
            width: 1px;
            background: linear-gradient(var(--accent-half), rgb(173 145 228 / .15));
        }

        /* losange */
        &::after {
            content: "";
            position: absolute;
            top: 5px;
            left: 0;
            width: 9px;
            height: 9px;
            background: var(--black);
            border: 1px solid var(--accent);
            transform: rotate(45deg);
            transition: background .3s;
        }

        &:last-child {
            padding-bottom: 0;

            &::before { display: none; }
        }

        &:hover::after { background: var(--accent); }

        &.en-cours::after {
            background: var(--accent);
            box-shadow: 0 0 10px var(--accent);
        }
    }

    .parcours-date {
        font-size: .65rem;
        letter-spacing: .1em;
        color: var(--accent);
    }

    a {
        justify-self: start;
        margin: 3px 0 2px;
        font-family: var(--title);
        font-size: 1rem;
        font-weight: 600;
        transition: color .2s;

        &:hover,
        &:focus-visible { color: var(--accent); }
    }

    .parcours-detail {
        font-size: .75rem;
        opacity: .6;
    }
}

@media (max-width: 1100px) {
    .apropos-contenu {
        grid-template-columns: 1fr;
        gap: 50px;
    }
}

@media (max-width: 700px) {
    .apropos-contenu { margin: 30px 0 0; }

    .apropos-piliers { grid-template-columns: 1fr; }

    .apropos-fiche { padding: 24px 20px; }

    .fiche-stats dd { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
    .fiche-statut::before { animation: none; }
}

/* ===== FOOTER ===== */
footer {
    --coupe: 10px;

    position: relative;
    margin-top: 150px;
    padding: 60px 100px 25px;
    background: linear-gradient(0deg, rgb(173 145 228 / .08), transparent);

    /* liseré dégradé en haut */
    &::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 2px;
        background-image: linear-gradient(90deg, var(--accent-none), var(--accent), var(--accent-none));
    }

    /* languette centrale, coins coupés en haut */
    &::after {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        translate: -50% 0;
        width: 140px;
        height: 10px;
        background-color: var(--accent);
        clip-path: polygon(var(--coupe) 0,
                calc(100% - var(--coupe)) 0,
                100% 100%,
                0 100%);
    }
}

.footer-contenu {
    display: grid;
    grid-template-columns: 1.5fr 1fr auto;
    gap: 40px;
    align-items: start;

    .footer-id p {
        margin-top: 10px;
        max-width: 40ch;
        font-size: .9rem;
        opacity: .7;
    }
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;

    a {
        position: relative;
        font-size: .9rem;

        /* soulignement qui se déploie depuis la gauche */
        &::after {
            content: "";
            position: absolute;
            bottom: -3px;
            left: 0;
            width: 100%;
            height: 1px;
            background: var(--accent);
            transform: scaleX(0);
            transform-origin: left;
            transition: transform .4s cubic-bezier(.2, .8, .2, 1);
        }

        &:hover {
            color: var(--accent);
        }

        &:hover::after {
            transform: scaleX(1);
        }
    }
}

.footer-social {
    display: flex;
    gap: 20px;

    a {
        transition: transform .3s ease, filter .3s ease;

        &:hover {
            transform: translateY(-3px);
            filter: drop-shadow(0 0 8px var(--accent));
        }
    }

    img {
        display: block;
        height: 40px;
    }
}

.footer-bas {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid rgb(242 242 242 / .1);
    font-size: .75rem;
    opacity: .6;

    span:first-child,
    span:last-child {
        color: var(--accent);
    }
}

@media (max-width: 700px) {
    footer {
        padding: 50px 30px 25px;
    }

    .footer-contenu {
        grid-template-columns: 1fr;
    }

    .footer-bas {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
}
/* =====================================================================
   MOBILE
   ===================================================================== */

/* Le site est sombre : on le dit au navigateur pour qu'il ne le
   « recolore » pas (mode sombre automatique de Chrome / Samsung Internet) */
:root { color-scheme: dark; }

/* --- Bouton burger (masqué sur grand écran) --- */
.menu-btn {
    display: none;
}

@media (max-width: 900px) {
    /* Bouton discret : trois traits violets sur fond translucide,
       toujours accessible (fixe en haut à droite) */
    .menu-btn {
        position: fixed;
        top: 18px;
        right: 18px;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        gap: 6px;
        width: 46px;
        height: 46px;
        padding: 0 11px;
        border: 1px solid var(--accent-half);
        border-radius: 0;
        background: rgb(6 7 8 / .55);
        backdrop-filter: blur(6px);
        cursor: pointer;

        span {
            display: block;
            width: 22px;
            height: 2px;
            background: var(--accent);
            transition: transform .35s ease, opacity .25s ease, width .35s ease;

            &:nth-child(2) { width: 14px; }
        }

        /* Croix quand le menu est ouvert */
        &[aria-expanded="true"] {
            border-color: var(--accent);

            span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
            span:nth-child(2) { opacity: 0; width: 0; }
            span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
        }

        &:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 3px;
        }
    }

    /* Menu plein écran */
    header > nav {
        position: fixed;
        inset: 0;
        z-index: 999;
        align-self: stretch; /* sinon le « center » du menu ordinateur le réduit à son contenu */
        flex-direction: column;
        justify-content: center;
        gap: 0;
        padding: 90px 32px 60px;
        background:
            radial-gradient(circle 420px at 100% 0%, var(--accent-half), transparent),
            var(--black);
        counter-reset: lien;
        opacity: 0;
        visibility: hidden;
        transition: opacity .35s ease, visibility .35s;

        &.ouvert {
            opacity: 1;
            visibility: visible;
        }

        a {
            display: flex;
            align-items: baseline;
            gap: 18px;
            padding: 18px 0;
            border-bottom: 1px solid var(--accent);
            font-family: var(--title);
            font-size: clamp(1.4rem, 7vw, 2rem);
            font-weight: bold;
            opacity: 0;
            transform: translateX(-20px);
            transition: opacity .4s ease, transform .4s ease, color .3s ease;

            /* Numéro « 01 // » devant chaque lien */
            &::before {
                counter-increment: lien;
                content: "0" counter(lien) " //";
                color: var(--accent);
                font-family: var(--body);
                font-size: .75rem;
                font-weight: normal;
                letter-spacing: .1em;
            }

            &::after { display: none; }
            &.activ { color: var(--accent); }
        }

        /* Les liens arrivent l'un après l'autre */
        &.ouvert a {
            opacity: 1;
            transform: none;

            &:nth-child(2) { transition-delay: .05s; }
            &:nth-child(3) { transition-delay: .1s; }
            &:nth-child(4) { transition-delay: .15s; }
            &:nth-child(5) { transition-delay: .2s; }
        }
    }

    /* Pas de scroll de la page derrière le menu ouvert */
    body.menu-ouvert { overflow: hidden; }
}

/* --- Mise en page petit écran --- */
@media (max-width: 700px) {
    /* Lueurs du fond réduites à la taille de l'écran */
    body {
        background-image:
            radial-gradient(circle 300px at 100% 0%, #ad91e44d, transparent),
            radial-gradient(circle 260px at 0% 100%, rgb(242 242 242 / .08), transparent);
    }

    h1 { font-size: clamp(2.6rem, 13vw, 4rem); }

    /* Header de l'accueil : le grand cadre (étiré) laisse place au cadre en morceaux */
    header:not(.header-page) > .header-main > svg:not(.cadre) { display: none; }
    .cadre-mobile { display: block; }
    .cadre-mobile .cadre-deco { display: none; }

    header .header-main { padding: 100px 24px 40px; }

    .info {
        h1 { line-height: 1.1; }
        p { width: 100%; }
    }

    .links { flex-wrap: wrap; gap: 16px; }
    .info .social { margin-top: 40px; }

    /* Trou noir sous le texte plutôt qu'à côté */
    #trou-noir {
        top: auto;
        bottom: 0;
        right: 50%;
        transform: translateX(50%);
        width: min(100%, 560px);
    }

    /* Sections */
    main > section { margin-top: 90px; }

    /* Ornement des titres de section, réduit à la largeur de l'écran */
    .title {
        img { width: 100%; height: auto; }
        h2 { left: 16%; font-size: 1.2rem; }
    }

    .competences .title h2 { right: 16%; }

    /* Cartes du carrousel de projets : image au-dessus du texte */
    .list-projets a {
        flex-basis: 280px;
        grid-template-columns: 1fr;
        gap: 14px;
        margin-right: 24px;

        > img { height: 160px; }
    }

    /* Compétences : plus de carrousel, une liste compacte des catégories */
    .carousel-competences {
        display: block;
        min-height: 0;
        margin-top: 20px;
        overflow: visible;
    }

    .carousel-btn { display: none; }

    .list-competences {
        flex-direction: column;
        gap: 14px;
        height: auto;
    }

    .list-competences .categorie,
    .list-competences .categorie:is(.active, .gauche, .droite, .cache-gauche, .cache-droite) {
        --coupe: 16px;

        position: relative;
        align-items: flex-start;
        width: 100%;
        min-height: 0;
        padding: 18px 20px;
        text-align: left;
        opacity: 1;
        transform: none;
        filter: none;
        pointer-events: auto;
        cursor: default;
    }

    .categorie h3 { font-size: 1.05rem; }
    .categorie-desc { display: none; }

    .categorie ul {
        justify-content: flex-start;
        gap: 14px 10px;
        margin-top: 14px;
    }

    /* Icônes seules : le nom reste lu par les lecteurs d'écran */
    .categorie li {
        width: auto;

        img { width: 26px; height: 26px; }

        span {
            position: absolute;
            width: 1px;
            height: 1px;
            overflow: hidden;
            clip-path: inset(50%);
            white-space: nowrap;
        }
    }

    .categorie-plus { margin-top: 10px; }

    .categorie-projets {
        align-self: stretch; /* séparateur sur toute la largeur de la carte */
        margin-top: 12px;
        padding-top: 10px;

        a { pointer-events: auto; }
    }
}

/* Crédit du modèle 3D (licence CC BY 4.0) */
.footer-credit {
    margin-top: 14px;
    font-size: .65rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-align: center;
    color: rgb(242 242 242 / .35);

    span {
        color: var(--accent);
        opacity: .7;
    }

    a {
        font-size: inherit;
        color: rgb(242 242 242 / .55);
        transition: color .2s;
    }

    a:hover,
    a:focus-visible {
        color: var(--accent);
    }
}
