/* ==========================================================================
   Composants — aucune couleur en dur : tout passe par tokens.css
   ========================================================================== */

@layer components {
  /* Liens : toujours colorés ET soulignés */
  a {
    color: var(--action);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
  }

  a:hover {
    color: var(--action-hover);
    text-decoration-thickness: 2px;
  }

  /* Boutons */
  .btn {
    display: inline-flex;
    gap: var(--s2);
    align-items: center;
    min-height: 44px;
    padding: var(--s3) var(--s5);
    border-radius: var(--r-btn);
    /* Aussi pour un <button> : police du site et curseur de lien */
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
  }

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

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

  .btn-secondary {
    border: 1px solid var(--border);
    background: none;
    color: var(--text);
  }

  .btn-secondary:hover {
    border-color: var(--action);
    color: var(--action);
  }

  /* Badge de disponibilité (moutarde) */
  .badge {
    display: inline;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    font-size: var(--fs-small);
    line-height: 2.1;
    padding: var(--s1) var(--s3);
    border-radius: var(--r-pill);
    /* Si le texte passe à la ligne, chaque ligne garde sa forme de pilule */
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }

  /* Lignes du badge équilibrées plutôt qu'un mot orphelin */
  p:has(> .badge) {
    text-wrap: balance;
  }

  /* Tags de stack (contour, police mono) */
  .tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .tag {
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    padding: 2px var(--s3);
  }

  /* Cartes projet */
  .card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: var(--s5);
    transition: border-color .2s;
  }

  .card:hover,
  .card:focus-within {
    border-color: var(--action);
  }

  /* Toute la carte est cliquable via le lien « Voir le projet » */
  .card__link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--r-card);
  }

  /* Petites étiquettes mono au-dessus des titres (ex. « 01 — projet 3iL ») */
  .eyebrow {
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    color: var(--text-3);
    letter-spacing: .03em;
    margin: 0 0 var(--s2);
  }

  /* ==========================================================================
     Gabarit commun
     ========================================================================== */

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

  .skip-link {
    position: absolute;
    top: var(--s2);
    left: var(--s2);
    z-index: 100;
    padding: var(--s2) var(--s4);
    background: var(--surface);
    border-radius: var(--r-btn);
    transform: translateY(-200%);
  }

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

  /* Mise en page générale : la page fait au moins la hauteur de l'écran, le contenu
     prend la place restante et le pied de page reste en bas sans scroll sur les pages courtes */
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
  }

  .site-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-bottom: var(--s7);
  }

  /* Cible du focus du bouton « Haut de page » (au clavier) : pas de contour sur tout le contenu */
  .site-main:focus {
    outline: none;
  }

  /* En-tête figé en haut de l'écran */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  /* Les ancres (lien d'évitement, sections) ne passent pas sous l'en-tête figé */
  html {
    scroll-padding-top: 88px;
  }

  /* Liens de la navigation vers les sections de la page : défilement doux */
  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }

  .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    min-height: 72px;
  }

  /* Logo à gauche de l'en-tête, dans la version du thème affiché */
  .site-brand {
    display: block;
    flex-shrink: 0;
    margin-right: var(--s4);
    border-radius: 22%;
  }

  .site-brand__logo {
    display: block;
    width: 40px;
    height: 40px;
  }

  [data-theme="dark"] .site-brand__logo--light,
  [data-theme="light"] .site-brand__logo--dark {
    display: none;
  }

  /* Menu collé au logo, bouton de thème à droite */
  .site-brand + .nav {
    margin-right: auto;
  }

  /* Téléphone : le menu prend toute la place */
  @media (max-width: 600px) {
    .site-brand {
      display: none;
    }
  }

  .nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2) var(--s5);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .nav a {
    display: inline-block;
    padding: var(--s2) 0;
    font-weight: 500;
  }

  /* Page courante : pas une cible de clic, donc couleur de texte */
  .nav a[aria-current] {
    color: var(--text);
    font-weight: 600;
  }

  .theme-toggle {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--r-btn);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: border-color .2s, color .2s;
  }

  /* Lune en clair (passer en sombre), soleil en sombre : les deux icônes sont
     superposées et la nouvelle arrive en tournant */
  .theme-toggle {
    display: grid;
    place-items: center;
  }

  .theme-toggle svg {
    grid-area: 1 / 1;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .4s var(--ease-out), opacity .25s;
  }

  .theme-toggle__sun,
  [data-theme="dark"] .theme-toggle__moon {
    opacity: 0;
    transform: rotate(-90deg) scale(.6);
  }

  [data-theme="dark"] .theme-toggle__sun {
    opacity: 1;
    transform: none;
  }

  .theme-toggle:hover {
    border-color: var(--action);
    color: var(--action);
  }

  /* Pied de page */
  .site-footer {
    border-top: 1px solid var(--border);
    padding-block: var(--s5);
    font-size: var(--fs-small);
    color: var(--text-3);
  }

  .site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--s4);
  }

  .site-footer p {
    margin: 0;
    color: var(--text-3);
  }

  /* Liens de contact (GitHub, LinkedIn, e-mail) */
  /* Accueil : les contacts sont déjà sous les boutons, pas besoin de les répéter en bas */
  body:has(.hero) .site-footer .contact-links {
    display: none;
  }

  .contact-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s2) var(--s5);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .contact-links a {
    display: inline-block;
    padding: var(--s2) 0;
    font-weight: 600;
  }

  /* Boutons icône (GitHub, e-mail) : cadre fin, fond teinté au survol */
  .contact-links .social-btn {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--r-card);
    color: var(--text);
  }

  .social-btn__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 1px solid color-mix(in srgb, var(--text) 28%, transparent);
    border-radius: var(--r-card);
    transition: background-color .3s;
  }

  .social-btn__icon svg {
    width: auto;
    height: 1.4em;
    fill: currentColor;
  }

  .social-btn:hover .social-btn__icon,
  .social-btn:focus-visible .social-btn__icon {
    background-color: color-mix(in srgb, var(--text) 8%, transparent);
  }

  /* Bouton GitHub : au survol, l'Octocat fait coucou */
  .github-btn:hover svg,
  .github-btn:focus-visible svg {
    transform-origin: 50% 90%;
    animation: octocat-wave .6s var(--ease-out);
  }

  @keyframes octocat-wave {
    20% { transform: rotate(-14deg); }
    45% { transform: rotate(10deg); }
    70% { transform: rotate(-6deg); }
  }



  /* Bouton e-mail : au survol, l'avion en papier s'envole en haut à droite
     et revient par le bas à gauche */
  .mail-btn .social-btn__icon {
    overflow: hidden;
  }

  .mail-btn svg {
    height: 1.25em;
  }

  .mail-btn:hover svg,
  .mail-btn:focus-visible svg {
    animation: plane-fly .6s var(--ease-out);
  }

  @keyframes plane-fly {
    45% { transform: translate(20px, -20px); opacity: 0; }
    46% { transform: translate(-20px, 20px); opacity: 0; }
  }

  /* Bouton LinkedIn : au survol, les cadres se décalent en escalier */
  .has-tip {
    position: relative;
  }

  .contact-links .layered-btn {
    display: block;
    padding: 0;
    color: var(--action);
  }

  .layered-btn__layer {
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
    transition: transform .3s;
  }

  .layered-btn__layer > span {
    position: absolute;
    inset: 0;
    border: 1px solid currentColor;
    border-radius: var(--r-btn);
    transition: transform .3s, opacity .3s;
  }

  .layered-btn__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
  }

  .layered-btn__icon svg {
    height: 1.2em;
    fill: currentColor;
  }

  .layered-btn:hover .layered-btn__layer,
  .layered-btn:focus-visible .layered-btn__layer {
    transform: rotate(-35deg) skew(20deg);
  }

  .layered-btn:hover .layered-btn__layer > span:nth-child(1) { opacity: .2; }
  .layered-btn:hover .layered-btn__layer > span:nth-child(2) { opacity: .4; transform: translate(4px, -4px); }
  .layered-btn:hover .layered-btn__layer > span:nth-child(3) { opacity: .6; transform: translate(8px, -8px); }
  .layered-btn:hover .layered-btn__layer > span:nth-child(4) { opacity: .8; transform: translate(12px, -12px); }
  .layered-btn:hover .layered-btn__layer > span:nth-child(5) {
    transform: translate(16px, -16px);
    box-shadow: -1px 1px 3px color-mix(in srgb, var(--action) 50%, transparent);
  }

  /* Carte de profil : apparaît sous le bouton (au-dessus s'il n'y a pas la place, cf. site.js) */
  .profile-tip {
    position: absolute;
    top: calc(100% + var(--s3));
    left: 50%;
    z-index: 20;
    width: max-content;
    padding: var(--s3);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    background: var(--surface);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 14%, transparent);
    opacity: 0;
    transform: translate(-50%, -8px);
    pointer-events: none;
    transition: opacity .3s, transform .3s;
  }

  .has-tip.tip-up .profile-tip {
    top: auto;
    bottom: calc(100% + var(--s3));
    transform: translate(-50%, 8px);
  }

  .has-tip:hover .profile-tip,
  .has-tip:focus-within .profile-tip {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  /* Écran tactile : pas de survol, le toucher ouvre directement LinkedIn */
  @media (hover: none) {
    .profile-tip {
      display: none;
    }
  }

  .profile-tip__user {
    display: flex;
    align-items: center;
    gap: var(--s3);
  }

  .profile-tip__photo {
    width: 44px;
    height: 44px;
    border-radius: var(--r-btn);
    object-fit: cover;
  }

  .profile-tip p {
    margin: 0;
  }

  .profile-tip__name {
    font-weight: 600;
    color: var(--text);
  }

  .profile-tip__handle {
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    color: var(--text-3);
  }

  .profile-tip__about {
    padding-top: var(--s2);
    font-size: var(--fs-small);
  }

  /* Sections */
  .section {
    padding-block: var(--s8);
  }

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

  .section > h3,
  .section__title {
    margin: 0 0 var(--s6);
  }

  .section > h3 {
    font-size: var(--fs-h2);
  }

  /* Blocs de la page (Parcours, Compétences, Projets), séparés par un filet */
  .page-block {
    border-top: 1px solid var(--border);
  }

  /* En-tête de chaque bloc */
  .page-head {
    padding-block: var(--s8) var(--s6);
  }

  .page-head h2 {
    margin: 0 0 var(--s4);
    font-size: var(--fs-h1);
  }

  .page-head + .section {
    padding-top: var(--s5);
  }

  .page-head p {
    margin: 0 0 var(--s5);
    font-size: 1.125rem;
  }

  /* ==========================================================================
     Accueil
     ========================================================================== */

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: var(--s6) var(--s8);
    align-items: end;
    align-content: center;
    /* Premier écran : l'accueil remplit la hauteur sous l'en-tête */
    min-height: calc(100svh - 73px);
    padding-block: var(--s6);
  }

  .hero__identity p:last-child {
    margin-bottom: 0;
  }

  .hero h1 {
    margin: 0 0 var(--s3);
  }

  .hero__subtitle {
    margin: 0 0 var(--s2);
    font-size: clamp(1.15rem, 2.2vw, 1.4rem);
    font-weight: 500;
    color: var(--text);
  }

  .hero__info {
    margin: 0 0 var(--s5);
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    color: var(--text-3);
  }

  .hero__intro {
    margin: 0 0 var(--s6);
    font-size: 1.125rem;
  }

  .hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s3);
    margin-bottom: var(--s6);
  }

  /* ==========================================================================
     Parcours — frise
     ========================================================================== */

  .timeline {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* ==========================================================================
     Parcours en frise (ordinateur, parcours-timeline.js)
     Chaque ligne va du plus ancien au plus récent, de gauche à droite ;
     la carte de l'étape sélectionnée s'affiche sous la frise.
     ========================================================================== */

  /* Les sections classiques sont masquées : leurs étapes sont déplacées dans la frise */
  .parcours-film > .section {
    display: none;
  }

  .parcours-film .gantt {
    padding-bottom: var(--s8);
  }

  .gantt {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s4);
    padding-top: var(--s3);
  }

  /* Grille : noms des catégories à gauche, frise à droite */
  .gantt__chart {
    --gantt-names: 130px;
    position: relative;
    display: grid;
    padding-bottom: var(--s6);
    grid-template-columns: var(--gantt-names) 1fr;
    row-gap: var(--s2);
    align-items: center;
  }

  .gantt__lanes {
    display: contents;
  }

  .gantt__axis {
    position: relative;
    height: 28px;
  }

  .gantt__tick {
    position: absolute;
    top: 0;
    font-family: var(--font-title);
    font-size: 1.35rem;
    line-height: 1;
    color: var(--text);
    transform: translateX(-50%);
  }

  .gantt__lane-name {
    align-self: start;
    padding-top: 8px;
    font-weight: 600;
    color: var(--text-2);
  }

  .gantt__track {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--s2);
    padding-block: var(--s1);
    border-top: 1px solid var(--border);
    padding-top: var(--s3);
  }

  .gantt__row {
    position: relative;
    height: 34px;
  }

  /* Repères verticaux (années en pointillés, aujourd'hui), derrière les barres */
  .gantt__overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--gantt-names);
    right: 0;
    pointer-events: none;
  }

  .gantt__gridline {
    position: absolute;
    top: 30px;
    bottom: var(--s6);
    width: 0;
    border-left: 1px dashed var(--border);
  }

  .gantt__today {
    position: absolute;
    top: 30px;
    bottom: var(--s6);
    width: 0;
    border-left: 2px dashed var(--text-3);
  }

  /* Badge en bas du repère : en haut, il recouvrirait l'année en cours */
  .gantt__today .badge {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translate(-50%, 2px);
    white-space: nowrap;
  }

  /* Barres : une étape = sa durée réelle ; cliquables (survol terracotta), sélection en espresso plein */
  .gantt__bar {
    position: absolute;
    top: 0;
    height: 100%;
    min-width: 10px;
    padding: 0 var(--s3);
    border: 1px solid var(--text-3);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--text);
    font: 600 var(--fs-small) var(--font-text);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: background .2s, border-color .2s, color .2s;
  }

  .gantt__label {
    position: relative;
    display: block;
    width: max-content;
    white-space: nowrap;
  }

  /* Barre trop courte (stage de quelques semaines) : l'étiquette passe à droite de la barre */
  .gantt__bar.is-label-out {
    overflow: visible;
    padding: 0;
  }

  .gantt__bar.is-label-out .gantt__label {
    position: absolute;
    top: 50%;
    left: calc(100% + var(--s2));
    transform: translateY(-50%);
    color: var(--text);
  }

  /* En cours (alternance) : la barre s'arrête à aujourd'hui, bord droit en pointillés */
  .gantt__bar.is-ongoing {
    border-right-style: dashed;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  /* Partie prévue d'une formation (après aujourd'hui) : hachurée */
  .gantt__future {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    background: repeating-linear-gradient(135deg, transparent 0 5px, var(--border) 5px 8px);
  }

  .gantt__bar:hover {
    border-color: var(--action);
    color: var(--action);
  }

  .gantt__bar[aria-selected="true"] {
    border-color: var(--text);
    background: var(--text);
    color: var(--bg);
  }

  .gantt__bar[aria-selected="true"].is-label-out .gantt__label {
    color: var(--text);
    font-weight: 600;
  }

  .gantt__bar[aria-selected="true"] .gantt__future {
    background: repeating-linear-gradient(135deg, transparent 0 5px, var(--bg) 5px 6px);
    opacity: .35;
  }

  /* Carte de l'étape sélectionnée */
  .gantt__details {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: var(--s6);
    padding-top: var(--s4);
    border-top: 1px solid var(--border);
  }

  /* La page défile : la carte prend sa hauteur, sans zone de défilement à elle
     (une barre apparaissait pendant son glissement d'arrivée) */
  .gantt__panels {
    flex: 0 1 960px;
    align-self: stretch;
    min-width: 0;
  }

  .gantt__panel[hidden] {
    display: none;
  }

  .gantt__cards {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* Carte en deux colonnes : l'essentiel à gauche, le détail à droite */
  .gantt__cards .timeline__item,
  .gantt__cards .timeline__item:first-child {
    display: grid;
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    /* Lignes serrées à gauche ; la dernière (1fr) absorbe la hauteur du détail à droite */
    grid-template-rows: repeat(6, auto) 1fr;
    grid-auto-flow: row dense;
    align-content: start;
    gap: 0 var(--s7);
    padding: 0;
    border: 0;
  }

  .gantt__cards .timeline__item > div {
    display: contents;
  }

  .gantt__cards .timeline__item > *,
  .gantt__cards .timeline__item > div > * {
    grid-column: 1;
  }

  .gantt__cards .timeline__item > div > .timeline__list,
  .gantt__cards .timeline__item > div > p:not(.timeline__org, .timeline__lead) {
    grid-column: 2;
    grid-row: 1 / -1;
    margin: 0;
  }

  .gantt__cards .timeline__item .timeline__org {
    margin-bottom: var(--s3);
  }

  /* Dans la carte, la période devient une petite mention (la durée est déjà sur la frise) */
  .gantt__cards .timeline__date {
    flex-direction: row;
    gap: var(--s2);
    margin-bottom: var(--s2);
  }

  .gantt__cards .timeline__year,
  .gantt__cards .timeline__detail {
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    line-height: var(--lh);
    color: var(--text-3);
  }

  .gantt__kind {
    margin: 0 0 var(--s1);
  }

  /* Flèches précédent / suivant */
  .film-arrow {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--r-btn);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: border-color .2s, color .2s, opacity .2s;
  }

  .film-arrow:hover:not(:disabled) {
    border-color: var(--action);
    color: var(--action);
  }

  .film-arrow:disabled {
    opacity: .35;
    cursor: default;
  }

  .timeline__item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--s5);
    padding-block: var(--s6);
    border-top: 1px solid var(--border);
  }

  .timeline__item:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .timeline__date {
    display: flex;
    flex-direction: column;
    gap: var(--s1);
  }

  /* Les années portent la chronologie : grands chiffres dans la police des titres */
  .timeline__year {
    font-family: var(--font-title);
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    line-height: 1;
    color: var(--text);
    font-variant-numeric: lining-nums;
  }

  .timeline__detail {
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    color: var(--text-3);
  }

  .timeline__item h4 {
    margin: 0 0 var(--s1);
  }

  .timeline__org {
    margin: 0 0 var(--s4);
    font-weight: 600;
    color: var(--text-2);
  }

  /* Chapô d'une expérience : le cadre en une ligne, avant les réalisations */
  .timeline__item .timeline__lead {
    margin: 0 0 var(--s3);
    font-size: var(--fs-small);
    color: var(--text-2);
  }

  .timeline__list {
    list-style: disc;
    margin: 0 0 var(--s4);
    padding-left: 1.1em;
    max-width: var(--readw);
    color: var(--text-2);
  }

  .timeline__list li + li {
    margin-top: var(--s1);
  }

  .timeline__item p {
    margin: 0 0 var(--s4);
  }

  .timeline__item .timeline__date {
    margin: 0;
  }

  /* ==========================================================================
     Compétences
     ========================================================================== */

  .skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s7) var(--s8);
  }

  .skill-group h4 {
    margin: 0 0 var(--s2);
  }

  .skill-group p {
    margin: 0 0 var(--s4);
    font-size: var(--fs-small);
  }

  .plain-list {
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--text-2);
  }

  .plain-list li + li {
    margin-top: var(--s2);
  }

  .facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s5) var(--s8);
    margin: 0;
  }

  .facts dt {
    font-weight: 600;
    color: var(--text);
  }

  .facts dd {
    margin: var(--s1) 0 0;
    color: var(--text-2);
  }

  /* ==========================================================================
     Projets
     ========================================================================== */

  .cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s5);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .card h3 {
    margin: 0 0 var(--s3);
    font-size: var(--fs-h3);
  }

  .card p {
    margin: 0 0 var(--s4);
  }

  .card .tags {
    margin-bottom: var(--s5);
  }

  .card__link {
    font-weight: 600;
  }

  .cards > .card:only-child {
    grid-column: 1 / -1;
  }

  @media (min-width: 769px) {
    .cards > .card:only-child {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-areas:
        "eyebrow aside"
        "title   aside"
        "text    aside"
        "tags    aside"
        "link    aside";
      align-items: start;
      column-gap: var(--s7);
      padding: var(--s6);
    }

    .cards > .card:only-child .eyebrow { grid-area: eyebrow; }
    .cards > .card:only-child h3 { grid-area: title; font-size: var(--fs-h2); }
    .cards > .card:only-child p:not(.eyebrow) { grid-area: text; }
    .cards > .card:only-child .tags { grid-area: tags; margin-bottom: var(--s5); }
    .cards > .card:only-child .card__link { grid-area: link; }
    .cards > .card:only-child .card__aside { grid-area: aside; align-self: stretch; }
  }

  /* Page projet */
  /* Ligne de repères « a · b · c » : chaque morceau reste entier, le retour à la ligne
     se fait entre deux morceaux (un morceau trop long pour la ligne se coupe quand même) */
  .meta-line > span {
    display: inline-block;
  }

  .project-head {
    padding-block: var(--s8) var(--s6);
    border-bottom: 1px solid var(--border);
  }

  .back-link {
    display: inline-block;
    margin-bottom: var(--s5);
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
  }

  .project-head h1 {
    margin: 0 0 var(--s3);
  }

  .project-head p {
    margin: 0;
    font-size: 1.125rem;
  }

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

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

  .project-list {
    max-width: var(--readw);
    margin: 0 0 var(--s5);
    padding-left: 1.1em;
    color: var(--text-2);
  }

  .project-list li + li {
    margin-top: var(--s1);
  }

  /* Schéma de la base (SVG) : couleurs de la charte, défile de côté sur petit écran */
  .schema-figure {
    margin: var(--s5) 0 0;
  }

  .schema-figure__scroll {
    overflow-x: auto;
    padding: var(--s4);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    background: var(--surface);
  }

  .schema {
    display: block;
    width: 100%;
    min-width: 760px;
    height: auto;
  }

  .schema__box {
    fill: var(--bg);
    stroke: var(--text-3);
  }

  .schema__head {
    fill: color-mix(in srgb, var(--accent) 22%, var(--bg));
  }

  .schema__name {
    font: 700 15px var(--font-text);
    fill: var(--text);
  }

  .schema__col {
    font: 400 13px var(--font-mono);
    fill: var(--text-2);
  }

  .schema__key {
    font: 600 11px var(--font-mono);
    fill: var(--text-3);
  }

  .schema__links path {
    fill: none;
    stroke: var(--text-3);
    stroke-width: 1.5;
  }

  .schema-figure figcaption {
    margin-top: var(--s2);
    font-size: var(--fs-small);
    color: var(--text-3);
  }

  .project-section h2 {
    margin: 0 0 var(--s4);
  }

  .project-section h3 {
    margin: var(--s6) 0 var(--s2);
  }

  .project-section p {
    margin: 0 0 var(--s4);
  }

  .project-section ul:not(.tags, .reel__track) {
    margin: 0 0 var(--s4);
    padding-left: 1.1em;
    max-width: var(--readw);
    color: var(--text-2);
  }

  .project-section :not(.reel__track, .tags) > li + li {
    margin-top: var(--s2);
  }

  .project-section .last-update {
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    color: var(--text-3);
  }

  /* Captures et diagrammes */
  .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: var(--s4);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .gallery--wide {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .figure {
    margin: 0;
  }

  .figure a {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    overflow: hidden;
    background: var(--surface);
    transition: border-color .2s;
  }

  .figure a:hover {
    border-color: var(--action);
  }

  .figure figcaption {
    margin-top: var(--s2);
    font-size: var(--fs-small);
    color: var(--text-3);
  }

  /* Vidéo de présentation, verticale, sous le carrousel */
  .video-figure {
    width: min(280px, 70%);
    margin: var(--s6) auto 0;
    text-align: center;
  }

  .video-figure video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--r-card);
  }

  /* Carrousel de captures (.reel) : chaque capture une seule fois, en vague. S'il y en a
     peu, elles restent centrées ; sinon la bande défile, à la main (aimantée sur chaque
     capture, points de position en Chrome 135+) et, avec site.js, toute seule en
     aller-retour (classe is-auto). */
  .reel__track {
    display: flex;
    justify-content: safe center;
    gap: var(--s5);
    margin: 0;
    /* Place pour l'inclinaison, le décalage en vague et l'agrandissement au survol */
    padding: var(--s5) var(--s3) var(--s6);
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    scroll-marker-group: after;
  }

  /* Défilement automatique : l'aimantation bloquerait le mouvement continu */
  .reel.is-auto .reel__track {
    scroll-snap-type: none;
  }

  .reel__track > li {
    flex: 0 0 clamp(170px, 20vw, 230px);
    scroll-snap-align: center;
    rotate: -2deg;
    transition: rotate .4s var(--ease-out), scale .4s var(--ease-out), opacity .3s;
  }

  /* Vague : une capture sur deux penche de l'autre côté et descend un peu */
  .reel__track > li:nth-child(even) {
    rotate: 2deg;
    translate: 0 var(--s4);
  }

  .reel__track > li:hover,
  .reel__track > li:focus-within {
    rotate: 0deg;
    scale: 1.06;
  }

  /* Légende sur une seule ligne, centrée sous sa capture même si elle est plus large */
  .reel__track figcaption {
    display: flex;
    justify-content: center;
    white-space: nowrap;
  }

  .reel__track:hover > li:not(:hover) {
    opacity: .55;
  }

  .reel__track::scroll-marker-group {
    display: flex;
    justify-content: center;
    gap: var(--s2);
  }

  .reel__track > li::scroll-marker {
    content: "";
    width: 10px;
    height: 10px;
    border: 1px solid var(--text-3);
    border-radius: var(--r-pill);
  }

  .reel__track > li::scroll-marker:target-current {
    border-color: var(--action);
    background: var(--action);
  }

  .reel__toggle {
    margin-top: var(--s3);
    padding: var(--s2) var(--s3);
    border: 1px solid var(--border);
    border-radius: var(--r-btn);
    background: none;
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    color: var(--text-2);
    cursor: pointer;
    transition: border-color .2s, color .2s;
  }

  .reel__toggle:hover {
    border-color: var(--action);
    color: var(--action);
  }

  @media (max-width: 768px) {
    .reel__track > li {
      flex-basis: 62%;
    }
  }

  /* Capture en grand (site.js) : la carte seule, au centre, sur un fond flouté */
  .shot-dialog {
    width: fit-content;
    height: fit-content;
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    background: none;
    overflow: visible;
    /* Le glissement horizontal change de capture (site.js) ; le zoom à deux doigts reste */
    touch-action: pinch-zoom;
  }

  .shot-dialog::backdrop {
    background: color-mix(in srgb, var(--bg) 45%, transparent);
    backdrop-filter: blur(12px);
  }

  .shot-dialog img {
    display: block;
    width: auto;
    height: auto;
    max-width: 92vw;
    max-height: 88vh;
    max-height: 88svh;
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    box-shadow: 0 24px 64px color-mix(in srgb, #000 40%, transparent);
    cursor: zoom-out;
  }

  .shot-dialog__close {
    position: fixed;
    top: var(--s4);
    right: var(--s4);
    background: var(--surface);
  }

  /* ==========================================================================
     Bouton « Haut de page » (pages longues, ajouté par site.js)
     ========================================================================== */

  /* La pastille fait toujours sa largeur complète : clip-path n'en montre que le
     rond de droite, puis la dévoile au survol ou au focus (pas d'animation de largeur) */
  .to-top {
    position: fixed;
    right: var(--s5);
    bottom: var(--s5);
    z-index: 50;
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 0 0 var(--s5);
    border: 0;
    border-radius: var(--r-pill);
    background: var(--action);
    color: var(--on-action);
    font: 700 var(--fs-small) var(--font-text);
    cursor: pointer;
    clip-path: inset(0 0 0 calc(100% - 48px) round var(--r-pill));
    transition: clip-path .25s cubic-bezier(.23, 1, .32, 1), background .2s,
      opacity .2s, transform .2s, visibility .2s;
  }

  .to-top__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }

  .to-top__icon svg {
    width: 18px;
    height: 18px;
  }

  @media (hover: hover) and (pointer: fine) {
    .to-top:hover {
      clip-path: inset(0 round var(--r-pill));
      background: var(--action-hover);
    }
  }

  /* Au clavier : tout est dévoilé, contour de focus compris */
  .to-top:focus-visible {
    clip-path: inset(-4px round var(--r-pill));
    background: var(--action-hover);
  }

  .to-top[data-visible="false"] {
    opacity: 0;
    transform: translateY(12px);
    visibility: hidden;
    pointer-events: none;
  }

  /* ==========================================================================
     Page 404 — la télé « Pas de signal »
     ========================================================================== */

  .notfound {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: var(--s5);
    text-align: center;
  }

  .notfound h1 {
    margin: var(--s5) 0 var(--s3);
  }

  .notfound p {
    margin: 0 auto var(--s6);
  }

  .notfound .hero__actions {
    justify-content: center;
  }

  .tv-404 {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    font-size: clamp(9px, min(2.4vw, 1.9vh), 17px);
    padding-top: var(--s4);
  }

  /* Le grand « 404 » derrière la télé */
  .tv-404__number {
    position: absolute;
    inset: 0;
    z-index: -1;
    display: grid;
    place-items: center;
    font-family: var(--font-title);
    font-size: 14em;
    line-height: 1;
    color: var(--border);
    user-select: none;
  }

  .tv {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .tv__antenna {
    position: relative;
    width: 10em;
    height: 4.5em;
  }

  .tv__rod {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 4.8em;
    background: var(--text);
    transform-origin: bottom center;
  }

  .tv__rod--left { transform: rotate(-32deg); }
  .tv__rod--right { transform: rotate(24deg); }

  .tv__rod::before {
    content: "";
    position: absolute;
    top: -.5em;
    left: 50%;
    width: .7em;
    height: .7em;
    border: 2px solid var(--text);
    border-radius: 50%;
    background: var(--accent);
    transform: translateX(-50%);
  }

  .tv__body {
    display: flex;
    gap: 1em;
    width: 18em;
    padding: 1em;
    border: 2px solid var(--text);
    border-radius: 1em;
    background: var(--accent);
  }

  .tv__screen {
    flex: 1;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    border: 2px solid var(--text);
    border-radius: .8em;
    /* Neige d'écran : deux motifs très fins superposés et décalés en boucle */
    background:
      repeating-radial-gradient(var(--text) 0 .0001%, var(--bg) 0 .0002%) 50% 0 / 2500px 2500px,
      repeating-conic-gradient(var(--text) 0 .0001%, var(--bg) 0 .0002%) 60% 60% / 2500px 2500px;
    background-blend-mode: difference;
    animation: tv-static .2s infinite alternate;
  }

  .tv__label {
    padding: .25em .6em;
    border-radius: .3em;
    background: var(--text);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: .85em;
  }

  .tv__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .8em;
    width: 3.6em;
  }

  .tv__knob {
    position: relative;
    width: 1.6em;
    height: 1.6em;
    border: 2px solid var(--text);
    border-radius: 50%;
    background: var(--surface);
  }

  .tv__knob::after {
    content: "";
    position: absolute;
    top: .15em;
    left: 50%;
    width: 2px;
    height: .55em;
    background: var(--text);
    transform: translateX(-50%) rotate(var(--knob-angle, 35deg));
    transform-origin: bottom center;
  }

  .tv__knob + .tv__knob { --knob-angle: -50deg; }

  .tv__speaker {
    width: 2.6em;
    height: 2.2em;
    background: repeating-linear-gradient(var(--text) 0 2px, transparent 2px 6px);
  }

  .tv__feet {
    display: flex;
    justify-content: space-between;
    width: 13em;
  }

  .tv__feet span {
    width: 1.5em;
    height: .9em;
    border-radius: 0 0 .3em .3em;
    background: var(--text);
  }

  @keyframes tv-static {
    to { background-position: 50% 0, 60% 50%; }
  }

  /* ==========================================================================
     Projets — colonne de droite de la carte (aperçu du projet)
     ========================================================================== */

  /* Aperçu du projet : capture d'écran recadrée sur le haut de la page */
  /* Logo du projet dans la colonne de droite de la carte, centré en hauteur */
  .card__aside:has(.card__logo) {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .card__logo {
    width: min(240px, 100%);
    height: auto;
  }

  /* Icône d'appli carrée : plus petite, coins arrondis comme sur le téléphone */
  .card__logo--icon {
    width: min(120px, 100%);
    border-radius: 22%;
  }

  /* Mobile : le logo passe sous le lien « Voir le projet » */
  @media (max-width: 768px) {
    .card__aside:has(.card__logo) {
      margin-top: var(--s5);
    }
  }

  .card__shot {
    width: 240px;
    height: 100%;
    max-height: 220px;
    min-height: 160px;
    object-fit: cover;
    object-position: top;
    border: 1px solid var(--border);
    border-radius: var(--r-btn);
  }

  /* ==========================================================================
     Fenêtre du CV (dialog + iframe)
     ========================================================================== */

  .cv-dialog {
    width: min(92vw, 900px);
    height: 92vh;
    height: 92svh;
    max-width: none;
    max-height: none;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    background: var(--surface);
    color: var(--text);
  }

  .cv-dialog[open] {
    display: flex;
    flex-direction: column;
  }

  .cv-dialog::backdrop {
    background: var(--text);
    opacity: .6;
  }

  .cv-dialog__bar {
    display: flex;
    align-items: center;
    gap: var(--s5);
    padding: var(--s2) var(--s2) var(--s2) var(--s5);
    border-bottom: 1px solid var(--border);
  }

  .cv-dialog__title {
    margin: 0 auto 0 0;
    font-size: var(--fs-h3);
  }

  .cv-dialog__bar a {
    font-weight: 600;
  }

  .cv-dialog__close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--r-btn);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: border-color .2s, color .2s;
  }

  .cv-dialog__close:hover {
    border-color: var(--action);
    color: var(--action);
  }

  .cv-dialog iframe {
    flex: 1;
    width: 100%;
    border: 0;
    border-radius: 0 0 var(--r-card) var(--r-card);
  }

  /* ==========================================================================
     Animations GSAP (animations.js)
     ========================================================================== */

  /* Hero caché jusqu'à son animation d'arrivée (classe « anim » posée dans le <head>).
     Si GSAP tarde ou ne se charge pas, il réapparaît de lui-même après 1,2 s. */
  .anim .hero h1,
  .anim .hero__subtitle,
  .anim .hero__info {
    visibility: hidden;
    animation: anim-secours 0s 1.2s forwards;
  }

  @keyframes anim-secours {
    to { visibility: visible; }
  }

  /* Soulignés moutarde « tracés à la main » */
  .scribble {
    position: relative;
    display: inline-block;
  }

  .scribble__line {
    position: absolute;
    left: -2%;
    bottom: -.3em;
    width: 104%;
    height: .45em;
    overflow: visible;
    pointer-events: none;
  }

  .scribble__line path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.6;
    stroke-linecap: round;
  }

  /* Compétences : tags cliquables qui montrent où la techno a servi */
  .tag:has(.tag__btn) {
    padding: 0;
    border-color: color-mix(in srgb, var(--action) 45%, transparent);
    color: var(--action);
    transition: background .2s, color .2s, border-color .2s;
  }

  .tag:has(.tag__btn):hover {
    border-color: var(--action);
  }

  .tag:has(.tag__btn[aria-expanded="true"]) {
    border-color: var(--action);
    background: var(--action);
    color: var(--on-action);
  }

  .tech-hint {
    margin: calc(-1 * var(--s4)) 0 var(--s6);
    font-size: var(--fs-small);
    color: var(--text-3);
  }

  .tag__btn {
    padding: 2px var(--s3);
    border: 0;
    border-radius: var(--r-pill);
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
  }

  /* flow-root : la marge du panneau compte dans la hauteur animée de l'emplacement */
  .tech-panel-slot {
    display: flow-root;
  }

  /* Étape du Parcours atteinte depuis le panneau d'une technologie : brève surbrillance */
  @keyframes flash-step {
    from { background-color: color-mix(in srgb, var(--accent) 18%, transparent); }
  }

  .timeline__item.is-flash {
    border-radius: var(--r-card);
    animation: flash-step 1.6s .3s ease-out backwards;
  }

  .tech-panel {
    margin-top: var(--s7);
    padding: var(--s5) var(--s6);
    border: 1px solid var(--action);
    border-radius: var(--r-card);
    background: var(--surface);
  }

  .tech-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    margin-bottom: var(--s4);
  }

  .tech-panel__title {
    margin: 0;
    font-size: var(--fs-h3);
  }

  .tech-panel__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--s3);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .tech-panel__list a {
    display: block;
    height: 100%;
    padding: var(--s3) var(--s4);
    border: 1px solid var(--border);
    border-radius: var(--r-btn);
    text-decoration: none;
    transition: border-color .2s;
  }

  .tech-panel__list a:hover {
    border-color: var(--action);
  }

  .tech-panel__kind {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    color: var(--text-3);
  }

  .tech-panel__name {
    display: block;
    font-weight: 600;
    color: var(--text);
  }

  /* Projets en défilement horizontal (à partir de 3 projets, sur ordinateur) */
  .is-horizontal .cards {
    display: flex;
    gap: var(--s5);
    width: max-content;
  }

  .is-horizontal .card {
    flex: 0 0 min(560px, 70vw);
  }

  /* Bloc de code (page de projet) : les lignes se tapent une à une */
  .code-block {
    margin: 0;
    padding: var(--s5);
    overflow-x: auto;
    border-radius: var(--r-card);
    background: var(--code-bg);
    color: var(--code-text);
    font-family: var(--font-mono);
    font-size: .8125rem;
    line-height: 1.7;
  }

  /* Ligne à la largeur de son texte : le dévoilement avance d'un caractère par étape */
  .code-line {
    display: block;
    width: max-content;
    min-height: 1.7em;
  }

  /* Mobile : lignes repliées plutôt que coupées, suite décalée sous le début de la ligne */
  @media (max-width: 768px) {
    .code-block {
      font-size: .75rem;
    }

    .code-line {
      width: auto;
      padding-left: 4ch;
      text-indent: -4ch;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }
  }

  /* Écrans tactiles : cibles d'au moins 44 px (tags un peu moins, pour rester lisibles) */
  @media (pointer: coarse) {
    .card__link,
    .back-link,
    .nav a,
    .reel__toggle {
      display: inline-flex;
      align-items: center;
      min-height: 44px;
    }

    .tag__btn {
      padding: var(--s2) var(--s3);
    }

    .contact-links .social-btn,
    .layered-btn__layer {
      width: 44px;
      height: 44px;
    }
  }

  /* Écrans d'ordinateur peu hauts (portable 1280 x 720…) : titres et frise plus compacts,
     pour voir la frise et la carte de l'étape ensemble */
  @media (min-width: 1100px) and (max-height: 820px) {
    .page-head {
      padding-block: var(--s6) var(--s3);
    }

    .page-head h2 {
      font-size: clamp(2.2rem, 7vh, 4.5rem);
    }

    .parcours-film .gantt__chart {
      padding-bottom: var(--s3);
    }

    .parcours-film .gantt__row {
      height: 28px;
    }

    .parcours-film .gantt__details {
      padding-top: var(--s3);
    }
  }

  .tok-k { color: var(--code-keyword); }
  .tok-s { color: var(--code-string); }
  .tok-t { color: var(--code-type); }
  .tok-n { color: var(--code-number); }
  .tok-c { color: var(--code-comment); font-style: italic; }

  /* ==========================================================================
     Transition entre les pages
     Le repère de la navigation glisse vers la rubrique choisie, sur la
     bordure de l'en-tête, pendant que le contenu s'efface ; la nouvelle page
     fait apparaître son contenu en douceur. En-tête et pied de page ne bougent pas.
     ========================================================================== */

  .nav__glider {
    position: absolute;
    bottom: -1px;
    left: 0;
    /* Trait de 1px étiré en transform (pas d'animation de largeur) */
    width: 1px;
    height: 2px;
    background: var(--action);
    transform-origin: left;
    transform: translateX(var(--glider-x, 0)) scaleX(var(--glider-w, 0));
    pointer-events: none;
    transition: transform .22s var(--ease-out), opacity .2s;
  }

  .nav__glider[data-ready="false"] {
    transition: none;
  }

  .nav__glider[data-visible="false"] {
    opacity: 0;
  }

  @keyframes page-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
  }

  .site-main {
    animation: page-in var(--page-in) var(--ease-out) backwards;
  }

  .is-leaving .site-main {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity var(--page-out) ease-in, transform var(--page-out) ease-in;
  }

  /* ==========================================================================
     Responsive
     ========================================================================== */

  @media (max-width: 768px) {
    .site-header__inner {
      padding-block: var(--s2);
    }

    html {
      scroll-padding-top: 64px;
    }

    .hero {
      grid-template-columns: 1fr;
      align-items: start;
      align-content: start;
      gap: var(--s4);
      min-height: 0;
      padding-block: var(--s4) var(--s7);
    }

    .hero h1 {
      margin-bottom: var(--s2);
    }

    .hero__intro {
      margin-bottom: var(--s4);
      font-size: .9375rem;
      line-height: 1.5;
    }

    .hero__subtitle {
      font-size: 1.05rem;
    }

    .hero .badge {
      font-size: .8125rem;
      line-height: 1.95;
    }

    .hero__actions {
      margin-bottom: var(--s4);
    }

    .container {
      padding: 0 var(--s4);
    }

    /* Navigation et bouton de thème sur une seule ligne */
    .site-header__inner {
      flex-wrap: nowrap;
      min-height: 0;
      gap: var(--s3);
    }

    .nav ul {
      flex-wrap: nowrap;
      gap: 0 var(--s3);
    }

    .nav a {
      font-size: .875rem;
    }

    .site-main {
      padding-bottom: var(--s5);
    }

    .site-footer {
      padding-block: var(--s4);
    }

    .timeline__item {
      grid-template-columns: 1fr;
      gap: var(--s2);
    }

    .timeline__date {
      flex-direction: row;
      align-items: baseline;
      gap: var(--s3);
    }

    .skills-grid,
    .facts,
    .cards {
      grid-template-columns: 1fr;
    }

    .skills-grid {
      gap: var(--s6);
    }

    .gallery--wide {
      grid-template-columns: 1fr;
    }
  }

  /* Très petits écrans (moins de 360 px) : la navigation repasse sur deux lignes plutôt que de déborder */
  @media (max-width: 360px) {
    .site-header__inner,
    .nav ul {
      flex-wrap: wrap;
    }

    /* Navigation sur deux lignes : le repère ne peut pas suivre */
    .nav__glider {
      display: none;
    }
  }
}
