/* =======================
   0. POLICE (auto-hébergée : IBM Plex Mono)
======================= */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-100-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-700-normal.woff2') format('woff2');
}

/* =======================
   PALETTE : noir sur blanc, les images de projet sont les seules couleurs
======================= */
:root {
  --ink: #000;             /* texte fort, traits, boutons */
  --paper: #fff;           /* fond */
  --graphite: #333;        /* texte courant */
  --graphite-soft: #444;   /* texte secondaire */
  --caption: #6b6b6b;      /* légendes, petits libellés */
  --rule: #ccc;            /* filets */
  --hairline: #eee;        /* traits très légers */
  --selection: #010cfe;    /* seule couleur du site : le texte sélectionné */
}

/* =======================
   1. GÉNÉRAL & RESET (Optimisé Safari)
======================= */
html.lenis {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

/* Scrollbar personnalisée (Desktop) */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--paper);
}
::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ink);
}

body {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  background-color: var(--paper);
  color: var(--graphite);
  /* La transition de page gère l'opacité, on s'assure ici de la visibilité par défaut */
  opacity: 1;
  /* Lissage des polices pour un rendu plus fin et élégant */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Texte lisible uniquement par les lecteurs d'écran (ex : titre h1 de l'index) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Contour visible au clavier (Tab) uniquement, pas au clic souris */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* =======================
   2. HEADER GÉNÉRAL
======================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 55px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 40px;
  background: transparent;
  z-index: 10003;
}

/* Logos à gauche */
.logo-link {
  position: absolute;
  top: 48px;
  left: 40px;
  transform: translateY(-50%);
  height: 22px;
  display: flex;
  align-items: center;
  z-index: 10000;
}

.logo {
  display: block;
  width: auto;
  height: auto;
  max-height: 100%;
  position: relative;
}

.logo-long { display: block; }
.logo-short { display: none; }

/* Titre central */
.header-center-container {
  position: absolute;
  top: 48px;
  left: 48%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.header-center {
  font-weight: 900;
  font-size: 15px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ink);
}

/* Bouton + dans le header */
.header-plus {
  position: absolute;
  top: 45px;
  right: 112px;
  width: 40px;
  height: 40px;
  z-index: 10010;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 3.3rem;
  font-weight: 100;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transform: translateY(-50%);
  transform-origin: center center;
  transition: transform 0.3s ease;
  color: black !important;
}

.header-plus.active {
  transform: translateY(-50%) rotate(45deg);
}

/* Version Mobile Header */
@media (max-width: 768px) {
  header {
    padding: 0 0px;
    height: 50px;
  }
  .logo-link {
    left: 20px;
    height: 18px;
  }
  .header-center {
    font-size: 14px;
  }
  .header-plus {
    right: 30px;
    font-size: 3.5rem;
    top: 43px;
  }
  /* Le titre central est masqué sur mobile */
  .header-center-container {
    opacity: 0;
  }
}

/* Header ordinateur : marge au-dessus un peu plus grande, logo et éléments un peu plus gros */
@media (min-width: 769px) {
  .logo-link {
    top: 72px;
    height: 20px;
  }
  .header-center-container {
    top: 72px;
  }
  .header-center {
    font-size: 17px;
    font-weight: 600; /* un peu moins gras puisque le texte est plus grand */
  }
  .header-plus {
    top: 69px;
    font-size: 3.6rem;
  }
}

/* Bouton CONTACT du header (et bouton son à sa gauche) : cachés par défaut, affichés sur ordinateur dans la section 5.2 (index) */
.header-actions {
  display: none;
}
.header-contact {
  display: none;
}

/* =======================
   3. MENU DÉROULANT (Avec Animation Soulignement)
======================= */

/* Zone invisible qui capte le clic en dehors du menu pour le fermer (desktop) */
#menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1400;
}
#menu-overlay.show {
  display: block;
}

.header-menu {
  position: absolute;
  top: 30px;
  right: 160px;
  width: max-content;
  max-height: 0;
  overflow: hidden;
  /* Fermé : le menu n'est plus atteignable au clavier ni lu par les lecteurs d'écran */
  visibility: hidden;
  transition: max-height 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  transform: translateX(100%);
  z-index: 1500;
  background: rgba(255, 255, 255, 0.95); /* Fond légèrement plus opaque pour lisibilité */
  border: none;
  box-shadow: none;
}

.header-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

/* Liens du menu avec animation */
.header-menu li a {
  position: relative; /* Nécessaire pour l'after */
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-size: 0.95rem;
  transition: background 0.2s ease; /* On garde la transition de fond au cas où */
}

/* Ligne de soulignement animée */
.header-menu li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 8px;
  left: 15px; /* Aligné avec le padding du texte */
  background-color: var(--ink);
  transition: width 0.3s ease-in-out;
}

.header-menu li a:hover::after,
.header-menu li a:focus-visible::after,
.header-menu li a[aria-current="page"]::after {
  width: calc(100% - 30px); /* Largeur totale moins le padding gauche/droite */
}

/* Menu ouvert */
.header-menu.show {
  max-height: 640px; /* assez haut pour afficher CONTACT en entier */
  transform: translateX(0);
  visibility: visible;
  transition: max-height 0.2s ease, transform 0.2s ease, visibility 0s;
}

.header-menu ul li.menu-separator {
  border-top: 1px solid var(--rule);
  margin: 0.5rem 0;
  list-style: none;
  pointer-events: none;
}

.header-menu ul li a.menu-contact {
  font-weight: 700;
}

/* Le menu déroulant suit le bouton + (descendu de 24 px) */
@media (min-width: 901px) {
  .header-menu {
    top: 54px;
  }
}

/* =========================================
   MENU MOBILE & OVERLAY (CORRIGÉ & SCROLLABLE)
========================================= */
@media (max-width: 900px) {
  /* On cache l'overlay séparé car le menu lui-même fera office de fond */
  #menu-overlay {
    display: none !important;
  }

  .header-menu {
    /* POSITIONNEMENT : Fixe et Plein Écran */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh; /* Utilisation de dvh pour couvrir tout l'écran mobile (barres incluses) */

    /* RESET DES STYLES DESKTOP */
    transform: none;
    right: auto;
    border-radius: 0;

    /* STYLE VISUEL */
    background-color: var(--paper);
    z-index: 10002; /* Juste sous le header (10003) pour garder le bouton + accessible */
    padding: 0;

    /* FLEXBOX : Centrage parfait */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centre verticalement */
    align-items: center;     /* Centre horizontalement */

    /* ANIMATION D'APPARITION (Fade global) */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  }

  .header-menu.show {
    opacity: 1;
    pointer-events: auto;
    max-height: none; /* CORRECTION CRUCIALE : Annule la limite de 500px du desktop */
    transition: opacity 0.3s ease, visibility 0s;
  }

  .header-menu ul {
    /* GESTION DU CONTENU */
    width: 100%;
    max-height: 100%;
    overflow-y: auto; /* Scroll si la liste est trop longue */
    -webkit-overflow-scrolling: touch;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px; /* Espacement plus rythmé */

    padding: 100px 20px 40px 20px; /* Espace supérieur ajusté pour l'équilibre */
    margin: 0;
    box-sizing: border-box;
  }

  /* LIENS DU MENU (Sans animation cascade) */
  .header-menu li {
    width: 100%;
    text-align: center;
  }

  .header-menu li a {
    font-size: 1.15rem; /* Taille légèrement augmentée pour la lisibilité */
    font-weight: 300;   /* Graisse plus fine pour l'élégance architecturale */
    padding: 8px 15px;
    display: inline-block;
  }

  /* Suppression du soulignement animé desktop sur mobile */
  .header-menu li a::after {
    display: none;
  }

  .header-menu ul li.menu-separator {
    width: 40px; /* Petit trait de séparation centré */
    border-top: 1px solid var(--ink);
    margin: 15px auto;
  }

  /* Adaptation Dark Mode Mobile (Force le fond noir opaque) */
  body.dark-page .header-menu {
    background-color: var(--ink) !important;
  }
  body.dark-page .header-menu ul li.menu-separator {
    border-color: var(--paper);
  }
}

/* =======================
   4. INTRO (Index)
======================= */
.intro {
  padding-top: 120px;
  text-align: center;
}

/* =======================
   5. INDEX : PROJETS CARDS
======================= */
.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 70px;
  padding: 60px;
}

.project-card {
  background-color: var(--paper);
  width: clamp(300px, 80%, 1400px);
  aspect-ratio: 16 / 9;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  /* État initial pour l'animation : invisible et décalée vers le bas */
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out, filter 0.2s ease;
  overflow: hidden;
  /* Optimisation majeure : ne calcule pas le rendu si hors écran */
  content-visibility: auto;
  contain-intrinsic-size: 1px 600px; /* Taille estimée pour éviter les sauts de scroll */
}

.project-media-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden; /* Le secret de l'effet de révélation */
}

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

.project-card:hover {
  filter: brightness(1.1);
}

.project-info {
  position: absolute;
  top: 0%;
  left: 0%;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 15px;
}

/* Apparition du texte au survol (desktop) et au focus clavier */
.project-card:hover .project-info,
.project-card:focus-visible .project-info {
  opacity: 1;
}

.project-info .title {
  font-weight: 500;
  display: block;
  color: var(--ink);
}

.project-info .details {
  font-size: 12px;
  font-weight: 300;
  display: block;
  color: #3a3a3a;
}
.project-info .annee {
  font-size: 12px;
  font-weight: 300;
  display: block;
  color: #3a3a3a;
}

.project-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

/* Version Mobile Index */
@media (max-width: 768px) {
  .projects {
    padding: 0;
    padding-top: 22%;
    padding-bottom: 40px;
  }

  .project-card {
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    margin: 0 0 30px 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .project-card img,
  .project-card video {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .project-info {
    position: relative;
    top: auto;
    left: auto;
    margin-top: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: none;
    text-align: left;
    max-width: 100%;
    padding: 10px 20px;
    display: block;
  }

  .project-info.active {
    opacity: 1;
  }

  .project-info .title {
    font-size: 14px;
    font-weight: 500;
    display: block;
    color: var(--ink);
  }

  .project-info .details,
  .project-info .annee {
    display: none;
  }
}

/* =================================================
   5.1. INDEX : ANIMATION D'APPARITION DES CARTES
================================================= */

/* Quand la carte est visible (.scrolled), elle remonte et devient opaque */
.project-card.scrolled {
  opacity: 1;
  transform: translateY(0);
}

/* =======================
   5.2. INDEX ORDINATEUR (> 768px) : liste + image au survol
   (la version mobile ci-dessus reste inchangée)
======================= */
@media (min-width: 769px) {
  .intro {
    padding-top: 180px; /* début de page plus aéré */
  }
  .projects {
    display: block;
    padding: 30px 40px 80px;
    min-height: 100vh;
  }
  .project-card {
    display: flex;
    align-items: baseline;
    width: auto;
    max-width: none;
    aspect-ratio: auto;
    margin: 0;
    padding: 0.35vw 0;
    background: none;
    overflow: visible;
    content-visibility: visible;
    color: var(--ink);
    text-decoration: none;
    transform: translateY(30px);
    pointer-events: none; /* la ligne entière n'est plus cliquable : seul le titre l'est (voir .title) */
  }
  .project-card:hover {
    filter: none;
  }
  .project-media-wrapper {
    display: none; /* l'image apparaît près du curseur (script.js) */
  }
  .project-info {
    position: static;
    opacity: 1;
    background: none;
    padding: 0;
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 22px;
  }
  .project-info .title {
    display: flex;
    align-items: baseline;
    gap: 22px;
    font-size: clamp(24px, 4.3vw, 76px);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1;
    transition: opacity 0.25s ease;
    pointer-events: auto;
    cursor: pointer;
  }
  .idx-num {
    flex: none;
    width: 34px;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0;
    transform: translateY(-1.6vw);
  }
  /* Stage et Mémoire (sans numéro) : un tiret à la place du chiffre */
  .idx-num:empty::before {
    content: "–";
  }
  .idx-sep {
    display: none;
  }
  .idx-meta {
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
  }
  .project-info .details,
  .project-info .annee {
    font-size: 12px;
    line-height: 1.4;
    color: var(--ink);
  }

  /* Image affichée à droite du titre survolé (position calculée dans script.js) */
  #index-float {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    z-index: 40;
    pointer-events: none;
  }
  #index-float img,
  #index-float video {
    position: absolute;
    top: 0;
    left: 0;
    /* 16/9 = format des images d'origine (rien n'est coupé) ; taille = environ 3,5 lignes de la liste */
    width: min(35.5vw, 680px);
    aspect-ratio: 16 / 9;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  #index-float img.on,
  #index-float video.on {
    opacity: 1;
  }

  /* Header : bouton CONTACT à la place du + (index, ordinateur uniquement) */
  .plus-mobile-only {
    display: none;
  }
  .header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    position: absolute;
    top: 72px;
    right: 120px; /* le header est plus large que l'écran (padding) : 120px = 40px du bord, aligné sur la liste */
    transform: translateY(-50%);
    z-index: 10010;
  }
  .header-contact {
    display: block;
    background: transparent;
    border: 1px solid var(--ink);
    border-radius: 4px;
    padding: 8px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  .header-contact:hover,
  .header-contact:focus-visible {
    background-color: var(--ink);
    color: var(--paper);
  }
}

/* Au survol (souris) : les autres titres s'effacent */
@media (min-width: 769px) and (hover: hover) and (pointer: fine) {
  .projects:has(.project-card:hover) .project-info .title,
  .projects:has(.project-card:focus-visible) .project-info .title {
    opacity: 0.14;
  }
  .projects .project-card:hover .project-info .title,
  .projects .project-card:focus-visible .project-info .title {
    opacity: 1;
  }
}

/* =======================
   6. PAGE PROJET : INTRO (Alignée Gauche)
======================= */
.projet-intro {
  padding-top: 150px;
  max-width: 900px;
  margin-left: 40px;
  margin-right: 40px;
  margin-bottom: 60px; /* Espace avant la galerie */
  text-align: left; /* Alignement gauche restauré */
}

.project-title {
  font-weight: 500;
  font-size: 1.8rem;
  line-height: 1.05;
  letter-spacing: -1.2px;
  margin-top: 0.83em;
  margin-bottom: 0px;
  color: var(--ink);
}

.project-subtitle {
  font-weight: 300;
  font-size: 1.4rem;
  line-height: 1.05;
  letter-spacing: -1.2px;
  margin-top: 0px;
  margin-bottom: 12px;
  color: var(--ink);
}

.project-date {
  font-weight: 300;
  font-size: 0.9rem;
  letter-spacing: -0.02em; /* petit texte : à -1.2px les lettres se touchaient */;
  margin-top: 0px;
  margin-bottom: 28px;
  color: var(--ink);
}

.project-description {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 0px;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .projet-intro {
    padding: 120px 0 0;
    margin-top: 0;
    margin-left: 20px; /* Marges réduites mobile */
    margin-right: 20px;
    margin-bottom: 40px;
  }
  .project-title {
    font-size: 1.4rem;
    line-height: 1.1;
  }
  .project-subtitle {
    font-size: 1.2rem;
    line-height: 1.1;
  }
  .project-date {
    font-size: 0.8rem;
  }
  .project-description {
    font-size: 0.75rem;
    line-height: 1.5;
    margin-bottom: 8px;
  }
}

/* Ordinateur : début de page plus aéré (suit le header plus grand) */
@media (min-width: 769px) {
  .projet-intro {
    padding-top: 205px;
  }
}

/* =======================
   7. PAGE PROJET : GALERIE (Colonne Unique)
======================= */
.galerie-projet {
  display: flex;
  flex-direction: column; /* Retour à la colonne unique verticale */
  gap: 60px; /* Espace entre les images */
  max-width: 100%;
  margin-left: 40px;
  margin-right: 40px;
  margin-bottom: 60px;
}

/* Images de la galerie */
.galerie-projet img,
.galerie-projet video {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  display: block;
}

/* Mobile Galerie */
@media (max-width: 768px) {
  .galerie-projet {
    margin-left: 0; /* Bord à bord sur mobile */
    margin-right: 0;
    gap: 30px;
  }
  .galerie-projet img {
    width: 100%;
  }
}

/* =======================
   8. PAGE PROJET : NAVIGATION
======================= */
.project-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
  margin: 80px 40px 40px 40px; /* Alignement avec le reste */
  padding-top: 40px;
  border-top: 1px solid #e0e0e0; /* Ligne de séparation fine */
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  transition: opacity 0.3s ease;
  max-width: 45%;
}

.nav-link span {
  display: block;
  font-size: 0.75rem;
  color: var(--caption);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-link.nav-next {
  text-align: right;
}

.nav-link:hover {
  opacity: 0.6;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .project-navigation {
    flex-direction: column;
    gap: 30px;
    margin: 40px 20px;
    text-align: center;
  }
  /* Force l'alignement centré sur mobile pour le lien "Suivant" */
  .nav-link.nav-next {
    text-align: center;
  }
}

/* =======================
   9. FOOTER
======================= */
footer {
  text-align: center;
  padding: 20px 0;
  background: transparent;
}

.footer-line {
  border: none;
  border-top: 1px solid #aaaaaa84;
  margin-bottom: 20px;
  width: 100%;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-content p {
  margin: 0;
  line-height: 0.5;
  font-size: 14px;
  font-weight: 400;
  color: var(--graphite);
  padding-bottom: 12px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .footer-content {
   gap: 6px;
  }
  .footer-content p {
    font-size: 12px;
  }
}

/* =======================
   10. CONTACT OVERLAY
======================= */
#contact-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(255, 255, 255);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 40px 20px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  /* Fermé : invisible pour le clavier et les lecteurs d'écran */
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  z-index: 20000;
}

#contact-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0s;
}

.contact-content {
  background: rgba(255, 255, 255, 0);
  max-width: 1000px;
  width: 100%;
  padding: 50px;
  padding-bottom: 60px;
  padding-top: 60px;
  border-radius: 8px;
  text-align: left;
  position: relative;
}

#close-contact {
  z-index: 2100;
  position: absolute;
  top: 48px;
  right: 0px;
  font-size: 28px;
  font-weight: 100;
  background: none;
  border: none;
  cursor: pointer;
  color: black;
  transition: transform 0.2s ease;
}

.contact-logo img {
  max-width: 300px;
  height: auto; /* garde les proportions du logo (sinon il est étiré en hauteur) */
  margin: 0 auto 40px;
  display: block;
  margin-left: 0px;
  margin-bottom: 15px;
}

.about-me-wrapper {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 40px;
}
.about-text {
  flex: 2;
  font-size: 0.9rem;
  text-align: left;
  line-height: 1.6;
}
.about-text p {
  margin-bottom: -10px;
}
.about-photo {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}
.about-photo img {
  max-width: 300px;
  height: auto;
  margin-top: 20px;
  border-radius: 3px;
  object-fit: cover;
  margin-left: 0px;
}

.contact-info {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--graphite-soft);
  margin-bottom: 0px;
}
.contact-info a {
  color: var(--graphite);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--graphite-soft);
}
.contact-info a:hover {
  text-decoration: underline;
}

.social-links {
  display: flex;
  justify-content: flex-start;
  gap: 15px;
}
.social-button {
  padding: 6px 14px;
  border: 1px solid var(--graphite);
  border-radius: 4px;
  background: transparent;
  color: black;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.social-button:hover {
  background-color: var(--graphite);
  color: var(--paper);
}

/* Contact : grand texte + liens soulignés (ordinateur ci-dessous, mobile juste après) */
.contact-big {
  display: none;
}
@media (min-width: 769px) {
  #contact-overlay {
    display: block;
    padding: 0;
  }
  .contact-content {
    max-width: none;
    width: 100%;
    min-height: 100%;
    padding: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  .contact-logo,
  .about-me-wrapper,
  .contact-info,
  .social-links {
    display: none;
  }
  .contact-big {
    display: flex;
    flex: 1;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    padding: 205px 40px 24px;
  }
  /* Même repères que le header du site (logo, titre central, croix à la place du +) */
  .contact-big-logo {
    position: absolute;
    top: 62px;
    left: 40px;
    height: 20px;
    width: auto;
    display: block;
  }
  .contact-big-title {
    position: absolute;
    top: 72px;
    left: 48%;
    transform: translate(-50%, -50%);
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
  }
  #close-contact {
    top: 49px;
    right: 32px;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
  }
  #close-contact::before {
    content: '+';
    font-size: 3.6rem;
    font-weight: 100;
    line-height: 1;
    transform: rotate(45deg);
  }
  .contact-big-text {
    margin: 0;
    width: min(78vw, calc(100vw - clamp(150px, 15.3vw, 300px) - 100px)); /* ne passe jamais sous la photo */
    font-size: clamp(22px, 2.08vw, 40px);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--ink);
  }
  .contact-big-bottom {
    margin-top: auto;
    padding-top: 40px;
    display: flex;
    align-items: flex-end;
  }
  .contact-big-links {
    display: flex;
    gap: 4.4vw;
  }
  .contact-big-link {
    display: block;
    color: var(--ink);
    text-decoration: none;
    transition: opacity 0.25s ease;
  }
  .cbl-label {
    display: flex;
    align-items: baseline;
    font-size: clamp(22px, 2.08vw, 40px);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--ink);
    color: var(--ink);
  }
  .cbl-label svg {
    width: 0.6em;
    height: 0.6em;
    margin-left: 0.32em;
    align-self: center;
    flex: none;
  }
  .contact-big-photo {
    position: absolute;
    right: 40px;
    bottom: 86px; /* aligné sur le bas des liens (marge basse + ligne © + espace) */
    width: clamp(150px, 15.3vw, 300px);
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
  }
  .contact-big-copy {
    margin: 44px 0 0;
    text-align: center;
    font-size: 14px;
    line-height: 18px;
    font-weight: 400;
    color: var(--graphite);
  }
}
/* Contact mobile (≤ 768px) : même page que sur ordinateur, à l'échelle du téléphone
   (repères alignés sur le header mobile : logo à gauche, croix à droite) */
@media (max-width: 768px) {
  #contact-overlay {
    display: block;
    padding: 0;
  }
  .contact-content {
    max-width: none;
    width: 100%;
    min-height: 100%;
    padding: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  .contact-logo,
  .about-me-wrapper,
  .contact-info,
  .social-links,
  .contact-big-title {
    display: none;
  }
  .contact-big {
    display: flex;
    flex: 1;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    padding: 110px 20px 20px;
  }
  .contact-big-logo {
    position: absolute;
    top: 39px;
    left: 20px;
    height: 18px;
    width: auto;
    display: block;
  }
  #close-contact {
    top: 23px;
    right: 30px;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
  }
  #close-contact::before {
    content: '+';
    font-size: 3.5rem;
    font-weight: 100;
    line-height: 1;
    transform: rotate(45deg);
  }
  .contact-big-text {
    margin: 0;
    font-size: 19px;
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--ink);
  }
  .contact-big-bottom {
    margin-top: auto;
    padding-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .contact-big-photo {
    order: -1;
    width: 150px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
  }
  .contact-big-links {
    display: flex;
    gap: 32px;
  }
  .contact-big-link {
    display: block;
    color: var(--ink);
    text-decoration: none;
  }
  .cbl-label {
    display: flex;
    align-items: baseline;
    font-size: 22px;
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--ink);
    color: var(--ink);
  }
  .cbl-label svg {
    width: 0.6em;
    height: 0.6em;
    margin-left: 0.32em;
    align-self: center;
    flex: none;
  }
  .contact-big-copy {
    margin: 36px 0 0;
    text-align: center;
    font-size: 13px;
    line-height: 18px;
    font-weight: 400;
    color: var(--graphite);
  }
}
@media (min-width: 769px) and (hover: hover) {
  .contact-big-links:hover .contact-big-link {
    opacity: 0.14;
  }
  .contact-big-links .contact-big-link:hover {
    opacity: 1;
  }
}

/* =======================
   11. BOUTONS TOGGLE & LANGUES
======================= */
.toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: black;
}

.toggle-btn .dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 34px;
  transition: transform 0.3s ease;
}

.toggle-btn .dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.toggle-btn.active .dots {
  transform: rotate(90deg);
}

.more-text {
  font-size: 0.9rem;
  line-height: 1.6;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  /* Conserve les sauts de ligne du texte (paragraphes) */
  white-space: pre-line;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

.more-text.open {
  max-height: 500px;
  opacity: 1;
  margin-top: 10px;
}

.language-selector {
  margin: 15px 0;
  font-size: 0.8rem;
  text-align: left;
  font-family: 'IBM Plex Mono', monospace;
}
.language-selector .lang-btn {
  background: none; border: none; cursor: pointer; color: var(--graphite); padding: 0 5px; font-family: inherit; font-weight: 300; transition: all 0.2s ease;
}
.language-selector .lang-btn:hover { color: var(--ink); }
/* Langue active en plus gras */
.language-selector .lang-btn[aria-pressed="true"] { font-weight: 500; }

/* ======================
   12. LIGHTBOX
====================== */
.lightbox {
  display: none;
  position: fixed;
  z-index: 20001; /* au-dessus du header et de la barre de progression, comme le panneau contact */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.lightbox.show { display: flex; }

.lightbox-content {
  max-width: 100%;
  max-height: 100%;
  text-align: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  cursor: pointer;
  object-fit: contain;
}

.lightbox-content p {
  margin-top: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  color: var(--ink);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  user-select: none;
  transform: translateY(-50%);
  z-index: 2100;
  transition: color 0.2s ease;
}
/* Chevrons fins, même trait que la croix de fermeture */
.lightbox-prev svg,
.lightbox-next svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.lightbox-prev { left: 20px; }

/* Fermer la visionneuse : même croix fine que le reste du site */
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 1;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.lightbox-close svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
@media (max-width: 768px) {
  .lightbox-close { top: 12px; right: 12px; }
}
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover { color: var(--caption); }

/* =======================
   13. MODE SOMBRE (forcé pour certaines pages)
======================= */
body.dark-page {
  background-color: var(--ink);
  color: var(--paper);
}
body.dark-page header,
body.dark-page footer {
  background-color: transparent;
  color: var(--paper);
}
body.dark-page h1,
body.dark-page h2,
body.dark-page h3,
body.dark-page h4,
body.dark-page h5,
body.dark-page h6,
body.dark-page p,
body.dark-page span,
body.dark-page .project-title,
body.dark-page .project-subtitle,
body.dark-page .lang-btn,
body.dark-page .toggle-btn,
body.dark-page .header-center,
body.dark-page #open-plus {
  color: var(--paper) !important;
}
body.dark-page .toggle-btn,
body.dark-page #open-plus {
  border: none !important;
  background-color: transparent !important;
}
body.dark-page .header-menu {
  background-color: #000000c9 !important;
  color: var(--paper) !important;
}
body.dark-page .header-menu ul li a {
  color: var(--paper) !important;
}
/* Liens Précédent / Suivant et barre de progression visibles sur fond noir */
body.dark-page .nav-link {
  color: var(--paper);
}
body.dark-page #progress-bar {
  background-color: var(--paper);
}
/* Le contact et la lightbox gardent un fond blanc : on remet le texte en sombre */
body.dark-page #contact-overlay p,
body.dark-page #contact-overlay span {
  color: var(--graphite) !important;
}
body.dark-page #contact-overlay .contact-big-text,
body.dark-page #contact-overlay .cbl-label {
  color: var(--ink) !important;
}
body.dark-page #contact-overlay .contact-big-copy,
body.dark-page #contact-overlay .contact-big-copy span {
  color: var(--graphite) !important;
}
body.dark-page .lightbox-content p {
  color: var(--ink) !important;
}

/* =======================
   14. SPLASH SCREEN & TRANSITIONS
======================= */
/* Logo visible dès le début ; après 1,5 s l'écran blanc monte (classe .leave, voir script.js)
   pendant que la page arrive par dessous. Même effet sur ordinateur et mobile. */
:root {
  --splash-ease: cubic-bezier(0.76, 0, 0.24, 1);
  --splash-dur: 1s;
}
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10005; /* Au-dessus du header au tout premier chargement */
}
#splash-screen.leave {
  transform: translateY(-100%);
  transition: transform var(--splash-dur) var(--splash-ease);
}
.splash-logo {
  max-width: 180px;
  height: auto; /* garde les proportions du logo (sinon il est étiré en hauteur) */
}
/* Pages suivantes de la même visite : pas de splash (classe posée dans le <head>) */
html.no-splash #splash-screen {
  display: none;
}
/* Pendant le splash : la page est déjà là, un peu plus bas, et le défilement est bloqué */
html:not(.no-splash) {
  overflow: hidden;
}
html:not(.no-splash) #page-container {
  opacity: 1;
  transform: translateY(22vh);
}
html:not(.no-splash).splash-go #page-container {
  transform: none;
  transition: transform var(--splash-dur) var(--splash-ease);
}
/* Sans JavaScript : pas de splash */
@media (scripting: none) {
  #splash-screen { display: none; }
  html:not(.no-splash) { overflow: auto; }
  html:not(.no-splash) #page-container { transform: none; }
}

/* AJUSTEMENT MOBILE SPLASH SCREEN */
@media (max-width: 768px) {
  .splash-logo {
    max-width: 120px; /* Plus petit sur mobile (au lieu de 180px) */
  }
}

/* Splash : tout l'écran est cliquable ; le logo reste centré, "ENTRER" apparaît en fondu dessous 1 s après */
#splash-screen {
  cursor: pointer;
}
.splash-enter,
.son-toggle {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--caption);
  background: none;
  border: 0;
  padding: 10px 14px; /* zone de clic confortable sans rien de visible */
  cursor: pointer;
}
.splash-enter {
  position: absolute;
  left: 50%;
  top: calc(50% + 52px); /* sous le logo (180 px de large, environ 50 px de haut) */
  transform: translateX(-50%);
  opacity: 0;
  animation: splash-fade-in 0.8s ease 1s forwards;
}
/* La respiration est sur le texte : au survol on l'arrête sans toucher au fondu d'apparition du bouton */
.splash-enter span {
  display: inline-block;
  animation: splash-enter-breathe 2.6s ease-in-out 1.8s infinite;
}
@keyframes splash-fade-in { to { opacity: 1; } }
@keyframes splash-enter-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.splash-son {
  position: absolute;
  right: 26px;
  bottom: 26px;
  opacity: 0;
  animation: splash-fade-in 0.8s ease 1s forwards;
}
/* Bouton son : une icône de haut-parleur (ondes = son activé, croix = son coupé) */
.son-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.son-toggle svg {
  width: 22px;
  height: 22px;
}
@media (hover: hover) {
  .splash-enter:hover,
  .son-toggle:hover { color: var(--ink); }
  .splash-enter:hover span { animation: none; }
}
.splash-enter:focus-visible,
.son-toggle:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .splash-enter,
  .splash-son { animation: splash-fade-in 0.01s linear 1s forwards; }
  .splash-enter span { animation: none; }
}
@media (max-width: 768px) {
  .splash-enter { top: calc(50% + 36px); } /* logo de 120 px sur mobile */
  .splash-son { right: 10px; bottom: 16px; }
}

/* Bouton son dans le header de l'accueil (à gauche de CONTACT) et dans le menu + */
.header-son {
  padding: 8px;
  color: var(--ink);
}
.menu-son .son-toggle {
  padding: 10px 15px; /* aligné sur les liens du menu */
  color: var(--ink);
}
.menu-son .son-toggle svg {
  width: 20px;
  height: 20px;
}

/* Transition de page : fondu (durée alignée sur le délai de navigation dans script.js) */
#page-container {
  opacity: 0;
  transition: opacity 0.3s ease;
}
#page-container.fade-in { opacity: 1; }
#page-container.fade-out { opacity: 0; }

/* ===========================
   BARRE DE PROGRESSION & BOUTON RETOUR HAUT
=========================== */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px; /* Assez fin pour ne pas gêner sur mobile */
  background-color: var(--ink);
  z-index: 20000;
  transition: width 0.1s linear;
}

#back-to-top {
  position: fixed;
  bottom: 40px; /* Position par défaut Desktop */
  right: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  font-family: inherit;
  line-height: 1;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none; /* Inactif quand invisible */
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9000;
  font-size: 1.2rem;
  color: var(--graphite);
  box-shadow: none; /* pas d'ombre : le site n'en utilise nulle part ailleurs */
  /* Désactive le surlignage bleu au clic sur mobile */
  -webkit-tap-highlight-color: transparent;
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Hover uniquement sur PC (pour éviter effet collant sur mobile) */
@media (hover: hover) {
  #back-to-top:hover {
    transform: translateY(-3px);
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
  }
}

/* ADAPTATION MOBILE */
@media (max-width: 768px) {
  #back-to-top {
    bottom: 25px; /* Plus bas */
    right: 20px;  /* Plus au bord */
    width: 45px;  /* Un peu plus gros pour le doigt */
    height: 45px;
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.95); /* Légèrement transparent */
  }
}

/* ===========================
   VIDÉO IFRAME (PROJET BELLE-ÎLE)
=========================== */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* Ratio 16:9 pour que la vidéo reste proportionnée */
  height: 0;
  overflow: hidden;
  background-color: var(--ink); /* Fond noir propre pendant le chargement */
  margin-bottom: 60px; /* Même espacement que tes images */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Ajustement mobile pour l'espacement */
@media (max-width: 768px) {
  .video-container {
    margin-bottom: 30px;
  }
}

/* ===========================
   15. CURSEUR PERSONNALISÉ
   (le curseur système n'est masqué que si script.js a bien créé le point)
=========================== */
@media (pointer: fine) {
  body.custom-cursor,
  body.custom-cursor * {
    cursor: none !important;
  }
}
/* Contraste élevé ou couleurs forcées : curseur système (souvent agrandi par l'utilisateur), pas de point */
@media (prefers-contrast: more), (forced-colors: active) {
  body.custom-cursor,
  body.custom-cursor * {
    cursor: revert !important;
  }
  #cursor-dot { display: none; }
}

#cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 99999;
  pointer-events: none; /* Laisse passer les clics */

  /* État normal : un point noir plein */
  width: 5px;
  height: 5px;
  background-color: var(--ink);
  transition: width 0.3s cubic-bezier(0.2, 1, 0.8, 1), height 0.3s cubic-bezier(0.2, 1, 0.8, 1);
}

/* État Hover : le point s'agrandit et passe en mode « différence » :
   il reste noir sur fond blanc, et ce qui se trouve dessous apparaît en négatif */
body.hovering #cursor-dot {
  width: 30px;
  height: 30px;
  background-color: var(--paper);
  mix-blend-mode: difference;
}

/* Page sombre : point blanc (en survol, le mode « différence » donne aussi un cercle blanc) */
body.dark-page #cursor-dot { background-color: var(--paper); }

/* ===========================
   16. MOUVEMENT RÉDUIT (réglage système d'accessibilité)
=========================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* Contact : dernière ligne de la bio (CV sur LinkedIn), un peu détachée du texte */
.contact-big-text.contact-big-cv {
  margin-top: 0.7em;
}

/* Contact : le logo ramène à l'accueil (le lien porte la position qu'avait le logo) */
.contact-big-logo-link {
  position: absolute;
  display: block;
  line-height: 0;
  top: 62px;
  left: 40px;
}
.contact-big-logo-link .contact-big-logo {
  position: static;
}
@media (max-width: 768px) {
  .contact-big-logo-link {
    top: 39px;
    left: 20px;
  }
}

/* =======================
   FINITIONS
======================= */
/* Boutons de langue et bouton … : alignés sur le bord du texte (leur marge intérieure les décalait) */
.language-selector { margin-left: -5px; }
.toggle-btn { margin-left: -10px; } /* les trois points tombent sur le bord du texte */

/* Paragraphes : pas de mot isolé en dernière ligne (navigateurs récents) */
.project-description,
.more-text,
.contact-big-text {
  text-wrap: pretty;
}
.nav-link { text-wrap: balance; }

/* Cartes de l'accueil : le lien prenait le bleu par défaut du navigateur (visible dans le soulignement sur mobile) */
.projects .project-card { color: var(--ink); }

/* Sélection de texte : la seule couleur du site, un bleu électrique (texte blanc dessus), sur toutes les pages */
::selection {
  background: var(--selection);
  color: var(--paper);
}

/* =======================
   PAGE 404
======================= */
/* Même marge que les pages projet ; "404" composé comme les grands titres de l'accueil */
.page-404 {
  min-height: calc(100vh - 160px);
  min-height: calc(100dvh - 160px);
  box-sizing: border-box;
  padding: 150px 40px 60px;
}
.page-404-code {
  margin: 0;
  font-size: clamp(64px, 12vw, 200px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.page-404-texte {
  margin: 24px 0 40px;
  text-wrap: balance;
  font-size: 1.4rem;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.page-404-lien {
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
@media (hover: hover) {
  .page-404-lien:hover { color: var(--caption); }
}
@media (max-width: 768px) {
  .page-404 { padding: 120px 20px 40px; }
  .page-404-texte { font-size: 1.15rem; }
}

/* =======================
   MOBILE : CARTES DE L'ACCUEIL ET MENU +
======================= */
/* Au toucher, le navigateur posait un voile gris sur la carte (lien) ; et l'éclaircissement prévu
   pour le survol à la souris restait parfois collé sur écran tactile */
a,
button { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  .project-card:hover { filter: none; }
}

/* Texte qui se déplie (bouton …) : même taille que la description toujours visible */
@media (max-width: 768px) {
  .more-text {
    font-size: 0.75rem;
    line-height: 1.5;
  }
}

/* Menu + (ordinateur) : le numéro et le titre restent sur une ligne, comme avant */
.header-menu li a .m-num:empty { display: none; }

/* Menu + (mobile) : en écho à l'index de l'accueil sur ordinateur — aligné à gauche, grandes capitales
   fines, petit numéro à part dans sa colonne (un tiret pour le stage et le mémoire) */
@media (max-width: 900px) {
  .header-menu ul {
    align-items: stretch;
    gap: 0;
    padding: 110px 20px 40px;
  }
  .header-menu li { text-align: left; }
  .header-menu li a {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 6px 0;
    font-size: clamp(26px, 8.4vw, 44px); /* grandes capitales fines, comme la liste de l'accueil sur ordinateur */
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1;
    text-wrap: balance;
  }
  .header-menu li a .m-num,
  .header-menu li a .m-num:empty {
    display: block;
    flex: none;
    width: 22px;
    font-size: 11px;
    letter-spacing: 0;
    transform: translateY(-0.9em);
  }
  .header-menu li a .m-num:empty::before { content: "–"; }
  .header-menu li a .m-sep { display: none; }
  /* Page en cours : soulignée, comme dans la liste */
  .header-menu li a[aria-current="page"] .m-titre {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
  }
  .header-menu ul li.menu-separator {
    width: 100%;
    border-top: 1px solid var(--rule);
    margin: 14px 0;
  }
  body.dark-page .header-menu ul li.menu-separator { border-color: var(--graphite); }
  /* Page sombre : menu plein écran opaque, comme prévu (une règle plus haut le rendait transparent à 79 %) */
  body.dark-page .header-menu { background-color: var(--ink) !important; }
  /* CONTACT : tout en haut du menu, séparé de la liste par un filet ; le son reste en bas.
     Les deux sont alignés sur les titres (après la colonne des numéros) */
  .header-menu li:has(> .menu-contact) {
    order: -1;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 14px;
    padding-bottom: 8px;
  }
  body.dark-page .header-menu li:has(> .menu-contact) { border-color: var(--graphite); }
  .header-menu li a.menu-contact { padding-left: 36px; font-weight: 500; }
  .header-menu li a.menu-contact strong { font-weight: 500; }
  .header-menu .menu-son .son-toggle { padding: 12px 0 12px 36px; }
}

/* Images en <picture> (AVIF avec WebP de secours) : la balise picture ne crée pas de boîte,
   l'image se comporte exactement comme avant */
picture { display: contents; }
picture > source { display: none; } /* sinon, dans la galerie (colonne flexible), chaque source ajoute un espacement */
