/* Design « Carnet de bord » : une carte marine de nuit.
   Lignes de sonde, route tracée au fil du défilement, rose des vents. */
:root {
  color-scheme: dark;
  --nuit: #0a1330;
  --nuit-2: #0f1a3d;
  --texte: #e7ebf5;
  --discret: #8d9bc0;
  --ligne: rgba(150, 185, 255, 0.16);
  --laiton: #dcb878;
  --rose: #ef93ab;
  --voie: 120px;             /* largeur du couloir de la route, à gauche */
  --p: 0;
  --prof: 0;                 /* 0 à la surface, 1 au fond de la page */
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --serif: 'Cormorant Garamond', Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--texte);
  /* L'eau s'assombrit jusqu'au noir des abysses, tout au long de la page */
  background: linear-gradient(to bottom, var(--nuit) 0, var(--nuit) 6%, #071029 28%, #040a1d 52%, #02050f 78%, #000105 100%);
  overflow-x: clip;
}

/* ---------- Choix de la langue ---------- */
.langues {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 30;
  display: flex;
  transform: translateX(-50%);
  border: 1px solid var(--ligne);
  border-radius: 999px;
  background: rgba(10, 19, 48, 0.7);
  font: 500 0.72rem var(--mono);
}
.langues a { padding: 6px 12px; border-radius: 999px; color: var(--discret); text-decoration: none; }
.langues a:hover { color: var(--texte); }
.langues a[aria-current] { color: var(--nuit); background: var(--laiton); }

/* ---------- Abysses : calque fixe derrière le contenu ---------- */
.abysses { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.abysses > span { position: absolute; }
/* Rayons de lumière venus de la surface, qui s'éteignent en descendant */
.abysses .rayons {
  inset: -10% -30% 25%;
  background: repeating-linear-gradient(100deg, transparent 0 70px, rgba(170, 200, 255, 0.06) 70px 110px, transparent 110px 200px);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
  filter: blur(8px);
  opacity: max(0, 1 - var(--prof) * 2.5);
  transform-origin: top;
  animation: ondule 14s ease-in-out infinite alternate;
}
@keyframes ondule { to { transform: skewX(7deg) translateX(-60px); } }
/* Neige marine : particules qui tombent lentement, de plus en plus visibles */
.abysses .neige {
  inset: -520px 0 0;
  background-image:
    radial-gradient(circle at 30px 40px, rgba(220, 230, 255, 0.55) 1.2px, transparent 2px),
    radial-gradient(circle at 150px 110px, rgba(220, 230, 255, 0.4) 1px, transparent 1.6px),
    radial-gradient(circle at 90px 200px, rgba(220, 230, 255, 0.5) 1.5px, transparent 2.2px),
    radial-gradient(circle at 220px 60px, rgba(220, 230, 255, 0.35) 0.8px, transparent 1.4px),
    radial-gradient(circle at 200px 230px, rgba(220, 230, 255, 0.45) 1.1px, transparent 1.8px);
  background-size: 260px 260px;
  opacity: calc(var(--prof) * 1.3 - 0.1);
  animation: neige 34s linear infinite;
}
.abysses .neige.lointaine { background-size: 170px 170px; inset: -340px 0 0; opacity: calc(var(--prof) * 0.9 - 0.15); filter: blur(0.6px); animation-duration: 60s; animation-name: neige-loin; }
@keyframes neige { to { transform: translateY(520px); } }
@keyframes neige-loin { to { transform: translateY(340px); } }
/* Lueurs bioluminescentes, seulement dans les grands fonds */
.abysses .lueurs {
  inset: 0;
  background:
    radial-gradient(circle at 12% 30%, rgba(110, 230, 255, 0.5) 0 2px, transparent 7px),
    radial-gradient(circle at 84% 22%, rgba(239, 147, 171, 0.5) 0 2px, transparent 7px),
    radial-gradient(circle at 70% 76%, rgba(110, 230, 255, 0.45) 0 1.5px, transparent 6px),
    radial-gradient(circle at 28% 84%, rgba(126, 224, 161, 0.4) 0 1.5px, transparent 6px),
    radial-gradient(circle at 92% 58%, rgba(110, 230, 255, 0.4) 0 1.5px, transparent 6px);
  opacity: calc(var(--prof) * 2.4 - 1.2);
  animation: luit 5s ease-in-out infinite alternate;
}
@keyframes luit { from { filter: brightness(0.4); } to { filter: brightness(1.3); } }
/* Les bords de l'écran s'assombrissent avec la profondeur */
.abysses::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.75));
  opacity: var(--prof);
}

/* Profondeur, en haut à droite */
.profondeur {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0;
  padding-right: 12px;
  border-right: 1px solid var(--laiton);
  font-family: var(--mono);
  line-height: 1.4;
  text-transform: uppercase;
  opacity: clamp(0, calc(var(--p) * 4 - 3), 1);
  pointer-events: none;
}
.profondeur .valeur { font-size: 1rem; letter-spacing: 0.08em; color: var(--laiton); font-variant-numeric: tabular-nums; }
.profondeur #zone { font-size: 0.62rem; letter-spacing: 0.2em; color: var(--discret); }

/* Bouton « Remonter à la surface » */
.surface {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  padding: 10px 18px 10px 40px;
  border: 1px solid rgba(220, 184, 120, 0.6);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--laiton);
  background:
    radial-gradient(circle at 20px 50%, transparent 5px, rgba(220, 184, 120, 0.8) 5.5px, transparent 6.5px),
    radial-gradient(circle at 27px 38%, transparent 2.5px, rgba(220, 184, 120, 0.8) 3px, transparent 4px),
    rgba(10, 19, 48, 0.9);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.5s, transform 0.5s, visibility 0.5s, background-color 0.3s;
}
.surface.montre { opacity: 1; visibility: visible; transform: none; }
.surface:hover { color: var(--nuit); background-color: var(--laiton); background-image: none; }

/* Bulles d'air */
.air {
  position: absolute;
  z-index: 40;
  width: var(--t);
  height: var(--t);
  margin-left: calc(var(--t) / -2);
  border: 1px solid rgba(220, 235, 255, 0.7);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.8) 0 12%, rgba(180, 210, 255, 0.18) 30%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  animation: remonte var(--duree) cubic-bezier(0.45, 0, 0.7, 1) var(--delai) forwards;
}
.air.fixe { position: fixed; }
@keyframes remonte {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  12% { opacity: 1; }
  50% { transform: translate(var(--oscille), calc(var(--monte) * -0.5)) scale(1); }
  85% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(calc(var(--oscille) * -0.4), calc(var(--monte) * -1)) scale(1.15); }
}

/* ---------- Accueil ---------- */
#accueil {
  position: relative;
  display: grid;
  place-items: center;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background: #3a0d3c;
}
#accueil .fond {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateY(calc(var(--p) * 18%)) scale(1.05);
}
#accueil::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, transparent 55%, var(--nuit));
}
.quadrillage {
  position: absolute;
  inset: -20% 0;
  z-index: -1;
  background:
    repeating-linear-gradient(to right, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 120px),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 120px);
  transform: translateY(calc(var(--p) * -25%));
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  animation: apparait 2s ease both;
}
.coin {
  position: absolute;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  animation: apparait 1.2s 1s ease both;
}
.coin.hg { top: 24px; left: 24px; }
.coin.bd { bottom: 24px; right: 24px; }
.horizon {
  position: absolute;
  left: 0;
  top: 54.5%;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--laiton), transparent);
  transform-origin: left;
  animation: trace 2.2s 0.3s cubic-bezier(0.6, 0, 0.2, 1) both;
}
@keyframes trace { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }
/* Accueil en deux colonnes : nom et accroche à gauche, console à droite */
.accueil-grille {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
  width: min(1400px, 100%);
  padding: 80px clamp(16px, 5vw, 72px) 120px;
}
.titre {
  text-align: left;
  transform: translateY(calc(var(--p) * 20vh));
  opacity: calc(1 - var(--p) * 1.5);
}
h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3rem, 6.4vw, 6.6rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.02em;
  animation: resserre 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
h1 em { display: block; font-weight: 500; }
@keyframes resserre {
  from { opacity: 0; letter-spacing: 0.4em; filter: blur(8px); }
  to { opacity: 1; letter-spacing: 0.02em; filter: none; }
}
#accroche {
  max-width: 30ch;
  margin: 1.2em 0 0;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  font-style: italic;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
  animation: apparait 1.4s 0.9s ease both;
}

/* Console de passerelle : la section « Mon profil » s'y imprime comme sur un écran de bord */
.terminal {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: min(56svh, 520px);
  border: 1px solid rgba(220, 184, 120, 0.45);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(10, 19, 48, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 60px rgba(220, 184, 120, 0.14), inset 0 0 40px rgba(0, 0, 0, 0.45);
  animation: apparait 1s 0.8s ease both;
}
/* Lignes de balayage d'écran cathodique */
.terminal::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px);
}
.terminal .barre {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid rgba(220, 184, 120, 0.25);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--discret);
}
.terminal .voyant { white-space: nowrap; }
.terminal .voyant::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: 1px;
  background: #7ee0a1;
  box-shadow: 0 0 6px #7ee0a1;
  animation: clignote 2s ease-in-out infinite;
}
@keyframes clignote { 50% { opacity: 0.3; } }
#console {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 20px;
  font-family: var(--mono);
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  line-height: 1.75;
  color: rgba(231, 235, 245, 0.85);
  scrollbar-width: thin;
  scrollbar-color: rgba(220, 184, 120, 0.4) transparent;
  z-index: 1;
}
.terminal .barre { position: relative; z-index: 1; }
/* Texte lu par les lecteurs d'écran à la place de l'animation */
.lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#console p { margin: 0; }
#console .systeme { color: var(--discret); }
#console .sortie { max-width: 72ch; }
#console .espace { margin-top: 14px; }
#console .valide { margin-top: 14px; color: #7ee0a1; }
/* Caractères encore chiffrés */
#console .chiffre { color: rgba(220, 184, 120, 0.6); }
.invite {
  position: absolute;
  bottom: 70px;
  left: 50%;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--laiton);
  white-space: nowrap;
  transform: translateX(-50%);
  animation: apparait 1s 1.6s ease both;
}

/* ---------- Rose des vents ---------- */
#rose {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 20;
  width: 74px;
  height: 74px;
  opacity: clamp(0, calc(var(--p) * 4 - 3), 1);
  pointer-events: none;
}
#rose .anneau { fill: rgba(10, 19, 48, 0.7); stroke: var(--ligne); }
#rose .anneau.fin { fill: none; stroke-dasharray: 1 3.2; stroke: var(--laiton); opacity: 0.6; }
#rose .aiguille { transform: rotate(var(--cap, 0deg)); }
#rose .branche { fill: none; stroke: var(--discret); stroke-width: 0.8; }
#rose .nord { fill: var(--rose); }
#rose text { font: 500 9px var(--mono); fill: var(--laiton); }

/* ---------- Carte : sondes et route ---------- */
.carte {
  position: relative;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 40px 16px 80px calc(var(--voie) + 16px);
}
.sondes {
  position: absolute;
  top: 0;
  left: calc(50% - 50vw);
  z-index: -1;
  width: 100vw;
  height: 100%;
  overflow: visible;
}
.sondes path { fill: none; stroke: rgba(150, 185, 255, 0.11); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 3s ease; }
.sondes g.visible path { stroke-dashoffset: 0; }
.sondes path:nth-child(3n) { stroke: rgba(220, 184, 120, 0.12); }
.sondes text { font: 9px var(--mono); fill: rgba(150, 185, 255, 0.35); opacity: 0; transition: opacity 1s 1.5s; }
.sondes g.visible text { opacity: 1; }
/* Le couloir de l'ancre se cale sur le bord gauche de l'écran (3 % de sa largeur),
   même quand le contenu est centré sur un grand écran */
.parcours {
  position: absolute;
  left: calc((100% - 100vw) / 2 + 3vw);
  top: 0;
  width: var(--voie);
  height: 100%;
}
.parcours > svg:first-child { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.parcours path { fill: none; stroke-width: 1.5; }
.parcours .prevue { stroke: var(--ligne); stroke-dasharray: 4 6; }
.parcours .suivie { stroke: var(--laiton); }
.ancre {
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 30px;
  overflow: visible;
  transform: translate(calc(var(--bx, 0px) - 13px), calc(var(--by, 0px) - 18px)) rotate(var(--bangle, 0deg));
  opacity: var(--bvis, 0);
  filter: drop-shadow(0 0 8px rgba(220, 184, 120, 0.6));
}
.ancre path, .ancre circle { fill: none; stroke: var(--laiton); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ancre circle { fill: var(--nuit); }
.escale-repere {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--laiton);
  border-radius: 50%;
  background: var(--nuit);
  transform: translate(-50%, -50%);
}
.escale-repere::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--laiton);
  transform: scale(0);
  transition: transform 0.4s;
}
.escale-repere.atteint::after { transform: scale(1); }

/* ---------- Sections (escales) ---------- */
.escale { padding-top: clamp(60px, 10vw, 130px); }
.escale-titre { margin-bottom: clamp(32px, 5vw, 56px); }
.escale-titre .etiquette {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--laiton);
}
h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1;
}
.escale-titre .trait {
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 18px;
  background: repeating-linear-gradient(to right, var(--ligne) 0 8px, transparent 8px 14px);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.6s cubic-bezier(0.6, 0, 0.2, 1) 0.2s;
}
.escale-titre.visible .trait { transform: none; }

/* ---------- Blocs (entrées du journal) ---------- */
.bloc { max-width: 760px; margin-bottom: clamp(40px, 6vw, 64px); }
.bloc h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1.2;
}
.bloc h3::before {
  content: attr(data-n);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--discret);
}
.bloc p { margin: 0 0 16px; }
.bloc.intro p { font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 1.95rem); line-height: 1.45; }
.bloc ul { margin: 0; padding-left: 20px; }

/* Listes datées : lignes du journal de bord */
.bloc ul.journal { padding: 0; list-style: none; border-top: 1px solid var(--ligne); }
.journal li {
  display: grid;
  grid-template-columns: 12.5rem 1fr;
  gap: 4px 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ligne);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.9s cubic-bezier(0.6, 0, 0.2, 1);
  transition-delay: calc(var(--i) * 80ms);
}
.journal.visible li { clip-path: inset(0 0 0 0); }
.journal .date {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  line-height: 2.2;
  text-transform: uppercase;
  color: var(--laiton);
}

/* Contact : pavillons */
.bloc ul.signaux { display: flex; flex-wrap: wrap; gap: 12px; padding: 0; list-style: none; }
.signaux a {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--laiton);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--laiton);
  transition: background 0.3s, color 0.3s;
}
.signaux a::before { content: '⚑ '; }
.signaux a:hover { color: var(--nuit); background: var(--laiton); }
.bloc ul.signaux.cv { margin-top: 12px; }
.signaux.cv a::before { content: '⤓ '; }

a { color: inherit; text-decoration-color: var(--laiton); text-underline-offset: 4px; }
a:hover { color: var(--laiton); }

/* Cadres (Sport, Musique) : cartouches de carte, avec repères aux coins */
.bloc.cadre {
  max-width: none;
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid var(--ligne);
  outline: 1px solid var(--ligne);
  outline-offset: 5px;
  background:
    linear-gradient(var(--laiton), var(--laiton)) left top / 14px 1px no-repeat,
    linear-gradient(var(--laiton), var(--laiton)) left top / 1px 14px no-repeat,
    linear-gradient(var(--laiton), var(--laiton)) right bottom / 14px 1px no-repeat,
    linear-gradient(var(--laiton), var(--laiton)) right bottom / 1px 14px no-repeat,
    rgba(15, 26, 61, 0.75);
}
.bloc.cadre h3 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-style: italic; font-weight: 400; }

/* Expériences : fiches de bord */
.bloc.large { max-width: none; }
.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.fiche {
  position: relative;
  padding: 22px 24px 24px;
  border: 1px solid var(--ligne);
  border-left: 2px solid var(--laiton);
  background: rgba(15, 26, 61, 0.75);
}
.fiche:hover { border-color: rgba(220, 184, 120, 0.5); border-left-color: var(--laiton); }
.fiche .date {
  display: inline-block;
  margin-bottom: 12px;
  padding: 2px 10px;
  border: 1px solid rgba(220, 184, 120, 0.4);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--laiton);
}
.fiche.en-cours .date::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: 1px;
  background: var(--rose);
  box-shadow: 0 0 8px var(--rose);
  animation: clignote 2s ease-in-out infinite;
}
.fiche h4, .bulle h4 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.2;
}
.fiche p, .bulle p { margin: 0; font-size: 0.93rem; line-height: 1.6; color: rgba(231, 235, 245, 0.82); }
.bloc ul.volets { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.volets li { padding-left: 12px; border-left: 1px solid var(--ligne); font-size: 0.93rem; line-height: 1.6; color: rgba(231, 235, 245, 0.82); }
.volets b { display: block; font-weight: 500; color: var(--texte); }
.volets span { display: block; }

/* Projets et expériences : plaque du logo (papier clair) ou photo, repères de laiton aux coins */
.fiche .date { align-self: flex-start; }
.fiche.avec-plaque { display: flex; flex-direction: column; gap: 20px; }
.plaque {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--nuit-2);
  box-shadow: 0 0 0 1px var(--ligne), 0 18px 40px rgba(0, 0, 0, 0.45);
}
.plaque::after {
  content: '';
  position: absolute;
  inset: 8px;
  pointer-events: none;
  background:
    linear-gradient(var(--laiton), var(--laiton)) left top / 14px 1px no-repeat,
    linear-gradient(var(--laiton), var(--laiton)) left top / 1px 14px no-repeat,
    linear-gradient(var(--laiton), var(--laiton)) right top / 14px 1px no-repeat,
    linear-gradient(var(--laiton), var(--laiton)) right top / 1px 14px no-repeat,
    linear-gradient(var(--laiton), var(--laiton)) left bottom / 14px 1px no-repeat,
    linear-gradient(var(--laiton), var(--laiton)) left bottom / 1px 14px no-repeat,
    linear-gradient(var(--laiton), var(--laiton)) right bottom / 14px 1px no-repeat,
    linear-gradient(var(--laiton), var(--laiton)) right bottom / 1px 14px no-repeat;
}
.plaque img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.plaque.logos { padding: 11% 15%; background: radial-gradient(circle at 30% 20%, #fbf8f1, #ece5d6); }
.plaque.logos img { flex: 1 1 0; min-height: 0; height: auto; object-fit: contain; object-position: center; }
.plaque.sombre { background: radial-gradient(circle at 30% 20%, #1d2c63, #0a1330); }
.fiche:hover .plaque img { transform: scale(1.04); }
.fiche .corps { display: flex; flex: 1; flex-direction: column; }
.fiche .credit {
  margin-top: auto;
  padding-top: 14px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--discret);
}
.fiche .credit a { text-decoration: none; }

/* Compétences : bulles et pastilles */
.bulles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.bulle {
  padding: 20px 22px;
  border: 1px solid var(--ligne);
  border-radius: 18px;
  background: radial-gradient(circle at 0 0, rgba(220, 184, 120, 0.07), transparent 60%), rgba(15, 26, 61, 0.75);
}
.bulle:hover { border-color: rgba(220, 184, 120, 0.5); }
.bulle h4 { font-size: 1.25rem; }
.bloc ul.pastilles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; padding: 0; list-style: none; }
.pastilles li {
  padding: 3px 12px;
  border: 1px solid rgba(150, 185, 255, 0.28);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--texte);
  background: rgba(150, 185, 255, 0.06);
}

/* Apparition décalée de chaque case, sans ralentir le survol */
.cases .fiche, .bulles .bulle {
  transition: opacity 1s ease, transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.4s;
  transition-delay: calc(var(--i) * 90ms), calc(var(--i) * 90ms), 0s;
}

/* Grille de cartouches (section faite uniquement de courts blocs) */
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.grille .bloc {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--ligne);
  background: rgba(15, 26, 61, 0.75);
  transition: border-color 0.4s, transform 0.4s;
}
.grille .bloc:hover { border-color: var(--laiton); }
.grille .bloc.visible:hover { transform: translateY(-4px); }

/* ---------- Apparitions ---------- */
.revele {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1s ease, transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 100ms);
}
.revele.visible { opacity: 1; transform: none; }

/* ---------- Sonar (rupture avant Mes intérêts) ---------- */
.sonar {
  position: relative;
  height: clamp(220px, 30vw, 340px);
  margin-top: 60px;
  overflow: hidden;
  border-top: 1px solid var(--ligne);
  border-bottom: 1px solid var(--ligne);
  background: radial-gradient(circle at 50% 50%, rgba(220, 184, 120, 0.08), transparent 60%);
}
.sonar .onde {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 600px;
  height: 600px;
  margin: -300px 0 0 -300px;
  border: 1px solid var(--laiton);
  border-radius: 50%;
  opacity: 0;
  animation: ping 4.5s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
  animation-delay: calc(var(--i) * 1.5s);
}
@keyframes ping {
  from { transform: scale(0.02); opacity: 0.9; }
  to { transform: scale(1); opacity: 0; }
}
.sonar .balayage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 640px;
  height: 640px;
  margin: -320px 0 0 -320px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(220, 184, 120, 0.22), transparent 60deg);
  animation: tourne 6s linear infinite;
}
@keyframes tourne { to { transform: rotate(1turn); } }
.sonar .echo {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 10px var(--rose);
  animation: echo 6s linear infinite;
  animation-delay: var(--d);
}
@keyframes echo { 0%, 100% { opacity: 0; } 8% { opacity: 1; } 40% { opacity: 0; } }
.sonar .legende {
  position: absolute;
  left: 16px;
  bottom: 12px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--discret);
}

/* ---------- Galerie horizontale épinglée (Sauvetage) ---------- */
.traversee {
  position: relative;
  /* hauteur et décalage à gauche réglés par main.js pour occuper toute la largeur */
  width: 100vw;
  margin-top: 20px;
}
.traversee .ecran {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  height: 100svh;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 50%, rgba(15, 26, 61, 0.7), transparent 70%);
}
.traversee .bande {
  display: flex;
  gap: clamp(16px, 3vw, 40px);
  padding: 0 8vw;
  transform: translateX(var(--tx, 0px));
  will-change: transform;
}
.traversee figure {
  flex: none;
  margin: 0;
}
.traversee img {
  display: block;
  height: min(62svh, 560px);
  width: auto;
  max-width: 82vw;
  object-fit: cover;
  border: 1px solid var(--ligne);
  border-radius: 18px;
  padding: 8px;
  background: var(--nuit-2);
}
.traversee figcaption, .galerie figcaption {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--discret);
}
.traversee figcaption b, .galerie figcaption b { color: var(--laiton); font-weight: 500; }
.traversee .compteur {
  position: absolute;
  left: 8vw;
  top: 12svh;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--laiton);
}
.traversee .jauge {
  position: absolute;
  left: 8vw;
  right: 8vw;
  bottom: 10svh;
  height: 1px;
  background: var(--ligne);
}
.traversee .jauge::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--laiton);
  transform-origin: left;
  transform: scaleX(var(--avance, 0));
}

/* ---------- Mises en scène des projets et expériences ---------- */
.defile { position: relative; }
.defile .ecran {
  position: relative;
  height: min(78svh, 660px);
  min-height: 460px;
  overflow: hidden;
}
.defile .compteur {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--laiton);
}
.defile .compteur, .defile .jauge { z-index: 20; }
.defile .compteur b { font-weight: 500; color: var(--discret); }
.defile .jauge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--ligne);
}
.defile .jauge::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--laiton);
  transform-origin: left;
  transform: scaleX(var(--avance, 0));
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.25, 1);
}
.commandes { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; }
.commandes button {
  padding: 10px 18px;
  border: 1px solid var(--laiton);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--laiton);
  background: rgba(10, 19, 48, 0.7);
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.commandes button:hover { color: var(--nuit); background: var(--laiton); }
.commandes .retour { border-color: var(--ligne); color: var(--texte); }
/* Le bouton appelle le clic tant qu'on n'a pas encore avancé */
.commandes .suivant:not(.deja) { animation: appel 2.4s ease-in-out infinite; }
@keyframes appel { 50% { box-shadow: 0 0 0 6px rgba(220, 184, 120, 0.15), 0 0 24px rgba(220, 184, 120, 0.35); } }
.defile .fiche { border-left: 1px solid var(--ligne); background: #101b40; }
.defile .fiche h4 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.defile .fiche p, .defile .volets li { font-size: 1rem; }

/* Effervescence : une seule fiche à l'écran ; au clic elle se perce de trous ronds
   qui grandissent jusqu'à la faire disparaître en bulles, et la suivante se forme */
@property --trou { syntax: '<length>'; inherits: false; initial-value: 0px; }
.effervescence .fiche {
  position: absolute;
  inset: 44px 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 52px);
  padding: clamp(20px, 3.5vw, 40px);
  border-top: 2px solid var(--laiton);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
}
.effervescence .fiche.visible { opacity: 1; visibility: visible; }
.effervescence .fiche.dissout {
  visibility: visible;
  z-index: 1;
  pointer-events: none;
  -webkit-mask: radial-gradient(circle, transparent var(--trou), #000 calc(var(--trou) + 0.5px)) 0 0 / 26px 26px;
  mask: radial-gradient(circle, transparent var(--trou), #000 calc(var(--trou) + 0.5px)) 0 0 / 26px 26px;
  animation: dissout 0.9s cubic-bezier(0.3, 0, 0.6, 1) forwards;
}
@keyframes dissout {
  from { --trou: 0px; opacity: 1; transform: none; }
  to { --trou: 19px; opacity: 0; transform: translateY(-30px) scale(0.98); }
}
.effervescence .fiche.forme { animation: forme 0.9s 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes forme {
  from { opacity: 0; transform: translateY(46px) scale(0.96); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* C · Frise : les fiches de part et d'autre d'un axe qui se trace au fil du défilement */
.frise .ecran {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 88px;
  align-items: start;
  height: auto;
  min-height: 0;
  overflow: visible;
  padding: 20px 0 clamp(60px, 10vw, 140px);
}
.frise .compteur { display: none; }
.frise .jauge { left: calc(50% - 0.5px); right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
.frise .jauge::after { transform-origin: top; transform: scaleY(var(--avance, 0)); }
/* Une année par ligne (réglée par main.js), une colonne sur deux ; chaque fiche
   remonte un peu à côté de la précédente pour former le quinconce sans chevauchement */
.frise .fiche { margin-bottom: 40px; }
.frise .fiche + .fiche { margin-top: -80px; }
.frise .fiche:nth-of-type(odd) { grid-column: 1; border-right: 2px solid var(--laiton); --cote: -1; }
.frise .fiche:nth-of-type(even) { grid-column: 2; border-left: 2px solid var(--laiton); --cote: 1; }
.frise .fiche.revele { transform: translateX(calc(var(--cote) * 60px)); transition-delay: 0s; }
.frise .fiche.revele.visible { transform: none; }
/* Dans la frise, l'année s'affiche en grand */
.frise .fiche .date {
  margin-bottom: 6px;
  padding: 0;
  border: none;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}
.frise .fiche h4 { font-size: 1.35rem; }
/* Point sur l'axe, qui se remplit quand la fiche apparaît ; centré sur l'axe :
   demi-écart entre colonnes (44px) + bordure de la fiche (2px) + demi-point (6.5px) */
.frise .fiche::before {
  content: '';
  position: absolute;
  /* à mi-hauteur de l'année (padding 22px + moitié de sa taille de police) */
  top: calc(22px + clamp(1.1rem, 2vw, 1.5rem) - 6.5px);
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--laiton);
  border-radius: 50%;
  background: var(--nuit);
  box-shadow: inset 0 0 0 3px var(--nuit);
  transition: background 0.6s 0.5s;
}
.frise .fiche:nth-of-type(odd)::before { right: -52.5px; }
.frise .fiche:nth-of-type(even)::before { left: -52.5px; }
.frise .fiche.visible::before { background: var(--laiton); }

/* ---------- Poissons (Sauvetage, Musique) ---------- */
.couloir { position: relative; width: 100vw; pointer-events: none; }
.couloir:not(.visible), .couloir:not(.visible) * { animation-play-state: paused !important; }
.poisson {
  position: absolute;
  display: block;
  width: var(--taille, 110px);
  animation: flotte 2.6s ease-in-out var(--delai, 0s) infinite alternate;
}
.poisson svg { display: block; width: 100%; overflow: visible; }
.poisson path, .poisson circle {
  fill: none;
  stroke: var(--c, var(--laiton));
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.poisson .corps { fill: rgba(10, 19, 48, 0.9); }
.poisson .oeil { fill: var(--c, var(--laiton)); stroke: none; }
.poisson .pavillon { fill: rgba(220, 184, 120, 0.15); }
.poisson .tuba { stroke-width: 2.4; }
/* La queue bat, la coulisse du trombone va et vient */
.poisson .queue { transform-box: fill-box; transform-origin: right center; animation: battement 0.55s ease-in-out var(--delai, 0s) infinite alternate; }
.poisson .coulisse { animation: coulisse 0.7s ease-in-out infinite alternate; }
@keyframes flotte { to { translate: 0 7px; } }
@keyframes battement { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
@keyframes coulisse { to { transform: translateX(8px); } }
/* Planche de surf rouge à liseret blanc, sur une vague qui ondule */
.poisson .planche { fill: #e2574c; stroke: #e2574c; }
.poisson .liseret { stroke: #f4efe4; }
.poisson .aileron { fill: #e2574c; stroke: #e2574c; }
.poisson .vague { stroke: #9fd3e6; animation: ondule 1.3s linear infinite; }
@keyframes ondule { to { transform: translateX(-16px); } }
/* Traversée d'un bord à l'autre de leur couloir */
@keyframes traverse { from { left: 0; transform: translateX(-100%); } to { left: 100%; transform: none; } }
@keyframes retour { from { left: 100%; transform: none; } to { left: 0; transform: translateX(-100%); } }

/* Sauvetage : entre la galerie et le cadre Sport, le banc en haut, le surfeur en bas */
.couloir.sauvetage { height: 250px; margin: 0 0 8px; overflow: hidden; }
.sauvetage .banc { position: absolute; top: 0; width: 320px; height: 120px; animation: traverse 24s linear infinite; }
.sauvetage > .poisson { bottom: 10px; animation: retour 32s linear -12s infinite; }
/* Il glisse vers la gauche : dessin retourné, et il tangue sur sa planche */
.sauvetage > .poisson svg { transform: scaleX(-1); animation: tangue 1.8s ease-in-out infinite alternate; }
@keyframes tangue { from { rotate: -4deg; translate: 0 0; } to { rotate: 4deg; translate: 0 6px; } }

/* Musique : le cortège passe entre la galerie et le cadre en lâchant des notes */
.couloir.fanfare { height: 170px; margin: -24px 0 8px; overflow: hidden; }
.fanfare .cortege { position: absolute; top: 56px; display: flex; gap: 12px; animation: traverse 30s linear infinite; }
.fanfare .poisson { position: relative; }
.note {
  position: absolute;
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--c, var(--laiton));
  opacity: 0;
  animation: chante 2.4s ease-out var(--n) infinite;
}
@keyframes chante {
  0% { opacity: 0; transform: translate(0, 0) rotate(-10deg) scale(0.7); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(16px, -42px) rotate(14deg) scale(1.1); }
}

/* ---------- Galerie balayée (Musique) ---------- */
.galerie { display: grid; gap: 14px; margin-bottom: 48px; }
.galerie figure { position: relative; margin: 0; min-height: 0; }
.galerie .cadre-image { position: relative; height: 100%; overflow: hidden; border-radius: 14px; clip-path: inset(0 100% 0 0); transition: clip-path 1.4s cubic-bezier(0.6, 0, 0.2, 1); transition-delay: calc(var(--i) * 180ms); }
.galerie.visible .cadre-image { clip-path: inset(0 0 0 0); }
.galerie .cadre-image::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--laiton);
  box-shadow: 0 0 16px var(--laiton);
  opacity: 0;
}
.galerie.visible .cadre-image::after { animation: scan 1.4s cubic-bezier(0.6, 0, 0.2, 1) both; animation-delay: calc(var(--i) * 180ms); }
@keyframes scan {
  0% { left: 0; opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
.galerie img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Musique : les portraits posés comme des notes sur une portée, le quatuor en grand dessous */
.galerie.musique {
  position: relative;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(24px, 5vw, 64px);
  row-gap: clamp(40px, 6vw, 72px);
  padding-top: 24px;
  margin-bottom: 64px;
}
/* Les cinq lignes de la portée, derrière les portraits */
.galerie.musique::before {
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  top: clamp(120px, 16vw, 220px);
  height: 97px;
  background: repeating-linear-gradient(to bottom, rgba(220, 184, 120, 0.35) 0 1px, transparent 1px 24px);
}
.galerie.musique figure { z-index: 1; }
.galerie.musique .cadre-image { aspect-ratio: 2 / 3; height: auto; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); }
.galerie.musique figure:nth-child(2) { margin-top: clamp(40px, 7vw, 90px); }
.galerie.musique figure:nth-child(3) { margin-top: clamp(16px, 3vw, 36px); }
.galerie.musique figure:nth-child(4) { grid-column: 1 / -1; justify-self: center; width: min(100%, 760px); }
.galerie.musique figure:nth-child(4) .cadre-image { aspect-ratio: 4 / 3; }
.bandeau { margin: 0 0 40px; }
.bandeau img { display: block; width: 100%; height: clamp(200px, 32vw, 400px); object-fit: cover; }

/* ---------- Pied de page ---------- */
footer {
  padding: 40px 16px 110px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--discret);
}
footer .fin { font-family: var(--serif); font-size: 1.6rem; font-style: italic; letter-spacing: 0; color: var(--texte); }

@media (max-width: 980px) {
  #accueil { height: auto; min-height: 100svh; }
  .accueil-grille { grid-template-columns: 1fr; padding: 72px 16px 110px; }
  .terminal { min-height: 0; }
}

@media (max-width: 760px) {
  :root { --voie: 34px; }
  .carte { padding-left: calc(var(--voie) + 20px); }
  .journal li { grid-template-columns: 1fr; gap: 0; }
  .journal .date { line-height: 1.6; }
  /* Sur mobile, les photos défilent à l'horizontale, une à la fois */
  .galerie.musique { display: flex; gap: 16px; margin-right: -16px; padding: 0 16px 8px 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .galerie.musique::before { display: none; }
  .galerie.musique figure, .galerie.musique figure:nth-child(n) { flex: 0 0 68vw; width: auto; margin: 0; scroll-snap-align: start; }
  .galerie.musique figure:nth-child(4) { flex-basis: 84vw; }
  #rose { width: 54px; height: 54px; left: auto; right: 12px; bottom: 16px; }
  .defile .fiche p, .defile .volets li { font-size: 0.9rem; }
  .defile .ecran { height: 82svh; }
  .effervescence .fiche { grid-template-columns: 1fr; align-content: center; gap: 14px; inset: 36px 0 20px; padding: 18px; overflow-y: auto; }
  .effervescence .plaque { width: min(100%, 44svh); margin: 0 auto; }
  .frise .ecran { grid-template-columns: 1fr; }
  .frise .jauge { left: 6px; }
  .frise .fiche:nth-of-type(n) { grid-column: 1; margin: 0 0 28px 30px; border-right: 1px solid var(--ligne); border-left: 2px solid var(--laiton); --cote: -1; }
  .frise .fiche:nth-of-type(n)::before { left: -32px; right: auto; }
  .surface { left: 12px; right: auto; bottom: 20px; }
  .profondeur { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .revele { opacity: 1; transform: none; }
  .journal li, .galerie .cadre-image { clip-path: none; }
  .sondes path { stroke-dashoffset: 0; }
  .commandes .suivant:not(.deja) { box-shadow: 0 0 0 1px var(--laiton); }
  .fanfare .cortege, .sauvetage .banc { left: 10%; }
  .sauvetage > .poisson { left: 60%; }
  .sondes text { opacity: 1; }
}
