/* ==========================================================================
   Portfolio : feuille de style principale
   --------------------------------------------------------------------------
    1. Police et thèmes          9. Projets
    2. Base                     10. Fenêtre de détail
    3. Utilitaires              11. Parcours
    4. Boutons et éléments      12. Méthode
    5. En-tête                  13. Contact et formulaire
    6. Accueil                  14. Pied de page, notifications
    7. Sections, À propos       15. Recherche rapide
    8. Compétences              16. Pages d'erreur, mentions légales
   Les adaptations par taille d'écran sont dans responsive.css,
   les animations dans animations.css. L'administration réutilise
   les variables et composants des parties 1 à 4.
   ========================================================================== */

/* 1. Police et thèmes
   ========================================================================== */

/* Archivo (SIL Open Font License) : graisse 100 à 900, largeur 62 à 125 % */
@font-face {
    font-family: "Archivo";
    src: url("../fonts/Archivo-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;

    --bg: #f4f2ed;
    --bg-alt: #ece9e2;
    --bg-elevated: #fffdf9;
    --surface: #fffdf9;
    --surface-hover: #efece5;
    --surface-sunken: #ebe8e0;
    --border: #dfdbd2;
    --border-strong: #c6c1b5;

    --text: #161513;
    --text-muted: #57534b;
    --text-subtle: #6f6b62;

    --ink: #161513;
    --ink-hover: #34312c;
    --on-ink: #fffdf9;

    --accent: #f0521f;
    --accent-hover: #ff6a3a;
    --on-accent: #160b06;
    --accent-text: #b8360c;
    --accent-soft: rgb(240 82 31 / 0.11);
    --accent-line: rgb(240 82 31 / 0.45);

    /* Noms historiques, utilisés aussi par l'administration */
    --primary: #b8360c;
    --primary-strong: #c2410c;
    --primary-hover: #9a2d0a;
    --primary-soft: rgb(240 82 31 / 0.14);
    --blue: #1d4ed8;
    --success: #15803d;
    --warning: #a16207;
    --danger: #b91c1c;
    --gradient: var(--accent);

    --c-formation: #4f46e5;
    --c-experience: #0369a1;
    --c-projet: #0f766e;
    --c-certification: #a16207;
    --c-apprentissage: #15803d;

    /* Couleurs des couvertures de projets sans image */
    --cat-frontend: #c2410c;
    --cat-backend: #1d4ed8;
    --cat-fullstack: #b8360c;
    --cat-java: #a16207;
    --cat-database: #047857;
    --cat-other: #57534b;

    --shadow-sm: 0 1px 2px rgb(22 21 19 / 0.06);
    --shadow: 0 10px 30px -12px rgb(22 21 19 / 0.18);
    --shadow-lg: 0 30px 80px -24px rgb(22 21 19 / 0.35);

    --header-bg: color-mix(in srgb, var(--bg) 80%, transparent);
    --overlay: rgb(22 21 19 / 0.5);

    --font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: var(--font-sans);
    --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;

    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 999px;

    --container: 1200px;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --header-h: 68px;
    --section-space: clamp(5rem, 11vw, 8.5rem);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
    --dur: 0.18s;
}

[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0e0e0d;
    --bg-alt: #131312;
    --bg-elevated: #191918;
    --surface: #171716;
    --surface-hover: #20201e;
    --surface-sunken: #0b0b0a;
    --border: #272725;
    --border-strong: #3b3b38;

    --text: #f3f1ec;
    --text-muted: #aaa79f;
    --text-subtle: #8a877e;

    --ink: #f3f1ec;
    --ink-hover: #ffffff;
    --on-ink: #0e0e0d;

    --accent: #ff5f2e;
    --accent-hover: #ff7a50;
    --on-accent: #140904;
    --accent-text: #ff8158;
    --accent-soft: rgb(255 95 46 / 0.13);
    --accent-line: rgb(255 95 46 / 0.5);

    --primary: #ff8158;
    --primary-strong: #c84116;
    --primary-hover: #e2501f;
    --primary-soft: rgb(255 95 46 / 0.18);
    --blue: #7aa5ff;
    --success: #4ade80;
    --warning: #facc15;
    --danger: #f87171;

    --c-formation: #a5b4fc;
    --c-experience: #7dd3fc;
    --c-projet: #5eead4;
    --c-certification: #fcd34d;
    --c-apprentissage: #86efac;

    --cat-frontend: #ff8158;
    --cat-backend: #8fb3ff;
    --cat-fullstack: #ff9a6b;
    --cat-java: #f5c46b;
    --cat-database: #6ee7b7;
    --cat-other: #c9c5bb;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow: 0 12px 32px -12px rgb(0 0 0 / 0.7);
    --shadow-lg: 0 30px 80px -20px rgb(0 0 0 / 0.85);

    --overlay: rgb(0 0 0 / 0.62);
}

/* 2. Base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

body.is-locked {
    overflow: hidden;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
}

button {
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

p {
    margin: 0;
    text-wrap: pretty;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

dl,
dd,
figure,
pre {
    margin: 0;
}

::selection {
    color: var(--on-accent);
    background: var(--accent);
}

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

main:focus {
    outline: none;
}

[hidden] {
    display: none !important;
}

/* 3. Utilitaires
   ========================================================================== */

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    font-weight: 600;
    color: var(--on-accent);
    background: var(--accent);
    border-radius: var(--radius-sm);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
}

/* Icônes placées dans une ligne de texte */
.text-link .icon,
.link-arrow .icon,
.project-card__links .icon,
.site-footer .icon {
    display: inline-block;
    width: 0.95em;
    height: 0.95em;
    vertical-align: -0.1em;
}

.logo-mark {
    display: inline-grid;
    flex-shrink: 0;
    place-items: center;
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--on-accent);
    background: var(--accent);
    border-radius: 10px;
}

/* Logos monochromes (GitHub, Express…) lisibles en thème sombre */
[data-theme="dark"] .is-mono {
    filter: invert(1);
}

.text-link {
    color: var(--accent-text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--dur);
}

.text-link:hover {
    text-decoration-color: currentColor;
}

/* Lien avec flèche qui avance au survol */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    color: var(--text);
    transition: color var(--dur);
}

.link-arrow .icon {
    transition: transform 0.3s var(--ease-out);
}

.link-arrow:hover {
    color: var(--accent-text);
}

.link-arrow:hover .icon {
    transform: translateX(4px);
}

.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5em;
    padding: 0.1rem 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1.4;
    color: var(--text-muted);
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 6px;
}

/* 4. Boutons et éléments
   ========================================================================== */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    transition: background-color var(--dur), border-color var(--dur), color var(--dur), transform 0.2s var(--ease-out);
}

.btn:active {
    transform: scale(0.97);
}

.btn--lg {
    min-height: 52px;
    padding: 0.8rem 1.6rem;
    font-size: 1rem;
}

.btn--sm {
    min-height: 36px;
    padding: 0.4rem 0.9rem;
    font-size: 0.875rem;
}

.btn--block {
    width: 100%;
}

.btn--primary {
    color: var(--on-accent);
    background-color: var(--accent);
}

.btn--primary:hover {
    background-color: var(--accent-hover);
}

.btn--ghost {
    color: var(--text);
    background-color: transparent;
    border-color: var(--border-strong);
}

.btn--ghost:hover {
    background-color: var(--surface-hover);
    border-color: var(--text-subtle);
}

.btn--text {
    padding-inline: 0.5rem;
    color: var(--text-muted);
}

.btn--text:hover {
    color: var(--text);
}

.btn--danger {
    color: #fff;
    background-color: #b91c1c;
}

.btn--danger:hover {
    background-color: #991b1b;
}

.btn__icon {
    width: 1.1em;
    height: 1.1em;
}

.btn__arrow {
    transition: transform 0.3s var(--ease-out);
}

.btn:hover .btn__arrow {
    transform: translateX(4px);
}

.btn__meta {
    font-size: 0.75rem;
    color: var(--text-subtle);
}

.btn__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid color-mix(in srgb, currentColor 35%, transparent);
    border-top-color: currentColor;
    border-radius: 50%;
}

.btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.btn.is-loading .btn__spinner {
    display: inline-block;
}

.btn.is-loading .btn__icon {
    display: none;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    transition: color var(--dur), background-color var(--dur), border-color var(--dur), transform 0.2s var(--ease-out);
}

.icon-btn:hover {
    color: var(--text);
    background-color: var(--surface-hover);
}

.icon-btn:active {
    transform: scale(0.92);
}

.icon-btn .icon {
    width: 18px;
    height: 18px;
}

.icon-btn--sm {
    width: 34px;
    height: 34px;
}

.icon-btn--sm .icon {
    width: 16px;
    height: 16px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.12rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-muted);
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}

.badge .icon {
    width: 12px;
    height: 12px;
}

.badge .status-dot {
    width: 6px;
    height: 6px;
    box-shadow: none;
}

.badge--formation,
.badge--experience,
.badge--projet,
.badge--certification,
.badge--apprentissage,
.badge--current {
    background: color-mix(in srgb, currentColor 11%, transparent);
    border-color: color-mix(in srgb, currentColor 28%, transparent);
}

.badge--formation { color: var(--c-formation); }
.badge--experience { color: var(--c-experience); }
.badge--projet { color: var(--c-projet); }
.badge--certification { color: var(--c-certification); }
.badge--apprentissage { color: var(--c-apprentissage); }
.badge--current { color: var(--success); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: var(--radius-full);
}

.pill .icon {
    width: 11px;
    height: 11px;
}

.pill--accent {
    color: var(--accent-text);
    background: var(--accent-soft);
}

.tag-list,
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag,
.chip {
    padding: 0.18rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-muted);
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}

.tag--more {
    color: var(--text-subtle);
}

.bullet-list {
    padding-left: 1.1rem;
    list-style: disc;
    color: var(--text-muted);
}

.bullet-list li + li {
    margin-top: 0.35rem;
}

.bullet-list ::marker {
    color: var(--accent);
}

.plain-list li + li {
    margin-top: 0.25rem;
}

.status-dot {
    display: inline-block;
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent);
}

/* Barre d'outils au-dessus d'une grille : filtres, recherche */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Sélecteur segmenté : la pastille glisse vers le bouton choisi */
.segmented {
    position: relative;
    display: inline-flex;
    max-width: 100%;
    padding: 4px;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
    display: none;
}

.segmented__btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex-shrink: 0;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    border-radius: var(--radius-full);
    transition: color 0.25s var(--ease);
}

.segmented__btn:hover {
    color: var(--text);
}

.segmented__btn[aria-pressed="true"] {
    color: var(--on-ink);
}

/* Avant la mise en place de la pastille (ou sans JavaScript) */
.segmented:not(.is-ready) .segmented__btn[aria-pressed="true"] {
    background: var(--ink);
}

.segmented__count {
    font-size: 0.72rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    opacity: 0.65;
}

.segmented__indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: var(--w, 0);
    background: var(--ink);
    border-radius: var(--radius-full);
    opacity: 0;
    transform: translateX(var(--x, 0));
    transition: transform 0.45s var(--ease-spring), width 0.45s var(--ease-spring);
}

.segmented.is-ready .segmented__indicator {
    opacity: 1;
}

.segmented:not(.is-ready) .segmented__indicator {
    transition: none;
}

/* Champ de recherche arrondi */
.search-field {
    position: relative;
    flex: 0 1 19rem;
    min-width: 12rem;
}

.search-field__icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    width: 17px;
    height: 17px;
    color: var(--text-subtle);
    pointer-events: none;
    transform: translateY(-50%);
}

.search-field__input {
    width: 100%;
    height: 46px;
    padding: 0 1rem 0 2.7rem;
    font-size: 0.9375rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    outline: none;
    transition: border-color var(--dur), box-shadow var(--dur);
}

.search-field__input::placeholder {
    color: var(--text-subtle);
}

.search-field__input:hover {
    border-color: var(--border-strong);
}

.search-field__input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

/* État vide (aucun projet, parcours non renseigné) */
.empty-state {
    max-width: 44rem;
    padding: 2rem;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}

.empty-state__title {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.empty-state__text {
    color: var(--text-muted);
}

.empty-state__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    margin-top: 1.25rem;
}

/* Champs de formulaire (site et administration) */
.field {
    margin-bottom: 1.25rem;
}

.field__label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.field__req {
    color: var(--accent-text);
}

.field__input {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 0.95rem;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--dur), box-shadow var(--dur), background-color var(--dur);
    appearance: none;
}

.field__input::placeholder {
    color: var(--text-subtle);
    opacity: 1;
}

.field__input:hover {
    border-color: var(--border-strong);
}

.field__input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.field__input--area {
    min-height: 170px;
    line-height: 1.55;
    resize: vertical;
}

.field.is-invalid .field__input {
    border-color: var(--danger);
}

.field.is-invalid .field__input:focus {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent);
}

.field.is-valid .field__input {
    border-color: color-mix(in srgb, var(--success) 55%, var(--border));
}

.field__error {
    margin-top: 0.4rem;
    font-size: 0.8125rem;
    color: var(--danger);
}

.field__error:empty {
    display: none;
}

.field__foot {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.field__count {
    margin-top: 0.4rem;
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-subtle);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.field__count.is-near {
    color: var(--warning);
}

/* Jauge : progression vers la longueur minimale du message */
.field__meter {
    height: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
    background: var(--border);
    border-radius: 2px;
}

.field__meter-bar {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: inherit;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-out), background-color 0.3s;
}

.field__meter-bar.is-complete {
    background: var(--success);
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Bouton de thème : soleil en sombre, lune en clair, petite rotation au changement */
.theme-toggle .icon {
    transition: transform 0.5s var(--ease-spring);
}

.theme-toggle:hover .icon {
    transform: rotate(-25deg);
}

[data-theme="dark"] .theme-toggle__moon,
:root:not([data-theme="dark"]) .theme-toggle__sun {
    display: none;
}

/* Changement de thème : le nouveau thème s'étend en cercle depuis le bouton (theme.js) */
html.is-theme-switching::view-transition-old(root),
html.is-theme-switching::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

/* Bouton « copier » */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.95rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    transition: color var(--dur), background-color var(--dur), border-color var(--dur);
}

.copy-btn .icon {
    width: 15px;
    height: 15px;
}

.copy-btn:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.copy-btn__done {
    display: none;
}

.copy-btn.is-copied {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 45%, transparent);
    background: color-mix(in srgb, var(--success) 10%, transparent);
}

.copy-btn.is-copied .copy-btn__icon {
    display: none;
}

.copy-btn.is-copied .copy-btn__done {
    display: block;
}

/* 5. En-tête
   ========================================================================== */

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    height: var(--header-h);
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s, border-color 0.3s, transform 0.4s var(--ease-out);
}

.site-header.is-scrolled,
.site-header.is-menu-open {
    background: var(--header-bg);
    border-bottom-color: var(--border);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
}

.site-header.is-menu-open {
    background: var(--bg);
}

/* Masqué en descendant, réaffiché dès que l'on remonte */
.site-header.is-hidden:not(.is-menu-open):not(:focus-within) {
    transform: translateY(-100%);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 100%;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-right: auto;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.brand__mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
    font-weight: 800;
    font-stretch: 112%;
    color: var(--on-accent);
    background: var(--accent);
    border-radius: 10px;
    transition: transform 0.45s var(--ease-spring);
}

.brand:hover .brand__mark {
    transform: rotate(-10deg) scale(1.06);
}

.site-nav {
    position: relative;
}

.site-nav__list {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 0.15rem;
}

.site-nav__link {
    display: block;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    transition: color var(--dur);
}

.site-nav__link:hover,
.site-nav__link.is-active {
    color: var(--text);
}

.site-nav__indicator {
    position: absolute;
    top: 50%;
    left: 0;
    height: 34px;
    width: var(--w, 0);
    background: color-mix(in srgb, var(--text) 8%, transparent);
    border-radius: var(--radius-full);
    opacity: 0;
    transform: translate(var(--x, 0), -50%);
    transition: transform 0.4s var(--ease-spring), width 0.4s var(--ease-spring), opacity 0.25s;
}

.site-nav__indicator.is-visible {
    opacity: 1;
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.palette-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    height: 38px;
    padding: 0 0.45rem 0 0.8rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    transition: color var(--dur), border-color var(--dur);
}

.palette-trigger .icon {
    width: 15px;
    height: 15px;
}

.palette-trigger:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: 0.55rem;
    min-height: 38px;
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
}

.nav-toggle__bars {
    position: relative;
    display: grid;
    gap: 4px;
    width: 14px;
}

.nav-toggle__bars span {
    display: block;
    height: 1.5px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.3s var(--ease-out);
}

.is-menu-open .nav-toggle__bars span:first-child {
    transform: translateY(2.75px) rotate(45deg);
}

.is-menu-open .nav-toggle__bars span:last-child {
    transform: translateY(-2.75px) rotate(-45deg);
}

/* Progression de lecture */
.scroll-progress {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    pointer-events: none;
}

.scroll-progress__bar {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
}

/* 6. Accueil
   ========================================================================== */

.hero {
    display: flex;
    flex-direction: column;
    min-height: min(100svh, 1000px);
    padding-top: calc(var(--header-h) + clamp(2rem, 7vh, 4.5rem));
}

.hero__inner {
    flex: 1;
}

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    font-size: 0.875rem;
}

.hero__status {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.9rem 0.4rem 0.75rem;
    font-weight: 500;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}

.hero__clock {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted);
}

.hero__clock .icon {
    width: 16px;
    height: 16px;
    color: var(--accent-text);
}

.hero__time {
    padding: 0.1rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text);
    background: var(--surface-sunken);
    border-radius: var(--radius-xs);
    font-variant-numeric: tabular-nums;
}

.hero__title {
    margin-top: clamp(2rem, 6vh, 3.75rem);
    font-weight: 800;
    letter-spacing: 0;
    text-wrap: initial;
}

.hero__name {
    display: block;
}

.hero__name-visual {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.2em;
    font-size: clamp(3.6rem, 13vw, 11.5rem);
    line-height: 0.88;
    letter-spacing: -0.045em;
}

.hero__word {
    display: inline-flex;
    flex-wrap: wrap;
}

.hero__char {
    display: inline-block;
    font-weight: var(--wght, 800);
    transition: font-weight 0.6s var(--ease-out);
}

.hero__role {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-top: clamp(1rem, 2.5vh, 1.5rem);
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text-muted);
}

.hero__role::before {
    content: "";
    flex-shrink: 0;
    width: clamp(2rem, 5vw, 3.5rem);
    height: 2px;
    background: var(--accent);
}

.hero__body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 2rem clamp(2rem, 6vw, 6rem);
    padding-top: clamp(1.75rem, 4vh, 2.5rem);
    margin-top: clamp(2rem, 6vh, 4rem);
    border-top: 1px solid var(--border);
}

.hero__statement {
    font-size: clamp(1.45rem, 2.6vw, 2.25rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.hero__statement-end {
    color: var(--text-subtle);
}

.hero__intro {
    font-size: 1.0625rem;
    color: var(--text-muted);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

/* Bandeau défilant des technologies principales */
.marquee {
    margin-top: clamp(3rem, 8vh, 5rem);
    overflow: hidden;
    border-block: 1px solid var(--border);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__viewport {
    display: flex;
    width: max-content;
}

.marquee__track {
    display: flex;
    flex-shrink: 0;
    gap: clamp(2rem, 4vw, 3.5rem);
    padding: 1.15rem clamp(1rem, 2vw, 1.75rem);
}

.marquee__item {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: clamp(1.05rem, 1.7vw, 1.4rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color var(--dur);
}

.marquee__item:hover {
    color: var(--text);
}

.marquee__item + .marquee__item::before,
.marquee__track + .marquee__track .marquee__item:first-child::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: clamp(1.25rem, 2.5vw, 2rem);
    background: var(--accent);
    border-radius: 50%;
}

.marquee__logo {
    width: 28px;
    height: 28px;
}

/* 7. Sections, À propos
   ========================================================================== */

.section {
    padding-block: var(--section-space);
}

.skills,
.journey {
    background: var(--bg-alt);
}

.section-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 25rem);
    align-items: end;
    gap: 1.25rem 3rem;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-title {
    font-size: clamp(2.75rem, 7.5vw, 6.25rem);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: -0.045em;
}

.section-title::after {
    content: ".";
    color: var(--accent);
}

.section-intro {
    font-size: 1.0625rem;
    color: var(--text-muted);
}

.about__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 2.5rem clamp(2rem, 6vw, 5.5rem);
    align-items: start;
}

.about__grid--single {
    grid-template-columns: minmax(0, 52rem);
}

.about__lead p {
    font-size: clamp(1.25rem, 2.1vw, 1.7rem);
    font-weight: 450;
    line-height: 1.42;
    letter-spacing: -0.015em;
}

.about__lead p + p {
    margin-top: 1.1rem;
}

.about__lead .about__more {
    margin-top: 2rem;
    font-size: 1rem;
}

.facts {
    padding: 0.4rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.facts__row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1.5rem;
    padding: 1rem 0;
    font-size: 0.9375rem;
}

.facts__row + .facts__row {
    border-top: 1px solid var(--border);
}

.facts__label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
}

.facts__label .icon {
    width: 17px;
    height: 17px;
    color: var(--accent-text);
}

.facts__value {
    font-weight: 600;
    text-align: right;
}

.about__blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1.25rem;
    margin-top: clamp(3rem, 6vw, 4.5rem);
}

.about-block {
    padding: 1.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform 0.4s var(--ease-out), border-color 0.3s;
}

.about-block:hover {
    border-color: var(--accent-line);
    transform: translateY(-4px);
}

.about-block__icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    color: var(--accent-text);
    background: var(--accent-soft);
    border-radius: var(--radius);
    transition: transform 0.45s var(--ease-spring), background-color 0.3s, color 0.3s;
}

.about-block__icon .icon {
    width: 22px;
    height: 22px;
}

.about-block:hover .about-block__icon {
    color: var(--on-accent);
    background: var(--accent);
    transform: rotate(-8deg);
}

.about-block__title {
    margin-top: 1.25rem;
    font-size: 1.125rem;
}

.about-block__text {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.about-block__text + .about-block__text {
    margin-top: 0.6rem;
}

/* 8. Compétences
   ========================================================================== */

.skill-group + .skill-group {
    margin-top: 2.75rem;
}

.skill-group__title {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.skill-group__count {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-subtle);
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
    gap: 0.75rem;
}

.skill-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 8.75rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform 0.35s var(--ease-out), border-color 0.25s, box-shadow 0.35s;
}

.skill-tile:hover {
    z-index: 2;
    border-color: var(--accent-line);
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.skill-tile__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.skill-tile__logo {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    background: var(--surface-sunken);
    border-radius: var(--radius);
    transition: transform 0.45s var(--ease-spring);
}

.skill-tile:hover .skill-tile__logo {
    transform: rotate(-8deg) scale(1.08);
}

.skill-tile__img {
    width: 24px;
    height: 24px;
}

.skill-tile__img.is-pictogram {
    color: var(--text-muted);
}

.skill-tile__name {
    margin-top: auto;
    padding-top: 0.9rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.skill-tile__level {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--text-subtle);
}

.skill-tile__projects {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.3rem;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-text);
}

.skill-tile__projects .icon {
    width: 12px;
    height: 12px;
    transition: transform 0.3s var(--ease-out);
}

.skill-tile__projects:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.skill-tile__projects:hover .icon {
    transform: translateX(3px);
}

/* Niveau : quatre barres de hauteur croissante */
.level {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
}

.level i {
    width: 4px;
    background: var(--border-strong);
    border-radius: 2px;
    transition: background-color 0.3s;
}

.level i:nth-child(1) { height: 5px; }
.level i:nth-child(2) { height: 8px; }
.level i:nth-child(3) { height: 12px; }
.level i:nth-child(4) { height: 16px; }

.level[data-level="1"] i:nth-child(-n + 1),
.level[data-level="2"] i:nth-child(-n + 2),
.level[data-level="3"] i:nth-child(-n + 3),
.level[data-level="4"] i {
    background: var(--accent);
}

/* Description affichée au survol */
.skill-tile__tip {
    position: absolute;
    right: 0.5rem;
    bottom: calc(100% + 10px);
    left: 0.5rem;
    z-index: 5;
    padding: 0.7rem 0.85rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--on-ink);
    background: var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}

.skill-tile__tip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 1.5rem;
    border: 6px solid transparent;
    border-top-color: var(--ink);
}

.skill-tile:hover .skill-tile__tip {
    opacity: 1;
    transform: none;
    transition-delay: 0.25s;
}

.skills__empty {
    padding: 2rem;
    color: var(--text-muted);
    text-align: center;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}

/* 9. Projets
   ========================================================================== */

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.25rem, 2.5vw, 2rem);
}

.project-card__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    transition: transform 0.5s var(--ease-out), border-color 0.3s, box-shadow 0.5s var(--ease-out);
}

.project-card__inner:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
}

.project-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--border);
}

.project-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease-out);
}

.project-card__inner:hover .project-card__media img {
    transform: scale(1.05);
}

/* Couverture typographique pour les projets sans image */
.project-cover {
    --cat: var(--cat-other);

    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: clamp(1.25rem, 3vw, 2rem);
    overflow: hidden;
    color: var(--cat);
    background: color-mix(in srgb, var(--cat) 13%, var(--surface));
}

.project-cover--frontend { --cat: var(--cat-frontend); }
.project-cover--backend { --cat: var(--cat-backend); }
.project-cover--fullstack { --cat: var(--cat-fullstack); }
.project-cover--java { --cat: var(--cat-java); }
.project-cover--database { --cat: var(--cat-database); }

.project-cover::before {
    content: "";
    position: absolute;
    top: -30%;
    right: -12%;
    width: 62%;
    aspect-ratio: 1;
    border: 1.5px solid color-mix(in srgb, var(--cat) 35%, transparent);
    border-radius: 50%;
    transition: transform 0.9s var(--ease-out);
}

.project-cover__initials {
    position: relative;
    font-size: clamp(5rem, 11vw, 9rem);
    font-weight: 800;
    font-stretch: 115%;
    line-height: 0.8;
    letter-spacing: -0.06em;
    transition: transform 0.7s var(--ease-out);
}

.project-cover__stack {
    position: absolute;
    top: clamp(1.1rem, 2.5vw, 1.5rem);
    left: clamp(1.25rem, 3vw, 2rem);
    max-width: calc(100% - 6rem);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: color-mix(in srgb, var(--cat) 75%, var(--text));
    text-transform: uppercase;
}

.project-card__inner:hover .project-cover__initials {
    transform: translateX(0.6rem);
}

.project-card__inner:hover .project-cover::before {
    transform: scale(1.15) translate(-4%, 6%);
}

.project-card__arrow {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    color: var(--text);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50%;
    transform: rotate(-45deg);
    transition: transform 0.45s var(--ease-spring), background-color 0.3s, color 0.3s, border-color 0.3s;
}

.project-card__arrow .icon {
    width: 18px;
    height: 18px;
}

.project-card__inner:hover .project-card__arrow {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
    transform: rotate(0deg);
}

.project-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.5rem 1.5rem 1.35rem;
}

.project-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

.project-card__title {
    margin-top: 0.5rem;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    letter-spacing: -0.025em;
}

.project-card__open {
    font-weight: inherit;
    text-align: left;
}

/* Toute la carte est cliquable ; les liens secondaires restent au-dessus */
.project-card__open::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.project-card__open:focus-visible {
    outline: none;
}

.project-card__open:focus-visible::after {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    border-radius: var(--radius-xl);
}

.project-card__summary {
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.project-card__body .chip-list {
    margin-top: 1.1rem;
}

.project-card__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.35rem;
    padding-top: 1.35rem;
    margin-top: auto;
    font-size: 0.875rem;
}

.project-card__links a {
    position: relative;
    z-index: 2;
    color: var(--text-muted);
    transition: color var(--dur);
}

.project-card__links a:hover {
    color: var(--accent-text);
}

.project-card__more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: auto;
    font-weight: 600;
    color: var(--text);
}

.project-card__more .icon {
    transition: transform 0.3s var(--ease-out);
}

.project-card__inner:hover .project-card__more {
    color: var(--accent-text);
}

.project-card__inner:hover .project-card__more .icon {
    transform: translateX(4px);
}

/* Projet à la une : pleine largeur, image et texte côte à côte */
.project-card--featured {
    grid-column: 1 / -1;
}

.project-card--featured .project-card__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

.project-card--featured .project-card__media {
    aspect-ratio: auto;
    min-height: 22rem;
    border-right: 1px solid var(--border);
    border-bottom: 0;
}

.project-card--featured .project-card__body {
    justify-content: center;
    padding: clamp(1.75rem, 3.5vw, 2.75rem);
}

.project-card--featured .project-card__title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: -0.035em;
}

.project-card--featured .project-card__summary {
    font-size: 1.0625rem;
}

.project-card--featured .project-cover__initials {
    font-size: clamp(6rem, 14vw, 12rem);
}

/* Filtre par technologie (depuis la section Compétences) */
.tech-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.35rem 0.3rem 1rem;
    font-size: 0.875rem;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: var(--radius-full);
}

.tech-chip__label {
    color: var(--text-muted);
}

.tech-chip__name {
    color: var(--accent-text);
}

.tech-chip__clear {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: var(--accent-text);
    border-radius: 50%;
    transition: background-color var(--dur), color var(--dur);
}

.tech-chip__clear .icon {
    width: 14px;
    height: 14px;
}

.tech-chip__clear:hover {
    color: var(--on-accent);
    background: var(--accent);
}

/* 10. Fenêtre de détail
   ========================================================================== */

.modal {
    width: min(1040px, calc(100% - 2rem));
    max-width: none;
    max-height: calc(100dvh - 2rem);
    padding: 0;
    overflow: visible;
    color: var(--text);
    background: transparent;
    border: 0;
}

.modal::backdrop {
    background: var(--overlay);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.modal__bar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem;
    pointer-events: none;
}

.modal__bar > * {
    pointer-events: auto;
}

.modal__pager {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 3px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.modal__position {
    min-width: 3.25rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.modal__close {
    color: var(--text);
    background: var(--bg-elevated);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.modal__panel {
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.modal__content.is-switching {
    animation: modal-switch 0.35s var(--ease-out);
}

.gallery {
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.gallery__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(58vh, 560px);
    overflow: hidden;
    background: #0b0b0a;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.gallery__slide {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.gallery__slide.is-active {
    animation: fade-in 0.35s var(--ease);
}

.gallery__slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery__nav {
    position: absolute;
    top: 50%;
    color: #fff;
    background: rgb(0 0 0 / 0.55);
    transform: translateY(-50%);
}

.gallery__nav:hover {
    color: #fff;
    background: rgb(0 0 0 / 0.8);
}

.gallery__nav:active {
    transform: translateY(-50%) scale(0.92);
}

.gallery__nav--prev { left: 0.85rem; }
.gallery__nav--next { right: 0.85rem; }

.gallery__counter {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
    padding: 0.15rem 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #fff;
    background: rgb(0 0 0 / 0.6);
    border-radius: var(--radius-full);
    font-variant-numeric: tabular-nums;
}

.gallery__thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    overflow-x: auto;
}

.gallery__thumb {
    display: block;
    width: 88px;
    height: 55px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    opacity: 0.55;
    transition: opacity var(--dur), border-color var(--dur);
}

.gallery__thumb:hover {
    opacity: 1;
}

.gallery__thumb[aria-current="true"] {
    border-color: var(--accent);
    opacity: 1;
}

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

.project-detail__body {
    padding: clamp(1.5rem, 4vw, 2.75rem);
}

/* Sans galerie, le texte laisse la place à la barre de navigation */
.project-detail:not(:has(.gallery)) .project-detail__body {
    padding-top: 4.5rem;
}

.project-detail__meta {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent-text);
}

.project-detail__title {
    margin-top: 0.35rem;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.project-detail__summary {
    max-width: 62ch;
    margin-top: 0.75rem;
    font-size: 1.125rem;
    color: var(--text-muted);
}

.project-detail__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.project-detail__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 14rem;
    gap: 2rem 3rem;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
}

.detail-block + .detail-block,
.detail-pair {
    margin-top: 2rem;
}

.detail-block__title {
    margin-bottom: 0.6rem;
    font-size: 1rem;
}

.detail-block p {
    color: var(--text-muted);
}

.detail-block p + p {
    margin-top: 0.6rem;
}

.detail-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.detail-pair .detail-block {
    padding: 1.25rem 1.35rem;
    background: var(--surface-sunken);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--radius-sm) var(--radius) var(--radius) var(--radius-sm);
}

.detail-pair .detail-block + .detail-block {
    margin-top: 0;
}

.detail-block--challenge {
    border-left-color: var(--warning) !important;
}

.detail-block--solution {
    border-left-color: var(--success) !important;
}

.project-detail__aside .chip-list {
    margin-top: 0.25rem;
}

/* 11. Parcours
   ========================================================================== */

.timeline {
    --rail: 2.5rem;

    position: relative;
}

.timeline__rail {
    position: absolute;
    top: 1.5rem;
    bottom: 1.5rem;
    left: calc(var(--rail) / 2 - 1px);
    width: 2px;
    overflow: hidden;
    background: var(--border);
    border-radius: 2px;
}

.timeline__progress {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleY(var(--progress, 0));
    transform-origin: top;
}

.timeline__item {
    position: relative;
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 11rem) minmax(0, 1fr);
    gap: 0 1.5rem;
    padding: 0.6rem 0;
}

.timeline__dot {
    z-index: 1;
    justify-self: center;
    width: 15px;
    height: 15px;
    margin-top: 1.75rem;
    background: var(--bg-alt);
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    transition: background-color 0.4s, border-color 0.4s, box-shadow 0.4s, transform 0.4s var(--ease-spring);
}

.timeline__item.is-passed .timeline__dot {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
    transform: scale(1.1);
}

.timeline__aside {
    padding-top: 1.45rem;
}

.timeline__date {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.timeline__type {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.timeline__card {
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color 0.3s, transform 0.4s var(--ease-out);
}

.timeline__item:hover .timeline__card {
    border-color: var(--accent-line);
    transform: translateX(4px);
}

.timeline__title {
    font-size: 1.1875rem;
}

.timeline__org {
    margin-top: 0.2rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.timeline__text {
    margin-top: 0.85rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.timeline__text p + p {
    margin-top: 0.6rem;
}

.timeline__card .chip-list {
    margin-top: 1rem;
}

.timeline__link {
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* 12. Méthode
   ========================================================================== */

.stepper__tabs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stepper__tab {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 0.5rem 1.3rem 0;
    font-size: clamp(0.95rem, 1.4vw, 1.125rem);
    font-weight: 700;
    color: var(--text-subtle);
    text-align: left;
    transition: color 0.3s;
}

.stepper__tab:hover,
.stepper__tab[aria-selected="true"] {
    color: var(--text);
}

.stepper__num {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 38px;
    height: 38px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    border: 1.5px solid var(--border-strong);
    border-radius: 50%;
    transition: background-color 0.35s, border-color 0.35s, color 0.35s, transform 0.45s var(--ease-spring);
}

.stepper__tab.is-done .stepper__num {
    color: var(--accent-text);
    background: var(--accent-soft);
    border-color: var(--accent-line);
}

.stepper__tab[aria-selected="true"] .stepper__num {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.08);
}

.stepper__track {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--border);
}

.stepper__fill {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleX(var(--progress, 0.25));
    transform-origin: left;
    transition: transform 0.6s var(--ease-out);
}

.stepper__panels {
    margin-top: 2rem;
}

.stepper__panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 1.75rem clamp(2rem, 5vw, 4.5rem);
    padding: clamp(1.75rem, 4vw, 3rem);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.stepper__panel:focus-visible {
    outline-offset: 4px;
}

.stepper__panel + .stepper__panel {
    margin-top: 1rem;
}

.stepper__big {
    position: absolute;
    right: 1.5rem;
    bottom: -0.18em;
    font-size: clamp(9rem, 20vw, 15rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.06em;
    color: color-mix(in srgb, var(--text) 5%, transparent);
    pointer-events: none;
    user-select: none;
}

.stepper__intro {
    position: relative;
}

.stepper__title {
    font-size: clamp(1.75rem, 3.6vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.stepper__summary {
    margin-top: 0.75rem;
    font-size: 1.125rem;
    color: var(--text-muted);
}

.stepper__points {
    position: relative;
    display: grid;
    gap: 1rem;
    align-content: start;
}

.stepper__points li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.stepper__points .icon {
    width: 26px;
    height: 26px;
    padding: 5px;
    color: var(--accent-text);
    background: var(--accent-soft);
    border-radius: 50%;
}

.stepper__points span {
    padding-top: 0.1rem;
}

.stepper__next {
    position: relative;
    grid-column: 1 / -1;
    justify-self: start;
    font-size: 0.9375rem;
    color: var(--accent-text);
}

/* Avec JavaScript : une seule étape visible à la fois */
.js .stepper__panel:not(.is-active) {
    display: none;
}

.js .stepper__panel + .stepper__panel {
    margin-top: 0;
}

html:not(.js) .stepper__tabs,
html:not(.js) .stepper__next {
    display: none;
}

/* 13. Contact et formulaire
   ========================================================================== */

.contact__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 2.5rem clamp(2rem, 6vw, 5.5rem);
    align-items: start;
}

.contact__label {
    margin-bottom: 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-subtle);
    text-transform: uppercase;
}

.contact__email-link {
    display: inline;
    font-size: clamp(1.5rem, 3.2vw, 2.4rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
    transition: background-size 0.45s var(--ease-out), color var(--dur);
}

.contact__email-link:hover {
    color: var(--accent-text);
    background-size: 100% 2px;
}

.contact__email .copy-btn {
    display: flex;
    margin-top: 1.1rem;
    width: fit-content;
}

.contact__networks-wrap {
    margin-top: 2.75rem;
}

.contact__networks {
    border-top: 1px solid var(--border);
}

.network-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 0.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    transition: color var(--dur), padding-left 0.35s var(--ease-out);
}

.network-link .icon {
    width: 22px;
    height: 22px;
}

.network-link__arrow {
    width: 16px !important;
    height: 16px !important;
    margin-left: auto;
    opacity: 0.45;
    transition: transform 0.35s var(--ease-out), opacity var(--dur);
}

.network-link:hover {
    padding-left: 0.75rem;
    color: var(--accent-text);
}

.network-link:hover .network-link__arrow {
    opacity: 1;
    transform: translate(2px, -2px);
}

.contact__panel {
    padding: clamp(1.5rem, 3.5vw, 2.5rem);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.contact-form__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
}

.contact-form__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-top: 0.5rem;
}

.contact-form__privacy {
    flex: 1 1 16rem;
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

.contact-form__privacy a,
.legal__block a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.contact-form__status:empty {
    display: none;
}

.contact-form__status {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-radius: var(--radius);
}

.contact-form__status.is-error {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}

.form-success {
    padding: 1rem 0;
}

.form-success:focus {
    outline: none;
}

.form-success__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 1.25rem;
    color: #fff;
    background: var(--success);
    border-radius: 50%;
}

[data-theme="dark"] .form-success__icon {
    color: #052e16;
}

.form-success__icon .icon {
    width: 26px;
    height: 26px;
}

.form-success__title {
    font-size: 1.5rem;
}

.form-success__text {
    margin: 0.5rem 0 1.25rem;
    color: var(--text-muted);
}

/* 14. Pied de page, notifications
   ========================================================================== */

.site-footer {
    padding: clamp(3.5rem, 7vw, 5.5rem) 0 2rem;
    border-top: 1px solid var(--border);
}

.site-footer__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem 3rem;
}

.site-footer__name {
    font-size: clamp(2.5rem, 8vw, 6.5rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.05em;
}

.site-footer__mail {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    transition: color var(--dur);
}

.site-footer__mail .icon {
    transition: transform 0.3s var(--ease-out);
}

.site-footer__mail:hover {
    color: var(--accent-text);
}

.site-footer__mail:hover .icon {
    transform: translateX(4px);
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding-top: 1.5rem;
    margin-top: clamp(2.5rem, 5vw, 3.5rem);
    font-size: 0.875rem;
    color: var(--text-subtle);
    border-top: 1px solid var(--border);
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.site-footer__links a {
    color: var(--text-muted);
    transition: color var(--dur);
}

.site-footer__links a:hover {
    color: var(--text);
}

/* Retour en haut de page */
.to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 40;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: var(--on-ink);
    background: var(--ink);
    border-radius: 50%;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px) scale(0.9);
    transition: opacity 0.3s, transform 0.4s var(--ease-spring), background-color var(--dur), color var(--dur);
}

.to-top .icon {
    width: 18px;
    height: 18px;
}

.to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.to-top:hover {
    color: var(--on-accent);
    background: var(--accent);
}

.toast-region {
    position: fixed;
    right: 1.25rem;
    bottom: 5rem;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(380px, calc(100% - 2rem));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.8rem 0.65rem 0.8rem 0.95rem;
    font-size: 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    pointer-events: auto;
}

.toast__icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-top: 0.1rem;
    color: #fff;
    border-radius: 50%;
}

.toast__icon .icon {
    width: 12px;
    height: 12px;
}

.toast--success .toast__icon { background: #15803d; }
.toast--error .toast__icon { background: #b91c1c; }
.toast--info .toast__icon { background: #c2410c; }

.toast__body {
    flex: 1;
    min-width: 0;
}

.toast__title {
    font-weight: 600;
}

.toast__text {
    color: var(--text-muted);
}

.toast .icon-btn {
    width: 28px;
    height: 28px;
    margin: -0.25rem 0;
}

/* 15. Recherche rapide
   ========================================================================== */

.palette {
    width: min(640px, calc(100% - 2rem));
    max-width: none;
    margin-top: min(14vh, 9rem);
    padding: 0;
    overflow: visible;
    color: var(--text);
    background: transparent;
    border: 0;
}

.palette::backdrop {
    background: var(--overlay);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.palette__panel {
    overflow: hidden;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.palette__search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem 0 1.15rem;
    border-bottom: 1px solid var(--border);
}

.palette__icon {
    width: 19px;
    height: 19px;
    color: var(--text-subtle);
}

.palette__input {
    flex: 1;
    min-width: 0;
    height: 60px;
    font-size: 1.0625rem;
    background: transparent;
    border: 0;
    outline: none;
}

.palette__input::placeholder {
    color: var(--text-subtle);
}

.palette__list {
    max-height: min(430px, 55vh);
    padding: 0.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.palette__group {
    padding: 0.8rem 0.75rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-subtle);
    text-transform: uppercase;
}

.palette__option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.9375rem;
    border-radius: var(--radius);
    cursor: pointer;
}

.palette__option-icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    background: var(--surface-sunken);
    border-radius: var(--radius-sm);
    transition: background-color var(--dur), color var(--dur);
}

.palette__option-icon .icon {
    width: 16px;
    height: 16px;
}

.palette__option-hint {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-subtle);
}

.palette__option[aria-selected="true"] {
    background: var(--accent-soft);
}

.palette__option[aria-selected="true"] .palette__option-icon {
    color: var(--on-accent);
    background: var(--accent);
}

.palette__empty {
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    text-align: center;
}

.palette__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    padding: 0.7rem 1.15rem;
    font-size: 0.75rem;
    color: var(--text-subtle);
    background: var(--surface-sunken);
    border-top: 1px solid var(--border);
}

.palette__foot span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* 16. Pages d'erreur, mentions légales
   ========================================================================== */

.error-page {
    padding: calc(var(--header-h) + clamp(4rem, 12vw, 8rem)) 0 clamp(4rem, 10vw, 7rem);
}

.page-minimal .error-page {
    padding-top: clamp(4rem, 12vw, 8rem);
}

.error-page__code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent-text);
}

.error-page__title {
    margin-top: 0.75rem;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.045em;
}

.error-page__text {
    max-width: 44ch;
    margin-top: 1rem;
    font-size: 1.0625rem;
    color: var(--text-muted);
}

.error-page__debug {
    max-width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--danger);
    white-space: pre-wrap;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.legal {
    padding: calc(var(--header-h) + clamp(3rem, 8vw, 5rem)) 0 5rem;
}

/* Contenu aligné sur la grille du site, largeur de lecture limitée */
.legal__inner > * {
    max-width: 46rem;
}

.legal__back {
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

.legal__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
}

.legal__block {
    padding-top: 1.75rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
}

.legal__block h2 {
    margin-bottom: 0.6rem;
    font-size: 1.1875rem;
}

.legal__block p {
    color: var(--text-muted);
}

.legal__block p + p {
    margin-top: 0.75rem;
}
