/* ============================================================
   ACCUEIL (index.html) : DA « Télémétrie »
   Le mur des stands de l'écurie BRESSON, chapitre par chapitre :
   - hero : affiche du pilote #26, fiche HUD, virages T01 à T06,
     trace de télémétrie (vitesse, accélérateur, frein) ;
   - 01 profil : scan d'identification du pilote ;
   - 02 stack : fiche de réglages + terminal ;
   - 03 chiffres : timing tower P1 à P4 ;
   - 04 projets : frise épinglée, box des stands, mini-carte du circuit ;
   - 05 recherche : la feuille posée sur les atomes computationnels ;
   - 06 en poste : livrée pleine, statut piste « en piste » (drapeau vert).
   Socle (tokens, scènes, composants) : css/core.css.
   ============================================================ */

/* Compte-tours du portrait (interpolable) */
@property --rev { syntax: "<number>"; inherits: true; initial-value: 0; }

/* ============================================================
   HERO : l'affiche du pilote
   ============================================================ */
.hero {
  --mh-k: 0.318;       /* taille du nom (part de la largeur utile) */
  --mh-wdth: 62;       /* largeur de repos de l'axe wdth */
  container-type: inline-size;
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  margin-top: calc(-1 * var(--nav-h));
  padding-top: calc(var(--nav-h) + clamp(16px, 3vh, 36px));
  padding-bottom: clamp(20px, 3.2vh, 40px);
  overflow: clip;
}

/* Voile discret côté texte, seulement quand la scène 3D est là */
.hero:has(.hero-3d)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6, 7, 10, 0.66) 0%, rgba(6, 7, 10, 0.28) 32%, rgba(6, 7, 10, 0) 56%),
    linear-gradient(0deg, var(--carbon) 0%, rgba(6, 7, 10, 0.55) 16%, rgba(6, 7, 10, 0) 38%),
    linear-gradient(180deg, rgba(6, 7, 10, 0.7) 0%, rgba(6, 7, 10, 0) 20%);
}

.hero-frame {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: auto minmax(var(--s-6), 1fr) auto auto auto auto auto;
  column-gap: var(--gutter);
}

/* --- Mode veille (js/hero3d.js) ------------------------------
   La page s'ouvre en veille (classe posée dans le <head>) et y revient
   après quelques secondes sans geste : seule la scène 3D du hero reste.
   Le moindre geste fait tout revenir. L'intro de démarrage (.boot) et
   le repli sans 3D (html.no-3d) ne sont jamais masqués. */
.hero:has(.hero-3d)::after { transition: opacity 0.35s ease; }

html.is-idle:not(.no-3d) body > :not(main):not(.boot),
html.is-idle:not(.no-3d) main > :not(.hero),
html.is-idle:not(.no-3d) .hero > :not(.hero-3d) {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 1.4s ease !important;
}

html.is-waking body > :not(main):not(.boot),
html.is-waking main > :not(.hero),
html.is-waking .hero > :not(.hero-3d) {
  transition: opacity 0.35s ease !important;
}

html.is-idle:not(.no-3d) .hero:has(.hero-3d)::after {
  opacity: 0;
  transition: opacity 1.4s ease;
}

html.is-idle:not(.no-3d),
html.is-idle:not(.no-3d) *:not(.boot):not(.boot *) { cursor: none !important; }

/* --- Haut : rubrique + fiche pilote HUD --------------------- */
.hero-top {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4) var(--s-6);
}

.hero-kicker {
  margin: 0;
  padding-top: 2px;
  color: var(--fg);
}

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

.hero-hud {
  position: relative;
  width: min(100%, 330px);
  padding: 10px 14px 12px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--carbon) 66%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
}

/* Crochets d'angle de la fiche */
.hero-hud::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)) top right / 10px 1px no-repeat,
    linear-gradient(var(--livery-2), var(--livery-2)) top right / 1px 10px no-repeat,
    linear-gradient(var(--livery-2), var(--livery-2)) bottom left / 10px 1px no-repeat,
    linear-gradient(var(--livery-2), var(--livery-2)) bottom 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;
}

.hero-hud-head {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: 8px;
  padding-bottom: 7px;
  font-size: 0.625rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

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

.hero-meta {
  list-style: none;
  display: grid;
  gap: 5px;
  color: var(--fg);
}

.hero-meta li {
  display: grid;
  grid-template-columns: 6.2em minmax(0, 1fr);
  gap: 0.8em;
  align-items: baseline;
}

.hm-k { color: var(--muted); }

.hm-v { min-width: 0; }

.hm-gps {
  display: block;
  margin-top: 1px;
  font-size: 0.9em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Statut en direct : voyant vert (moins de 1 clignotement par seconde) */
.hero-meta .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.35em;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  vertical-align: 0.05em;
  animation: hm-live 1.8s steps(2, jump-none) infinite;
}

@keyframes hm-live { 50% { opacity: 0.35; box-shadow: none; } }

/* --- Sommaire : les virages du circuit ------------------------ */
.hero-index { display: none; }

/* --- Le nom --------------------------------------------------- */
.masthead {
  grid-column: 1 / -1;
  grid-row: 3 / span 2;
  display: grid;
  grid-template-columns: subgrid;
  grid-template-rows: subgrid;
  font-size: calc((100cqi - 2 * var(--margin)) * var(--mh-k));
  font-weight: 850;
  font-style: italic;
  font-stretch: normal;
  line-height: 0.8;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--fg);
}

.masthead-line {
  grid-column: 1 / -1;
  display: block;
  white-space: nowrap;
  font-variation-settings: "wdth" var(--mh-wdth), "wght" 850;
  overflow-x: visible;
  overflow-y: clip;
  overflow-clip-margin: 0.04em;
}

.masthead-line:first-child { grid-row: 1; }

.masthead-line:last-child {
  grid-row: 2;
  justify-self: end;
  color: var(--livery-2);
}

/* --- Trace de télémétrie (js/home.js) ------------------------- */
.hero-trace {
  grid-column: 1 / -1;
  grid-row: 5;
  position: relative;
  height: clamp(78px, 12vh, 118px);
  margin-top: clamp(var(--s-4), 2.4vh, var(--s-5));
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

html:not(.js) .hero-trace,
.hero-trace:empty { display: none; }

.tr-head {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: 14px;
  white-space: nowrap;
}

.tr-title { color: var(--fg); }
.tr-title::before { content: "▸ "; color: var(--accent-small); }

.tr-legend { display: flex; gap: 12px; margin-left: auto; }

@media (max-width: 639.98px) {
  .tr-title { display: none; }
  .tr-legend { margin-left: 0; }
}

.tr-legend i {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-style: normal;
}

.tr-legend i::before {
  content: "";
  width: 12px;
  height: 2px;
  background: var(--c);
}

.tr-l--spd { --c: var(--white); }
.tr-l--thr { --c: var(--green); }
.tr-l--brk { --c: var(--red); }

.tr-plot {
  position: absolute;
  inset: 20px 0 13px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tr-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tr-svg path,
.tr-svg line { vector-effect: non-scaling-stroke; fill: none; }

.tr-band { stroke: rgba(150, 175, 255, 0.1); stroke-width: 1; stroke-dasharray: 2 4; }
.tr-spd { stroke: var(--white); stroke-width: 1.5; }
.tr-thr { stroke: var(--green); stroke-width: 1.25; }
.tr-brk { stroke: var(--red); stroke-width: 1.25; }
.tr-brk-fill { fill: color-mix(in srgb, var(--red) 28%, transparent); stroke: none; }
.tr-ghost { opacity: 0.22; }
.tr-cur { stroke: var(--accent-small); stroke-width: 1; }
.tr-apex { stroke: rgba(150, 175, 255, 0.22); stroke-width: 1; stroke-dasharray: 1 3; }

.tr-turns {
  position: absolute;
  inset: auto 0 -13px;
  height: 12px;
}

.tr-turns span {
  position: absolute;
  top: 1px;
  translate: -50% 0;
  color: var(--muted);
  transition: color 0.3s ease;
}

.tr-turns span.is-on { color: var(--fg); }

.tr-read {
  position: absolute;
  top: -1px;
  left: 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: 1px 8px;
  padding: 4px 7px 4px 8px;
  color: var(--fg);
  white-space: nowrap;
  background: color-mix(in srgb, var(--carbon) 82%, transparent);
  border-left: 1px solid var(--accent-small);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  will-change: transform;
}

.tr-read b {
  grid-row: span 3;
  align-self: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 850;
  font-style: italic;
  font-stretch: 110%;
  line-height: 0.9;
  letter-spacing: -0.01em;
}

.tr-read b small {
  margin-left: 3px;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.tr-read .tr-g { color: var(--livery-glow); }
.tr-read .tr-t { color: var(--green); }
.tr-read .tr-b { color: var(--muted); }
.tr-read .tr-b.is-on { color: var(--red); }

/* --- Accroche, actions ---------------------------------------- */
.hero-sub {
  grid-column: 1 / -1;
  grid-row: 6;
  max-width: 34ch;
  margin-top: var(--s-5);
  font-size: var(--fs-lede);
  font-weight: 300;
  line-height: 1.22;
  letter-spacing: -0.005em;
  color: var(--fg);
}

.hero-em {
  font-style: italic;
  font-weight: 400;
  color: var(--livery-glow);
}

.hero-actions {
  grid-column: 1 / -1;
  grid-row: 7;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4) var(--s-5);
  margin-top: var(--s-5);
}

.hero-cta {
  display: grid;
  gap: var(--s-2);
  width: 100%;
  padding-left: 6px;
}

@media (min-width: 640px) {
  .hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    width: auto;
  }
}

.hero-social {
  display: flex;
  gap: 6px;
}

.hero-social a {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--fg);
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--carbon) 50%, transparent);
  transition: background-color var(--dur-2) ease, color var(--dur-2) ease, border-color var(--dur-2) ease;
}

.hero-social a:hover,
.hero-social a:focus-visible {
  background: var(--livery);
  border-color: var(--livery);
  color: var(--white);
}

.hero-social svg { width: 18px; height: 18px; }

/* Indicateur de défilement : la voie des stands, un signal la parcourt */
.scroll-cue {
  display: none;
  position: relative;
  width: 44px;
  height: 72px;
}

.scroll-cue::before,
.scroll-cue::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  background: var(--line-2);
}

.scroll-cue::before { top: 0; bottom: 0; }

.scroll-cue::after {
  top: 0;
  width: 3px;
  margin-left: -1px;
  height: 18px;
  background: var(--accent-small);
  box-shadow: 0 0 10px var(--accent-small);
  animation: cue 2.4s var(--ease-in-out) infinite;
}

@keyframes cue {
  0%   { transform: translateY(-18px); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(72px); opacity: 0; }
}

/* Tablette */
@media (min-width: 640px) {
  .hero { --mh-k: 0.285; --mh-wdth: 70; }
  .hero-sub { grid-column: 1 / span 6; }
}

/* Bureau : composition d'affiche, l'accroche se glisse sous « GUYLANN »,
   la trace et les actions s'alignent sur « BRESSON ». Le coin bas gauche
   reste libre pour le panneau de télémétrie (js/hud.js). */
@media (min-width: 1024px) {
  .hero { --mh-k: 0.153; --mh-wdth: 86; }

  .hero-frame { grid-template-rows: auto auto minmax(var(--s-5), 1fr) auto auto auto auto; }

  .hero-index {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: start;
    display: grid;
    grid-template-columns: subgrid;
    margin-top: clamp(var(--s-5), 4.5vh, var(--s-8));
    list-style: none;
  }

  .hero-index li {
    position: relative;
    grid-column: span 2;
  }

  /* Repère de piste au départ de chaque virage */
  .hero-index li::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 0;
    width: 1px;
    height: 9px;
    background: var(--line-2);
    transition: background-color var(--dur-2) ease;
  }

  .hero-index a {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 10px;
    min-height: 44px;
    padding: 11px var(--s-3) 6px 0;
    font-family: var(--font-mono);
    font-size: var(--fs-label);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    border-top: 1px solid var(--rule);
    transition: color var(--dur-2) ease;
  }

  .hi-num {
    color: var(--fg);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: color var(--dur-2) ease;
  }

  .hi-num::before {
    content: "T";
    content: "T" / "";
    color: var(--accent-small);
  }

  .hi-label {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
  }

  .hi-turn {
    grid-column: 2;
    grid-row: 1;
    width: 34px;
    height: 20px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.6;
    transition: opacity var(--dur-2) ease, color var(--dur-2) ease;
  }

  .hi-turn path { stroke-dasharray: 1; stroke-dashoffset: 0; }

  /* Barres de secteur : elles recouvrent le filet au survol */
  .hi-sectors {
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    height: 3px;
    pointer-events: none;
  }

  .hi-sectors i {
    background: var(--purple);
    transform: scaleX(0) skewX(var(--slant));
    transform-origin: 0 50%;
    transition: transform 0.35s var(--ease-out);
  }

  .hi-sectors i:nth-child(2) { background: var(--green); transition-delay: 0.08s; }
  .hi-sectors i:nth-child(3) { background: var(--yellow); transition-delay: 0.16s; }

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

  .hero-index a:hover .hi-num,
  .hero-index a:focus-visible .hi-num { color: var(--accent-small); }

  .hero-index a:hover .hi-turn,
  .hero-index a:focus-visible .hi-turn { opacity: 1; color: var(--accent-small); }

  .hero-index a:hover .hi-turn path,
  .hero-index a:focus-visible .hi-turn path { animation: hi-draw 0.7s var(--ease-out) both; }

  .hero-index a:hover .hi-sectors i,
  .hero-index a:focus-visible .hi-sectors i { transform: scaleX(1) skewX(var(--slant)); }

  .hero-index li:hover::before,
  .hero-index li:focus-within::before { background: var(--accent-small); }

  .masthead { grid-row: 4 / span 2; }
  .masthead-line:first-child { grid-column: 1 / span 11; }
  .masthead-line:last-child { grid-column: 4 / -1; }

  .hero-sub {
    grid-column: 1 / span 3;
    grid-row: 5;
    align-self: start;
    max-width: none;
    margin: 0.55em 0 0;
    padding-right: var(--s-3);
    font-size: clamp(1.1rem, 0.5rem + 0.9vw, 1.6rem);
  }

  .hero-trace {
    grid-column: 4 / -1;
    grid-row: 6;
  }

  .hero-actions {
    grid-column: 4 / span 8;
    grid-row: 7;
    margin-top: clamp(var(--s-4), 3vh, var(--s-6));
  }

  .scroll-cue {
    display: block;
    grid-column: 12;
    grid-row: 7;
    justify-self: end;
    align-self: end;
  }
}

@keyframes hi-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* Sans sous-grille : les lignes s'empilent simplement */
@supports not (grid-template-columns: subgrid) {
  .masthead { display: block; }
  .masthead-line:last-child { text-align: right; }
}

/* --- Entrée du hero (après les feux de départ) ---------------- */
.js .hero [data-intro] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.9s var(--ease-out) var(--d, 0s),
    transform 1.1s var(--ease-out) var(--d, 0s);
}

.js .hero .hero-top { --d: 0.55s; }
.js .hero .hero-index { --d: 0.7s; }
.js .hero .hero-trace { --d: 0.8s; }
.js .hero .hero-sub { --d: 0.9s; }
.js .hero .hero-actions { --d: 1.05s; }
.js .hero .scroll-cue { --d: 1.3s; }

.js .hero.is-ready [data-intro] {
  opacity: 1;
  transform: none;
}

.js .hero .ch {
  transform: translateY(104%);
  transition: transform 1.2s var(--ease-out) calc(0.1s + var(--ci, 0) * 0.045s);
}

.js .hero.is-ready .ch { transform: none; }

/* Sortie du hero : le haut, la trace et l'accroche remontent plus vite */
.hero-top,
.hero-index { translate: 0 calc(var(--hp, 0) * -9vh); }

.hero-sub,
.hero-trace,
.hero-actions { translate: 0 calc(var(--hp, 0) * -5vh); }

/* Les décors qui entrent depuis l'extérieur (crochets, tampon, frise)
   ne doivent jamais élargir la page. */
.profile,
.tools,
.figures,
.works,
.research,
.cta { overflow-x: clip; }

/* ============================================================
   CHAPITRE 01, PROFIL (cockpit)
   Le portrait détouré passe au scan d'identification : crochets
   qui se resserrent, un balayage, étiquettes déchiffrées, boîte
   de détection. Derrière lui, le compte-tours en livrée.
   ============================================================ */
.profile { padding-block: var(--section); }

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

.profile-portrait {
  position: relative;
  grid-column: 1 / -1;
  width: 100%;
  max-width: 440px;
  margin: 0;
}

/* Compte-tours : disque de livrée, graduations, arc de régime qui
   monte avec le défilement (--p posé par [data-scroll]), zone rouge. */
.profile-disc {
  --rev: clamp(0.08, (var(--p, 0.62) - 0.1) * 1.55, 0.9);
  position: absolute;
  top: 3%;
  left: 50%;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, transparent 0 80.5%, rgba(150, 175, 255, 0.16) 81% 81.4%, transparent 82%),
    radial-gradient(closest-side, var(--livery) 0 66%, color-mix(in srgb, var(--livery) 55%, var(--carbon)) 76%, transparent 76.5%);
  transform:
    translate3d(-50%, calc((0.5 - var(--p, 0.5)) * 20%), 0)
    scale(calc(0.84 + var(--p, 0.5) * 0.26));
  will-change: transform;
}

/* Graduations sur 270 degrés */
.profile-disc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from 225deg, rgba(190, 205, 255, 0.55) 0 0.7deg, transparent 0.7deg 6.75deg);
  -webkit-mask:
    radial-gradient(closest-side, transparent 85%, #000 85.5% 92%, transparent 92.5%),
    conic-gradient(from 225deg, #000 0 271deg, transparent 271deg);
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(closest-side, transparent 85%, #000 85.5% 92%, transparent 92.5%) intersect,
    conic-gradient(from 225deg, #000 0 271deg, transparent 271deg);
}

/* Arc de régime + zone rouge */
.disc-arc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    conic-gradient(from 225deg, transparent 0 238deg, var(--red) 238deg 270deg, transparent 270deg),
    conic-gradient(from 225deg, var(--livery-glow) 0 calc(var(--rev) * 270deg), transparent 0);
  -webkit-mask: radial-gradient(closest-side, transparent 94%, #000 94.5% 99%, transparent 99.5%);
  mask: radial-gradient(closest-side, transparent 94%, #000 94.5% 99%, transparent 99.5%);
  opacity: 0.95;
}

.profile-photo {
  position: relative;
  translate: 0 calc((0.5 - var(--p, 0.5)) * -6%);
}

.profile-photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0 72px, var(--line-2) 72px);
}

.profile-photo img {
  width: 100%;
  height: auto;
  transform-origin: 50% 100%;
}

/* --- Le scan (calque décoratif, mêmes dimensions que la photo) --- */
.profile-scan {
  position: absolute;
  inset: 0 0 auto;
  aspect-ratio: 2 / 3;
  pointer-events: none;
  translate: 0 calc((0.5 - var(--p, 0.5)) * -6%);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scan-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 0 solid var(--accent-small);
}

.scan-corner--tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.scan-corner--tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.scan-corner--bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.scan-corner--br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }

/* Un seul passage de balayage */
.scan-sweep {
  position: absolute;
  inset: 0 0 auto;
  height: 16%;
  opacity: 0;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--cyan) 10%, transparent) 75%, color-mix(in srgb, var(--cyan) 80%, transparent) 99%, transparent);
  border-bottom: 1px solid var(--cyan);
}

/* Boîte de détection sur le visage */
.scan-box {
  --hud-c: var(--green);
  position: absolute;
  left: 35%;
  top: 30.5%;
  width: 30%;
  height: 23.5%;
  border: 1px solid color-mix(in srgb, var(--green) 38%, transparent);
  background:
    linear-gradient(var(--hud-c), var(--hud-c)) top left / 10px 2px no-repeat,
    linear-gradient(var(--hud-c), var(--hud-c)) top left / 2px 10px no-repeat,
    linear-gradient(var(--hud-c), var(--hud-c)) top right / 10px 2px no-repeat,
    linear-gradient(var(--hud-c), var(--hud-c)) top right / 2px 10px no-repeat,
    linear-gradient(var(--hud-c), var(--hud-c)) bottom left / 10px 2px no-repeat,
    linear-gradient(var(--hud-c), var(--hud-c)) bottom left / 2px 10px no-repeat,
    linear-gradient(var(--hud-c), var(--hud-c)) bottom right / 10px 2px no-repeat,
    linear-gradient(var(--hud-c), var(--hud-c)) bottom right / 2px 10px no-repeat;
}

.scan-box-tag,
.scan-box-id {
  position: absolute;
  bottom: calc(100% + 4px);
  padding: 2px 5px 1px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.scan-box-tag { left: -1px; color: var(--carbon); background: var(--green); }

.scan-box-id {
  left: auto;
  right: -1px;
  color: var(--green);
  background: color-mix(in srgb, var(--carbon) 80%, transparent);
}

/* Fiche lue par le scan */
.scan-read {
  position: absolute;
  top: 5%;
  left: 5%;
  list-style: none;
  display: grid;
  gap: 2px;
  padding: 7px 10px 7px 9px;
  color: var(--white);
  background: color-mix(in srgb, var(--carbon) 72%, transparent);
  border-left: 2px solid var(--accent-small);
}

.scan-read li {
  display: grid;
  grid-template-columns: 5.6em auto;
  gap: 0.6em;
  white-space: nowrap;
}

.scan-k { color: #aab2c5; }
.scan-ok { color: var(--green); }

/* Séquence (avec JS) : crochets larges puis serrés, balayage,
   fiche, puis verrouillage sur le visage. Sans JS : état final. */
.js .scan-corner {
  opacity: 0;
  transition: opacity 0.4s ease 0.5s, translate 1.1s var(--ease-out) 0.5s;
}

.js .scan-corner--tl { translate: -26px -26px; }
.js .scan-corner--tr { translate: 26px -26px; }
.js .scan-corner--bl { translate: -26px 26px; }
.js .scan-corner--br { translate: 26px 26px; }

.js .scan-read li {
  opacity: 0;
  transition: opacity 0.35s ease calc(0.75s + var(--si, 0) * 0.14s);
}

.scan-read li:nth-child(2) { --si: 1; }
.scan-read li:nth-child(3) { --si: 2; }
.scan-read li:nth-child(4) { --si: 3; }

.js .scan-box {
  opacity: 0;
  transform: scale(1.35);
  transition: opacity 0.25s ease 2.15s, transform 0.55s var(--ease-snap) 2.15s;
}

.js .profile-photo.is-in ~ .profile-scan .scan-corner { opacity: 1; translate: 0 0; }
.js .profile-photo.is-in ~ .profile-scan .scan-read li { opacity: 1; }
.js .profile-photo.is-in ~ .profile-scan .scan-box { opacity: 1; transform: none; }
.js .profile-photo.is-in ~ .profile-scan .scan-sweep { animation: scan-sweep 1.3s var(--ease-in-out) 0.9s both; }

@keyframes scan-sweep {
  0%   { opacity: 0; transform: translateY(-100%); }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(625%); }
}

.profile-caption {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding-top: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-caption span:first-child { color: var(--fg); }

.profile-text {
  grid-column: 1 / -1;
  padding-bottom: var(--s-5);
}

.profile-title {
  margin-bottom: var(--s-6);
  font-size: clamp(3.4rem, 1.4rem + 6vw, 8rem);
  font-weight: 850;
  font-stretch: 104%;
  white-space: nowrap;
  line-height: 0.84;
  text-transform: uppercase;
}

.profile-role {
  max-width: 22ch;
  margin-bottom: var(--s-5);
  font-size: var(--fs-lede);
  font-style: italic;
  line-height: 1.18;
  color: var(--accent-small);
}

.profile-desc {
  max-width: 46ch;
  font-size: clamp(1.0625rem, 0.98rem + 0.36vw, 1.3rem);
  font-weight: 300;
  line-height: 1.6;
}

.profile-skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  max-width: 560px;
  margin-top: var(--s-7);
}

.profile-skills .chip {
  min-height: 38px;
  padding: 6px 14px;
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
}

.profile-skills .chip::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: skewX(var(--slant));
}

@media (min-width: 640px) {
  .profile-portrait { grid-column: 1 / span 4; }
  .profile-text { grid-column: 5 / -1; }
}

@media (min-width: 1024px) {
  .profile-portrait {
    grid-column: 1 / span 5;
    max-width: 560px;
  }

  .profile-text { grid-column: 7 / -1; }
  .scan-read { font-size: 0.6875rem; }
}

/* ============================================================
   CHAPITRE 02, STACK (cockpit)
   La fiche de réglages de la voiture, ligne par ligne ; à côté,
   le terminal tape « cat stack.json » et répond au survol.
   ============================================================ */
.tools { padding-block: var(--section); }

.tools-head {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--s-5);
  margin-bottom: clamp(var(--s-7), 6vw, var(--s-9));
}

.tools-title {
  grid-column: 1 / -1;
  font-size: clamp(2.7rem, 0.9rem + 5.4vw, 7.4rem);
  font-weight: 850;
  font-stretch: 100%;
  line-height: 0.86;
  text-transform: uppercase;
}

.tools-intro {
  grid-column: 1 / -1;
  max-width: 38ch;
  line-height: 1.5;
  color: var(--muted);
}

.tools-body {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--s-8);
  align-items: start;
}

.tools-list {
  grid-column: 1 / -1;
  min-width: 0;
  border-bottom: 1px solid var(--rule);
}

.tools-legend { display: none; }

.tool {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: var(--s-4);
  row-gap: var(--s-3);
  align-items: baseline;
  padding: var(--s-5) var(--s-3) var(--s-5) var(--s-3);
  border-top: 1px solid var(--rule);
}

.tool > :not(canvas) { position: relative; z-index: 1; }

/* Survol : panneau éclairé en livrée, barre de réglage à gauche */
.tool::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--livery) 18%, transparent), color-mix(in srgb, var(--livery) 4%, transparent) 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tool::after {
  content: "";
  position: absolute;
  top: -1px;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform 0.45s var(--ease-out);
}

.tool-num {
  justify-self: start;
  align-self: start;
  margin-top: 0.35em;
  padding: 2px 7px 1px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--fg);
  border: 1px solid var(--line-2);
  transform: skewX(var(--slant));
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.tool-title {
  font-size: clamp(1.7rem, 1rem + 1.6vw, 2.6rem);
  font-weight: 850;
  font-stretch: 92%;
  line-height: 0.9;
  text-transform: uppercase;
  color: inherit;
}

.tool-body { grid-column: 2 / -1; }

.tool-desc {
  margin-bottom: var(--s-3);
  line-height: 1.4;
}

.tool-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-chips li {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--fg) 3%, transparent);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.tool-key,
.tool-icon { display: none; }

/* Réseau de neurones de la ligne IA (js/atoms.js) : à droite, en fond */
.tool .neural-canvas {
  opacity: 0.6;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 78%);
  mask-image: linear-gradient(90deg, transparent 30%, #000 78%);
  transition: opacity 0.4s ease;
}

@media (hover: hover) {
  .tool:hover::before { opacity: 1; }
  .tool:hover::after { transform: scaleY(1); }
  .tool:hover .tool-num { background: var(--livery); border-color: var(--livery); color: var(--white); }
  .tool:hover .tool-chips li { color: var(--fg); border-color: var(--line-2); }
  .tool:hover .neural-canvas { opacity: 1; }
}

@media (min-width: 640px) {
  .tool { grid-template-columns: 3rem minmax(0, 0.9fr) minmax(0, 1.2fr); }
  .tool-body { grid-column: auto; }
  .tools-intro { grid-column: 4 / -1; }
}

@media (min-width: 1024px) {
  .tools-title { grid-column: 1 / span 9; }

  .tools-intro {
    grid-column: 10 / -1;
    align-self: end;
  }

  .tool,
  .tools-legend {
    grid-template-columns: 3rem minmax(0, 1.05fr) minmax(0, 1.25fr) 4.6rem 26px;
  }

  .tool { padding-block: var(--s-6); }

  .tools-legend {
    display: grid;
    column-gap: var(--s-4);
    padding: 0 var(--s-3) var(--s-3);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .tools-legend span:last-child { grid-column: 4 / -1; }

  .tool-key {
    display: block;
    align-self: center;
    font-family: var(--font-mono);
    font-size: var(--fs-label);
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: var(--muted);
    transition: color 0.3s ease;
  }

  .tool-icon {
    display: block;
    width: 24px;
    height: 24px;
    align-self: center;
    color: var(--muted);
    transition: transform 0.6s var(--ease-out), color 0.45s var(--ease-out);
  }

  .tool-icon svg { width: 100%; height: 100%; }

  .tool:hover .tool-key { color: var(--cyan); }

  .tool:hover .tool-icon {
    color: var(--accent-small);
    transform: rotate(-10deg) scale(1.15);
  }
}

/* --- Le terminal : un écran du mur des stands --------------- */
.terminal {
  position: relative;
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  color: #c3cadb;
  font-family: var(--font-mono);
  background: linear-gradient(180deg, #0a0d14, #06070a 60%);
  border: 1px solid var(--line-2);
  box-shadow:
    0 40px 90px -50px color-mix(in srgb, var(--livery) 75%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

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

.term-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(150, 175, 255, 0.035);
}

.term-bar .dots { display: flex; gap: 6px; }

.term-bar .dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0.85;
}

.term-bar .dots span:nth-child(2) { background: var(--yellow); }
.term-bar .dots span:nth-child(3) { background: var(--green); }

.term-title {
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  color: var(--muted);
}

.term-bar::after {
  content: "tty/26 · ssh";
  content: "tty/26 · ssh" / "";
  margin-left: auto;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Pas de hauteur fixe : js/terminal.js ajoute sortie et saisie dessous */
.term-body {
  margin: 0;
  padding: 20px 18px 22px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  font-size: clamp(0.72rem, 0.66rem + 0.22vw, 0.8125rem);
  line-height: 1.8;
}

.term-body::-webkit-scrollbar { display: none; }

/* En flex, les retours à la ligne du <pre> entre les lignes ne sont pas
   rendus : plus de lignes vides parasites. */
.term-body code {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font: inherit;
}

.term-body .ln {
  display: block;
  width: max-content;
  max-width: none;
  white-space: pre;
  transition: background-color 0.35s ease, color 0.35s ease, opacity 0.35s ease;
}

.term-body .prompt { color: var(--green); }
.term-body .cmd { color: var(--white); font-weight: 600; }
.term-body .key { color: var(--livery-glow); }
.term-body .str { color: #9fdcff; }
.term-body .com { color: #7d869a; }

/* Le curseur du terminal (core.css donne à .cursor le rôle de curseur
   contextuel fixe : on le remet dans le flux du texte). */
.term-body .cursor {
  position: relative;
  top: auto;
  left: auto;
  z-index: auto;
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--livery-glow);
  pointer-events: none;
  animation: term-caret 1.1s steps(1) infinite;
}

@keyframes term-caret { 50% { opacity: 0; } }

@media (min-width: 1280px) {
  .tools-list { grid-column: 1 / span 7; }

  .terminal {
    grid-column: 8 / -1;
    position: sticky;
    top: calc(var(--nav-h) + var(--s-6));
  }
}

/* Survol d'une ligne de la fiche : la clé correspondante s'allume */
.terminal[data-hl] .ln { opacity: 0.36; }

.terminal[data-hl] .ln.is-hl {
  opacity: 1;
  background: var(--livery);
  color: var(--white);
}

.terminal[data-hl] .ln.is-hl .str,
.terminal[data-hl] .ln.is-hl .key,
.terminal[data-hl] .ln.is-hl .prompt,
.terminal[data-hl] .ln.is-hl .com { color: var(--white); }

/* Frappe : les commandes se tapent, les réponses s'impriment */
.js .terminal .ln { clip-path: inset(0 100% 0 0); }

.js .terminal.is-typed .ln {
  animation: term-type var(--dur, 0.05s) steps(var(--n, 1), end) var(--t, 0s) forwards;
}

@keyframes term-type { to { clip-path: inset(0 0 0 0); } }

/* Petits écrans : les lignes longues passent à la ligne (retrait
   suspendu) et s'impriment au lieu d'être tapées. */
@media (max-width: 639.98px) {
  .term-body .ln {
    width: auto;
    max-width: 100%;
    padding-left: 2ch;
    text-indent: -2ch;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .js .terminal .ln {
    clip-path: none;
    opacity: 0;
  }

  .js .terminal.is-typed .ln { animation: term-print 0.01s linear var(--t, 0s) forwards; }
  .term-bar::after { display: none; }
}

@keyframes term-print { to { opacity: 1; } }

/* Lien d'attention entre la ligne survolée et sa clé (js/home.js) */
.tools-link {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.tools-link path {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tools-link circle { fill: var(--cyan); opacity: 0; transition: opacity 0.25s ease; }

.tools-link.is-on path {
  opacity: 0.9;
  animation: link-draw 0.5s var(--ease-out) forwards;
}

.tools-link.is-on circle { opacity: 1; }

@keyframes link-draw { to { stroke-dashoffset: 0; } }

/* ============================================================
   CHAPITRE 03, EN CHIFFRES (cockpit) : la timing tower
   Les quatre lignes entrent l'une après l'autre ; chaque chiffre
   se « gonfle » sur l'axe wdth pendant son comptage, et le filet
   de livrée sous la ligne se remplit au même rythme.
   ============================================================ */
.figures { padding-block: var(--section); }

.figures-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--s-7);
  align-items: start;
}

.figures-title {
  grid-column: 1 / -1;
  font-size: clamp(2.5rem, 1.3rem + 3.4vw, 4.9rem);
  font-weight: 850;
  font-stretch: 100%;
  line-height: 0.9;
  text-transform: uppercase;
}

.figures-tower {
  --tw-pos: 3.2rem;
  --tw-num: minmax(7.2rem, auto);
  grid-column: 1 / -1;
  min-width: 0;
  counter-reset: pos;
  border-top: 2px solid var(--fg);
}

.tower-head,
.figure {
  display: grid;
  grid-template-columns: var(--tw-pos) var(--tw-num) minmax(0, 1fr);
  column-gap: var(--s-4);
  align-items: center;
}

.tower-head {
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}

.figure {
  position: relative;
  min-width: 0;
  padding: clamp(14px, 2vw, 26px) 0;
  counter-increment: pos;
  border-bottom: 1px solid var(--rule);
}

/* Plaque de position, façon tour de chronométrage */
.figure::before {
  content: "P" counter(pos);
  content: "P" counter(pos) / "";
  justify-self: start;
  min-width: 2.6em;
  padding: 4px 7px 3px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--carbon);
  background: var(--fg);
  transform: skewX(var(--slant));
}

/* Le meneur porte le violet du meilleur tour */
.figure--a::before { background: var(--purple); color: var(--white); }

.figure-num {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 1.7rem + 5.6vw, 8.2rem);
  font-weight: 850;
  font-style: italic;
  font-variation-settings: "wdth" var(--fw, 74), "wght" var(--fwg, 850);
  line-height: 0.8;
  letter-spacing: -0.01em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Filet de livrée : il se remplit pendant le comptage (--fw : 50 à 74) */
.figure-num::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--livery-glow));
  transform: scaleX(clamp(0, (var(--fw, 74) - 50) / 24, 1));
  transform-origin: 0 50%;
}

.figure-label {
  max-width: 26ch;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--fg);
}

/* Entrée : chaque ligne arrive depuis la gauche, en décalé */
.js .figures-tower [data-in="fade"] { transform: translateX(-36px); }
.js .figures-tower [data-in="fade"].is-in { transform: none; }
.figure--b { --d: 0.09s; }
.figure--c { --d: 0.18s; }
.figure--d { --d: 0.27s; }

@media (min-width: 640px) {
  .figures-tower { --tw-pos: 4rem; --tw-num: minmax(11rem, 0.6fr); }
  .figure-label { font-size: 0.8125rem; }
}

@media (min-width: 1024px) {
  .figures-grid { row-gap: var(--s-8); }

  .figures-title {
    grid-column: 1 / span 4;
    font-size: clamp(2.3rem, 0.6rem + 3.2vw, 4.6rem);
    position: sticky;
    top: calc(var(--nav-h) + var(--s-6));
  }

  .figures-tower {
    grid-column: 5 / -1;
    --tw-pos: 4.5rem;
    --tw-num: minmax(15rem, 0.62fr);
  }
}

/* ============================================================
   CHAPITRE 04, PROJETS (carbone)
   Bureau : la section s'épingle et le défilement vertical fait
   glisser la frise des box ; mobile : défilement natif aimanté.
   La mini-carte du circuit suit la progression (--wp).
   ============================================================ */
.works {
  --plate-h: clamp(220px, 36vh, 430px);
  --lift: 1;
  padding-top: var(--section);
}

@media (max-height: 820px) {
  .works { --plate-h: clamp(200px, 32vh, 360px); --lift: 0.5; }
}

.works-head {
  max-width: var(--maxw);
  margin: 0 auto var(--s-7);
  padding-inline: var(--margin);
}

.works-head .runhead { margin-bottom: var(--s-7); }

.works-title {
  margin-bottom: var(--s-5);
  font-size: clamp(2.7rem, 0.9rem + 5.6vw, 7.6rem);
  font-weight: 850;
  font-stretch: 100%;
  line-height: 0.86;
  text-transform: uppercase;
}

.works-intro {
  max-width: 36ch;
  line-height: 1.5;
  color: var(--muted);
}

.works-sticky { position: relative; }

/* --- Progression : LAP 01/06 + mini-carte du circuit ---------- */
.works-progress {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  max-width: var(--maxw);
  margin: var(--s-4) auto 0;
  padding: 0 var(--margin) var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.works-lap {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 0.4em;
}

.works-lap::before {
  content: "Lap";
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

.works-count {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 850;
  font-style: italic;
  font-stretch: 110%;
  line-height: 0.85;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.works-total::before { content: "/ "; }

.works-bar {
  position: relative;
  flex: none;
  width: 176px;
  height: 88px;
}

/* Barre linéaire de script.js : discrète, sous la carte */
.works-bar > span {
  position: absolute;
  left: 14px;
  right: 16px;
  bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
}

.wb-map {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.wb-track,
.wb-done,
.wb-line {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.wb-track { stroke: rgba(150, 175, 255, 0.2); stroke-width: 6; }

.wb-done {
  stroke: var(--accent-small);
  stroke-width: 2;
  stroke-dasharray: 100 100;
  stroke-dashoffset: calc((0.95 - var(--wp, 0) * 0.9) * 100px);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--livery-glow) 70%, transparent));
}

.wb-line { stroke: var(--white); stroke-width: 2; stroke-linecap: butt; stroke-dasharray: 2 2; }

/* Repères des sept projets et voiture : sur le tracé (offset-path) */
.wb-mark,
.wb-car {
  position: absolute;
  top: 0;
  left: 0;
  offset-path: path("M30 72H124C146 72 160 64 160 46C160 32 150 24 138 28L112 38C102 42 94 36 98 26C102 16 116 14 118 8C119 3 112 2 104 4L46 18C26 23 12 36 14 52C15 64 21 72 30 72Z");
}

.wb-mark {
  --lit: clamp(0, (var(--wp, 0) * 6 - var(--i) + 0.12) * 8, 1);
  width: 7px;
  height: 7px;
  offset-distance: calc(5% + var(--i) * 15%);
  offset-rotate: 0deg;
  border-radius: 50%;
  background: var(--carbon);
  border: 1.5px solid var(--muted);
}

.wb-mark::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  background: var(--accent-small);
  box-shadow: 0 0 8px var(--accent-small);
  opacity: var(--lit);
}

.wb-car {
  width: 11px;
  height: 5px;
  offset-distance: calc(5% + var(--wp, 0) * 90%);
  offset-rotate: auto;
  border-radius: 1px;
  background: var(--white);
  box-shadow: 0 0 0 1.5px var(--livery), 0 0 12px var(--livery-glow);
}

/* --- Frise : défilement natif par défaut ---------------------- */
.works-track {
  display: flex;
  align-items: flex-start;
  gap: var(--gutter);
  padding: var(--s-2) var(--margin) var(--s-6);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--margin);
  scrollbar-width: none;
}

.works-track::-webkit-scrollbar { display: none; }

/* Une planche = un box des stands */
.work {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(80vw, 380px);
  scroll-snap-align: start;
}

.work-media {
  --ar: 1;
  position: relative;
  aspect-ratio: var(--ar);
  margin: 0 0 var(--s-4);
  overflow: hidden;
  background:
    linear-gradient(rgba(11, 14, 20, 0.05) 1px, transparent 1px) 0 0 / 100% 24px,
    linear-gradient(90deg, rgba(11, 14, 20, 0.05) 1px, transparent 1px) 0 0 / 24px 100%,
    #e9edf6;
  transition: background-color 0.5s var(--ease-out);
}

/* Crochets d'angle sur la plaque */
.work-media::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 1;
  pointer-events: none;
  --c: rgba(11, 14, 20, 0.55);
  background:
    linear-gradient(var(--c), var(--c)) top left / 10px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 1px 10px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 10px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 1px 10px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 10px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 1px 10px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 10px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 1px 10px no-repeat;
  transition: opacity 0.4s ease;
}

.work-media img {
  width: 100%;
  height: 100%;
  padding: 20%;
  object-fit: contain;
  translate: calc(var(--mx, 0) * 10px) calc(var(--my, 0) * 10px);
  transition: transform 0.9s var(--ease-out), filter 0.5s var(--ease-out), translate 0.6s var(--ease-out);
}

.work--tall .work-media { --ar: 4 / 5; }
.work--square .work-media { --ar: 1; }

.work-media--banner {
  --ar: 851 / 315;
  background: #000;
}

.work-media--banner::after { --c: rgba(233, 237, 246, 0.6); }

.work-media--banner img {
  padding: 0;
  object-fit: cover;
}

/* Plaques illustrées (js/illus.js) : écran sombre animé à la place d'un logo */
.work-media--illus {
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, color-mix(in srgb, var(--livery) 14%, transparent), transparent 72%),
    linear-gradient(rgba(120, 150, 255, 0.06) 1px, transparent 1px) 0 0 / 100% 24px,
    linear-gradient(90deg, rgba(120, 150, 255, 0.06) 1px, transparent 1px) 0 0 / 24px 100%,
    var(--carbon-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.4s var(--ease-out);
}

.work-media--illus::after { --c: rgba(233, 237, 246, 0.5); }

/* EveryWear en 3D (js/wear3d.js) : canvas WebGL et surcouche HUD */
.w3d-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.w3d-hud {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e9edf6;
}

.w3d-tag {
  position: absolute;
  top: 20px;
  left: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.w3d-tag::before { content: ""; width: 6px; height: 6px; background: #3d7dff; }

.w3d-meteo {
  position: absolute;
  top: 17px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.w3d-sky svg { display: block; width: 15px; height: 15px; }
.w3d-meteo b { font-weight: 700; }
.w3d-meteo span { color: rgba(233, 237, 246, 0.6); }

.w3d-pieces {
  position: absolute;
  top: 50%;
  left: 22px;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  transform: translateY(-50%);
}

.w3d-pieces li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(233, 237, 246, 0.35);
  transition: color 0.3s ease;
}

.w3d-pieces li::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--c, #3d7dff);
  opacity: 0.35;
  transition: opacity 0.3s ease, box-shadow 0.3s ease;
}

.w3d-pieces li.is-on { color: #e9edf6; }
.w3d-pieces li.is-on::before { opacity: 1; box-shadow: 0 0 10px var(--c, #3d7dff); }
.w3d-narrow .w3d-pieces { display: none; }

.w3d-scan {
  position: absolute;
  top: 50%;
  right: 22px;
  color: #c58bff;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.w3d-hud.is-scan .w3d-scan { opacity: 1; }

.w3d-card {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(120, 150, 255, 0.2);
  border-radius: 3px;
  background: rgba(6, 7, 10, 0.86);
}

.w3d-k { color: rgba(233, 237, 246, 0.5); transition: color 0.3s ease; }
.w3d-card.is-ready .w3d-k { color: #b44dff; }

.w3d-msg {
  flex: 1;
  overflow: hidden;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: rgba(233, 237, 246, 0.55);
}

.w3d-card.is-ready .w3d-msg { color: #e9edf6; }

.w3d-heart { width: 15px; height: 15px; flex: none; }
.w3d-heart path { fill: transparent; stroke: rgba(233, 237, 246, 0.5); stroke-width: 1.3; transition: fill 0.3s ease, stroke 0.3s ease; }
.w3d-card.is-fav .w3d-heart path { fill: #ff2d3d; stroke: #ff2d3d; }

/* Format bandeau (NEUROPULSE) : même proportion que l'ancienne bannière */
.work--wide .work-media--illus { --ar: 851 / 315; }

/* Sans JS : le nom du projet en repère */
html:not(.js) .work-media--illus::before {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (hover: hover) {
  .work:hover .work-media--illus {
    box-shadow: inset 0 0 0 1px var(--livery-2), 0 0 32px -8px color-mix(in srgb, var(--livery) 70%, transparent);
  }
}

/* Trois projets Zone01, une seule marque : trois cadrages différents */
.work-media--zone-full img { padding: 12%; }

.work-media--zone-dots img {
  padding: 0;
  object-fit: cover;
  scale: 1.9;
  transform-origin: 50% 48%;
}

.work-media--zone-side img {
  padding: 0;
  object-fit: cover;
  scale: 2.3;
  transform-origin: 74% 50%;
}

.work-meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

/* Numéro de course : plaque penchée de livrée */
.work-num {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 2.4em;
  padding: 1px 8px 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  font-style: italic;
  font-stretch: 115%;
  line-height: 1.15;
  color: var(--white);
  background: var(--livery);
  transform: skewX(var(--slant));
  font-variant-numeric: tabular-nums;
}

.work-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.work-tags li {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 1px 7px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--rule);
}

.work-title {
  margin-bottom: var(--s-3);
  font-size: clamp(1.9rem, 1.2rem + 1.7vw, 3rem);
  font-weight: 850;
  font-stretch: 100%;
  line-height: 0.9;
  text-transform: uppercase;
  transition: transform 0.6s var(--ease-out);
}

.work-desc {
  margin-bottom: var(--s-3);
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--muted);
}

.work-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 44px;
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  background: linear-gradient(var(--accent), var(--accent)) 0 78% / 0 1px no-repeat;
  transition: background-size 0.6s var(--ease-out), color 0.3s ease;
}

/* Toute la planche est cliquable ; le focus entoure la planche */
.work-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}

.work-link:focus-visible { outline: none; }

.work:focus-within {
  outline: 2px solid var(--accent-small);
  outline-offset: 8px;
}

@media (hover: hover) {
  .work:hover .work-link { background-size: 100% 1px; color: var(--accent-small); }
  .work:hover .work-title { transform: translateX(8px); }
  .work:hover .work-media--plate { background-color: var(--livery); background-image: none; }
  .work:hover .work-media--plate::after { --c: rgba(255, 255, 255, 0.7); }
  .work:hover .work-media--plate img { filter: brightness(0) invert(1); }
  .work:hover .work-media img { transform: scale(1.05); }
}

/* Apparition latérale (frise épinglée) : les planches rattrapent la frise */
.js .is-pinned [data-in="slide"] {
  opacity: 0;
  transform: translateX(70px);
  transition:
    opacity 0.8s var(--ease-out) var(--d, 0s),
    transform 1.2s var(--ease-out) var(--d, 0s);
}

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

/* --- Bureau : la frise épinglée ------------------------------- */
.works.is-pinned .works-pin { height: var(--pin-h, auto); }

.works.is-pinned .works-sticky {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  height: 100vh;
  height: 100svh;
  padding-top: calc(var(--nav-h) * 0.6);
  overflow: clip;
}

.works.is-pinned .works-row {
  display: flex;
  align-items: center;
  gap: clamp(56px, 7vw, 140px);
  width: max-content;
  padding-inline: var(--margin);
  will-change: transform;
}

.works.is-pinned .works-head {
  flex: 0 0 auto;
  width: clamp(320px, 30vw, 520px);
  margin: 0;
  padding: 0;
}

.works.is-pinned .works-title { font-size: clamp(2.4rem, 0.8rem + 3.4vw, 5.2rem); }

.works.is-pinned .works-track {
  gap: clamp(40px, 5vw, 96px);
  padding: 0;
  overflow: visible;
  scroll-snap-type: none;
}

/* La progression reste à l'écran pendant l'épinglage (coin haut droit) */
.works.is-pinned .works-progress {
  position: absolute;
  top: calc(var(--nav-h) + var(--s-3));
  right: var(--margin);
  z-index: 2;
  margin: 0;
  padding: 10px 14px 12px;
  background: color-mix(in srgb, var(--carbon) 70%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
}

/* Planches en « cartel » : la plaque, et sa notice alignée en bas */
.works.is-pinned .work {
  display: grid;
  grid-template-columns: auto clamp(15rem, 17vw, 19rem);
  grid-template-rows: 1fr auto auto auto auto;
  column-gap: var(--s-5);
  width: auto;
}

.works.is-pinned .work-media {
  grid-column: 1;
  grid-row: 1 / -1;
  width: auto;
  height: var(--plate-h);
  margin: 0;
}

.works.is-pinned .work > :not(.work-media) { grid-column: 2; }
.works.is-pinned .work-meta { grid-row: 2; }
.works.is-pinned .work-title { grid-row: 3; }
.works.is-pinned .work-desc { grid-row: 4; }
.works.is-pinned .work-link { grid-row: 5; margin-top: 0; }

.works.is-pinned .work--wide {
  display: flex;
  flex-direction: column;
  width: calc(var(--plate-h) * 1.7);
}

.works.is-pinned .work--wide .work-media {
  width: 100%;
  height: auto;
  margin-bottom: var(--s-4);
}

.works.is-pinned .work:nth-child(2) { margin-top: calc(9vh * var(--lift)); }
.works.is-pinned .work:nth-child(3) { margin-top: calc(-4vh * var(--lift)); }
.works.is-pinned .work:nth-child(4) { margin-top: calc(12vh * var(--lift)); }
.works.is-pinned .work:nth-child(6) { margin-top: calc(6vh * var(--lift)); }
.works.is-pinned .work:nth-child(7) { margin-top: calc(-2vh * var(--lift)); }

@media (min-width: 640px) {
  .work { width: min(46vw, 420px); }
  .work--wide { width: min(70vw, 560px); }
}

/* ============================================================
   CHAPITRE 05, RECHERCHE (carbone)
   Les atomes computationnels (js/atoms.js) vivent derrière la
   feuille : un vrai document papier posé sur le mur des stands,
   tamponné, qui se redresse quand on arrive à sa hauteur.
   ============================================================ */
.research { padding-block: var(--section); }

.research-head {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--s-5);
  margin-bottom: clamp(var(--s-6), 4vw, var(--s-8));
}

.research-title {
  grid-column: 1 / -1;
  font-size: clamp(2.7rem, 0.9rem + 5.4vw, 7.4rem);
  font-weight: 850;
  font-stretch: 100%;
  line-height: 0.86;
  text-transform: uppercase;
}

.research-intro {
  grid-column: 1 / -1;
  max-width: 34ch;
  line-height: 1.5;
  color: var(--muted);
}

@media (min-width: 1024px) {
  .research-title { grid-column: 1 / span 9; }
  .research-intro { grid-column: 10 / -1; align-self: end; }
}

/* La scène déborde de la grille : le champ d'atomes prend toute la largeur */
.research-stage {
  position: relative;
  margin-inline: calc(50% - 50vw);
  padding: clamp(56px, 8vw, 140px) var(--margin);
  perspective: 1600px;
  border-block: 1px solid var(--line);
}

.research-stage .atoms-canvas {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.research-stage .atoms-hud {
  left: var(--margin);
  bottom: 14px;
  color: var(--muted);
}

/* --- La feuille ----------------------------------------------- */
.sheet {
  --tilt: max(0, 0.42 - var(--p, 0.42));
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin-inline: auto;
  padding: clamp(28px, 5.5vw, 84px) clamp(20px, 6vw, 92px) clamp(28px, 5vw, 68px);
  background: var(--bg);
  color: var(--fg);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.35),
    0 60px 120px -50px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transform:
    translate3d(0, calc(var(--tilt) * 20vh), 0)
    rotate(calc(var(--tilt) * -5deg - 0.4deg));
  transform-origin: 30% 100%;
  will-change: transform;
}

/* Le grain du papier */
.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  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.5 0 0 0 0 0.5 0 0 0 0 0.5 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;
}

/* Ruban adhésif qui tient la feuille au mur */
.sheet::after {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 120px;
  height: 26px;
  translate: -50% 0;
  rotate: -2deg;
  background: rgba(200, 210, 230, 0.42);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.sheet > * { position: relative; }

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-2) var(--s-5);
  padding: var(--s-3) 0;
  border-top: 3px solid var(--fg);
  border-bottom: 1px solid var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-4);
}

.sheet-meta .publication-type { color: var(--muted); }

.publication-doi {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

/* Tampon « PUBLIÉ · ZENODO » (décoratif, il s'abat une fois) */
.sheet-stamp {
  position: absolute;
  top: clamp(64px, 9vw, 130px);
  right: clamp(14px, 4vw, 64px);
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 9px 16px 8px;
  font-family: var(--font-mono);
  font-size: clamp(0.6875rem, 0.5rem + 0.5vw, 1.0625rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--livery);
  border: 2px solid currentColor;
  outline: 1px solid currentColor;
  outline-offset: 3px;
  opacity: 0.82;
  mix-blend-mode: multiply;
  transform: rotate(-9deg);
  pointer-events: none;
}

/* Mobile : le tampon descend en pied de feuille, à côté du lien */
@media (max-width: 639.98px) {
  .sheet-stamp { top: auto; bottom: clamp(30px, 6vw, 44px); right: 18px; }
  .sheet-foot { justify-content: flex-start; }
}

.sheet-stamp span + span {
  padding-top: 2px;
  border-top: 1px solid currentColor;
}

.js .sheet-stamp[data-in="fade"] {
  opacity: 0;
  transform: rotate(-9deg) scale(1.9);
  transition: opacity 0.18s ease 0.5s, transform 0.4s var(--ease-snap) 0.5s;
}

.js .sheet-stamp[data-in="fade"].is-in {
  opacity: 0.82;
  transform: rotate(-9deg);
}

.sheet-title {
  max-width: 24ch;
  margin: clamp(var(--s-7), 6vw, var(--s-9)) auto var(--s-5);
  font-family: var(--font-text);
  font-size: clamp(1.7rem, 1.05rem + 2.4vw, 3.3rem);
  font-weight: 600;
  font-style: normal;
  font-stretch: 100%;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-align: center;
  text-transform: none;
}

.sheet-authors {
  margin-bottom: clamp(var(--s-7), 5vw, var(--s-8));
  font-style: italic;
  text-align: center;
  color: var(--muted);
}

.sheet-authors strong {
  margin-right: 0.4em;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-abstract {
  padding-top: var(--s-6);
  border-top: 1px solid var(--rule);
  font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem);
  line-height: 1.6;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

@media (min-width: 900px) {
  .sheet-abstract {
    columns: 2;
    column-gap: var(--s-8);
    column-rule: 1px solid var(--rule);
  }
}

/* Caviardage (js/home.js) : des bandes noires couvrent quelques
   mots-clés, puis se lèvent une fois. Le texte reste dans le DOM. */
.redact {
  background: linear-gradient(#0b0e14, #0b0e14) 100% 55% / 100% 86% no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size 0.7s var(--ease-in-out) var(--rd, 0s);
}

.sheet.is-declassified .redact { background-size: 0 86%; }

.sheet-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--s-7);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}

.sheet-tags li {
  display: inline-flex;
  align-items: center;
  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;
  border: 1px solid var(--rule);
}

.sheet-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--s-7);
}

/* Le libellé porte déjà sa flèche */
.sheet .sheet-link::after { content: none; }

/* ============================================================
   CHAPITRE 06, EN POSTE (livrée pleine)
   Le pilote est en piste (il est en alternance) : drapeau vert,
   piste libre, la #26 roule. Le bouton est le bouton BOX : on
   peut toujours le faire rentrer au stand pour échanger.
   ============================================================ */
.cta { padding-block: var(--section) calc(var(--section) * 0.7); }

.cta-body {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--s-7);
  align-items: end;
}

.cta .cta-title {
  grid-column: 1 / -1;
  max-width: none;
  margin: 0;
  font-size: clamp(2.7rem, 0.5rem + 6.9vw, 9.4rem);
  font-weight: 850;
  font-stretch: 100%;
  line-height: 0.88;
  text-transform: uppercase;
  text-align: left;
  color: var(--white);
}

/* Le statut en creux */
.cta-date {
  color: transparent;
  -webkit-text-stroke: 2px var(--white);
}

/* Contour net (filtre de script.js), mot par mot : la virgule regroupée
   avec le dernier mot (setupTitleGlue) reste pleine. */
.svg-outline .cta-date .w:not(.w-punct) {
  color: var(--white);
  -webkit-text-stroke: 0;
  filter: url(#gb-ol-2);
}

@media (min-width: 640px) {
  .cta-date { white-space: nowrap; }
}

/* La virgule qui suit le statut reste pleine et collée à son mot
   (voir setupTitleGlue dans home.js) */
.cta-date .w-punct {
  color: var(--white);
  -webkit-text-stroke: 0;
}

.t-glue { white-space: nowrap; }

/* Statut piste : drapeau vert, la #26 roule */
.track-status {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
}

.ts-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: 10px;
}

.ts-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 9px 2px;
  color: var(--carbon);
  background: var(--green);
  transform: skewX(var(--slant));
}

/* Voyant « en direct » (moins de 1 clignotement par seconde) */
.ts-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--carbon);
  animation: hm-live 1.8s steps(2, jump-none) infinite;
}

/* La piste sous drapeau vert, sur toute sa longueur */
.ts-bar {
  position: relative;
  height: 12px;
  overflow: hidden;
  background:
    repeating-linear-gradient(-60deg, rgba(6, 7, 10, 0.2) 0 6px, transparent 6px 12px),
    var(--green);
  outline: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 22px color-mix(in srgb, var(--green) 45%, transparent);
}

/* La voiture #26 boucle son tour */
.ts-car {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 18%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85));
  border-right: 3px solid var(--white);
  animation: ts-lap 5.5s linear infinite;
}

@keyframes ts-lap {
  from { transform: translateX(-100%); }
  to { transform: translateX(560%); }
}

.ts-scale {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: 8px;
  color: #dbe5ff;
}

/* Petit drapeau vert devant le libellé */
.ts-flag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ts-flag::before {
  content: "";
  width: 14px;
  height: 10px;
  background: var(--green);
  box-shadow: -2px 0 0 0 var(--white);
  transform: skewX(var(--slant));
}

/* Le bouton BOX : disque blanc magnétique, couronne graduée */
.cta-button {
  position: relative;
  grid-column: 1 / -1;
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: clamp(156px, 15vw, 232px);
  aspect-ratio: 1;
  margin: 18px;
  border-radius: 50%;
  background: var(--white);
  color: var(--livery);
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 0.66rem + 0.2vw, 0.875rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
  transition:
    background-color 0.45s var(--ease-out),
    color 0.45s var(--ease-out),
    scale 0.6s var(--ease-out);
}

.cta-button::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.75) 0 1deg, transparent 1deg 10deg);
  -webkit-mask: radial-gradient(closest-side, transparent 90%, #000 91%);
  mask: radial-gradient(closest-side, transparent 90%, #000 91%);
  transition: transform 0.9s var(--ease-out);
}

.cta-button::after {
  content: "→";
  content: "→" / "";
  display: block;
  font-size: 1.5em;
  line-height: 1;
  transition: transform 0.5s var(--ease-out);
}

.cta-button:hover,
.cta-button:focus-visible {
  background: var(--carbon);
  color: var(--white);
  scale: 1.06;
}

.cta-button:hover::before,
.cta-button:focus-visible::before { transform: rotate(45deg); }
.cta-button:hover::after { transform: translateX(6px); }
.cta-button:focus-visible { outline: 2px solid var(--white); outline-offset: 20px; }

@media (min-width: 640px) {
  .track-status { grid-column: 1 / span 6; }
  .cta-button { grid-column: 7 / -1; justify-self: end; }
}

@media (min-width: 1024px) {
  .cta .cta-title { grid-column: 1 / span 11; }
  /* Colonnes 4 à 9, comme la trace du hero : le coin bas gauche reste
     au panneau de télémétrie fixe de hud.js */
  .track-status { grid-column: 4 / span 6; align-self: end; }
  .cta-button { grid-column: 10 / -1; }
}

/* ============================================================
   MOUVEMENT RÉDUIT : états finaux, rien ne voyage ni ne boucle
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-meta .dot,
  .ts-state::before,
  .ts-car,
  .scroll-cue::after,
  .term-body .cursor { animation: none !important; }

  .scroll-cue::after { transform: translateY(27px); opacity: 1; }
  .ts-car { transform: translateX(240%); }

  .js .profile-scan .scan-corner,
  .js .profile-scan .scan-read li,
  .js .profile-scan .scan-box {
    opacity: 1 !important;
    translate: 0 0 !important;
    transform: none !important;
  }

  .scan-sweep { display: none; }

  .sheet { transform: rotate(-0.4deg) !important; }
  .js .sheet-stamp[data-in="fade"] { opacity: 0.82 !important; transform: rotate(-9deg) !important; }
  .profile-disc { transform: translate3d(-50%, 0, 0) !important; }

  .profile-photo,
  .profile-scan,
  .hero-top,
  .hero-index,
  .hero-sub,
  .hero-trace,
  .hero-actions { translate: none !important; }
}

/* ============================================================
   IMPRESSION
   ============================================================ */
@media print {
  .hero-trace,
  .hero-hud-head,
  .profile-scan,
  .profile-disc,
  .tools-link,
  .works-progress,
  .track-status,
  .sheet-stamp { display: none !important; }

  .masthead-line:last-child { color: #000; }
  .cta-date,
  .svg-outline .cta-date .w:not(.w-punct) { color: #000; -webkit-text-stroke: 0; filter: none; }
  .redact { background: none; }
}
