/* ============================================================
   GUYLANN BRESSON, PORTFOLIO
   Direction artistique « Télémétrie »
   ------------------------------------------------------------
   Le portfolio est le mur des stands de l'écurie BRESSON : le
   visiteur lit la télémétrie du pilote #26. Trois couches fondues
   dans un seul langage :
   - F1 : livrée bleu BRESSON sur carbone, feux de départ,
     shift-lights, secteurs (violet, vert, jaune), vibreurs, damier ;
   - cyber : HUD à crochets, texte qui se déchiffre, terminal,
     réticule, lignes de balayage ;
   - IA : réseaux de neurones, atomes computationnels (NEUROPULSE).
   Typographie : Anybody (affichage large et penché, axe wdth 50 à 150),
   Titillium Web (texte), JetBrains Mono (HUD, annotations).
   Ce fichier porte le socle commun ; chaque page a sa feuille.
   ============================================================ */

/* ------------------------------------------------------------
   1. TOKENS
   ------------------------------------------------------------ */

/* Couleurs de scène enregistrées : elles s'interpolent quand la
   page passe d'un chapitre à l'autre. */
@property --bg     { syntax: "<color>"; inherits: true; initial-value: #06070a; }
@property --fg     { syntax: "<color>"; inherits: true; initial-value: #e9edf6; }
@property --muted  { syntax: "<color>"; inherits: true; initial-value: #8d95a8; }
@property --faint  { syntax: "<color>"; inherits: true; initial-value: #5d6578; }
@property --rule   { syntax: "<color>"; inherits: true; initial-value: rgba(150, 175, 255, 0.14); }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #3d7dff; }
@property --grid-line { syntax: "<color>"; inherits: true; initial-value: rgba(120, 150, 255, 0.05); }

:root {
  color-scheme: dark;

  /* Carbone */
  --carbon: #06070a;
  --carbon-2: #0b0e14;
  --carbon-3: #121722;
  --line: rgba(150, 175, 255, 0.14);
  --line-2: rgba(150, 175, 255, 0.28);

  /* Texte */
  --text: #e9edf6;
  --white: #f6f7fb;

  /* Livrée BRESSON */
  --livery: #0a5cf0;          /* bleu de la bannière, fonds pleins (texte blanc AA) */
  --livery-2: #3d7dff;        /* le même bleu, lisible sur carbone */
  --livery-glow: #6fa0ff;

  /* Données, secteurs, alertes */
  --cyan: #40e0ff;
  --purple: #b44dff;
  --green: #23d56b;
  --yellow: #ffd23f;
  --red: #ff2d3d;

  /* Alias historiques (anciennes feuilles, iframe, 404) */
  --ink: var(--carbon);
  --paper: var(--text);
  --signal: var(--livery);
  --signal-light: var(--livery-glow);

  /* Scène par défaut : carbone */
  --bg: var(--carbon);
  --fg: var(--text);
  --muted: #8d95a8;
  --faint: #5d6578;
  --rule: var(--line);
  --accent: var(--livery-2);
  --accent-small: var(--livery-glow);
  --on-accent: var(--carbon);
  --grid-line: rgba(120, 150, 255, 0.05);

  /* Familles */
  --font-display: "Anybody", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Titillium Web", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Échelle typographique fluide */
  --fs-label: 0.75rem;
  --fs-small: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);
  --fs-body: clamp(1.0625rem, 0.98rem + 0.3vw, 1.2rem);
  --fs-lede: clamp(1.3rem, 1.02rem + 1.05vw, 2.1rem);

  /* Espace */
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --section: clamp(96px, 7vw + 64px, 200px);

  /* Grille : 4 → 8 → 12 colonnes */
  --margin: clamp(16px, 3.6vw, 56px);
  --gutter: clamp(12px, 1.5vw, 24px);
  --cols: 4;
  --maxw: 1760px;
  --nav-h: 64px;
  --grid-size: 64px;

  /* Inclinaison « vitesse » (titres, boutons, plaques) */
  --slant: -10deg;

  /* Mouvement */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ease-scene: cubic-bezier(0.45, 0, 0.2, 1);
  --ease-snap: cubic-bezier(0.2, 0.9, 0.1, 1.2);
  --dur-1: 160ms;
  --dur-2: 320ms;
}

@media (min-width: 640px)  { :root { --cols: 8; } }
@media (min-width: 1024px) { :root { --cols: 12; --nav-h: 72px; --grid-size: 80px; } }

/* ------------------------------------------------------------
   2. SCÈNES : l'éclairage change avec le chapitre lu
   ink = carbone, paper = cockpit (carbone bleuté, grille plus
   présente), signal = livrée bleue pleine.
   ------------------------------------------------------------ */
body[data-scene="paper"],
html:not(.js) [data-scene="paper"],
.scene-cockpit {
  --bg: var(--carbon-2);
  --fg: var(--text);
  --muted: #949cb0;
  --faint: #5f687c;
  --rule: rgba(150, 175, 255, 0.16);
  --accent: var(--livery-2);
  --accent-small: var(--livery-glow);
  --on-accent: var(--carbon);
  --grid-line: rgba(120, 150, 255, 0.075);
}

body[data-scene="signal"],
html:not(.js) [data-scene="signal"],
.scene-signal {
  --bg: var(--livery);
  --fg: var(--white);
  --muted: #dbe5ff;
  --faint: #bcd0ff;
  --rule: rgba(246, 247, 251, 0.4);
  --accent: var(--white);
  --accent-small: var(--white);
  --on-accent: var(--livery);
  --grid-line: rgba(255, 255, 255, 0.09);
}

body[data-scene="ink"],
html:not(.js) [data-scene="ink"],
.scene-ink {
  --bg: var(--carbon);
  --fg: var(--text);
  --muted: #8d95a8;
  --faint: #5d6578;
  --rule: var(--line);
  --accent: var(--livery-2);
  --accent-small: var(--livery-glow);
  --on-accent: var(--carbon);
  --grid-line: rgba(120, 150, 255, 0.05);
}

/* Document papier posé sur le mur des stands (feuille de publication) */
.scene-paper {
  --bg: #eef0f4;
  --fg: #0b0e14;
  --muted: #4a5163;
  --faint: #5f6678;
  --rule: rgba(11, 14, 20, 0.18);
  --accent: var(--livery);
  --accent-small: var(--livery);
  --on-accent: var(--white);
  color-scheme: light;
}

/* Avec JS, c'est le <body> qui porte la scène active et les sections
   restent transparentes ; sans JS, chaque section garde sa couleur. */
html:not(.js) main [data-scene],
html:not(.js) footer[data-scene] {
  background-color: var(--bg);
  color: var(--fg);
}

/* ------------------------------------------------------------
   3. BASE
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  background: var(--carbon);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  min-height: 100vh;
  font-family: var(--font-text);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  font-kerning: normal;
  color: var(--fg);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition:
    --bg 0.9s var(--ease-scene),
    --fg 0.9s var(--ease-scene),
    --muted 0.9s var(--ease-scene),
    --faint 0.9s var(--ease-scene),
    --rule 0.9s var(--ease-scene),
    --accent 0.9s var(--ease-scene),
    --grid-line 0.9s var(--ease-scene);
}

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

::selection {
  background: var(--livery);
  color: var(--white);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  font-stretch: 110%;
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-wrap: balance;
}

p { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-1) ease, opacity var(--dur-1) ease;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
}

strong { font-weight: 700; }

/* Barre de défilement fine, couleur carbone */
html { scrollbar-color: var(--carbon-3) var(--carbon); scrollbar-width: thin; }

/* ------------------------------------------------------------
   4. PRIMITIVES TYPOGRAPHIQUES
   ------------------------------------------------------------ */
.label,
.kicker,
.about-label,
.cta-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  font-style: normal;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  font-family: var(--font-display);
  font-weight: 850;
  font-style: italic;
  font-stretch: 120%;
  text-transform: uppercase;
  line-height: 0.86;
}

.mono { font-family: var(--font-mono); }

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

/* Résonance : chaque lettre est un « atome » (script.js) */
.mh-chars { display: inline-flex; }

.ch {
  display: inline-block;
  font-variation-settings: "wdth" var(--w, var(--rw, var(--mh-wdth, 76))), "wght" var(--g, 850);
}

.ch-space { white-space: pre; }

/* Brouillage puis déchiffrement des étiquettes (script.js) */
[data-scramble] { position: relative; }

.scr-fx {
  position: absolute;
  inset: 0;
  white-space: nowrap;
  pointer-events: none;
  color: var(--accent-small);
}

.is-scrambling > .scr-real { opacity: 0; }

/* ------------------------------------------------------------
   5. MISE EN PAGE
   ------------------------------------------------------------ */
.frame {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--margin);
}

.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
}

/* Tête de chapitre : plaque numérotée façon timing tower, filet,
   rubrique, et repère de secteur à droite. */
.runhead {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding-top: var(--s-3);
  margin-bottom: clamp(var(--s-7), 5vw, var(--s-9));
}

.runhead::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0 64px, var(--rule) 64px);
  transform-origin: left center;
}

.runhead::after {
  content: "";
  flex: none;
  width: 46px;
  height: 5px;
  margin-left: auto;
  background: linear-gradient(90deg, var(--purple) 0 31%, transparent 31% 34.5%, var(--green) 34.5% 65.5%, transparent 65.5% 69%, var(--yellow) 69%);
  transform: skewX(var(--slant));
  opacity: 0.9;
}

.runhead-num {
  display: inline-grid;
  place-items: center;
  min-width: 2.6em;
  padding: 3px 7px 2px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.06em;
  color: var(--on-accent);
  background: var(--accent);
  font-variant-numeric: tabular-nums;
  transform: skewX(var(--slant));
}

.runhead > .kicker,
.runhead > .about-label,
.runhead > .cta-label { margin: 0; color: var(--fg); }

/* ------------------------------------------------------------
   6. FOND : grille blueprint, grain, vignettage
   ------------------------------------------------------------ */
.el {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 100% var(--grid-size),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / var(--grid-size) 100%;
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 75% at 50% 40%, #000 30%, transparent 100%);
}

/* Grain : la matière du carbone */
.el::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.6 0 0 0 0 0.65 0 0 0 0 0.8 0 0 0 1.4 -0.45'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* Lueur de livrée en haut de l'écran */
.el::after {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 9%, transparent), transparent);
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

/* ------------------------------------------------------------
   7. FOCUS & ACCESSIBILITÉ
   ------------------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--accent-small);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: var(--s-3);
  left: var(--s-3);
  z-index: 3000;
  transform: translateY(-200%);
  padding: var(--s-3) var(--s-4);
  background: var(--livery);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform var(--dur-2) var(--ease-out);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline-color: var(--white);
}

/* ============================================================
   COMPOSANTS HUD PARTAGÉS
   ============================================================ */

/* Cadre à crochets d'angle */
.hud-frame {
  --hud-c: var(--accent);
  --hud-l: 10px;
  position: relative;
  background:
    linear-gradient(var(--hud-c), var(--hud-c)) top left / var(--hud-l) 1px,
    linear-gradient(var(--hud-c), var(--hud-c)) top left / 1px var(--hud-l),
    linear-gradient(var(--hud-c), var(--hud-c)) top right / var(--hud-l) 1px,
    linear-gradient(var(--hud-c), var(--hud-c)) top right / 1px var(--hud-l),
    linear-gradient(var(--hud-c), var(--hud-c)) bottom left / var(--hud-l) 1px,
    linear-gradient(var(--hud-c), var(--hud-c)) bottom left / 1px var(--hud-l),
    linear-gradient(var(--hud-c), var(--hud-c)) bottom right / var(--hud-l) 1px,
    linear-gradient(var(--hud-c), var(--hud-c)) bottom right / 1px var(--hud-l);
  background-repeat: no-repeat;
}

/* Petite étiquette mono */
.hud-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  font-style: normal;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
}

.hud-tag--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: hud-blink 1.6s steps(2, jump-none) infinite;
}

@keyframes hud-blink { 50% { opacity: 0.25; } }

/* Pastilles et pneus (codes officiels : soft rouge, medium jaune,
   hard blanc, intermédiaire vert, pluie bleu) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: 28px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--fg) 3%, transparent);
}

.tyre {
  --tyre: var(--white);
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--tyre);
  box-shadow: inset 0 0 0 2px var(--carbon);
  background: var(--carbon);
}

.tyre--soft { --tyre: var(--red); }
.tyre--medium { --tyre: var(--yellow); }
.tyre--hard { --tyre: var(--white); }
.tyre--inter { --tyre: var(--green); }
.tyre--wet { --tyre: #2f7bff; }

/* Barre de secteur */
.sector {
  --sector: var(--yellow);
  display: block;
  height: 4px;
  background: var(--sector);
  transform: skewX(var(--slant));
}

.sector--purple { --sector: var(--purple); }
.sector--green { --sector: var(--green); }
.sector--yellow { --sector: var(--yellow); }

/* Vibreur rouge et blanc */
.kerb {
  height: 8px;
  background: repeating-linear-gradient(-60deg, var(--red) 0 14px, var(--white) 14px 28px);
}

/* Damier */
.checker {
  --checker: 10px;
  background:
    conic-gradient(var(--white) 0 25%, var(--carbon) 0 50%, var(--white) 0 75%, var(--carbon) 0) 0 0 / calc(var(--checker) * 2) calc(var(--checker) * 2);
}

/* Lignes de balayage (à poser sur un pseudo-élément ou un calque) */
.scanlines {
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

/* ============================================================
   NAVIGATION : fixe, s'efface en descendant, revient en remontant
   ============================================================ */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-h);
  color: var(--fg);
  border-bottom: 1px solid transparent;
  transition:
    transform 0.6s var(--ease-out),
    background-color 0.35s ease,
    border-color 0.35s ease;
}

.header.is-scrolled {
  background-color: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom-color: var(--rule);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}

.header.is-hidden { transform: translate3d(0, -101%, 0); }

html:not(.js) .header {
  background-color: var(--carbon);
  border-bottom-color: var(--line);
}

.navbar,
.navbar-container { height: 100%; }

.navbar-container {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--margin);
}

/* Logo : la plaque #26 de la livrée */
.navbar-logo {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.logo-icon {
  position: relative;
  width: 22px;
  height: 14px;
  overflow: hidden;
  background: var(--livery);
  transform: skewX(var(--slant));
  transition: transform 0.6s var(--ease-out), background-color 0.35s ease;
}

/* Reflet qui balaie la plaque */
.logo-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.85) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: logo-glint 5s var(--ease-in-out) 2s infinite;
}

@keyframes logo-glint {
  0%, 70% { transform: translateX(-120%); }
  85%, 100% { transform: translateX(120%); }
}

.navbar-logo:hover .logo-icon { transform: skewX(-24deg) scaleX(1.25); }

.logo-text::after {
  content: " /26";
  color: var(--accent-small);
  font-weight: 500;
}

/* Indicateur de chapitre : [02] stack technique, voyant de direct */
.nav-now { display: none; }

@media (min-width: 1180px) {
  .nav-now {
    display: flex;
    align-items: center;
    gap: 0.8em;
    height: 1.3em;
    margin-left: clamp(24px, 5vw, 120px);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: var(--fs-label);
    line-height: 1.3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .nav-now::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--red);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .nav-now.is-on::before {
    opacity: 1;
    animation: hud-blink 1.2s steps(2, jump-none) infinite;
  }

  .nav-now-inner {
    display: flex;
    gap: 0.9em;
    transform: translateY(110%);
    transition: transform 0.55s var(--ease-out);
  }

  .nav-now.is-on .nav-now-inner { transform: none; }
  .nav-now.is-swapping .nav-now-inner {
    transform: translateY(-110%);
    transition-duration: 0.22s;
    transition-timing-function: var(--ease-in);
  }

  .nav-now-num { color: var(--fg); }
  .nav-now-num:not(:empty)::before { content: "S"; color: var(--accent-small); }
}

/* Liens : capitales mono, survol en « roulement » */
.header .nav-menu { list-style: none; }

.header .nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--dur-2) ease;
}

.header .nav-link:hover,
.header .nav-link:focus-visible,
.header .nav-link[aria-current="page"] { color: var(--fg); }

.header .nav-link[target="_blank"]::after {
  content: "↗";
  content: "↗" / "";
  font-size: 0.95em;
  transition: transform var(--dur-2) var(--ease-out);
}

.header .nav-link[target="_blank"]:hover::after { transform: translate(2px, -2px); }

.roll {
  display: inline-grid;
  overflow: hidden;
  line-height: 1.3;
}

.roll > span {
  grid-area: 1 / 1;
  transition: transform 0.5s var(--ease-out);
}

.roll-b { transform: translateY(115%); color: var(--accent-small); }

a:hover > .roll > .roll-a,
a:focus-visible > .roll > .roll-a { transform: translateY(-115%); }

a:hover > .roll > .roll-b,
a:focus-visible > .roll > .roll-b { transform: none; }

/* Bureau : liste horizontale */
@media (min-width: 1024px) {
  .hamburger-menu { display: none; }

  .header .nav-menu {
    display: flex;
    align-items: center;
    gap: clamp(14px, 1.5vw, 26px);
    margin-left: auto;
  }

  .header .nav-link { min-height: 44px; }

  /* Page courante : barre de secteur violette sous le lien */
  .header .nav-link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    height: 2px;
    background: var(--purple);
    transform: skewX(var(--slant));
    box-shadow: 0 0 10px color-mix(in srgb, var(--purple) 70%, transparent);
  }

  .header .nav-contact {
    padding-inline: 10px;
    border: 1px solid var(--rule);
  }

  .header .nav-contact:hover,
  .header .nav-contact:focus-visible { border-color: var(--accent); }
}

/* Mobile et tablette : menu plein écran aux couleurs de la livrée */
@media (max-width: 1023.98px) {
  .hamburger-menu {
    position: relative;
    z-index: 2;
    display: block;
    width: 44px;
    height: 44px;
    margin-left: auto;
    margin-right: -10px;
  }

  .hamburger-menu span {
    position: absolute;
    left: 11px;
    right: 11px;
    top: 50%;
    height: 2px;
    background: currentColor;
    transition: transform 0.5s var(--ease-out), opacity 0.3s ease;
  }

  .hamburger-menu span:nth-child(1) { transform: translateY(-5px) skewX(var(--slant)); }
  .hamburger-menu span:nth-child(2) { transform: scaleX(0.6) skewX(var(--slant)); transform-origin: right; }
  .hamburger-menu span:nth-child(3) { transform: translateY(5px) skewX(var(--slant)); }
  .hamburger-menu.active span:nth-child(1) { transform: rotate(45deg); }
  .hamburger-menu.active span:nth-child(2) { opacity: 0; }
  .hamburger-menu.active span:nth-child(3) { transform: rotate(-45deg); }

  .header .nav-menu {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: calc(var(--nav-h) + var(--s-6)) var(--margin) var(--s-7);
    background:
      linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 100% 48px,
      var(--livery);
    color: var(--white);
    counter-reset: menu;
    visibility: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition:
      clip-path 0.6s var(--ease-in-out),
      visibility 0s linear 0.6s;
  }

  /* Damier en pied de menu : la ligne d'arrivée */
  .header .nav-menu::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 14px;
    background:
      conic-gradient(var(--white) 0 25%, var(--carbon) 0 50%, var(--white) 0 75%, var(--carbon) 0) 0 0 / 14px 14px;
  }

  .header .nav-menu.active {
    visibility: visible;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transition: clip-path 0.75s var(--ease-in-out);
  }

  .header .nav-menu li {
    overflow: hidden;
    border-top: 1px solid rgba(246, 247, 251, 0.38);
    counter-increment: menu;
  }

  .header .nav-menu .nav-link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-4);
    width: 100%;
    padding: 12px 0 8px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 9.2vw, 4.2rem);
    font-weight: 850;
    font-style: italic;
    font-stretch: 105%;
    line-height: 0.95;
    letter-spacing: -0.01em;
    color: var(--white);
    transform: translateY(105%);
    transition: transform 0.4s var(--ease-in);
  }

  .header .nav-menu.active .nav-link {
    transform: none;
    transition: transform 0.9s var(--ease-out) calc(0.16s + var(--i, 0) * 55ms);
  }

  .header .nav-menu .nav-link::before {
    content: "P" counter(menu);
    content: "P" counter(menu) / "";
    order: 2;
    font-family: var(--font-mono);
    font-size: var(--fs-label);
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.08em;
  }

  .header .nav-menu .nav-link[target="_blank"]::after { order: 1; margin-right: auto; font-size: 0.5em; }
  .header .nav-menu .nav-link[aria-current="page"] { color: var(--carbon); }
  .header .nav-menu .roll { overflow: visible; line-height: 0.95; }
  .header .nav-menu .roll-b { display: none; }
  .header .nav-menu a:hover > .roll > .roll-a { transform: none; }

  .header.menu-open {
    color: var(--white);
    background-color: transparent;
    border-bottom-color: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .header.menu-open .logo-icon { background: var(--white); }
  .header.menu-open .logo-text::after { color: var(--white); }
}

html.menu-open { overflow: hidden; }

/* Le contenu démarre sous la barre fixe */
main { padding-top: var(--nav-h); }

/* ============================================================
   PIED DE PAGE : ligne d'arrivée, colophon, signature
   ============================================================ */
.footer {
  container-type: inline-size;
  padding-top: var(--section);
  overflow: hidden;
}

/* La ligne d'arrivée en damier ouvre le pied de page */
.footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 16px;
  background:
    conic-gradient(var(--fg) 0 25%, transparent 0 50%, var(--fg) 0 75%, transparent 0) 0 0 / 16px 16px;
  opacity: 0.9;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--s-8);
}

.footer-section {
  grid-column: 1 / -1;
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}

@media (min-width: 1024px) {
  .footer-nav { grid-column: 1 / span 4; }
  .footer-contact { grid-column: 7 / -1; }
}

.footer-title {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin-bottom: var(--s-6);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  font-style: normal;
  font-stretch: 100%;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-title::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: skewX(var(--slant));
}

.footer-section ul { list-style: none; }

.footer-nav .nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  padding: 5px 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.05rem + 1.2vw, 2.1rem);
  font-weight: 800;
  font-style: italic;
  font-stretch: 105%;
  line-height: 1;
  text-transform: uppercase;
  color: var(--fg);
  transition: color var(--dur-2) ease, transform 0.5s var(--ease-out);
}

.footer-nav .nav-link[target="_blank"]::after {
  content: "↗";
  content: "↗" / "";
  font-family: var(--font-mono);
  font-size: 0.45em;
  font-style: normal;
  font-weight: 500;
  transition: transform var(--dur-2) var(--ease-out);
}

.footer-nav .nav-link:hover,
.footer-nav .nav-link:focus-visible { color: var(--accent-small); transform: translateX(8px); }
.footer-nav .nav-link[target="_blank"]:hover::after { transform: translate(2px, -2px); }

/* L'e-mail est l'appel à l'action final */
.footer-contact li:first-child a {
  display: inline-block;
  margin-bottom: var(--s-6);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.35cqi, 2.5rem);
  font-weight: 700;
  font-style: italic;
  font-stretch: 92%;
  line-height: 1.1;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
  transition: background-size 0.6s var(--ease-out), color var(--dur-2) ease;
}

.footer-contact li:first-child a:hover,
.footer-contact li:first-child a:focus-visible {
  background-size: 100% 2px;
  color: var(--accent-small);
}

.footer-contact li:not(:first-child) {
  display: inline-block;
  margin-right: var(--s-6);
}

.footer-contact li:not(:first-child) a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-contact li:not(:first-child) a::after {
  content: "↗";
  content: "↗" / "";
}

.footer-contact li:not(:first-child) a:hover { color: var(--fg); }

/* Signature : le nom plein cadre, en livrée, coupé par le bas */
.footer-mark {
  --rw: 96;
  position: relative;
  margin-top: clamp(var(--s-8), 9vw, var(--s-10));
  margin-bottom: -0.12em;
  font-family: var(--font-display);
  font-size: 9.6cqi;
  font-weight: 850;
  font-style: italic;
  line-height: 0.8;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--fg) 55%, transparent);
  user-select: none;
}

.footer-mark .ch {
  transition: color 0.4s ease, -webkit-text-stroke-color 0.4s ease;
}

/* Les lettres « élargies » par le curseur se remplissent de livrée */
.footer-mark .ch[style*="--w: 1"] { color: var(--accent); -webkit-text-stroke-color: var(--accent); }

.footer-mark-line { display: inline-block; }

.footer-bottom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2) var(--s-5);
  padding-top: var(--s-4);
  padding-bottom: var(--s-5);
  padding-right: calc(var(--margin) + 48px + var(--s-4));
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
}

.footer-bottom::before {
  content: "";
  position: absolute;
  inset: 0 var(--margin) auto;
  height: 1px;
  background: var(--rule);
}

/* Résumé de session (js/hud.js) */
.footer-session {
  color: var(--accent-small);
  font-variant-numeric: tabular-nums;
}

.footer-session::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.7em;
  vertical-align: 0.1em;
  border-radius: 50%;
  background: var(--green);
}

/* ============================================================
   SHIFT-LIGHTS : la progression de lecture, comme les voyants du
   volant (vert, rouge, bleu). Chaque voyant s'allume quand la
   lecture dépasse son seuil ; tout clignote en bout de page.
   ============================================================ */
.scroll-progress {
  --p: 0;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1100;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 3px;
  height: 3px;
  padding-inline: 3px;
  pointer-events: none;
}

.scroll-progress .led {
  --c: var(--green);
  background: var(--c);
  opacity: clamp(0, (var(--p) * 15 - var(--i)) * 1.5, 1);
  box-shadow: 0 0 8px var(--c);
  transform: skewX(var(--slant));
}

.scroll-progress .led:nth-child(n + 6) { --c: var(--red); }
.scroll-progress .led:nth-child(n + 11) { --c: #4f7dff; }

.scroll-progress.is-max .led { animation: shift-flash 0.5s steps(2, jump-none) 3; }

@keyframes shift-flash { 50% { opacity: 0.15; } }

/* Retour en haut : bouton HUD */
.back-to-top {
  position: fixed;
  right: var(--margin);
  bottom: var(--s-5);
  z-index: 900;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition:
    opacity 0.3s ease,
    transform 0.6s var(--ease-out),
    visibility 0s linear 0.3s,
    background-color var(--dur-1) ease,
    color var(--dur-1) ease;
}

.back-to-top::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    linear-gradient(var(--accent), var(--accent)) top left / 8px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top left / 1px 8px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 8px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 1px 8px no-repeat;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.3s ease,
    transform 0.6s var(--ease-out),
    background-color var(--dur-1) ease,
    color var(--dur-1) ease;
}

.back-to-top:hover {
  background: var(--fg);
  color: var(--bg);
}

.back-to-top span { transition: transform 0.5s var(--ease-out); }
.back-to-top:hover span { transform: translateY(-3px); }

/* ============================================================
   BOUTONS : plaques penchées, balayage lumineux au survol
   ============================================================ */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
  min-height: 52px;
  max-width: 100%;
  padding: 0 var(--s-5);
  overflow: hidden;
  border: 1px solid var(--line-2);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  transform: skewX(var(--slant));
  transition: color 0.45s var(--ease-out), border-color 0.3s ease, box-shadow 0.4s ease;
}

/* Remplissage qui arrive de la gauche */
.btn::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.55s var(--ease-out);
}

.btn::after {
  content: "→";
  content: "→" / "";
  transition: transform 0.5s var(--ease-out);
}

.btn:hover,
.btn:focus-visible { color: var(--bg); border-color: var(--fg); }

.btn:hover::before,
.btn:focus-visible::before { transform: scaleX(1); }

.btn:hover::after,
.btn:focus-visible::after { transform: translateX(6px); }

.btn-primary,
.btn-light {
  background: var(--livery);
  border-color: var(--livery);
  color: var(--white);
  box-shadow: 0 0 0 0 transparent, 0 10px 30px -12px color-mix(in srgb, var(--livery) 80%, transparent);
}

.btn-primary::before,
.btn-light::before { background: var(--white); }

.btn-primary:hover,
.btn-primary:focus-visible,
.btn-light:hover,
.btn-light:focus-visible {
  color: var(--carbon);
  border-color: var(--white);
  box-shadow: 0 0 0 1px var(--white), 0 14px 40px -10px color-mix(in srgb, var(--livery) 90%, transparent);
}

.btn-ghost { background: color-mix(in srgb, var(--bg) 40%, transparent); }

.btn[target="_blank"]::after {
  content: "↗";
  content: "↗" / "";
}

/* ============================================================
   APPARITIONS
   - mots : les titres montent derrière un masque, mot à mot, en
     se redressant (inclinaison de vitesse qui s'annule)
   - rideau : les figures s'ouvrent, une ligne de balayage passe
   - filet : les têtes de chapitre se tracent de gauche à droite
   - cascade : les listes arrivent élément par élément
   Sans JS (ou mouvement réduit), tout est visible d'emblée.
   ============================================================ */
.js [data-in] { --d: 0s; }

.js [data-in="fade"] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s var(--ease-out) var(--d),
    transform 1.1s var(--ease-out) var(--d);
}

.js [data-in="fade"].is-in {
  opacity: 1;
  transform: none;
}

.w {
  display: inline-block;
  overflow: clip;
  vertical-align: top;
  padding-block: 0.1em;
  margin-block: -0.1em;
  padding-inline: 0.06em;
  margin-inline: -0.06em;
}

.w > span { display: inline-block; }

.js [data-in="words"] .w > span {
  transform: translate3d(-0.4em, 112%, 0) skewX(18deg);
  transition: transform 1.05s var(--ease-out) calc(var(--d) + var(--wi, 0) * 45ms);
}

.js [data-in="words"].is-in .w > span { transform: none; }

.js [data-in="clip"] {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.3s var(--ease-in-out) var(--d);
}

.js [data-in="clip"].is-in { clip-path: inset(0); }

.js [data-in="clip"] img,
.js [data-in="clip"] video {
  transform: scale(1.14);
  transition: transform 1.8s var(--ease-out) var(--d);
}

.js [data-in="clip"].is-in img,
.js [data-in="clip"].is-in video { transform: none; }

.js .runhead::before {
  transform: scaleX(0);
  transition: transform 1.2s var(--ease-in-out) var(--d, 0s);
}

.js .runhead.is-in::before { transform: scaleX(1); }

.js .runhead > *,
.js .runhead::after {
  opacity: 0;
  transition: opacity 0.6s ease calc(var(--d, 0s) + 0.35s);
}

.js .runhead.is-in > *,
.js .runhead.is-in::after { opacity: 1; }

.js .runhead.is-in::after { opacity: 0.9; }

.js [data-in="list"] > * {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s var(--ease-out) calc(var(--d) + var(--i, 0) * 70ms),
    transform 0.9s var(--ease-out) calc(var(--d) + var(--i, 0) * 70ms);
}

.js [data-in="list"].is-in > * {
  opacity: 1;
  transform: none;
}

.js [data-in="slide"] {
  opacity: 0;
  transform: translateX(60px);
  transition:
    opacity 0.8s var(--ease-out) var(--d),
    transform 1.1s var(--ease-out) var(--d);
}

.js [data-in="slide"].is-in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   BANDES DÉFILANTES : panneau LED entre deux vibreurs.
   La vitesse suit celle du lecteur (script.js).
   ============================================================ */
.marquee {
  position: relative;
  overflow: clip;
  padding-block: clamp(16px, 2.4vw, 30px);
  user-select: none;
}

.marquee::before,
.marquee::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(-60deg, var(--red) 0 12px, var(--white) 12px 24px);
  opacity: 0.92;
}

.marquee::before { top: 0; }
.marquee::after { bottom: 0; }

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.marquee-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.marquee-track span {
  padding-inline: 0.16em;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 1.6rem + 5vw, 7.5rem);
  font-weight: 850;
  font-style: italic;
  font-stretch: 120%;
  line-height: 0.95;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--fg);
}

/* Mots-clés : en creux, contour de livrée */
.marquee-track .hl {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
}

.marquee-track .sep {
  padding-inline: 0.3em;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 0.7rem + 1.4vw, 2.2rem);
  font-style: normal;
  font-weight: 400;
  color: var(--accent-small);
}

.marquee-track span:empty,
.marquee-track .sep + .sep { display: none; }

html:not(.js) .marquee-track { animation: marquee 40s linear infinite; }
html:not(.js) .marquee--reverse .marquee-track { animation-direction: reverse; }
html:not(.js) .marquee--fast .marquee-track { animation-duration: 26s; }

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ============================================================
   EN-TÊTES DE PAGE : un titre-affiche pleine largeur par page,
   lui aussi « résonant » (même système que le nom de l'accueil)
   ============================================================ */
.page-hero {
  container-type: inline-size;
  position: relative;
  padding-top: clamp(var(--s-6), 7vh, var(--s-9));
  padding-bottom: var(--section);
}

.page-hero .kicker {
  margin-bottom: var(--s-5);
  color: var(--fg);
}

.page-hero .kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  align-self: center;
  background: var(--accent);
  transform: skewX(var(--slant));
}

.page-title {
  --rw: 88;
  margin-left: -0.03em;
  font-size: calc((100cqi - 2 * var(--margin)) * var(--pt-k-m, 0.26));
  font-weight: 850;
  font-style: italic;
  font-stretch: normal;
  line-height: 0.84;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-title-line {
  display: block;
  white-space: nowrap;
  font-variation-settings: "wdth" var(--rw), "wght" 850;
}

/* Le deuxième mot en creux, contour de livrée */
.page-title-line:last-child {
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
}

/* Contour net (filtres #gb-ol-* injectés par script.js) : seul le pourtour
   extérieur de la lettre est tracé, sans les contours superposés du R. */
.svg-outline .page-title-line:last-child,
.svg-outline .marquee-track .hl {
  color: var(--accent);
  -webkit-text-stroke: 0;
  filter: url(#gb-ol-2);
}

/* Couleur pleine + opacité à part : le filtre retire la lettre de son
   pourtour, ce qui ne marche qu'avec une lettre opaque. */
.svg-outline .footer-mark .ch {
  color: var(--fg);
  opacity: 0.55;
  -webkit-text-stroke: 0;
  filter: url(#gb-ol-1);
  transition: color 0.4s ease, opacity 0.4s ease;
}

.svg-outline .footer-mark .ch[style*="--w: 1"] { color: var(--accent); opacity: 1; filter: none; }

@media (min-width: 640px) {
  .page-title { font-size: calc((100cqi - 2 * var(--margin)) * var(--pt-k, 0.16)); }
  .page-title-line { display: inline; }
}

.page-title--projets { --pt-k: 0.158; --pt-k-m: 0.244; }
.page-title--parcours { --pt-k: 0.133; --pt-k-m: 0.205; }
.page-title--contact { --pt-k: 0.178; --pt-k-m: 0.255; }

.page-hero-foot {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  margin-top: clamp(var(--s-6), 5vw, var(--s-8));
}

.page-lede {
  grid-column: 1 / -1;
  max-width: 42ch;
  font-size: var(--fs-lede);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

@media (min-width: 1024px) {
  .page-lede { grid-column: 6 / -1; }
}

/* Fil d'Ariane façon invite de commande */
.breadcrumb {
  margin-bottom: var(--s-5);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 44px;
  color: var(--muted);
  transition: color var(--dur-2) ease;
}

.breadcrumb a::before {
  content: "$";
  color: var(--green);
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible { color: var(--fg); }

/* ============================================================
   INTRO DE DÉMARRAGE (js/boot.js) : séquence système, puis les
   cinq feux rouges s'allument un à un et s'éteignent ensemble.
   ============================================================ */
html.booting body { opacity: 0; animation: boot-failsafe 0.3s ease 4.5s forwards; }

@keyframes boot-failsafe { to { opacity: 1; } }

.boot {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(28px, 5vh, 56px);
  padding: var(--margin);
  background:
    linear-gradient(rgba(120, 150, 255, 0.05) 1px, transparent 1px) 0 0 / 100% 64px,
    linear-gradient(90deg, rgba(120, 150, 255, 0.05) 1px, transparent 1px) 0 0 / 64px 100%,
    var(--carbon);
  color: var(--text);
  font-family: var(--font-mono);
  cursor: pointer;
}

.boot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

.boot-log {
  width: min(560px, 100%);
  min-height: 9.5em;
  font-size: clamp(0.6875rem, 0.62rem + 0.25vw, 0.8125rem);
  line-height: 1.75;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.boot-line { display: flex; gap: 0.6em; white-space: nowrap; overflow: hidden; }
.boot-line::before { content: ">"; color: var(--livery-2); }
.boot-line .ok { margin-left: auto; color: var(--green); }
.boot-line .warn { margin-left: auto; color: var(--yellow); }

.boot-lights {
  display: flex;
  gap: clamp(10px, 2vw, 22px);
  padding: clamp(10px, 1.6vw, 18px);
  background: #000;
  border: 1px solid var(--line-2);
}

.boot-light {
  position: relative;
  display: grid;
  gap: clamp(6px, 1vw, 10px);
  padding: clamp(6px, 1vw, 10px);
  background: #0d0f14;
  border-radius: 6px;
}

.boot-light span {
  width: clamp(26px, 5.4vw, 58px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #1b0507;
  box-shadow: inset 0 -4px 10px rgba(0, 0, 0, 0.7);
  transition: background-color 0.08s linear, box-shadow 0.08s linear;
}

.boot-light span:first-child { background: #0b0d12; }

.boot-light.is-on span:not(:first-child) {
  background: var(--red);
  box-shadow: 0 0 22px var(--red), 0 0 60px color-mix(in srgb, var(--red) 55%, transparent), inset 0 -4px 10px rgba(120, 0, 0, 0.5);
}

.boot-msg {
  min-height: 1.2em;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1rem + 5vw, 5.5rem);
  font-weight: 900;
  font-style: italic;
  font-stretch: 130%;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0;
}

.boot.is-out .boot-msg {
  opacity: 1;
  animation: boot-msg 0.6s var(--ease-out) both;
}

@keyframes boot-msg {
  from { opacity: 0; transform: translateX(-12%) skewX(-20deg); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

.boot-hint {
  position: absolute;
  left: 50%;
  bottom: var(--s-5);
  translate: -50% 0;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Sortie : le rideau file vers le haut en biais */
.boot.is-leaving {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  animation: boot-leave 0.75s var(--ease-in-out) forwards;
  pointer-events: none;
}

@keyframes boot-leave {
  to { clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); }
}

/* ============================================================
   TÉLÉMÉTRIE (js/hud.js) : panneau du pilote en bas à gauche
   ============================================================ */
.telemetry {
  position: fixed;
  left: var(--margin);
  bottom: var(--s-5);
  z-index: 880;
  display: none;
  width: 236px;
  padding: 12px 14px 12px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--carbon) 72%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.8s var(--ease-out);
  user-select: none;
}

@media (min-width: 1024px) and (min-height: 640px) {
  .telemetry { display: block; }
}

.telemetry.is-on { opacity: 1; transform: none; }
.telemetry.is-dim { opacity: 0.45; }
.telemetry.is-pinned::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  background: var(--livery-glow);
}
.telemetry.is-away { opacity: 0; transform: translateY(24px); pointer-events: none; }

.telemetry::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(var(--livery-2), var(--livery-2)) top left / 10px 1px no-repeat,
    linear-gradient(var(--livery-2), var(--livery-2)) top left / 1px 10px no-repeat,
    linear-gradient(var(--livery-2), var(--livery-2)) bottom right / 10px 1px no-repeat,
    linear-gradient(var(--livery-2), var(--livery-2)) bottom right / 1px 10px no-repeat;
}

.tm-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: var(--text);
}

.tm-head b { font-weight: 700; color: var(--livery-glow); }

.tm-head i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: hud-blink 1.4s steps(2, jump-none) infinite;
}

.tm-main {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 4px 12px;
}

.tm-speed {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 850;
  font-style: italic;
  font-stretch: 115%;
  line-height: 0.85;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.tm-speed small {
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.tm-gear {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  color: var(--carbon);
  background: var(--text);
  transform: skewX(var(--slant));
  transition: background-color 0.2s ease;
}

.tm-gear.is-shift { background: var(--livery-glow); }

.tm-rpm {
  grid-column: 1 / -1;
  height: 4px;
  margin-top: 6px;
  background: var(--carbon-3);
  overflow: hidden;
}

.tm-rpm span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green) 0 55%, var(--red) 55% 82%, #4f7dff 82%);
  transform-origin: 0 50%;
  transform: scaleX(var(--rpm, 0));
}

.tm-rows {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  margin-top: 10px;
}

.tm-rows dd {
  margin: 0;
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.tm-drs {
  padding: 0 5px;
  border: 1px solid var(--line-2);
  color: var(--faint);
}

.tm-drs.is-on {
  color: var(--carbon);
  background: var(--green);
  border-color: var(--green);
}

.tm-sectors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 10px;
}

.tm-sectors span {
  height: 4px;
  background: var(--carbon-3);
  transform: skewX(var(--slant));
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.tm-sectors span.is-yellow { background: var(--yellow); }
.tm-sectors span.is-green { background: var(--green); }
.tm-sectors span.is-purple { background: var(--purple); box-shadow: 0 0 8px var(--purple); }

/* Replié : rail vertical logé dans la marge gauche, il ne couvre plus le
   contenu pendant la lecture (rapport, vitesse à la verticale, compte-tours). */
.telemetry.is-min {
  left: max(4px, calc((var(--margin) - 30px) / 2));
  width: 30px;
  padding: 10px 0 12px;
}
.telemetry.is-min .tm-rows,
.telemetry.is-min .tm-sectors,
.telemetry.is-min .tm-head > span:last-child,
.telemetry.is-min .tm-speed small { display: none; }
.telemetry.is-min .tm-head { justify-content: center; margin-bottom: 10px; font-size: 0; }
.telemetry.is-min .tm-head i { margin: 0; }
.telemetry.is-min .tm-main { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.telemetry.is-min .tm-gear { order: -1; width: 20px; height: 20px; font-size: 0.95rem; }
.telemetry.is-min .tm-speed {
  min-height: 3.1em;
  font-size: 1.05rem;
  line-height: 1;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.telemetry.is-min .tm-rpm { width: 3px; height: 52px; margin: 0; }
.telemetry.is-min .tm-rpm span {
  background: linear-gradient(0deg, var(--green) 0 55%, var(--red) 55% 82%, #4f7dff 82%);
  transform-origin: 50% 100%;
  transform: scaleY(var(--rpm, 0));
}

/* Bascule rail / panneau : un balayage plutôt qu'une largeur animée
   (deux noms d'animation pour qu'elle rejoue dans les deux sens). */
.telemetry.is-on { animation: tm-wipe-a 0.32s var(--ease-out); }
.telemetry.is-on.is-min { animation-name: tm-wipe-b; }

@keyframes tm-wipe-a {
  from { clip-path: inset(-2px 100% -2px -2px); }
  to { clip-path: inset(-2px -2px -2px -2px); }
}

@keyframes tm-wipe-b {
  from { clip-path: inset(100% -2px -2px -2px); }
  to { clip-path: inset(-2px -2px -2px -2px); }
}

/* ============================================================
   RÉTICULE (js/hud.js) : point précis + anneau de visée qui suit
   avec inertie et se verrouille sur les éléments interactifs.
   Souris uniquement, jamais en mouvement réduit.
   ============================================================ */
.reticle {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reticle.is-on { opacity: 1; }

.reticle-dot,
.reticle-ring {
  position: absolute;
  top: 0;
  left: 0;
}

.reticle-dot {
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  background: var(--accent-small);
  mix-blend-mode: difference;
}

.reticle-ring {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid color-mix(in srgb, var(--accent-small) 70%, transparent);
  border-radius: 50%;
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), margin 0.35s var(--ease-out), border-radius 0.35s var(--ease-out), border-color 0.3s ease;
}

/* Graduations de visée */
.reticle-ring::before,
.reticle-ring::after {
  content: "";
  position: absolute;
  background: var(--accent-small);
}

.reticle-ring::before { top: 50%; left: -6px; right: -6px; height: 1px; background: linear-gradient(90deg, var(--accent-small) 0 5px, transparent 5px calc(100% - 5px), var(--accent-small) 0); }
.reticle-ring::after { left: 50%; top: -6px; bottom: -6px; width: 1px; background: linear-gradient(180deg, var(--accent-small) 0 5px, transparent 5px calc(100% - 5px), var(--accent-small) 0); }

.reticle-coords {
  position: absolute;
  top: 18px;
  left: 18px;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--muted);
}

/* Verrouillage sur un lien ou un bouton */
.reticle.is-lock .reticle-ring {
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 0;
  border-color: var(--accent-small);
}

.reticle.is-lock .reticle-coords { color: var(--accent-small); }
.reticle.is-down .reticle-ring { width: 22px; height: 22px; margin: -11px 0 0 -11px; }

html.has-reticle,
html.has-reticle a,
html.has-reticle button,
html.has-reticle [role="button"],
html.has-reticle label { cursor: none; }

html.has-reticle input,
html.has-reticle textarea,
html.has-reticle iframe { cursor: auto; }

/* Le curseur contextuel de la frise prend le relais */
html:has(.cursor.is-on) .reticle { opacity: 0; }

/* ============================================================
   CURSEUR CONTEXTUEL (script.js) : seulement sur la frise de
   projets ; il annonce la destination (→ interne, ↗ externe).
   ============================================================ */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  width: 0;
  height: 0;
  pointer-events: none;
}

.cursor-label {
  position: absolute;
  top: -42px;
  left: -42px;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--livery);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  box-shadow: 0 0 0 1px var(--livery-glow), 0 0 40px color-mix(in srgb, var(--livery) 70%, transparent);
  transform: scale(0);
  transition: transform 0.45s var(--ease-snap);
}

.cursor-label::before {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px dashed color-mix(in srgb, var(--livery-glow) 70%, transparent);
  border-radius: 50%;
  animation: cursor-spin 6s linear infinite;
}

@keyframes cursor-spin { to { transform: rotate(360deg); } }

.cursor.is-on .cursor-label { transform: scale(1); }

.has-cursor [data-cursor],
.has-cursor [data-cursor] a { cursor: none; }

/* ============================================================
   TRANSITIONS DE PAGE (API View Transitions entre documents)
   La nouvelle page arrive comme une voiture qui passe : un rideau
   en biais balaie l'écran de droite à gauche.
   ============================================================ */
@view-transition { navigation: auto; }

.header { view-transition-name: site-header; }

::view-transition-old(root) {
  animation: vt-leave 0.6s var(--ease-in-out) both;
}

::view-transition-new(root) {
  animation: vt-enter 0.85s var(--ease-in-out) both;
}

/* Filtrage des projets (même page) : seules les études de cas glissent. */
html.vt-filter::view-transition-old(root),
html.vt-filter::view-transition-new(root) {
  animation: none;
}

@keyframes vt-leave {
  to {
    opacity: 0.25;
    transform: translateX(-6vw) skewX(4deg);
    filter: blur(4px);
  }
}

@keyframes vt-enter {
  from { clip-path: polygon(115% 0, 135% 0, 115% 100%, 95% 100%); }
  to { clip-path: polygon(-40% 0, 135% 0, 115% 100%, -60% 100%); }
}

/* ============================================================
   MOUVEMENT RÉDUIT : tout reste lisible et utilisable
   ============================================================ */
@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;
  }

  @view-transition { navigation: none; }

  .js [data-in],
  .js [data-in] .w > span,
  .js [data-in] > *,
  .js .runhead > *,
  .js .runhead::after,
  .js .hero [data-intro],
  .js .hero .ch {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }

  .js [data-in="clip"] img,
  .js [data-in="clip"] video { transform: none !important; }
  .js .runhead::before { transform: none !important; }

  .js .terminal .ln {
    clip-path: none !important;
    opacity: 1 !important;
    animation: none !important;
  }

  .term-body .cursor,
  .hud-tag--live::before,
  .logo-icon::after { animation: none !important; }

  html.booting body { opacity: 1; animation: none; }
  .boot,
  .reticle,
  .telemetry { display: none !important; }
}

/* ============================================================
   IMPRESSION : une version papier propre
   ============================================================ */
@media print {
  .header,
  .scroll-progress,
  .back-to-top,
  .skip-link,
  .el,
  .marquee,
  .scroll-cue,
  .hero-index,
  .tl-aside,
  .footer-mark,
  .project-filters,
  .boot,
  .telemetry,
  .reticle,
  .cursor,
  .hero-3d,
  canvas { display: none !important; }

  body {
    --bg: #fff;
    --fg: #000;
    --muted: #333;
    --rule: #999;
    --accent: #000;
    background: #fff;
    color: #000;
  }

  html.booting body { opacity: 1; animation: none; }
  main { padding-top: 0; }
  .hero { min-height: auto; margin-top: 0; }
  .page-title-line:last-child,
  .marquee-track .hl,
  .svg-outline .page-title-line:last-child,
  .svg-outline .marquee-track .hl { color: #000; -webkit-text-stroke: 0; filter: none; }

  .js [data-in],
  .js [data-in] .w > span,
  .js [data-in] > *,
  .js .runhead > *,
  .js .hero [data-intro],
  .js .hero .ch,
  .js .terminal .ln {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }

  .works-pin { height: auto !important; }
  .works-sticky { position: static !important; height: auto !important; overflow: visible !important; }
  .works-row { transform: none !important; display: block !important; width: auto !important; }
  .works-track { flex-wrap: wrap; overflow: visible; }
  .sheet { transform: none !important; box-shadow: none; }
  .case-media,
  .bio-portrait,
  .contact-photo,
  .terminal { position: static !important; }
}
