/* =========================================================================
   Portfolio Noah Candel — parcours en chapitres
   Palette reprise du CV : #374238 (vert foret), #EBEFEB (fond), #201714 (encre)
   ========================================================================= */

:root {
  --forest: #374238;
  --forest-deep: #2a322b;
  --forest-soft: #4a594c;
  --sage: #8fa891;
  --sage-light: #c9d8c9;
  --paper: #ebefeb;
  --ink: #201714;

  --bg: var(--paper);
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: var(--ink);
  --muted: #4a4340;
  --muted-soft: #6b635f;
  --line: rgba(55, 66, 56, 0.16);
  --accent: var(--forest);
  --on-accent: #f4f7f4;
  --shadow: 0 18px 44px rgba(32, 23, 20, 0.10);
  --shadow-lg: 0 30px 70px rgba(32, 23, 20, 0.16);
  --scrim-top: linear-gradient(180deg, rgba(235, 239, 235, 0.96) 38%, rgba(235, 239, 235, 0));
  --scrim-bottom: linear-gradient(0deg, rgba(235, 239, 235, 0.96) 46%, rgba(235, 239, 235, 0));

  --radius: 22px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.22, 0.68, 0.32, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --step: 55ms;          /* decalage entre elements d'un chapitre */
  --enter: 620ms;
  --lead: 240ms;         /* le contenu entre quand le scan l'atteint */

  /* Transition entre niveaux : la ligne de scan et les deux decoupes de
     chapitre partagent exactement la meme duree, le meme delai et la meme
     courbe, sinon la frontiere et la ligne se desynchronisent. */
  --scan-dur: 520ms;
  --scan-delay: 200ms;
  --scan-ease: cubic-bezier(0.45, 0.05, 0.25, 1);
  --scan-glow: rgba(55, 66, 56, 0.34);
  --scan-trail: rgba(55, 66, 56, 0.09);

  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Aptos", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --led: #a8e6a1;
  --ring: rgba(55, 66, 56, 0.14);
  --stripe: rgba(255, 255, 255, 0.28);
}

body[data-theme="dark"] {
  --bg: #171c18;
  --surface: rgba(35, 42, 36, 0.82);
  --surface-strong: #232a24;
  --text: #edf1ed;
  --muted: #c2ccc2;
  --muted-soft: #96a397;
  --line: rgba(160, 176, 161, 0.20);
  --accent: var(--sage-light);
  --on-accent: #1a201b;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.55);
  --scrim-top: linear-gradient(180deg, rgba(23, 28, 24, 0.96) 38%, rgba(23, 28, 24, 0));
  --scrim-bottom: linear-gradient(0deg, rgba(23, 28, 24, 0.96) 46%, rgba(23, 28, 24, 0));
  --scan-glow: rgba(201, 216, 201, 0.34);
  --scan-trail: rgba(201, 216, 201, 0.07);
  --led: #2e7d32;
  --ring: rgba(201, 216, 201, 0.16);
  --stripe: rgba(0, 0, 0, 0.16);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: inherit; }

.sr-only {
  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: fixed; top: 10px; left: 50%; transform: translate(-50%, -160%);
  z-index: 200; padding: 10px 18px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--on-accent);
  text-decoration: none; font-weight: 700; transition: transform 200ms var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

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

/* ============================ DECOR DE FOND ============================ */

.ambient {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
  transform: translate(calc(var(--shift, 0) * -1.3vw), calc(var(--shift, 0) * -0.9vh));
  transition: transform 1100ms var(--ease-spring);
}

/* Trame de points qui derive lentement : discrete, un peu technique */
.ambient-grid {
  position: absolute; inset: -14%;
  background-image: radial-gradient(circle, rgba(55, 66, 56, 0.20) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.45;
  animation: gridPan 44s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse at 50% 46%, #000 18%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 46%, #000 18%, transparent 70%);
}
body[data-theme="dark"] .ambient-grid {
  background-image: radial-gradient(circle, rgba(201, 216, 201, 0.16) 1px, transparent 1px);
  opacity: 0.35;
}
@keyframes gridPan {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(46px, 46px, 0); }
}

/* Halo central qui respire, pour que le fond ne soit jamais tout a fait fige */
.ambient-glow {
  position: absolute; left: 50%; top: 46%;
  width: 78vw; height: 78vw; min-width: 620px; min-height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(55, 66, 56, 0.11) 0%, rgba(55, 66, 56, 0) 62%);
  animation: breathe 18s ease-in-out infinite;
}
body[data-theme="dark"] .ambient-glow {
  background: radial-gradient(circle, rgba(143, 168, 145, 0.13) 0%, rgba(143, 168, 145, 0) 62%);
}
@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: translate3d(-50%, -50%, 0) scale(1); }
  50%      { opacity: 1;    transform: translate3d(-50%, -50%, 0) scale(1.16); }
}

.ambient-blob {
  position: absolute; display: block; border-radius: 50%;
  filter: blur(70px); opacity: 0.26;
  background: radial-gradient(circle, rgba(55, 66, 56, 0.45) 0%, rgba(55, 66, 56, 0) 72%);
}
body[data-theme="dark"] .ambient-blob {
  opacity: 0.22;
  background: radial-gradient(circle, rgba(143, 168, 145, 0.5) 0%, rgba(143, 168, 145, 0) 72%);
}

.ambient-blob-one   { top: -12%; left: -10%; width: 42vw; height: 42vw; min-width: 320px; min-height: 320px; animation: drift1 26s ease-in-out infinite; }
.ambient-blob-two   { bottom: -18%; right: -12%; width: 46vw; height: 46vw; min-width: 340px; min-height: 340px; animation: drift2 32s ease-in-out infinite; }
.ambient-blob-three { top: 42%; left: 52%; width: 30vw; height: 30vw; min-width: 240px; min-height: 240px; opacity: 0.14; animation: drift3 38s ease-in-out infinite; }

@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(5vw, 4vh); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-6vw,-3vh); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-4vw, 5vh) scale(1.12); } }

/* ============================ TRANSITIONS ============================ */

/* Progression du parcours, tout en haut de l'ecran */
.journey-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 70;
  background: linear-gradient(90deg, var(--accent), var(--sage));
  border-radius: 0 3px 3px 0;
  transition: width 620ms var(--ease);
  pointer-events: none;
}

/* Le numero de niveau bascule avec le chapitre */
.counter [data-current] { display: inline-block; }
body.is-moving .counter [data-current] { animation: digitIn 460ms var(--ease); }
@keyframes digitIn {
  0%   { transform: translateY(-9px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* --- Ligne de scan : revele le niveau suivant, a la maniere d'un scan de ports --- */
.scanline {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  height: 2px; opacity: 0; pointer-events: none;
  background: var(--accent);
  box-shadow: 0 0 10px 1px var(--scan-glow), 0 0 28px 5px var(--scan-glow);
}
/* sillage : la zone tout juste balayee garde une lueur qui s'eteint */
.scanline::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 120px;
  background: linear-gradient(0deg, var(--scan-trail), transparent);
}
body.going-back .scanline::before {
  bottom: auto; top: 100%;
  background: linear-gradient(180deg, var(--scan-trail), transparent);
}

body.is-scanning .scanline {
  animation: scanDown var(--scan-dur) var(--scan-ease) var(--scan-delay) both;
}
body.is-scanning.going-back .scanline { animation-name: scanUp; }

@keyframes scanDown {
  0%   { top: 0%;   opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
@keyframes scanUp {
  0%   { top: 100%; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: 0%;   opacity: 0; }
}

/* --- Terminal de transition : la commande qui mene au niveau suivant --- */
.hud {
  position: fixed; left: 50%; bottom: 102px; z-index: 75;
  width: min(92vw, 390px); padding: 0 0 11px;
  background: #141a15; color: #d6e2d6;
  border: 1px solid rgba(201, 216, 201, 0.14); border-radius: 12px;
  box-shadow: 0 24px 60px rgba(15, 19, 16, 0.32);
  font: 500 0.8rem/1.55 var(--mono);
  opacity: 0; transform: translate(-50%, 10px) scale(0.97);
  transition: opacity 240ms var(--ease), transform 200ms var(--ease-spring);
  pointer-events: none;
}
.hud.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }

.hud-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; margin-bottom: 8px;
  border-bottom: 1px solid rgba(201, 216, 201, 0.08);
}
.hud-bar span { width: 8px; height: 8px; border-radius: 50%; background: rgba(201, 216, 201, 0.22); }
.hud-bar em { margin-left: 6px; font-style: normal; font-size: 0.7rem; color: #8fa891; }

.hud-line, .hud-out { padding: 0 14px; white-space: nowrap; }
.hud-prompt { color: #8fa891; font-weight: 800; }

/* frappe : la largeur s'ouvre caractere par caractere (1ch = un caractere en chasse fixe) */
.hud-cmd {
  display: inline-block; vertical-align: bottom;
  overflow: hidden; white-space: nowrap; width: 0;
}
.hud.is-typing .hud-cmd { animation: hudType var(--type-dur, 450ms) steps(var(--n, 20), end) 60ms forwards; }
@keyframes hudType { to { width: calc(var(--n, 20) * 1ch); } }

.hud-caret {
  display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -3px;
  background: #c9d8c9; animation: caret 700ms steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* pas de transition a la disparition : sinon la sortie de la commande
   suivante s'afficherait un instant avant meme d'etre tapee */
.hud-out { color: #a8e6a1; opacity: 0; transform: translateY(3px); }
.hud.is-done .hud-out {
  opacity: 1; transform: none;
  transition: opacity 120ms var(--ease), transform 160ms var(--ease);
}

/* ============================ BARRE HAUTE ============================ */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 20px clamp(18px, 4vw, 42px) 34px;
  background: var(--scrim-top);
}

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; font-weight: 800; letter-spacing: -0.01em;
}
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; background: var(--accent); color: var(--on-accent);
  font-size: 0.9rem; font-weight: 800;
}
.brand-name { font-size: 1rem; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 16px; border-radius: var(--radius-pill);
  background: var(--surface-strong); border: 1px solid var(--line);
  box-shadow: var(--shadow); cursor: pointer; font-weight: 700; font-size: 0.86rem;
  transition: transform 200ms var(--ease);
}
.theme-toggle:hover { transform: translateY(-2px); }

/* ============================ CARTE RESEAU ============================ */

.netmap {
  position: fixed; left: clamp(18px, 3vw, 40px); top: 50%; z-index: 55;
  transform: translateY(-50%);
}

.netmap-title {
  display: none; align-items: center; gap: 7px; margin: 0 0 18px -1px;
  font: 700 0.66rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-soft); white-space: nowrap;
}
.netmap-led {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--ring); animation: ledBlink 2.4s ease-in-out infinite;
}
@keyframes ledBlink { 50% { opacity: 0.35; } }

.netmap-list { position: relative; display: grid; gap: 22px; }

/* liaison hors ligne : en pointille, le long de toute la carte */
.netmap-list::before {
  content: ""; position: absolute; left: 8px; top: 9px; bottom: 9px; width: 2px;
  background: repeating-linear-gradient(180deg, var(--line) 0 4px, transparent 4px 8px);
}
/* liaison en ligne : pleine, du premier noeud au noeud courant (positionnee en JS) */
.netmap-link {
  position: absolute; left: 8px; top: 0; width: 2px; height: 0;
  background: var(--accent); border-radius: 2px;
  transition: height 520ms var(--ease);
  pointer-events: none;
}

.node {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 12px;
  background: none; border: 0; padding: 0; cursor: pointer;
}
/* le noeud : un petit equipement reseau, avec sa diode */
.node-icon {
  position: relative; flex: none; width: 18px; height: 18px; border-radius: 5px;
  background: var(--bg); border: 2px dashed var(--line);
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease),
              transform 320ms var(--ease-spring), box-shadow 320ms var(--ease);
}
.node-icon::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 6px; height: 6px; border-radius: 50%; background: var(--line);
  transition: background-color 300ms var(--ease), box-shadow 300ms var(--ease);
}

.node-label {
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--surface-strong); box-shadow: var(--shadow);
  font-size: 0.8rem; font-weight: 700; color: var(--muted-soft); white-space: nowrap;
  opacity: 0; transform: translateX(-6px); pointer-events: none;
  transition: opacity 240ms var(--ease), transform 240ms var(--ease), color 240ms var(--ease);
}
.node:hover .node-label,
.node:focus-visible .node-label { opacity: 1; transform: none; }

/* en ligne : niveau deja atteint */
.node.is-online .node-icon { border-style: solid; border-color: var(--accent); background: var(--accent); }
.node.is-online .node-icon::after { background: var(--led); box-shadow: 0 0 6px var(--led); }
/* noeud courant : la session est ouverte ici */
.node.is-current .node-icon { transform: scale(1.18); box-shadow: 0 0 0 5px var(--ring); }
.node.is-current .node-label { color: var(--text); }

/* le paquet qui voyage d'un noeud a l'autre (trajet anime en JS) */
.netmap-packet {
  position: absolute; left: 0; top: 0; z-index: 3;
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 10px 2px var(--scan-glow);
  opacity: 0; pointer-events: none;
}

/* le noeud atteint passe en ligne a l'arrivee du paquet */
body.is-moving .node.is-current .node-icon { animation: nodeUp 560ms var(--ease-spring) 380ms backwards; }
@keyframes nodeUp {
  0%   { transform: scale(0.85); background: var(--bg); border-color: var(--line); box-shadow: 0 0 0 0 var(--scan-glow); }
  45%  { transform: scale(1.5);  box-shadow: 0 0 0 10px transparent; }
  100% { transform: scale(1.18); }
}

/* mission accomplie : tout le reseau s'allume en vague */
body.is-moving.at-last .node .node-icon {
  animation: nodeWave 620ms var(--ease-spring) both;
  animation-delay: calc(420ms + var(--k, 0) * 70ms);
}
@keyframes nodeWave {
  40% { transform: scale(1.45); box-shadow: 0 0 0 8px var(--ring); }
}

/* sur grand ecran, la place ne manque pas : etat du reseau et nom du niveau courant */
@media (min-width: 1380px) {
  .netmap-title { display: flex; }
  .node.is-current .node-label { opacity: 1; transform: none; }
}

/* ============================ SCENE ET CHAPITRES ============================ */

.stage { position: relative; z-index: 10; }

/* Sans JavaScript : tout s'affiche a la suite, le site reste lisible */
.no-js .chapter { min-height: auto; padding: 80px 0; }
/* sans script, la carte et les commandes n'ont rien a piloter */
.no-js .netmap, .no-js .controls, .no-js .hud { display: none; }

body.journey .stage {
  position: fixed; inset: 0;
  display: grid; place-items: center;
}

body.journey .chapter {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 92px clamp(18px, 5vw, 48px) 116px;
  overflow-y: auto;
  visibility: hidden; opacity: 0; pointer-events: none; z-index: 1;
}
body.journey .chapter.is-active { visibility: visible; opacity: 1; pointer-events: auto; z-index: 2; }
/* le niveau quitte reste affiche le temps que le scan l'efface */
body.journey .chapter.is-leaving { visibility: visible; opacity: 1; z-index: 1; }

/* Le scan revele le nouveau niveau pendant qu'il efface l'ancien. Les deux
   decoupes se rejoignent exactement sur la ligne de scan : les chapitres ne
   se chevauchent jamais, et le decor anime reste visible derriere eux. */
body.is-scanning .chapter.is-active {
  animation: revealDown var(--scan-dur) var(--scan-ease) var(--scan-delay) both;
}
body.is-scanning .chapter.is-leaving {
  animation: eraseDown var(--scan-dur) var(--scan-ease) var(--scan-delay) both;
}
body.is-scanning.going-back .chapter.is-active  { animation-name: revealUp; }
body.is-scanning.going-back .chapter.is-leaving { animation-name: eraseUp; }

@keyframes revealDown { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes eraseDown  { from { clip-path: inset(0 0 0 0); }    to { clip-path: inset(100% 0 0 0); } }
@keyframes revealUp   { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes eraseUp    { from { clip-path: inset(0 0 0 0); }    to { clip-path: inset(0 0 100% 0); } }

.chapter-inner {
  width: min(100%, 1080px);
  position: relative;
  margin: auto;
}

/* numero fantome en fond de chapitre */
.chapter-ghost {
  position: absolute; top: -8%; right: -1%;
  font-size: clamp(7rem, 22vw, 17rem); font-weight: 800; line-height: 1;
  color: var(--text); opacity: 0.045; pointer-events: none; user-select: none;
  letter-spacing: -0.05em;
}

.chapter-head { margin-bottom: clamp(22px, 4vh, 38px); }
.chapter-kicker {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.kicker-chip {
  padding: 3px 9px; border-radius: var(--radius-pill);
  border: 1px solid var(--accent);
  font: 800 0.64rem/1.3 var(--mono); letter-spacing: 0.08em;
}
.kicker-chip--done { background: var(--accent); color: var(--on-accent); }
body.journey .chapter.is-active .kicker-chip {
  animation: chipPop 420ms var(--ease-spring) both;
  animation-delay: calc(var(--lead) + 380ms);
}
@keyframes chipPop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: none; }
}
.chapter-title { font-size: clamp(1.9rem, 5vw, 3.1rem); font-weight: 800; }
.chapter-title:focus { outline: none; }
.chapter-sub {
  margin-top: 12px; color: var(--muted); font-size: clamp(0.98rem, 1.7vw, 1.1rem);
  max-width: 62ch;
}

/* ---- animation d'entree, decalee element par element ---- */
body.journey .chapter [style*="--i"]:not(.is-split) {
  opacity: 0;
  transform: translateY(var(--from-y, 30px));
}
body.journey .chapter.is-active [style*="--i"]:not(.is-split) {
  animation: riseIn var(--enter) var(--ease-spring) forwards;
  animation-delay: calc(var(--i) * var(--step) + var(--lead));
}
body.journey .chapter.is-active.from-next [style*="--i"] { --from-y: -30px; }

/* Le niveau quitte garde son contenu affiche pendant que le scan l'efface :
   sans cela, ses elements perdraient leur animation d'entree en meme temps
   que la classe is-active, et disparaitraient d'un coup au clic. */
body.journey .chapter.is-leaving [style*="--i"]:not(.is-split),
body.journey .chapter.is-leaving .split-char,
body.journey .chapter.is-leaving .split-space {
  opacity: 1; transform: none; animation: none;
}

@keyframes riseIn {
  from { opacity: 0; transform: perspective(900px) translateY(var(--from-y, 30px)) rotateX(-10deg) scale(0.97); }
  to   { opacity: 1; transform: perspective(900px) translateY(0) rotateX(0) scale(1); }
}

/* --- Titres : cascade lettre par lettre --- */
.split-char, .split-space { display: inline-block; will-change: transform, opacity; }
.split-space { white-space: pre; }
/* le mot reste solidaire : la coupure ne peut tomber qu'entre deux mots */
.split-word { display: inline-block; white-space: nowrap; }

body.journey .chapter .split-char,
body.journey .chapter .split-space { opacity: 0; }

body.journey .chapter.is-active .split-char,
body.journey .chapter.is-active .split-space {
  animation: charIn 720ms var(--ease-spring) both;
  animation-delay: calc(var(--i, 2) * var(--step) + var(--c) * 24ms + var(--lead));
}

@keyframes charIn {
  0%   { opacity: 0; transform: perspective(700px) translateY(0.55em) rotateX(-75deg); }
  100% { opacity: 1; transform: perspective(700px) translateY(0) rotateX(0); }
}

/* ============================ CHAPITRE 00 — DEPART ============================ */

.intro-inner { text-align: center; display: grid; justify-items: center; }

.intro-pulse { position: relative; width: 74px; height: 74px; margin-bottom: 26px; }
.intro-pulse span {
  position: absolute; inset: 0; margin: auto; width: 14px; height: 14px;
  border-radius: 50%; background: var(--accent);
}
.intro-pulse span:nth-child(2),
.intro-pulse span:nth-child(3) {
  width: 74px; height: 74px; background: none;
  border: 2px solid var(--accent); opacity: 0;
  animation: pulseRing 2.8s var(--ease) infinite;
}
.intro-pulse span:nth-child(3) { animation-delay: 1.4s; }

@keyframes pulseRing {
  0%   { transform: scale(0.25); opacity: 0.75; }
  80%  { transform: scale(1);    opacity: 0; }
  100% { opacity: 0; }
}

.intro-kicker {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted-soft);
}

.intro-title {
  margin-top: 16px;
  font-size: clamp(2.2rem, 7.4vw, 4.6rem); font-weight: 800;
}
.intro-title .word { display: block; }
.intro-title .accent { color: var(--accent); }

.intro-lead {
  margin-top: 26px; max-width: 56ch; color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.2rem);
}
.intro-lead strong { color: var(--text); }

/* ============================ BOUTONS ============================ */

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 26px; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  font-weight: 700; font-size: 0.96rem;
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn-ghost { background: var(--surface-strong); border-color: var(--line); color: var(--text); box-shadow: var(--shadow); }
.btn-ghost:hover { transform: translateY(-3px); }

.btn-arrow { transition: transform 260ms var(--ease); }

/* ============================ RACCOURCI CV ============================ */

.cv-corner {
  position: fixed; left: clamp(16px, 3vw, 34px); bottom: clamp(16px, 2.4vh, 26px);
  z-index: 62;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: var(--radius-pill);
  background: var(--surface-strong); border: 1px solid var(--line);
  box-shadow: var(--shadow); text-decoration: none;
  font-size: 0.79rem; font-weight: 700; color: var(--muted);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease),
              color 220ms var(--ease), opacity 260ms var(--ease), visibility 260ms;
}
.cv-corner:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--text); }
.cv-corner-icon { font-size: 0.9rem; font-weight: 800; color: var(--accent); }

/* Sur le dernier chapitre le CV devient l'action principale : le raccourci s'efface */
body.at-last .cv-corner { opacity: 0; visibility: hidden; pointer-events: none; }

/* --- Appel a l'action final --- */

.cv-hero {
  margin-top: clamp(16px, 2.4vh, 24px);
  display: flex; align-items: center; gap: 18px;
  padding: clamp(16px, 2.2vw, 22px) clamp(20px, 2.6vw, 28px);
  border-radius: var(--radius); text-decoration: none;
  background: var(--accent); color: var(--on-accent);
  box-shadow: var(--shadow); border: 1px solid var(--accent);
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease);
}
.cv-hero:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.cv-hero-icon {
  display: grid; place-items: center; flex: none;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18); font-size: 1.25rem; font-weight: 800;
  transition: transform 260ms var(--ease);
}
body[data-theme="dark"] .cv-hero-icon { background: rgba(26, 32, 27, 0.16); }
.cv-hero:hover .cv-hero-icon { transform: translateY(3px); }

.cv-hero-text { display: grid; gap: 2px; }
.cv-hero-text strong { font-size: clamp(1.05rem, 2vw, 1.28rem); font-weight: 800; }
.cv-hero-text span { font-size: 0.86rem; opacity: 0.85; }

/* ============================ CARTES ============================ */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(18px, 2.6vw, 26px);
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
}

.profil-grid {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(14px, 2vw, 22px); align-items: start;
}

.card-profil { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: start; }

.profil-photo {
  width: 108px; height: 108px; border-radius: 50%; flex: none;
  background-image: url("assets/images/noah-profile.jpg");
  background-size: cover; background-position: center top;
  border: 3px solid var(--surface-strong); box-shadow: var(--shadow);
}

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

.link-company {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-weight: 700; color: var(--accent); text-decoration: underline;
  text-underline-offset: 3px;
}

.facts { margin: 18px 0 0; display: grid; gap: 10px; }
.fact { display: grid; gap: 2px; }
.fact dt { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-soft); }
.fact dd { margin: 0; font-size: 0.92rem; font-weight: 600; }

.profil-side { display: grid; gap: clamp(12px, 1.6vw, 18px); }
.card-list h3 { font-size: 1rem; margin-bottom: 12px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills li {
  padding: 6px 13px; border-radius: var(--radius-pill);
  background: rgba(55, 66, 56, 0.10); color: var(--accent);
  font-size: 0.82rem; font-weight: 700;
}
body[data-theme="dark"] .pills li { background: rgba(201, 216, 201, 0.12); }
.pills.alt li { background: none; border: 1px dashed var(--line); color: var(--muted); }

/* ============================ CHAPITRE 02 — EXPERIENCES ============================ */

.track { display: grid; gap: clamp(10px, 1.4vw, 14px); }

.xp {
  position: relative; display: grid; gap: 9px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(15px, 2vw, 20px);
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}
.xp:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.xp-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; }
.xp-title { font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 800; }
.xp-company { font-weight: 700; color: var(--accent); margin-top: 3px; }
.xp-badge {
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--on-accent);
  font-size: 0.74rem; font-weight: 800; white-space: nowrap;
}
.xp-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.84rem; color: var(--muted-soft); font-weight: 600; }
.xp-desc { color: var(--muted); font-size: 0.94rem; }

.xp-missions { display: grid; gap: 5px; }
.xp-missions li { position: relative; padding-left: 20px; font-size: 0.88rem; line-height: 1.45; color: var(--muted); }
.xp-missions li::before {
  content: ""; position: absolute; left: 0; top: 0.58em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: 0.55;
}

.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags span {
  padding: 5px 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); font-size: 0.76rem; font-weight: 700; color: var(--muted);
}

/* ============================ CHAPITRE 03 — FORMATION : NIVEAUX ============================ */

/* barre de progression de la mission : un segment par niveau */
.lvl-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: clamp(14px, 2.2vh, 20px); }
.lvl-segs { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: 6px; flex: 1 1 220px; max-width: 420px; }
.lvl-seg { position: relative; height: 8px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.lvl-seg::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background-color: var(--accent); transform-origin: left; transform: scaleX(0);
}
.lvl-seg.is-done::after, .lvl-seg.is-active::after { transform: scaleX(1); }
.lvl-progress-label { font: 700 0.76rem/1 var(--mono); color: var(--muted-soft); white-space: nowrap; }

/* hachures animees : l'etat "en cours" */
.lvl-seg.is-active::after,
.lvl--active .lvl-xp span {
  background-image: linear-gradient(135deg,
    var(--stripe) 25%, transparent 25%, transparent 50%,
    var(--stripe) 50%, var(--stripe) 75%, transparent 75%, transparent);
  background-size: 16px 16px;
  animation: stripes 900ms linear infinite;
}
@keyframes stripes { to { background-position: 16px 0; } }

.levels { display: grid; gap: clamp(9px, 1.3vw, 13px); }

.lvl {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(12px, 1.6vw, 16px); align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(13px, 1.8vw, 17px) clamp(14px, 2vw, 20px);
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
  transition: transform 260ms var(--ease);
}
.lvl:hover { transform: translateX(5px); }

/* pastille du niveau */
.lvl-badge {
  display: grid; place-items: center; align-content: center; gap: 1px;
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--mono); text-align: center;
}
.lvl-badge small { font-size: 0.58rem; font-weight: 800; letter-spacing: 0.1em; opacity: 0.8; }
.lvl-badge strong { font-size: 1.15rem; font-weight: 800; line-height: 1; }

.lvl-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.lvl-title { font-size: clamp(0.98rem, 1.7vw, 1.12rem); font-weight: 800; }
.lvl-status {
  padding: 4px 10px; border-radius: var(--radius-pill); white-space: nowrap;
  font: 800 0.68rem/1.3 var(--mono); letter-spacing: 0.05em; text-transform: uppercase;
}
.lvl--done .lvl-status   { background: rgba(55, 66, 56, 0.12); color: var(--accent); }
body[data-theme="dark"] .lvl--done .lvl-status { background: rgba(201, 216, 201, 0.14); }
.lvl--active .lvl-status { background: var(--accent); color: var(--on-accent); }
.lvl--locked .lvl-status { border: 1px dashed var(--muted-soft); color: var(--muted); }

.lvl-school { margin-top: 3px; font-size: 0.85rem; font-weight: 700; color: var(--muted-soft); }
.lvl-desc { margin-top: 6px; font-size: 0.89rem; color: var(--muted); }

/* barre d'experience du niveau */
.lvl-xp { margin-top: 10px; height: 5px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.lvl-xp span {
  display: block; height: 100%; border-radius: inherit;
  background-color: var(--accent); transform-origin: left; transform: scaleX(0);
}
.lvl--done .lvl-xp span, .lvl--active .lvl-xp span { transform: scaleX(1); }

/* niveau verrouille : en pointille, le cadenas remplace le numero */
.lvl--locked { background: transparent; border-style: dashed; box-shadow: none; backdrop-filter: none; }
.lvl--locked .lvl-badge { background: transparent; border: 2px dashed var(--line); color: var(--muted-soft); }
.lvl--locked .lvl-title { color: var(--muted); }

/* --- deblocage, joue a l'entree dans le chapitre --- */
body.journey .chapter.is-active .lvl-seg.is-done::after {
  animation: segFill 520ms var(--ease-spring) both;
  animation-delay: calc(var(--s, 0) * 150ms + var(--lead) + 420ms);
}
/* le segment en cours se remplit puis garde ses hachures en mouvement */
body.journey .chapter.is-active .lvl-seg.is-active::after {
  animation: segFill 520ms var(--ease-spring) both, stripes 900ms linear infinite;
  animation-delay: calc(var(--s, 0) * 150ms + var(--lead) + 420ms), 0s;
}
@keyframes segFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

body.journey .chapter.is-active .lvl--done .lvl-xp span {
  animation: xpFill 720ms var(--ease-spring) both;
  animation-delay: calc(var(--i) * var(--step) + var(--lead) + 300ms);
}
@keyframes xpFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

body.journey .chapter.is-active .lvl-status {
  animation: chipPop 420ms var(--ease-spring) both;
  animation-delay: calc(var(--i) * var(--step) + var(--lead) + 560ms);
}

/* le cadenas resiste : le dernier niveau reste a debloquer */
body.journey .chapter.is-active .lvl--locked .lvl-badge svg {
  animation: lockNudge 520ms var(--ease) both;
  animation-delay: calc(var(--i) * var(--step) + var(--lead) + 620ms);
}
@keyframes lockNudge {
  0%, 100% { transform: none; }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(3deg); }
}

/* ============================ CHAPITRE 04 — MON CAP ============================ */

.milestones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.8vw, 20px); }

.milestone {
  position: relative; display: grid; gap: 10px; align-content: start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(18px, 2.4vw, 26px);
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}
.milestone:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.milestone-step {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 50%; background: rgba(55, 66, 56, 0.12); color: var(--accent);
  font-weight: 800; font-size: 1rem;
}
body[data-theme="dark"] .milestone-step { background: rgba(201, 216, 201, 0.14); }

.milestone h3 { font-size: 1.08rem; font-weight: 800; }
.milestone p { font-size: 0.91rem; color: var(--muted); }
.milestone-when {
  margin-top: 4px; font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-soft);
}

.milestone.is-goal { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.milestone.is-goal p,
.milestone.is-goal .milestone-when { color: var(--on-accent); opacity: 0.92; }
.milestone.is-goal .milestone-step { background: rgba(255, 255, 255, 0.18); color: var(--on-accent); }

/* ============================ CHAPITRE 05 — CONTACT ============================ */

.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(11px, 1.6vw, 16px); }

.contact-tile {
  display: grid; gap: 5px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 17px 19px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px);
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease);
}
a.contact-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.contact-label { font-size: 0.71rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-soft); }
.contact-value { font-weight: 700; font-size: 0.95rem; overflow-wrap: anywhere; }
.contact-tile-cv { background: var(--accent); border-color: var(--accent); }
.contact-tile-cv .contact-label { color: var(--on-accent); opacity: 0.8; }
.contact-tile-cv .contact-value { color: var(--on-accent); }

.contact-outro { margin-top: 26px; color: var(--muted-soft); font-size: 0.92rem; }
.link-restart {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-weight: 800; color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}

/* ============================ COMMANDES ============================ */

.controls {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2vw, 22px);
  padding: 34px clamp(16px, 4vw, 40px) 20px;
  background: var(--scrim-bottom);
  pointer-events: none;
}
.controls > * { pointer-events: auto; }

.nav-btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 20px; border-radius: var(--radius-pill);
  background: var(--surface-strong); border: 1px solid var(--line);
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), opacity 220ms var(--ease);
}
.nav-btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.nav-btn:disabled { opacity: 0.32; cursor: default; }

.nav-next { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.nav-text { display: grid; text-align: left; line-height: 1.2; }
.nav-prev .nav-text { text-align: right; }
.nav-hint { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; }
.nav-name { font-size: 0.9rem; font-weight: 800; }
.nav-arrow { font-size: 1.05rem; font-weight: 800; transition: transform 240ms var(--ease); }
.nav-next:hover:not(:disabled) .nav-arrow { transform: translateX(4px); }
.nav-prev:hover:not(:disabled) .nav-arrow { transform: translateX(-4px); }

.counter {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-size: 0.82rem; font-weight: 800; color: var(--muted-soft);
  font-variant-numeric: tabular-nums;
}
.counter-sep { opacity: 0.5; }

/* ============================ FICHE ENTREPRISE ============================ */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center; padding: 22px;
  background: rgba(23, 28, 24, 0.55); backdrop-filter: blur(5px);
  animation: fadeIn 220ms var(--ease);
}
.modal-backdrop[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative; width: min(100%, 640px); max-height: 86vh; overflow-y: auto;
  background: var(--surface-strong); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--shadow-lg);
  animation: popIn 300ms var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }

.modal-close {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--bg);
  cursor: pointer; font-size: 1.2rem; line-height: 1;
}
.modal-badge {
  display: inline-block; padding: 5px 12px; border-radius: var(--radius-pill);
  background: rgba(55, 66, 56, 0.12); color: var(--accent);
  font-size: 0.74rem; font-weight: 800; margin-bottom: 12px;
}
body[data-theme="dark"] .modal-badge { background: rgba(201, 216, 201, 0.14); }
.modal h3 { font-size: 1.25rem; margin-bottom: 12px; }
.modal > p { color: var(--muted); font-size: 0.93rem; }
.modal-grid { margin-top: 18px; display: grid; gap: 11px; }
.modal-card {
  display: grid; gap: 4px; padding: 14px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg);
}
.modal-card strong { font-size: 0.88rem; }
.modal-card span { font-size: 0.87rem; color: var(--muted); }

body.modal-open { overflow: hidden; }

/* ============================ EASTER EGG : TERMINAL DU CTF ============================ */

.ctf-term {
  position: relative; width: min(100%, 560px); max-height: 86vh; overflow-y: auto;
  background: #121712; color: #d6e2d6;
  border: 1px solid rgba(201, 216, 201, 0.16); border-radius: 14px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45);
  font: 500 0.86rem/1.6 var(--mono);
  animation: popIn 300ms var(--ease);
}
.ctf-term:focus { outline: none; }
.ctf-bar {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid rgba(201, 216, 201, 0.08);
}
.ctf-bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(201, 216, 201, 0.22); }
.ctf-bar em { margin-left: 8px; font-style: normal; font-size: 0.74rem; color: #8fa891; }

.ctf-body { padding: 16px 18px 20px; }
.ctf-body > * {
  margin: 0; opacity: 0;
  animation: ctfLine 260ms var(--ease) forwards;
  animation-delay: calc(var(--l, 0) * 170ms + 140ms);
}
@keyframes ctfLine { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.ctf-prompt { color: #8fa891; }
.ctf-flag { color: #a8e6a1; font-weight: 800; word-break: break-all; }
.ctf-granted { margin-top: 14px !important; color: #a8e6a1; font-weight: 800; letter-spacing: 0.14em; }
.ctf-msg { margin-top: 6px !important; font-family: var(--sans); font-size: 0.97rem; line-height: 1.55; }

.ctf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px !important; }
.ctf-btn {
  display: inline-flex; align-items: center; padding: 10px 18px; border-radius: var(--radius-pill);
  border: 1px solid rgba(201, 216, 201, 0.3); background: transparent; color: #d6e2d6;
  font: 700 0.84rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 200ms var(--ease);
}
.ctf-btn:hover { transform: translateY(-2px); }
.ctf-btn--primary { background: #a8e6a1; border-color: #a8e6a1; color: #121712; }
.ctf-btn:focus-visible { outline: 2px solid #a8e6a1; outline-offset: 3px; }

/* ============================ RESPONSIVE ============================ */

@media (max-width: 960px) {
  .profil-grid { grid-template-columns: minmax(0, 1fr); }
  .milestones { grid-template-columns: minmax(0, 1fr); }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  /* la carte reseau passe en bandeau horizontal sous la barre haute */
  .netmap { left: 0; right: 0; top: 74px; transform: none; display: flex; justify-content: center; }
  .netmap-title, .netmap-link, .netmap-list::before { display: none; }
  .netmap-list {
    display: flex; gap: 12px; padding: 8px 14px;
    background: var(--surface-strong); border: 1px solid var(--line);
    border-radius: var(--radius-pill); box-shadow: var(--shadow);
  }
  .node-label { display: none; }
  .node { padding: 3px; }
  .hud { bottom: 88px; }
  .lvl { grid-template-columns: minmax(0, 1fr); }
  .lvl-badge { width: 44px; height: 44px; }

  body.journey .chapter { padding: 128px 18px 104px; place-items: start center; }
  .chapter-ghost { display: none; }
  .card-profil { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .nav-text { display: none; }
  .nav-btn { padding: 12px 18px; }
  .cv-corner { left: 50%; transform: translateX(-50%); bottom: auto; top: 128px; }
  .cv-corner:hover { transform: translateX(-50%) translateY(-3px); }
  body.journey .chapter { padding-top: 178px; }
  .brand-name { display: none; }
  .theme-toggle-label { display: none; }
}

/* ============================ MOUVEMENT REDUIT ============================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  body.journey .chapter [style*="--i"] { opacity: 1; transform: none; }
  body.journey .chapter { transform: none; }
  body.journey .chapter .split-char,
  body.journey .chapter .split-space { opacity: 1; transform: none; }
  .scanline, .netmap-packet { display: none; }
  /* Le terminal reste visible : sans frappe ni deplacement, il apparait et
     disparait en fondu. Un changement d'opacite n'est pas un mouvement. */
  .hud, .hud.is-visible { transform: translate(-50%, 0); }
  .hud { transition-property: opacity !important; transition-duration: 160ms !important; }
  .hud-cmd { width: auto; animation: none !important; }
  .hud-out { opacity: 1; transform: none; }
  .ambient { transform: none; }
  .ambient-grid, .ambient-glow { animation: none; }
  .journey-progress { transition: none; }
  .ambient-blob { animation: none; }
}

/* ============================ IMPRESSION ============================ */

@media print {
  .topbar, .netmap, .controls, .ambient, .skip-link, .modal-backdrop, .cv-corner,
  .hud, .scanline, .journey-progress { display: none !important; }
  body.journey .stage { position: static; display: block; }
  body.journey .chapter {
    position: static; visibility: visible; opacity: 1; page-break-inside: avoid;
    padding: 24px 0; min-height: auto; display: block;
    transform: none; transition: none; clip-path: none; animation: none;
  }
  body.journey .chapter [style*="--i"] { opacity: 1; transform: none; animation: none; }
  body.journey .chapter .split-char,
  body.journey .chapter .split-space { opacity: 1; transform: none; animation: none; }
}

/* ============================ PAGE 404 ============================ */

body.notfound { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.notfound-term { max-width: 560px; }
.notfound-term h1 { font-size: 1rem; }
