/* ═══════════════════════════════════════════════════════════════
   base.css — squelette, composants et jetons (tokens)
   Les 9 thèmes ne font que redéfinir les jetons + quelques signatures.
   Portée des thèmes :
     · global        → html[data-theme="X"]
     · aperçu isolé  → [data-theme-scope="X"].sc
   ═══════════════════════════════════════════════════════════════ */

/* ---------- Jetons par défaut (le thème « neutre ») ---------- */
:root {
  /* couleurs */
  --bg: #f2f4f9;
  --bg-2: #e9edf7;
  --surface: #ffffff;
  --surface-2: #f0f3fa;
  --text: #17203a;
  --muted: #5a6480;
  --primary: #2f6bff;
  --on-primary: #ffffff;
  --accent: #ff4d6d;
  --line: #dfe5f2;
  --line-w: 1px;

  /* profondeur */
  --shadow-1: 0 1px 3px rgba(23, 32, 58, .10);
  --shadow-2: 0 14px 34px -18px rgba(23, 32, 58, .35);
  --card-shadow: none;
  --card-shadow-hover: none;
  --card-lift: none;
  --card-strip: transparent;
  --card-img: none;

  /* formes */
  --r: 14px;
  --r-sm: 9px;
  --r-lg: 22px;

  /* typographie */
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Inter", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --h-weight: 800;
  --h-transform: none;
  --h-tracking: -0.03em;
  --h-shadow: none;
  --em-c: var(--accent);

  /* titres d'échelle (redéfinissables par thème) */
  --fs-hero: clamp(2.7rem, 7vw, 5rem);
  --fs-h2: clamp(2rem, 4.4vw, 3.2rem);
  --fs-h3: clamp(1.15rem, 1.6vw, 1.35rem);

  /* boutons */
  --btn-bg: var(--primary);
  --btn-bg-hover: color-mix(in srgb, var(--primary) 86%, #000);
  --btn-fg: var(--on-primary);
  --btn-img: none;
  --btn-radius: var(--r-sm);
  --btn-border: transparent;
  --btn-shadow: none;
  --btn-shadow-hover: none;
  --btn-shadow-press: var(--btn-shadow);

  /* cartes & chips */
  --card-bg: var(--surface);
  --chip-bg: var(--surface-2);
  --chip-fg: var(--text);
  --chip-border: var(--line);

  /* liens & focus */
  --link-c: var(--primary);
  --link-deco: none;
  --focus: var(--primary);

  /* kicker (sur-titre) */
  --kicker-bg: transparent;
  --kicker-fg: var(--primary);

  /* fond global */
  --pattern: none;

  /* code */
  --code-bg: #101733;
  --code-fg: #dfe6ff;
  --code-kw: #ff7ab2;
  --code-str: #9ef0c0;
  --code-com: #7f8bb5;

  /* rythme */
  --sec-pad: clamp(64px, 8vw, 112px);
  --card-pad: clamp(20px, 2.4vw, 28px);

  /* mouvement */
  --dur: 420ms;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Reset léger ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-body);
  font-size: clamp(1rem, .97rem + .25vw, 1.06rem);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--pattern);
  background-size: var(--pattern-size, auto);
  background-position: var(--pattern-position, 0 0);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
ul, ol { padding: 0; list-style: none; }

::selection { background: var(--primary); color: var(--on-primary); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--surface);
  color: var(--text);
  border: var(--line-w) solid var(--line);
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top .2s var(--ease);
}
.skip:focus-visible { top: 14px; }

/* ---------- Mise en page ---------- */
.wrap { width: min(100% - 40px, 1160px); margin-inline: auto; }

.section { padding-block: var(--sec-pad); }
.band { background: var(--bg-2); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 780px;
  margin-bottom: clamp(36px, 5vw, 60px);
}

.kicker {
  font-family: var(--f-mono);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--kicker-fg);
  background: var(--kicker-bg);
  padding: .38em .75em;
  border-radius: var(--r-sm);
  width: fit-content;
}

.section-title {
  font-family: var(--f-display);
  font-size: var(--fs-h2);
  font-weight: var(--h-weight);
  text-transform: var(--h-transform);
  letter-spacing: var(--h-tracking);
  line-height: 1;
  text-shadow: var(--h-shadow);
}

.lead {
  font-size: clamp(1.02rem, 1rem + .3vw, 1.16rem);
  color: var(--muted);
  max-width: 62ch;
}

.section-note, .jobs-note {
  margin-top: 28px;
  color: var(--muted);
  font-size: .95rem;
  max-width: 64ch;
}

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--surface);
  border-bottom: var(--line-w) solid var(--line);
  transition: box-shadow var(--dur) var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow-1); }

.header-inner {
  width: min(100% - 40px, 1240px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 66px;
}

.brand { display: inline-flex; align-items: baseline; text-decoration: none; color: inherit; }
.brand-mark {
  font-family: var(--f-display);
  font-weight: var(--h-weight);
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}
.brand-dot { color: var(--accent); font-weight: 800; }

.nav { display: flex; gap: 4px; margin-inline: auto; }
.nav a {
  padding: 8px 13px;
  border-radius: var(--r-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
  border-bottom: 2px solid transparent;
  transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}
.nav a:hover { color: var(--primary); background: var(--surface-2); }
.nav a.is-active { color: var(--primary); border-bottom-color: var(--primary); }

.header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.hud {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: var(--line-w) solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: .78rem;
  white-space: nowrap;
}
.hud-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.hud-label { text-transform: uppercase; letter-spacing: .12em; font-size: .62rem; color: var(--muted); }
.hud strong { font-weight: 700; }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 9px;
  background: var(--surface-2);
  border: var(--line-w) solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
body.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 90;
  background: transparent;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width .12s linear;
}

/* ---------- Héros ---------- */
.hero { padding-block: clamp(56px, 8vw, 104px); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(34px, 5vw, 70px);
  align-items: center;
}

.hero-copy { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }

.hero-title {
  font-family: var(--f-display);
  font-size: var(--fs-hero);
  font-weight: var(--h-weight);
  text-transform: var(--h-transform);
  letter-spacing: var(--h-tracking);
  line-height: .96;
  text-shadow: var(--h-shadow);
}
.hero-title em { font-style: italic; color: var(--em-c); }

.hero-lead { color: var(--muted); max-width: 56ch; font-size: clamp(1.02rem, 1rem + .35vw, 1.18rem); }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px 24px;
  width: 100%;
  margin-top: 12px;
  padding-top: 26px;
  border-top: var(--line-w) solid var(--line);
}
.hero-stats li { display: flex; flex-direction: column; gap: 2px; }
.hero-stats strong {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: var(--h-weight);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.hero-stats span { font-size: .82rem; color: var(--muted); line-height: 1.4; }

.hero-visual { display: flex; flex-direction: column; gap: 16px; }
.hero-note { font-size: .85rem; color: var(--muted); text-align: center; }

/* Carte de code */
.code-card {
  background: var(--code-bg);
  color: var(--code-fg);
  border: var(--line-w) solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  font-family: var(--f-mono);
  transform: rotate(-.6deg);
}
.code-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--code-bg) 70%, #fff 6%);
}
.code-bar i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.code-bar i:nth-child(1) { background: var(--accent); }
.code-bar i:nth-child(2) { background: var(--primary); }
.code-bar i:nth-child(3) { background: var(--muted); }
.code-name { margin-left: auto; font-size: .74rem; opacity: .8; letter-spacing: .04em; }

.code-body {
  padding: 18px 20px;
  font-size: clamp(.8rem, 1.5vw, .92rem);
  line-height: 1.75;
  overflow-x: auto;
  white-space: pre;
  tab-size: 4;
}
.c-kw { color: var(--code-kw); font-weight: 600; }
.c-fn { color: color-mix(in srgb, var(--primary) 55%, var(--code-fg)); font-weight: 600; }
.c-str { color: var(--code-str); }
.c-c { color: var(--code-com); font-style: italic; }

.code-caption {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 20px 16px;
  font-size: .76rem;
  opacity: .85;
}
.code-caret { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  background-color: var(--btn-bg);
  background-image: var(--btn-img);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  border-radius: var(--btn-radius);
  box-shadow: var(--btn-shadow);
  font-weight: 600;
  font-size: .97rem;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    background-color .22s var(--ease),
    box-shadow .22s var(--ease),
    transform .12s var(--ease),
    color .22s var(--ease),
    border-color .22s var(--ease);
}
.btn:not(.btn-invert):not(.btn-invert-ghost):hover {
  background-color: var(--btn-bg-hover);
  box-shadow: var(--btn-shadow-hover);
}
.btn:active { box-shadow: var(--btn-shadow-press); transform: translateY(1px); }

.btn-ghost {
  background-color: transparent;
  background-image: none;
  color: var(--primary);
  border: var(--line-w) solid var(--line);
  box-shadow: none;
}
.btn-ghost:hover { background-color: var(--surface-2); border-color: var(--primary); box-shadow: none; }
.btn-ghost:active { box-shadow: none; }

.btn-invert {
  background-color: var(--surface);
  background-image: none;
  color: var(--text);
  border-color: transparent;
  box-shadow: var(--shadow-1);
}
.btn-invert:hover { background-color: var(--surface-2); box-shadow: var(--shadow-2); }

.btn-invert-ghost {
  background-color: transparent;
  background-image: none;
  color: inherit;
  border: 1px solid currentColor;
  box-shadow: none;
}
.btn-invert-ghost:hover { background-color: color-mix(in srgb, currentColor 12%, transparent); box-shadow: none; }

/* Ripple (utilisé par le thème Material) */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: .28;
  transform: scale(0);
  animation: ripple .55s var(--ease) forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ---------- Grilles & cartes ---------- */
.grid { display: grid; gap: clamp(16px, 2vw, 26px); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--card-pad);
  padding-top: calc(var(--card-pad) + 4px);
  background-color: var(--card-bg);
  background-image: var(--card-img);
  border: var(--line-w) solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition:
    opacity var(--dur) var(--ease),
    translate var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--card-strip);
}
.card:hover { box-shadow: var(--card-shadow-hover); transform: var(--card-lift); }

.card-index {
  font-family: var(--f-mono);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--muted);
}
.card-kicker {
  font-family: var(--f-mono);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--accent);
}
.card-title {
  font-family: var(--f-display);
  font-size: var(--fs-h3);
  font-weight: var(--h-weight);
  text-transform: var(--h-transform);
  letter-spacing: var(--h-tracking);
  line-height: 1.15;
  text-shadow: var(--h-shadow);
}
.card-text { color: var(--muted); font-size: .95rem; }
.card-tags {
  margin-top: auto;
  padding-top: 12px;
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.tag {
  align-self: flex-start;
  margin-top: auto;
  padding: 4px 11px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  border: var(--chip-w, 1px) solid var(--chip-border);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.card-tags + .tag, .card .tag { margin-top: auto; }

/* Chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 7px 15px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  border: var(--chip-w, 1px) solid var(--chip-border);
  border-radius: var(--r-sm);
  font-size: .88rem;
}
.chip strong { color: var(--primary); }
.chip-strong { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.chip-strong strong { color: inherit; }

/* ---------- Frise chronologique ---------- */
.timeline {
  position: relative;
  padding-left: 36px;
  display: grid;
  gap: clamp(26px, 3.4vw, 40px);
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--line);
  border-radius: 3px;
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 6px 26px;
}
.tl-mark {
  position: absolute;
  left: -36px;
  top: 7px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px var(--bg);
}
.tl-year {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--primary);
  letter-spacing: .02em;
  padding-top: 1px;
}
.tl-body { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tl-title {
  font-family: var(--f-display);
  font-size: var(--fs-h3);
  font-weight: var(--h-weight);
  text-transform: var(--h-transform);
  letter-spacing: var(--h-tracking);
  line-height: 1.15;
}
.tl-body p { color: var(--muted); max-width: 68ch; font-size: .97rem; }

/* ---------- Panneaux ---------- */
.ancestors, .bac, .premiere {
  margin-top: clamp(36px, 5vw, 56px);
  padding: clamp(22px, 3vw, 34px);
  background: var(--surface);
  border: var(--line-w) solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--card-shadow);
}
.ancestors-title, .bac-title, .premiere-title, .jobs-title {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: var(--h-weight);
  text-transform: var(--h-transform);
  letter-spacing: var(--h-tracking);
  margin-bottom: 8px;
}
.ancestors-text { color: var(--muted); font-size: .95rem; max-width: 70ch; margin-bottom: 18px; }
.premiere .chip-row { margin-top: 14px; }

.bac { display: flex; flex-wrap: wrap; gap: clamp(20px, 3vw, 36px); align-items: center; justify-content: space-between; }
.bac-head { display: flex; flex-direction: column; gap: 12px; }
.bac-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  flex: 1 1 420px;
}
.bac-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 16px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.bac-list strong {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: var(--h-weight);
  letter-spacing: -0.02em;
}
.bac-list span { font-size: .8rem; color: var(--muted); line-height: 1.35; }

/* ---------- Laboratoire ---------- */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: clamp(16px, 2vw, 26px);
}
.lab-note {
  margin-top: 28px;
  color: var(--muted);
  font-size: .93rem;
  max-width: 70ch;
}
.lab-note em { font-style: italic; color: var(--text); }

.pv {
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: left;
  cursor: pointer;
  padding: var(--card-pad);
  background-color: var(--card-bg);
  background-image: var(--card-img);
  border: var(--line-w) solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--card-shadow);
  transition:
    opacity var(--dur) var(--ease),
    translate var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}
.pv:hover { box-shadow: var(--card-shadow-hover); transform: var(--card-lift); }
.pv[aria-pressed="true"] {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

.pv-kicker {
  font-family: var(--f-mono);
  font-size: .66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
}
.pv-title {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  font-weight: var(--h-weight);
  text-transform: var(--h-transform);
  letter-spacing: var(--h-tracking);
  line-height: 1.1;
  text-shadow: var(--h-shadow);
}
.pv-text { font-size: .88rem; color: var(--muted); line-height: 1.55; }
.pv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}
.pv-btn {
  display: inline-block;
  padding: 9px 17px;
  background-color: var(--btn-bg);
  background-image: var(--btn-img);
  color: var(--btn-fg);
  border: 1px solid var(--btn-border);
  border-radius: var(--btn-radius);
  box-shadow: var(--btn-shadow);
  font-size: .85rem;
  font-weight: 600;
}
.pv-link {
  font-size: .84rem;
  color: var(--link-c);
  text-decoration: var(--link-deco);
  text-underline-offset: 3px;
}

/* ---------- Débouchés ---------- */
.path {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: var(--card-pad);
  background-color: var(--card-bg);
  border: var(--line-w) solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--card-shadow);
  color: inherit;
  text-decoration: none;
  transition:
    opacity var(--dur) var(--ease),
    translate var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}
.path:hover {
  border-color: var(--primary);
  box-shadow: var(--card-shadow-hover);
  transform: var(--card-lift);
}
.path-index {
  font-family: var(--f-display);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: var(--h-weight);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--primary);
}
.path-title {
  font-family: var(--f-display);
  font-size: var(--fs-h3);
  font-weight: var(--h-weight);
  text-transform: var(--h-transform);
  letter-spacing: var(--h-tracking);
}
.path-text { color: var(--muted); font-size: .93rem; }
.path-meta {
  margin-top: auto;
  padding-top: 12px;
  font-family: var(--f-mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}

.jobs { margin-top: clamp(40px, 5vw, 60px); }
.jobs .chip-row { margin-top: 16px; }

/* ---------- Bandeau CTA ---------- */
.cta-band {
  background: var(--cta-bg, var(--primary));
  color: var(--cta-fg, var(--on-primary));
  padding-block: var(--sec-pad);
}
.cta-inner { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.cta-band .kicker { color: var(--cta-kicker-fg, inherit); background: var(--cta-kicker-bg, transparent); }
.cta-title {
  font-family: var(--f-display);
  font-size: var(--fs-h2);
  font-weight: var(--h-weight);
  text-transform: var(--h-transform);
  letter-spacing: var(--h-tracking);
  line-height: 1;
}
.cta-text { max-width: 58ch; opacity: .92; }
.cta-band .hero-cta { margin-top: 8px; }

/* ---------- Pied de page ---------- */
.site-footer {
  background: var(--bg);
  border-top: var(--line-w) solid var(--line);
  padding-block: clamp(36px, 5vw, 56px);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 30px;
  align-items: start;
}
.footer-brand { font-size: 1.6rem; }
.footer-tag { color: var(--muted); font-size: .92rem; margin-top: 6px; }
.footer-nav { display: flex; flex-direction: column; gap: 9px; }
.footer-nav a {
  color: var(--text);
  text-decoration: var(--link-deco);
  text-underline-offset: 3px;
  font-size: .93rem;
  width: fit-content;
}
.footer-nav a:hover { color: var(--primary); text-decoration: underline; }
.footer-meta { color: var(--muted); font-size: .85rem; display: flex; flex-direction: column; gap: 6px; }
.footer-meta p:first-child { color: var(--text); font-weight: 600; font-family: var(--f-mono); }

/* ---------- Rail flottant (sélecteur d'esthétique) ---------- */
.dock {
  position: fixed;
  z-index: 80;
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: var(--line-w) solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
}
.dock-title {
  font-family: var(--f-mono);
  font-size: .6rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.dock-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.dock-btn:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--btn-shadow-hover); }
.dock-btn[aria-pressed="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent), var(--btn-shadow);
}
.dock-swatch {
  width: 18px;
  height: 18px;
  border-radius: calc(var(--r-sm) * .6);
  background: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.dock-label {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 11px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-1);
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease);
}
.dock-btn:hover .dock-label,
.dock-btn:focus-visible .dock-label { opacity: 1; }

@media (min-width: 1024px) {
  body { padding-right: 66px; }
  .dock {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    align-items: center;
    padding: 12px 9px;
  }
  .dock-title {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    margin-bottom: 4px;
  }
}

@media (max-width: 1023px) {
  body { padding-bottom: 78px; }
  .dock {
    left: 10px;
    right: 10px;
    bottom: 10px;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 8px;
    scrollbar-width: none;
  }
  .dock::-webkit-scrollbar { display: none; }
  .dock-title { display: none; }
  .dock-btn { width: auto; height: auto; flex: 0 0 auto; gap: 8px; padding: 9px 13px; }
  .dock-label {
    position: static;
    transform: none;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    font-size: .74rem;
  }
}

/* ---------- Révélations au scroll ---------- */
/* Les valeurs vivent ici, la transition de repli a une spécificité nulle
   (`:where`) : les composants dotés de leurs propres transitions gèrent
   l'entrée sans se faire voler leurs états au survol. */
.js .reveal { opacity: 0; translate: 0 20px; }
:where(.js .reveal) { transition: opacity .65s var(--ease), translate .65s var(--ease); }
.js .reveal.is-in { opacity: 1; translate: none; }

/* Décalage en cascade dans les grilles (6 propriétés = liste de délais) */
.grid .reveal:nth-child(2), .lab-grid .reveal:nth-child(2) { transition-delay: .07s, .07s, 0s, 0s, 0s, 0s; }
.grid .reveal:nth-child(3), .lab-grid .reveal:nth-child(3) { transition-delay: .14s, .14s, 0s, 0s, 0s, 0s; }
.grid .reveal:nth-child(4), .lab-grid .reveal:nth-child(4) { transition-delay: .21s, .21s, 0s, 0s, 0s, 0s; }
.grid .reveal:nth-child(5), .lab-grid .reveal:nth-child(5) { transition-delay: .28s, .28s, 0s, 0s, 0s, 0s; }
.grid .reveal:nth-child(6), .lab-grid .reveal:nth-child(6) { transition-delay: .35s, .35s, 0s, 0s, 0s, 0s; }
.lab-grid .reveal:nth-child(7) { transition-delay: .42s, .42s, 0s, 0s, 0s, 0s; }
.lab-grid .reveal:nth-child(8) { transition-delay: .49s, .49s, 0s, 0s, 0s, 0s; }
.lab-grid .reveal:nth-child(9) { transition-delay: .56s, .56s, 0s, 0s, 0s, 0s; }
.timeline .reveal:nth-child(2) { transition-delay: .05s, .05s; }
.timeline .reveal:nth-child(3) { transition-delay: .1s, .1s; }

/* ---------- Transition de thème (View Transitions API) ---------- */
@keyframes vt-out {
  to { opacity: 0; transform: scale(.995); }
}
@keyframes vt-in {
  from { clip-path: circle(0% at var(--vt-x, 50%) var(--vt-y, 50%)); opacity: .55; }
  to   { clip-path: circle(150% at var(--vt-x, 50%) var(--vt-y, 50%)); opacity: 1; }
}
::view-transition-old(root) { animation: vt-out .32s ease both; }
::view-transition-new(root) { animation: vt-in .55s var(--ease) both; }

/* Repli sans View Transitions : transition collective le temps du swap */
html.theming *, html.theming *::before, html.theming *::after {
  transition:
    background-color var(--dur) var(--ease),
    background-image var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    outline-color var(--dur) var(--ease),
    fill var(--dur) var(--ease) !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    padding: 10px 20px 18px;
    background: var(--surface);
    border-bottom: var(--line-w) solid var(--line);
    box-shadow: var(--shadow-1);
    display: none;
  }
  body.menu-open .nav { display: flex; }
  .nav a { padding: 12px 13px; border-bottom: var(--line-w) solid var(--line); border-radius: 0; }
  .nav a.is-active { border-bottom-color: var(--line); background: var(--surface-2); }
  .menu-toggle { display: flex; }
  .hud-label { display: none; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: 2; }
  .code-card { transform: none; }
}

@media (max-width: 720px) {
  .tl-item { grid-template-columns: 1fr; gap: 4px; }
  .tl-year { font-size: .95rem; }
  .bac { flex-direction: column; align-items: stretch; }
  .hud { display: none; }
}

@media (max-width: 480px) {
  .wrap { width: min(100% - 28px, 1160px); }
  .hero-cta .btn { width: 100%; }
}

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1 !important; translate: none !important; }
}

/* ---------- Bandeau inter-versions (liste neutre) ---------- */
.xnav {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: var(--line-w) solid var(--line);
  font-family: var(--f-display);
  color: var(--text);
}
.xnav a { color: inherit; }
.xnav__exergue { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.xnav__exergue b { color: var(--primary); }
.xnav__grid {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem 1.75rem;
  max-width: 76rem;
  margin: .9rem 0 0;
  padding: 0;
  list-style: none;
}
.xnav__grid > li { display: flex; flex: 0 0 auto; min-width: 0; max-width: 100%; }
.xnav__item {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .1rem .5rem;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  text-decoration: none;
  color: inherit;
}
.xnav__item:hover .xnav__name { text-decoration: underline; text-underline-offset: .15em; }
.xnav__item[aria-current="page"] .xnav__name { color: var(--primary); }
.xnav__name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xnav__name::before {
  content: "";
  flex: none;
  display: inline-block;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  margin-right: .45rem;
  vertical-align: .06em;
  background: var(--x-accent, var(--primary));
}
.xnav__cost { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); white-space: normal; }
.xnav__self { white-space: normal; font-size: .72rem; color: var(--muted); font-family: var(--f-mono); }
.xnav__credit { display: block; margin-top: 1rem; font-size: .72rem; line-height: 1.6; color: var(--muted); max-width: 74rem; }
.xnav__credit a { color: inherit; }
@media (max-width: 560px) { .xnav__grid { gap: .3rem 1.1rem; } }
