/* =========================================================
   Théo Mauhin — Portfolio (theomauhin.fr)
   Thème « netrunner » : on scanne et on décrypte le profil.
   Palette reprise du thème VS Code « Cyberpunk 2077 » (spicyhek),
   la même que le Website International et OdinFinance.

   Sommaire (chercher le titre « ---------- Nom ---------- ») :
     Polices · Variables de design · Langue · Remise à zéro / base · Boutons · Header
     Hero (portrait scanné) · Sections · À propos · Frise · Projets · Compétences · Références
     Loisirs · Contact · Footer · Pop-ups · Pages projet · Mentions légales · Page simple (404)
     Séquence de démarrage · Glitch du changement de langue · Effets désactivés · Responsive

   Règle d'or : les couleurs, polices et tailles communes sont dans les variables (:root).
   Pour changer une couleur partout, on la change une seule fois là-bas.
   ========================================================= */

/* ---------- Polices (hébergées sur le site : aucun service externe) ---------- */
@font-face {
    font-family: "Cyberpunk";
    src: url("../assets/fonts/Cyberpunk.otf") format("opentype");
    font-display: swap;
}

/* Oxanium est une police variable : une seule fichier pour toutes les graisses */
@font-face {
    font-family: "Oxanium";
    src: url("../assets/fonts/Oxanium.woff2") format("woff2");
    font-weight: 200 800;
    font-display: swap;
}

@font-face {
    font-family: "BlenderPro";
    src: url("../assets/fonts/BlenderProBook.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

/* ---------- Variables de design ---------- */
:root {
    /* fonds (editor.background = #160000) */
    --bg: #160000;
    --bg-raised: #200404;
    --bg-panel: #2a0909;
    --bg-hover: #340d0d;

    /* texte */
    --text: #ecdede;
    --text-muted: #c4a9a9;

    /* accents : le cyan est la lumière du scanner, le saumon les titres et les étiquettes */
    --cyan: #5aedf4;
    --cyan-soft: rgba(90, 237, 244, 0.5);
    --cyan-faint: rgba(90, 237, 244, 0.12);
    --salmon: #ff9393;
    --red: #ff5c5c;
    --yellow: #e5c07b;
    --green: #98c379;

    /* traits */
    --line: rgba(255, 147, 147, 0.2);
    --line-strong: rgba(255, 147, 147, 0.5);

    /* polices */
    --font-display: "Cyberpunk", "Oxanium", sans-serif;
    --font-head: "Oxanium", "Segoe UI", sans-serif;
    --font-body: "BlenderPro", "Segoe UI", sans-serif;

    /* mise en page */
    --container: 1200px;
    --gutter: clamp(16px, 4vw, 40px);
    --header-height: 64px;
    --cut: 14px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Langue : on n'affiche que les textes de la langue choisie ----------
   Chaque texte existe deux fois : <span lang="fr"> et <span lang="en">.
   <html lang="..."> est réglé par le petit script du <head>. */
html[lang="fr"] body [lang="en"],
html[lang="en"] body [lang="fr"] {
    display: none !important;
}

/* ---------- Remise à zéro / base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
    scrollbar-color: var(--line-strong) var(--bg);
    scrollbar-gutter: stable;
}

/* fond sombre, texte clair, police de lecture Blender Pro */
body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.55;
    caret-color: var(--cyan);
    -webkit-font-smoothing: antialiased;
}

/* grille de 64 px et lignes de balayage sur toute la page */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px),
        linear-gradient(rgba(255, 147, 147, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 147, 147, 0.045) 1px, transparent 1px);
    background-size: auto, 64px 64px, 64px 64px;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* tous les titres en Oxanium, équilibrés sur plusieurs lignes (text-wrap: balance) */
h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 500;
    line-height: 1.15;
    text-wrap: balance;
}

p {
    margin: 0 0 1em;
}

/* listes sans puces ni marges par défaut : chaque composant pose les siennes */
ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* liens en cyan, soulignement fin un peu décalé */
a {
    color: var(--cyan);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

a:hover {
    color: #fff;
}

/* le gras du texte courant s'affiche en saumon plutôt qu'en gras */
strong {
    font-weight: 400;
    color: var(--salmon);
}

/* texte surligné à la souris, aux couleurs du thème */
::selection {
    background: rgba(90, 237, 244, 0.5);
    color: #fff;
}

/* contour rouge visible seulement à la navigation au clavier (accessibilité) */
:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
}

/* barre de défilement assortie (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-panel);
    border: 1px solid var(--line-strong);
}

/* texte lu par les lecteurs d'écran mais invisible à l'écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* lien « Aller au contenu » : caché, il apparaît quand on l'atteint avec Tab */
.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 200;
    padding: 8px 16px;
    background: var(--cyan);
    color: var(--bg);
    font-family: var(--font-head);
}

.skip-link:focus {
    top: 12px;
}

/* colonne centrée (1200 px au maximum) avec des marges qui s'adaptent à l'écran */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* icônes du sprite écrit par layout.js : un contour qui prend la couleur du texte */
.icon {
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* logos GitHub et LinkedIn : formes pleines */
.icon--fill {
    fill: currentColor;
    stroke: none;
}

/* étiquette de donnée : petites capitales espacées, comme les libellés d'un scanner */
.label {
    color: var(--salmon);
    font-family: var(--font-head);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-height: 44px;
    padding: 0.65em 1.4em;
    border: 1px solid var(--cyan);
    background: transparent;
    color: var(--cyan);
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    transition: background-color 0.2s, color 0.2s;
}

.btn:hover {
    background: rgba(90, 237, 244, 0.14);
    color: #fff;
}

/* action principale : fond cyan plein */
.btn--primary {
    background: var(--cyan);
    color: var(--bg);
}

.btn--primary:hover {
    background: #9df6fa;
    color: var(--bg);
}

/* variante compacte (bouton CV du header) */
.btn--small {
    min-height: 36px;
    padding: 0.4em 1em;
    font-size: 0.85rem;
}

.btn .icon {
    transition: transform 0.25s var(--ease-out);
}

.btn:hover .i-arrow-move {
    transform: translateX(4px);
}

/* bouton carré avec seulement une icône (fermer, burger) */
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.icon-btn:hover {
    color: var(--cyan);
    border-color: var(--cyan);
}

/* lien texte en capitales avec une flèche qui avance au survol */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-head);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.95rem;
}

.link-arrow .icon {
    transition: transform 0.25s var(--ease-out);
}

.link-arrow:hover .icon {
    transform: translateX(4px);
}

/* rangée d'étiquettes qui passe à la ligne si besoin */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* étiquette : technologies en cyan */
.tag {
    padding: 4px 10px;
    border: 1px solid var(--cyan-soft);
    color: var(--cyan);
    font-family: var(--font-head);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* compétences acquises en saumon */
.tag--warm {
    border-color: var(--line-strong);
    color: var(--salmon);
}

/* technologie prévue mais pas encore utilisée : contour en pointillés */
.tag--planned {
    border-style: dashed;
    border-color: var(--line-strong);
    color: var(--text-muted);
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    background: rgba(22, 0, 0, 0.94);
    border-bottom: 1px solid var(--line);
}

/* logo à gauche, puis menu, outils et burger */
.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
}

/* « TM » en police Cyberpunk, avec une ombre cyan décalée ; margin-right: auto pousse le reste à droite */
.logo {
    margin-right: auto;
    font-family: var(--font-display);
    font-size: 1.9rem;
    color: var(--salmon);
    text-decoration: none;
    text-shadow: 2px 2px 0 rgba(90, 237, 244, 0.55);
}

.logo:hover {
    color: var(--salmon);
}

/* menu principal (sur petit écran, il devient un panneau plein écran : voir Responsive) */
.site-nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* lien du menu ; un trait cyan s'étire dessous au survol et sur la section en cours (aria-current, posé par main.js) */
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    color: var(--text);
    font-family: var(--font-head);
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 2px;
    background: var(--cyan);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease-out);
}

.nav-link:hover,
.nav-link[aria-current] {
    color: var(--cyan);
}

.nav-link:hover::after,
.nav-link[aria-current]::after {
    transform: scaleX(1);
}

/* outils du header : langue, effets, CV */
.header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* sélecteur de langue FR | EN */
.lang-switch {
    display: inline-flex;
    border: 1px solid var(--line-strong);
}

.lang-switch button {
    min-width: 44px;
    height: 36px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-head);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.lang-switch button:hover {
    color: var(--cyan);
}

.lang-switch button[aria-pressed="true"] {
    background: var(--salmon);
    color: var(--bg);
    cursor: default;
}

/* interrupteur des effets visuels */
.fx-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-head);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
}

.fx-toggle:hover {
    color: var(--cyan);
    border-color: var(--cyan);
}

.fx-switch {
    position: relative;
    width: 26px;
    height: 12px;
    border: 1px solid currentColor;
}

.fx-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 6px;
    background: currentColor;
    transition: transform 0.2s var(--ease-out);
}

.fx-toggle[aria-pressed="true"] {
    color: var(--cyan);
}

.fx-toggle[aria-pressed="true"] .fx-switch::after {
    transform: translateX(12px);
}

/* bouton burger : caché sur grand écran */
.nav-toggle {
    display: none;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
}

/* deux colonnes : texte à gauche, scanner à droite ; hauteur proche de celle de l'écran */
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
    gap: clamp(24px, 4vw, 56px);
    min-height: min(calc(100svh - var(--header-height) - 48px), 760px);
    padding-top: clamp(40px, 6vw, 72px);
    padding-bottom: clamp(32px, 4vw, 48px);
}

/* le nom en police Cyberpunk (capitales seulement), décrypté au chargement par main.js */
.hero-name {
    margin-bottom: 20px;
    font-family: var(--font-display);
    font-size: clamp(3rem, 8.4vw, 6rem);
    font-weight: 400;
    line-height: 0.95;
    color: var(--salmon);
    text-shadow: 3px 3px 0 rgba(90, 237, 244, 0.6);
    text-transform: uppercase;
    word-spacing: 0.1em;
}

/* rôle en capitales cyan sous le nom */
.hero-role {
    margin-bottom: 22px;
    color: var(--cyan);
    font-family: var(--font-head);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* phrase d'accroche, en grand pour être lue en premier */
.hero-intro {
    max-width: 33em;
    margin-bottom: 32px;
    font-size: clamp(1.2rem, 2.1vw, 1.42rem);
    line-height: 1.45;
}

/* boutons « Voir mes projets » et « Voir mon CV » */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* ----- Le scanner : portrait, cadre à coins, ligne de balayage et étiquettes ----- */
.scanner {
    position: relative;
    margin: 0 0 0 auto;
    width: min(100%, 480px);
}

/* cadre du portrait : quatre coins cyan dessinés avec des dégradés, fond rouge sombre et halo saumon */
.scanner-frame {
    position: relative;
    padding: 34px 24px 0;
    background:
        linear-gradient(var(--cyan), var(--cyan)) top left / 22px 2px no-repeat,
        linear-gradient(var(--cyan), var(--cyan)) top left / 2px 22px no-repeat,
        linear-gradient(var(--cyan), var(--cyan)) top right / 22px 2px no-repeat,
        linear-gradient(var(--cyan), var(--cyan)) top right / 2px 22px no-repeat,
        linear-gradient(var(--cyan), var(--cyan)) bottom left / 22px 2px no-repeat,
        linear-gradient(var(--cyan), var(--cyan)) bottom left / 2px 22px no-repeat,
        linear-gradient(var(--cyan), var(--cyan)) bottom right / 22px 2px no-repeat,
        linear-gradient(var(--cyan), var(--cyan)) bottom right / 2px 22px no-repeat,
        radial-gradient(ellipse 70% 60% at 50% 70%, rgba(255, 147, 147, 0.16), transparent 70%),
        var(--bg-raised);
    border: 1px solid var(--line);
    overflow: hidden;
}

/* lignes de balayage par-dessus la photo */
.scanner-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(22, 0, 0, 0.22) 0 1px, transparent 1px 3px);
}

/* le portrait détouré (fond transparent) */
.scanner-photo {
    position: relative;
    z-index: 1;
    width: 100%;
    filter: contrast(1.05) saturate(0.92);
}

/* la ligne de balayage : un trait cyan suivi d'une traîne */
.scan-beam {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 3;
    height: 90px;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(90, 237, 244, 0.16) 85%, var(--cyan) 98%, transparent);
    opacity: 0;
    transform: translateY(-100%);
}

.is-scanning .scan-beam {
    animation: beam 1.6s linear;
}

@keyframes beam {
    0% { opacity: 1; transform: translateY(-100%); }
    92% { opacity: 1; }
    100% { opacity: 0; transform: translateY(var(--beam-end, 600px)); }
}

/* étiquettes « relevé » épinglées au portrait */
.scan-tags {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

/* étiquette « relevé » posée sur le portrait (libellé saumon + valeur) */
.scan-tag {
    position: absolute;
    display: grid;
    gap: 2px;
    max-width: 230px;
    padding: 8px 12px;
    background: rgba(22, 0, 0, 0.92);
    border: 1px solid var(--cyan-soft);
    font-family: var(--font-head);
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--text);
    pointer-events: auto;
}

.scan-tag .label {
    font-size: 0.7rem;
}

/* trait qui relie l'étiquette au portrait */
.scan-tag::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 36px;
    height: 1px;
    background: var(--cyan-soft);
}

.scan-tag::before {
    content: "";
    position: absolute;
    top: calc(50% - 3px);
    width: 7px;
    height: 7px;
    border: 1px solid var(--cyan);
    background: var(--bg);
    transform: rotate(45deg);
}

.scan-tag--left::after { left: 100%; }
.scan-tag--left::before { left: calc(100% + 34px); }
.scan-tag--right::after { right: 100%; }
.scan-tag--right::before { right: calc(100% + 34px); }

/* les étiquettes débordent un peu du cadre, sans jamais mordre sur la colonne de texte */
.scan-tag--1 { top: 24%; left: -36px; }
.scan-tag--2 { top: 52%; right: -24px; }
.scan-tag--3 { bottom: 10%; left: -28px; }

.status-value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--green);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

/* les étiquettes restent toujours visibles : le balayage les fait juste « s'allumer » l'une après l'autre */
.scanner.is-scanned .scan-tag {
    animation: tag-lock 0.7s var(--ease-out);
}

.scanner.is-scanned .scan-tag--2 { animation-delay: 0.15s; }
.scanner.is-scanned .scan-tag--3 { animation-delay: 0.3s; }

@keyframes tag-lock {
    0% {
        border-color: var(--cyan);
        background-color: rgba(90, 237, 244, 0.22);
        transform: translateX(-5px);
    }
    100% {
        border-color: var(--cyan-soft);
        background-color: rgba(22, 0, 0, 0.92);
        transform: none;
    }
}

/* barre d'état, comme la barre du bas de VS Code */
.status-bar {
    position: relative;
    z-index: 2;
    background: var(--bg-raised);
    border-top: 1px solid var(--salmon);
    border-bottom: 1px solid var(--line);
    font-family: var(--font-head);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.status-bar ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 28px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.status-bar li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-bar .status-value {
    font-weight: 500;
}

/* ---------- Sections ---------- */
.section {
    padding: clamp(72px, 9vw, 120px) 0 0;
}

.home-main > .section:last-child {
    padding-bottom: clamp(72px, 9vw, 120px);
}

/* titre de section : grand, en capitales saumon, décrypté par main.js quand il arrive à l'écran */
.section-title {
    display: block;
    margin-bottom: 40px;
    color: var(--salmon);
    font-size: clamp(2rem, 4.5vw, 3.1rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* trait fin avec une encoche sous les titres */
.section-title::after {
    content: "";
    display: block;
    width: min(100%, 520px);
    height: 6px;
    margin-top: 14px;
    background: var(--salmon);
    clip-path: polygon(0 0, 0 100%, 18% 100%, calc(18% + 4px) 2px, 100% 2px, 100% 0);
}

/* phrase d'introduction sous un titre de section */
.section-lead {
    max-width: 62ch;
    margin: -12px 0 40px;
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* panneaux avec un coin coupé */
.panel {
    position: relative;
    padding: 26px 28px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}

.panel h3 {
    margin-bottom: 16px;
    color: var(--cyan);
    font-size: 1.2rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* relevé de données : libellé à gauche, valeur à droite, pointillés entre les deux */
.readout {
    display: grid;
    margin: 0;
}

.readout > div {
    display: grid;
    grid-template-columns: 9.5em 1fr;
    gap: 14px;
    align-items: baseline;
    padding: 11px 0;
    border-bottom: 1px dashed var(--line);
}

.readout > div:last-child {
    border-bottom: 0;
}

.readout dt {
    color: var(--salmon);
    font-family: var(--font-head);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.readout dd {
    margin: 0;
}

/* ---------- À propos ---------- */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 64px);
    align-items: start;
}

.about-text {
    max-width: 62ch;
    font-size: 1.25rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* ---------- Frise (formation, expériences) ---------- */
.timeline {
    position: relative;
    padding-left: 34px;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 7px;
    width: 1px;
    background: var(--cyan-soft);
}

.timeline > li {
    position: relative;
    margin-bottom: 24px;
}

.timeline > li:last-child {
    margin-bottom: 0;
}

.timeline > li::before {
    content: "";
    position: absolute;
    top: 30px;
    left: -33px;
    width: 13px;
    height: 13px;
    background: var(--bg);
    border: 2px solid var(--cyan);
    transform: rotate(45deg);
}

.timeline > li.is-current::before {
    background: var(--cyan);
}

/* en-tête d'une étape : titre et lieu à gauche, date à droite */
.entry-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 24px;
    margin-bottom: 14px;
}

.entry-head h3 {
    color: var(--text);
    font-size: 1.3rem;
    letter-spacing: 0.02em;
}

.entry-org {
    margin: 6px 0 0;
    color: var(--text-muted);
}

.entry-date {
    margin: 0;
    color: var(--cyan);
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.entry-tasks {
    margin-bottom: 18px;
}

/* tâche d'une liste, précédée d'un petit tiret saumon */
.entry-tasks li {
    position: relative;
    max-width: 75ch;
    margin-bottom: 6px;
    padding-left: 20px;
}

.entry-tasks li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 8px;
    height: 1px;
    background: var(--salmon);
}

/* pied d'une étape : compétences acquises et lien vers le dossier */
.entry-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 24px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
}

.entry-skills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.entry-skills .label {
    margin-right: 6px;
}

.entry-text {
    max-width: 70ch;
    margin: 0;
    color: var(--text-muted);
}

/* ---------- Projets : des « dossiers » qu'on scanne ---------- */
.files {
    display: grid;
    gap: 28px;
}

/* un dossier : visuel et texte en deux colonnes, coin coupé ; tout le dossier est cliquable */
.file {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    background: var(--bg-raised);
    border: 1px solid var(--line);
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
    transition: border-color 0.25s, background-color 0.25s;
}

.file:nth-child(even) .file-visual {
    order: 2;
}

.file:hover,
.file:focus-within {
    border-color: var(--cyan-soft);
    background: #250606;
}

/* zone de l'image du dossier */
.file-visual {
    position: relative;
    min-height: 300px;
    margin: 0;
    overflow: hidden;
    background: var(--bg);
    border-right: 1px solid var(--line);
}

.file:nth-child(even) .file-visual {
    border-right: 0;
    border-left: 1px solid var(--line);
}

.file-visual > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    transition: transform 0.6s var(--ease-out), filter 0.4s;
    filter: saturate(0.85) brightness(0.9);
}

.file:hover .file-visual > img,
.file:focus-within .file-visual > img {
    transform: scale(1.03);
    filter: none;
}

/* les diagrammes UML sont blancs : on les inverse pour qu'ils se fondent dans le thème */
.file-visual--uml {
    background: #0c0101;
}

.file-visual--uml > img {
    object-fit: contain;
    padding: 18px;
    filter: invert(0.92) hue-rotate(180deg) sepia(0.25) hue-rotate(-30deg);
}

.file:hover .file-visual--uml > img,
.file:focus-within .file-visual--uml > img {
    filter: invert(0.92) hue-rotate(180deg) sepia(0.25) hue-rotate(-30deg);
}

/* Pac-Fish : le décor du jeu et le poisson animé au centre */
.file-visual--sprite .sprite {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: 128px;
    height: auto;
    transform: translate(-50%, -50%);
    image-rendering: pixelated;
}

/* balayage au survol d'un dossier */
.file-visual::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 2;
    height: 70px;
    background: linear-gradient(to bottom, transparent, rgba(90, 237, 244, 0.14) 85%, var(--cyan) 98%, transparent);
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.fx-on .file:hover .file-visual::after,
.fx-on .file:focus-within .file-visual::after {
    animation: beam-file 0.9s linear;
}

@keyframes beam-file {
    0% { opacity: 1; transform: translateY(-100%); }
    90% { opacity: 1; }
    100% { opacity: 0; transform: translateY(420px); }
}

/* texte du dossier : titre, résumé, relevé, technologies, lien */
.file-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: clamp(24px, 3vw, 36px);
}

/* titre du dossier, décrypté au survol par main.js */
.file-title {
    color: var(--cyan);
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.file-subtitle {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    text-transform: none;
}

.file-summary {
    margin: 0;
    max-width: 58ch;
}

/* relevé compact du dossier : date, type, équipe, statut */
.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin: 0;
    font-family: var(--font-head);
    font-size: 0.9rem;
}

.file-meta div {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.file-meta dt {
    color: var(--salmon);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.file-meta dd {
    margin: 0;
}

.file-link {
    margin-top: auto;
}

/* tout le dossier est cliquable, mais un seul lien pour le clavier et les lecteurs d'écran */
.file-link a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
}

/* statut avec un losange : jaune = en cours, vert (status-pill--done) = terminé */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    background: var(--yellow);
    transform: rotate(45deg);
}

.status-pill--done::before {
    background: var(--green);
}

/* projet en cours sans capture : dossier compact avec un schéma du montage */
.file--compact {
    grid-template-columns: minmax(0, 1fr);
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}

.file--compact:hover {
    background: var(--bg-raised);
    border-color: var(--line);
}

/* schéma du montage Raspberry Pi : des maillons reliés par des flèches cyan */
.chain {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    margin: 4px 0 0;
}

.chain li {
    position: relative;
    display: grid;
    gap: 2px;
    min-width: 150px;
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    font-family: var(--font-head);
    font-size: 0.95rem;
    line-height: 1.35;
}

.chain li + li {
    margin-left: 34px;
}

/* flèche entre deux maillons */
.chain li + li::before {
    content: "";
    position: absolute;
    right: calc(100% + 6px);
    top: 50%;
    width: 22px;
    height: 1px;
    background: var(--cyan);
}

.chain li + li::after {
    content: "";
    position: absolute;
    right: calc(100% + 5px);
    top: calc(50% - 4px);
    width: 7px;
    height: 7px;
    border-top: 1px solid var(--cyan);
    border-right: 1px solid var(--cyan);
    transform: rotate(45deg);
}

.chain .label {
    font-size: 0.7rem;
}

.chain small {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.9rem;
}

/* ---------- Compétences ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
}

.skills-side {
    display: grid;
    gap: 20px;
    align-content: start;
}

.skills-table > div {
    grid-template-columns: 11em 1fr;
    padding: 14px 0;
}

/* une qualité : nom en clair, explication en gris */
.soft-list li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
}

.soft-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.soft-list strong {
    display: block;
    color: var(--text);
    font-family: var(--font-head);
    font-weight: 500;
    letter-spacing: 0.03em;
}

.soft-list li > span {
    color: var(--text-muted);
}

/* ---------- Références (version anglaise) ---------- */
.two-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.ref-item h3 {
    margin-bottom: 4px;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0.02em;
}

.ref-item p {
    color: var(--text-muted);
}

.ref-item a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    overflow-wrap: anywhere;
}

/* ---------- Loisirs ---------- */
.interests {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
}

.interest {
    padding: 28px 28px 8px 0;
}

.interest + .interest {
    padding-left: 28px;
    border-left: 1px solid var(--line);
}

.interest h3 {
    margin-bottom: 12px;
    color: var(--cyan);
    font-size: 1.2rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.interest p {
    color: var(--text-muted);
}

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

/* nom et email côte à côte */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

/* un champ : libellé au-dessus, message d'erreur dessous */
.field {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
}

.field label {
    color: var(--salmon);
    font-family: var(--font-head);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* zone de saisie : contour saumon au survol, cyan quand on écrit, rouge en cas d'erreur */
.field input,
.field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.05rem;
    transition: border-color 0.2s;
}

.field textarea {
    min-height: 150px;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #a88d8d;
}

.field input:hover,
.field textarea:hover {
    border-color: var(--salmon);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: inset 0 0 0 1px var(--cyan);
}

.field.has-error input,
.field.has-error textarea {
    border-color: var(--red);
}

/* message d'erreur écrit par main.js (checkField), lu par les lecteurs d'écran (aria-live) */
.field-error {
    min-height: 1.3em;
    color: var(--red);
    font-size: 0.95rem;
}

.field-error:empty {
    min-height: 0;
}

.form-note {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-status {
    margin: 8px 0 0;
    color: var(--green);
}

.form-status:empty {
    display: none;
}

/* une ligne de coordonnées avec son icône */
.contact-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--line);
}

.contact-list li:last-child {
    border-bottom: 0;
}

.contact-list .icon {
    color: var(--salmon);
}

.contact-list a {
    overflow-wrap: anywhere;
}

/* bouton « Copier » de l'adresse email */
.copy-btn {
    margin-left: auto;
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-head);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
}

.copy-btn:hover {
    color: var(--cyan);
    border-color: var(--cyan);
}

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: clamp(72px, 9vw, 120px);
    border-top: 1px solid var(--line);
    background: var(--bg-raised);
    font-size: 0.95rem;
    color: var(--text-muted);
}

.home-main + .site-footer {
    margin-top: 0;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 28px;
    padding-top: 24px;
    padding-bottom: 24px;
}

.footer-inner p {
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--cyan);
}

/* ---------- Pop-ups (CV, images) ---------- */
.dialog {
    width: min(960px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 1px solid var(--line-strong);
    border-top: 2px solid var(--cyan);
    background: var(--bg-raised);
    color: var(--text);
}

.dialog::backdrop {
    background: rgba(10, 0, 0, 0.8);
}

html:has(dialog[open]) {
    overflow: hidden;
}

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 12px 12px 22px;
    border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
    color: var(--salmon);
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* aperçu du PDF du CV (chargé seulement à l'ouverture) */
.cv-frame {
    display: block;
    width: 100%;
    height: min(72vh, 900px);
    border: 0;
    background: #fff;
}

.cv-mobile-note {
    display: none;
    margin: 0;
    padding: 12px 22px 0;
    color: var(--text-muted);
}

@media (hover: none) and (pointer: coarse) {
    .cv-mobile-note {
        display: block;
    }
}

.dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 22px 22px;
}

/* image agrandie dans la visionneuse (fond blanc pour les diagrammes UML) */
.viewer-img {
    width: 100%;
    max-height: 74vh;
    object-fit: contain;
    padding: 16px;
    background: #fff;
}

.viewer-img--dark {
    background: var(--bg);
}

/* ---------- Pages projet (dossiers détaillés) ---------- */
.case-hero {
    padding: clamp(40px, 6vw, 80px) 0 clamp(32px, 4vw, 48px);
    border-bottom: 1px solid var(--line);
}

/* fil d'Ariane : Accueil / Projets / nom de la page */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    font-family: var(--font-head);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.breadcrumb a {
    text-decoration: none;
}

.breadcrumb li + li::before {
    content: "/";
    margin-right: 8px;
    color: var(--line-strong);
}

/* grand titre de la page, décrypté par main.js */
.case-title {
    max-width: 18em;
    margin-bottom: 18px;
    color: var(--salmon);
    font-size: clamp(2.2rem, 5.5vw, 4rem);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* résumé sous le titre */
.case-lead {
    max-width: 60ch;
    margin-bottom: 32px;
    font-size: clamp(1.15rem, 2vw, 1.35rem);
}

/* relevé en ligne : date, type, équipe, statut… */
.case-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0;
    margin: 0;
    border: 1px solid var(--line);
    background: var(--bg-raised);
}

.case-meta > div {
    padding: 14px 18px;
    border-right: 1px solid var(--line);
}

.case-meta > div:last-child {
    border-right: 0;
}

.case-meta dt {
    margin-bottom: 4px;
    color: var(--salmon);
    font-family: var(--font-head);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.case-meta dd {
    margin: 0;
    font-family: var(--font-head);
}

/* contenu à gauche, colonne latérale (technologies, liens, sommaire) à droite */
.case-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: clamp(32px, 5vw, 64px);
    padding-top: clamp(48px, 6vw, 80px);
    align-items: start;
}

.case-content > section {
    margin-bottom: clamp(48px, 6vw, 72px);
}

.case-content > section:last-child {
    margin-bottom: 0;
}

/* titres des rubriques d'une page projet */
.case-content h2 {
    margin-bottom: 20px;
    color: var(--salmon);
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.case-content h3 {
    margin: 28px 0 12px;
    color: var(--cyan);
    font-size: 1.15rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.case-content p,
.case-content li {
    max-width: 70ch;
}

.case-content .entry-tasks li {
    margin-bottom: 10px;
}

/* colonne latérale : reste visible pendant le défilement (sticky) */
.case-aside {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    display: grid;
    gap: 20px;
}

.case-aside .panel h3 {
    font-size: 1rem;
}

.case-aside .tags {
    margin-bottom: 4px;
}

/* légende sous une liste de technologies (ex. « en pointillés : prévu ») */
.tags + .entry-text {
    margin-top: 14px;
    font-size: 0.95rem;
}

/* code cité dans le texte d'une page projet */
.case-content :not(pre) > code {
    padding: 1px 6px;
    border: 1px solid var(--line);
    background: #0f0000;
    color: var(--cyan);
    font-family: "Cascadia Code", Consolas, "SF Mono", monospace;
    font-size: 0.88em;
}

/* visuel du jeu hors d'un dossier (page Pac-Fish) */
.shot > .file-visual {
    aspect-ratio: 4 / 3;
    min-height: 0;
    border: 1px solid var(--line);
}

.case-aside .btn {
    width: 100%;
}

/* galerie de captures ; chaque image s'ouvre en grand au clic */
.gallery {
    display: grid;
    gap: 20px;
}

.gallery--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shot {
    margin: 0;
}

/* bouton qui contient l'image : un clic ouvre la visionneuse (main.js, initImageViewer) */
.shot-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--line);
    background: var(--bg);
    cursor: zoom-in;
    transition: border-color 0.2s;
}

.shot-btn:hover {
    border-color: var(--cyan);
}

.shot-btn img {
    width: 100%;
}

.shot-btn--uml {
    background: #fff;
}

.shot figcaption {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* encadré en pointillés pour une remarque (ex. « sans lien avec BMW ») */
.note {
    padding: 14px 18px;
    border: 1px dashed var(--line-strong);
    color: var(--text-muted);
    font-size: 1rem;
}

/* extrait de code commenté */
.code {
    margin: 0 0 1em;
    border: 1px solid var(--line);
    background: #0f0000;
}

.code-head {
    padding: 8px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--salmon);
    font-family: var(--font-head);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.code pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    color: var(--text);
    font-family: "Cascadia Code", Consolas, "SF Mono", monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    tab-size: 4;
}

.code .kw { color: var(--cyan); }
.code .str { color: var(--yellow); }
.code .com { color: #a88d8d; }
.code .num { color: var(--salmon); }

/* navigation de fin de page : projet précédent / suivant */
.case-next {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    margin-top: clamp(56px, 7vw, 96px);
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

/* ---------- Mentions légales ---------- */

/* éditeur, hébergeur et domaine : trois relevés côte à côte (ou empilés si la place manque) */
.legal-ids {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.legal-ids .panel {
    padding: 22px 22px 14px;
}

/* colonnes étroites : le libellé passe au-dessus de la valeur */
.legal-ids .readout > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    padding: 9px 0;
}

.legal-ids dd {
    overflow-wrap: break-word;
}

/* sur petit écran, la colonne passe au-dessus du contenu : on n'y garde que le sommaire */
@media (max-width: 1080px) {
    .panel--wide-only {
        display: none;
    }
}

/* relevé à libellés longs (localStorage) */
.readout--wide {
    margin: 4px 0 20px;
    padding: 4px 20px;
    border: 1px solid var(--line);
    background: var(--bg-raised);
}

.readout--wide > div {
    grid-template-columns: 11em 1fr;
}

.readout--wide dt {
    text-transform: none;
    letter-spacing: 0.04em;
    font-size: 0.9rem;
}

/* sommaire « Sur cette page » : la rubrique lue est mise en avant par main.js (aria-current) */
.toc li {
    border-bottom: 1px dashed var(--line);
}

.toc li:last-child {
    border-bottom: 0;
}

.toc a {
    position: relative;
    display: block;
    padding: 10px 0 10px 16px;
    color: var(--text);
    font-family: var(--font-head);
    font-size: 0.95rem;
    text-decoration: none;
}

.toc a::before {
    content: "";
    position: absolute;
    left: 0;
    top: calc(50% - 3px);
    width: 6px;
    height: 6px;
    border: 1px solid var(--line-strong);
    transform: rotate(45deg);
}

.toc a:hover,
.toc a[aria-current] {
    color: var(--cyan);
}

.toc a[aria-current]::before {
    border-color: var(--cyan);
    background: var(--cyan);
}

/* ---------- Page simple (404) ---------- */
.page-simple {
    padding: clamp(40px, 6vw, 80px) 0 0;
}

/* texte long : lignes de 72 caractères au maximum pour rester lisible */
.prose {
    max-width: 72ch;
}

.prose h2 {
    margin: 48px 0 14px;
    color: var(--salmon);
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.prose ul {
    margin-bottom: 1em;
}

.prose li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
}

.prose li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 8px;
    height: 1px;
    background: var(--salmon);
}

/* ---------- Séquence de démarrage ----------
   Affichée seulement si le script du <head> a ajouté la classe .boot sur <html>
   (première visite de la session, effets actifs). */
.boot-screen {
    display: none;
}

.boot .boot-screen {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg);
    cursor: pointer;
}

.boot .boot-screen.is-leaving {
    animation: boot-out 0.45s var(--ease-out) forwards;
}

@keyframes boot-out {
    to { clip-path: inset(0 0 100% 0); }
}

.boot-term {
    width: min(560px, 100%);
    font-family: var(--font-head);
    font-size: clamp(0.9rem, 2.4vw, 1.05rem);
    letter-spacing: 0.04em;
}

.boot-logo {
    margin-bottom: 22px;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 7vw, 3.4rem);
    line-height: 1;
    color: var(--salmon);
    text-shadow: 3px 3px 0 rgba(90, 237, 244, 0.6);
}

.boot-lines li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
    color: var(--text-muted);
    opacity: 0;
    animation: boot-line 0.01s linear forwards;
}

.boot-lines li:nth-child(1) { animation-delay: 0.1s; }
.boot-lines li:nth-child(2) { animation-delay: 0.38s; }
.boot-lines li:nth-child(3) { animation-delay: 0.66s; }
.boot-lines li:nth-child(4) { animation-delay: 0.94s; }

.boot-lines .ok {
    color: var(--green);
}

@keyframes boot-line {
    to { opacity: 1; }
}

.boot-bar {
    height: 4px;
    margin: 18px 0 14px;
    background: var(--bg-panel);
}

.boot-bar span {
    display: block;
    height: 100%;
    background: var(--cyan);
    transform: scaleX(0);
    transform-origin: left;
    animation: boot-bar 1.2s cubic-bezier(0.65, 0, 0.35, 1) 0.1s forwards;
}

@keyframes boot-bar {
    to { transform: scaleX(1); }
}

.boot-skip {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---------- Changement de langue : bref glitch ---------- */
.is-glitching main {
    animation: glitch 0.34s steps(1) both;
}

@keyframes glitch {
    0% { clip-path: inset(0); transform: none; }
    15% { clip-path: inset(12% 0 58% 0); transform: translateX(-6px); }
    30% { clip-path: inset(48% 0 22% 0); transform: translateX(5px); }
    45% { clip-path: inset(70% 0 8% 0); transform: translateX(-3px); }
    60% { clip-path: inset(0 0 80% 0); transform: translateX(4px); opacity: 0.85; }
    75% { clip-path: inset(30% 0 40% 0); transform: none; }
    100% { clip-path: inset(0); transform: none; opacity: 1; }
}

/* ---------- Effets désactivés : plus aucune animation ---------- */
html[data-fx="off"] *,
html[data-fx="off"] *::before,
html[data-fx="off"] *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

html[data-fx="off"] {
    scroll-behavior: auto;
}

/* sans JavaScript, on suit le réglage système */
@media (prefers-reduced-motion: reduce) {
    html:not([data-fx]) *,
    html:not([data-fx]) *::before,
    html:not([data-fx]) *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- Responsive ---------- */
/* écran moyen : les étiquettes du scanner restent dans le cadre pour ne pas mordre sur le texte */
@media (max-width: 1180px) {
    .scan-tag--1,
    .scan-tag--3 { left: 10px; }
    .scan-tag--2 { right: 10px; }
}

/* petit portable et en dessous : menu burger en plein écran, colonne latérale des pages projet au-dessus du contenu */
@media (max-width: 1080px) {
    .nav-toggle {
        display: inline-grid;
        order: 3;
    }

    .header-tools {
        order: 2;
    }

    .site-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 16px var(--gutter) 32px;
        overflow-y: auto;
        background: var(--bg);
        border-top: 1px solid var(--line);
    }

    .site-nav.is-open {
        display: flex;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-link {
        width: 100%;
        min-height: 52px;
        padding: 12px 4px;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--line);
    }

    .nav-link::after {
        left: 4px;
        right: auto;
        width: 40px;
    }

    .case-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .case-aside {
        position: static;
        grid-row: 1;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* tablette : une seule colonne (hero, à propos, compétences, contact, dossiers) */
@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .scanner {
        margin: 8px auto 0;
        width: min(100%, 420px);
    }

    .about-grid,
    .skills-grid,
    .contact-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .file,
    .file:nth-child(even) {
        grid-template-columns: minmax(0, 1fr);
    }

    .file:nth-child(even) .file-visual {
        order: 0;
    }

    .file-visual,
    .file:nth-child(even) .file-visual {
        /* pas de hauteur minimale ici : avec aspect-ratio, elle élargirait l'image hors de l'écran */
        min-height: 0;
        aspect-ratio: 16 / 9;
        border: 0;
        border-bottom: 1px solid var(--line);
    }

    .interests {
        grid-template-columns: minmax(0, 1fr);
    }

    .interest,
    .interest + .interest {
        padding: 22px 0;
        border-left: 0;
        border-bottom: 1px solid var(--line);
    }
}

/* téléphone : header compact, boutons pleine largeur, relevés empilés */
@media (max-width: 640px) {
    .header-inner {
        gap: 8px;
    }

    .fx-toggle .fx-text {
        display: none;
    }

    /* cibles tactiles de 44 px au minimum sur téléphone (FR, EN, Effets, Copier) */
    .lang-switch button,
    .fx-toggle,
    .copy-btn {
        min-height: 44px;
        height: 44px;
    }

    .header-tools .btn {
        display: none;
    }

    .hero-actions .btn {
        flex: 1 1 100%;
    }

    /* les étiquettes du scanner passent sous le portrait */
    .scan-tags {
        position: static;
        display: grid;
        gap: 8px;
        margin-top: 12px;
    }

    .scan-tag {
        position: static;
        max-width: none;
    }

    .scan-tag::before,
    .scan-tag::after {
        display: none;
    }

    .readout > div,
    .skills-table > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .form-row,
    .two-cols,
    .gallery--two {
        grid-template-columns: minmax(0, 1fr);
    }

    .panel {
        padding: 22px 18px;
    }

    /* l'aperçu du PDF laisse la place aux boutons sous lui */
    .cv-frame {
        height: 50vh;
    }

    .chain {
        flex-direction: column;
    }

    .chain li + li {
        margin-left: 0;
        margin-top: 30px;
    }

    .chain li + li::before {
        right: auto;
        left: 24px;
        top: -24px;
        width: 1px;
        height: 18px;
    }

    .chain li + li::after {
        right: auto;
        left: 20px;
        top: -12px;
        transform: rotate(135deg);
    }

    .case-meta > div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}
