/* ==========================================================================
   components.css — en-tête, hero, cartes, figures, sommaire, pied de page,
   formulaire, modules interactifs, lightbox
   ========================================================================== */

/* --- En-tête / navigation ------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; gap: 1rem;
  min-height: 66px;
}
.brand {
  display: inline-flex; align-items: center; gap: .62rem;
  font-family: var(--font-display);
  font-weight: 600; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none;
  font-size: 1.02rem; white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand .brand-mark { width: 30px; height: 30px; flex: 0 0 auto; }
.brand .brand-sub {
  font-family: var(--font-mono);
  font-size: .64rem; letter-spacing: .2em;
  color: var(--accent); text-transform: uppercase;
  display: block; margin-top: 1px;
}
.brand b { font-weight: 600; }

.nav-spacer { flex: 1 1 auto; }

.nav-links { display: flex; align-items: center; gap: .3rem; list-style: none; padding: 0; }
.nav-links a {
  display: inline-block;
  color: var(--text-2); text-decoration: none;
  font-size: .92rem; font-weight: 500;
  padding: .5rem .72rem; border-radius: var(--radius-sm);
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="page"],
.nav-links a.is-active { color: var(--accent); background: var(--accent-soft); }

.nav-tools { display: flex; align-items: center; gap: .35rem; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
}

.nav-toggle { display: none; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }

/* Navigation mobile : panneau déroulant ancré sous l'en-tête.
   En position absolute : l'en-tête (sticky + backdrop-filter) devient le bloc
   conteneur, un position: fixed y serait décalé et déborderait sur l'en-tête. */
.nav-backdrop { display: none; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    gap: .15rem;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: .6rem 1rem 1rem;
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 66px);
    max-height: calc(100dvh - 66px);
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  }
  .nav-links.open {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition: opacity .2s ease, transform .2s ease, visibility 0s;
  }
  .nav-links a { display: block; padding: .85rem .9rem; font-size: 1.02rem; }
  .nav-links li + li a { border-top: 1px solid var(--border); border-radius: 0; }

  /* Voile derrière le menu ouvert (ferme le menu au toucher) */
  .nav-backdrop {
    display: block;
    position: fixed; inset: 66px 0 0 0; z-index: 90;
    background: rgba(3, 7, 12, .5);
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease, visibility 0s linear .2s;
  }
  .nav-backdrop.show { opacity: 1; visibility: visible; transition: opacity .2s ease, visibility 0s; }
}

/* --- Bandeau héros ------------------------------------------------------- */
.hero {
  position: relative;
  padding: clamp(3.2rem, 8vw, 6.5rem) 0 clamp(2.4rem, 5vw, 4rem);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; }
.hero h1 { margin-top: .7rem; }
.hero h1 .accent { color: var(--accent); }
.hero .lede {
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.28rem);
  color: var(--text-2);
  margin-top: 1.1rem; max-width: 62ch;
}
.hero-chain {
  display: flex; flex-wrap: wrap; gap: .5rem .35rem;
  align-items: center;
  margin-top: 1.6rem;
  font-family: var(--font-mono); font-size: .82rem;
  color: var(--text-2);
}
.hero-chain .node {
  padding: .32rem .7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  white-space: nowrap;
}
.hero-chain .arrow { color: var(--accent); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.9rem; }

/* Fond animé d'ondes du héros */
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none; opacity: .9;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 100%);
          mask-image: linear-gradient(90deg, transparent, #000 25%, #000 100%);
}
.hero-bg svg { width: 100%; height: 100%; }
.hero-wave {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 1.4;
  opacity: .5;
  vector-effect: non-scaling-stroke;
}
.hero-wave.w2 { stroke: var(--accent); opacity: .3; }
@media (prefers-reduced-motion: no-preference) {
  .hero-wave { animation: drift 14s linear infinite; }
  .hero-wave.w2 { animation-duration: 20s; animation-direction: reverse; }
}
@keyframes drift { to { transform: translateX(-120px); } }

/* --- Boutons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-display);
  font-weight: 600; font-size: .95rem;
  padding: .72rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn svg { width: 1.05em; height: 1.05em; }

/* --- Zone de contenu principal ------------------------------------------- */
.page { padding: var(--pad-section) 0 clamp(3rem, 6vw, 5rem); }
.page-head { margin-bottom: clamp(1.6rem, 4vw, 2.6rem); }
.page-head h1 { margin-top: .6rem; }

/* Mise en page chapitre : contenu + sommaire latéral */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 3rem);
}
@media (min-width: 1000px) {
  .layout.has-toc { grid-template-columns: minmax(0, 1fr) 232px; }
  .layout.has-toc .toc-col { order: 2; }
}

/* Colonne de lecture pour le corps riche */
.prose { max-width: var(--maxw-read); }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 { margin-top: 2.4rem; padding-top: .3rem; }
.prose h2 + p, .prose h3 + p { margin-top: .7rem; }
.prose h3 { margin-top: 1.8rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: .4rem; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li {
  position: relative; padding-left: 1.5rem;
}
.prose ul > li::before {
  content: "";
  position: absolute; left: 0; top: .62em;
  width: 7px; height: 7px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.prose a { font-weight: 500; }

/* Encadré « important » */
.callout {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent 80%);
  padding: 1.1rem 1.3rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.callout .callout-title {
  font-family: var(--font-display); font-weight: 600;
  color: var(--text); margin-bottom: .4rem;
  display: flex; align-items: center; gap: .5rem;
}
.callout.warn { border-color: var(--accent-warm); background: linear-gradient(90deg, color-mix(in srgb, var(--accent-warm) 12%, transparent), transparent 80%); }
.callout.info { border-color: var(--accent-2); background: linear-gradient(90deg, var(--accent-2-soft), transparent 80%); }

/* Note datée (archive WordPress) */
.note-archive {
  font-size: .9rem; color: var(--text-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem; background: var(--surface);
}
.note-archive a { display: inline-block; padding: .35rem 0; }
.note-archive .tag {
  font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-right: .5rem;
}

/* --- Menu de chapitres (ancien bouton-pilules) --------------------------- */
.chapters {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: 1.4rem 0 .4rem;
}
.chapters a {
  font-family: var(--font-mono); font-size: .8rem;
  color: var(--text-2); text-decoration: none;
  padding: .45rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.chapters a .num { color: var(--muted); margin-right: .4em; }
.chapters a:hover { border-color: var(--border-strong); color: var(--text); }
.chapters a[aria-current="page"] {
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent);
}
.chapters a[aria-current="page"] .num { color: color-mix(in srgb, var(--accent-ink) 70%, transparent); }

/* --- Sommaire latéral (TOC) ---------------------------------------------- */
.toc { position: sticky; top: 92px; font-size: .86rem; }
.toc-title {
  font-family: var(--font-mono); font-size: .72rem;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .7rem;
}
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc a {
  display: block; padding: .32rem 0 .32rem .85rem;
  margin-left: -1px;
  color: var(--text-2); text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent); border-color: var(--accent); }
@media (max-width: 999px) { .toc-col { display: none; } }

/* --- Figures ------------------------------------------------------------- */
figure { margin: 1.6rem 0; }
figure.fig {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem;
  box-shadow: var(--shadow);
}
figure.fig img, figure.fig .figbody {
  border-radius: calc(var(--radius) - 6px);
  width: 100%;
}
/* Légende en bloc (et non en flex) : un texte mêlant italiques et indices
   doit se replier normalement, sinon chaque fragment devient une colonne. */
figcaption {
  display: block;
  font-size: .82rem; color: var(--muted);
  margin-top: .6rem; padding: 0 .4rem .2rem;
  overflow-wrap: break-word;
}
figcaption .fig-id {
  display: inline-block;
  margin-right: .5rem;
  font-family: var(--font-mono); color: var(--accent);
  font-size: .78rem;
}
.fig-row { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .fig-row.two { grid-template-columns: 1fr 1fr; } }

/* Placeholder image (en attendant les originaux) */
.img-placeholder {
  aspect-ratio: 16 / 9;
  display: grid; place-items: center; text-align: center;
  background:
    repeating-linear-gradient(45deg, var(--surface-2) 0 10px, var(--surface-3) 10px 20px);
  color: var(--muted);
  border-radius: calc(var(--radius) - 6px);
  font-family: var(--font-mono); font-size: .78rem;
  padding: 1rem; gap: .4rem;
}
.img-placeholder svg { width: 30px; height: 30px; opacity: .6; }
.img-placeholder .ph-name { color: var(--text-2); word-break: break-all; }

/* Image zoomable */
.zoomable { cursor: zoom-in; }

/* --- Tableaux ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; background: var(--surface); }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th {
  background: var(--surface-2);
  font-family: var(--font-display); font-weight: 600;
  font-size: .85rem; color: var(--text);
  position: sticky; top: 0;
}
tbody tr:hover { background: var(--surface-2); }
tfoot td { background: var(--surface-2); border-top: 2px solid var(--border-strong); border-bottom: 0; font-size: .95rem; }
td .score { font-family: var(--font-mono); color: var(--accent); }

/* --- Blocs de code ------------------------------------------------------- */
.code {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 1rem 0;
}
.code pre { margin: 0; padding: .95rem 1.05rem; overflow-x: auto; }
.code code { color: var(--text); font-size: .86rem; line-height: 1.6; }
/* Barre d'en-tête du bloc : langage à gauche, bouton « copier » à droite */
.code .code-lang {
  display: block;
  font-family: var(--font-mono); font-size: .66rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
  padding: .6rem .8rem;
  min-height: 42px;
  line-height: 1.6;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.code .tok-cmd { color: var(--accent); }
.code .tok-flag { color: var(--accent-2); }
.code .tok-str { color: var(--accent-warm); }
.code .tok-comment { color: var(--muted); font-style: italic; }
.copy-btn {
  position: absolute; top: 5px; right: 6px;
  font-family: var(--font-mono); font-size: .72rem;
  background: var(--bg-2); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 6px;
  padding: .25rem .75rem; min-height: 32px; cursor: pointer;
  opacity: .8;
  transition: opacity .15s, color .15s, border-color .15s;
}
.code:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }
.copy-btn.ok { color: var(--accent); }

/* --- Formules ------------------------------------------------------------ */
.formula {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
  overflow-x: auto;
}
.formula .math { font-family: "Cambria Math", "Latin Modern Math", Georgia, serif; font-size: 1.25rem; font-style: italic; }
.formula sub { font-style: normal; }

/* --- Formulaire de contact ---------------------------------------------- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 3vw, 2rem);
  box-shadow: var(--shadow);
  max-width: 640px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field.col-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.field label { font-size: .86rem; font-weight: 600; color: var(--text); }
.field label .req { color: var(--accent); }
/* 16 px minimum : en dessous, iOS zoome automatiquement au focus */
.field input, .field textarea, .field select {
  font: inherit; font-size: 1rem;
  min-height: 46px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: .65rem .8rem;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent-2); box-shadow: var(--ring);
}
.field .hint { font-size: .78rem; color: var(--muted); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field .err { font-size: .78rem; color: var(--danger); min-height: 1em; }
/* Champ piège masqué (sans le décaler hors écran, ce qui peut créer un débordement) */
.hp-field {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.form-card { position: relative; }
.hp-field input { font-size: 16px; }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .86rem; color: var(--text-2); }
.consent input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: .1rem; accent-color: var(--accent); }
.form-actions { display: flex; align-items: center; gap: 1rem; margin-top: .4rem; flex-wrap: wrap; }
.form-status { font-size: .9rem; }
.form-status.ok { color: var(--accent); }
.form-status.ko { color: var(--danger); }
.form-note {
  font-size: .8rem; color: var(--muted);
  display: flex; gap: .5rem; align-items: center; margin-top: 1rem;
}
.form-note svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--accent); }

/* --- Cartes de chapitres (accueil) --------------------------------------- */
.card-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.chapter-card {
  position: relative;
  display: flex; flex-direction: column; gap: .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.2rem;
  text-decoration: none; color: var(--text);
  overflow: hidden;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.chapter-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.chapter-card:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); color: var(--text); }
.chapter-card:hover::after { transform: scaleX(1); }
.chapter-card .cc-num { font-family: var(--font-mono); font-size: .72rem; color: var(--accent); letter-spacing: .1em; }
.chapter-card .cc-title { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; }
.chapter-card .cc-desc { font-size: .87rem; color: var(--text-2); }
.chapter-card .cc-arrow { margin-top: auto; color: var(--muted); transition: transform .18s, color .18s; }
.chapter-card:hover .cc-arrow { color: var(--accent); transform: translateX(3px); }

/* --- Statistiques / résultats clés --------------------------------------- */
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
}
.stat .stat-val { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; color: var(--accent); line-height: 1; }
.stat .stat-val .u { font-size: .9rem; color: var(--text-2); }
.stat .stat-label { font-size: .84rem; color: var(--text-2); margin-top: .4rem; }

/* --- Navigation chapitre précédent / suivant ----------------------------- */
.chapter-nav {
  display: grid; gap: .8rem; grid-template-columns: 1fr 1fr;
  margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--border);
}
@media (max-width: 560px) { .chapter-nav { grid-template-columns: 1fr; } }
.chapter-nav a {
  display: flex; flex-direction: column; gap: .2rem;
  text-decoration: none; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .85rem 1.1rem; background: var(--surface);
  transition: border-color .15s, background .15s;
}
.chapter-nav a:hover { border-color: var(--border-strong); background: var(--surface-2); }
.chapter-nav a.next { text-align: right; align-items: flex-end; }
.chapter-nav .cn-dir { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); letter-spacing: .1em; }
.chapter-nav .cn-title { font-weight: 600; color: var(--accent); }

/* --- Auteurs / établissement (fin de page héritée) ----------------------- */
.credits { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; margin-top: 2.4rem; }
@media (max-width: 560px) { .credits { grid-template-columns: 1fr; } }
.credits h4 { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.credits ul { list-style: none; padding: 0; margin: 0; }
.credits li { padding: .2rem 0; color: var(--text-2); }
.credits a { color: var(--text-2); }
.credits a:hover { color: var(--accent); }

/* Réseaux (page groupe) */
.people { display: grid; gap: .8rem; }
.person { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.person .p-name { font-family: var(--font-display); font-weight: 600; min-width: 190px; }
.person .p-links { display: flex; gap: .4rem; }
.social {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  text-decoration: none; transition: color .15s, border-color .15s;
}
.social:hover { color: var(--accent); border-color: var(--border-strong); }
.social svg { width: 17px; height: 17px; }

/* --- Pied de page -------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  margin-top: clamp(3rem, 7vw, 6rem);
  padding: clamp(2.4rem, 5vw, 3.6rem) 0 2rem;
}
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .8rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { padding: .25rem 0; }
.footer-grid a { color: var(--text-2); text-decoration: none; font-size: .92rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-brand { max-width: 34ch; }
.footer-brand p { font-size: .88rem; color: var(--muted); margin-top: .7rem; }
.footer-bottom {
  margin-top: 2.2rem; padding-top: 1.3rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .82rem; color: var(--muted);
}
.footer-bottom .mono { font-family: var(--font-mono); }

/* --- Façade YouTube (chargement au clic) --------------------------------- */
.video-embed { margin: 1.6rem 0; }
.yt-facade {
  position: relative; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 120% at 70% 20%, var(--accent-2-soft), transparent 55%),
    repeating-linear-gradient(0deg, var(--surface) 0 7px, var(--surface-2) 7px 14px);
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.yt-facade::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.35), transparent 60%);
  pointer-events: none;
}
.yt-facade .yt-play {
  position: relative; z-index: 2;
  width: 68px; height: 48px; border-radius: 12px;
  background: #ff0033; display: grid; place-items: center;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  transition: transform .18s;
}
.yt-facade:hover .yt-play { transform: scale(1.08); }
.yt-facade .yt-play svg { width: 24px; height: 24px; fill: #fff; }
.yt-facade .yt-label {
  position: absolute; z-index: 2; left: 1rem; bottom: .9rem; right: 1rem;
  color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.yt-facade .yt-src { position: absolute; z-index: 2; top: .8rem; left: 1rem; font-family: var(--font-mono); font-size: .72rem; color: #fff; opacity: .85; }
.video-embed iframe { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: var(--radius); }
.video-embed figcaption { margin-top: .6rem; }

/* --- Lightbox ------------------------------------------------------------ */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(3, 7, 12, .9);
  backdrop-filter: blur(4px);
  display: none; place-items: center;
  padding: 2rem;
}
.lightbox.open { display: grid; }
.lightbox img {
  max-width: min(96vw, 1400px); max-height: 82vh;
  width: auto; height: auto; object-fit: contain;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  background: var(--surface);
}
.lightbox .lb-body {
  width: min(96vw, 1200px);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.lightbox .lb-body svg { width: 100%; height: auto; max-height: 82vh; border-radius: var(--radius); }
.lightbox .lb-body.is-tall { width: auto; }
.lightbox .lb-body.is-tall svg { width: auto; height: 82vh; }
/* Téléphone : schéma (version étroite) en pleine largeur */
@media (max-width: 700px) {
  .lightbox { padding: 4rem .6rem 5rem; }
  .lightbox .lb-body, .lightbox .lb-body.is-tall { width: 100%; max-width: 440px; }
  .lightbox .lb-body svg, .lightbox .lb-body.is-tall svg { width: 100%; height: auto; max-height: calc(100dvh - 9rem); }
}

/* Indice « agrandir » sur les figures cliquables */
figure.fig:has(.zoomable) { position: relative; }
figure.fig:has(.zoomable)::after {
  content: ""; position: absolute; top: 1rem; right: 1rem;
  width: 30px; height: 30px; border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 70%, transparent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e6edf3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.5-4.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center / 18px no-repeat;
  opacity: .0; transition: opacity .15s; pointer-events: none;
}
figure.fig:has(.zoomable):hover::after { opacity: .95; }
@media (hover: none) { figure.fig:has(.zoomable)::after { opacity: .75; } }
svg.zoomable { cursor: zoom-in; }
svg.zoomable:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.lightbox .lb-close {
  position: fixed; z-index: 2; top: 1rem; right: 1rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); cursor: pointer;
  display: grid; place-items: center;
}
.lightbox .lb-cap {
  position: fixed; z-index: 2; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 2rem);
  text-align: center;
  font-size: .85rem; color: var(--text-2);
  background: var(--surface); padding: .45rem .9rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}

/* --- Calculateur de pixel clock ------------------------------------------ */
.calc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow);
}
.calc-inputs { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .calc-inputs { grid-template-columns: 1fr; } }
.calc .field input { text-align: center; font-family: var(--font-mono); }
.calc-out { margin-top: 1.3rem; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.calc-out .stat { background: var(--bg-2); }
.calc-harmonics { margin-top: 1rem; font-family: var(--font-mono); font-size: .9rem; color: var(--text-2); }
.calc-harmonics b { color: var(--accent); }
.calc-note { font-size: .8rem; color: var(--muted); margin-top: .9rem; }

/* --- Chaîne GNU Radio interactive (HTML, amélioration progressive) -------
   Sans JS : liste verticale lisible (blocs + descriptions).
   Avec JS (.is-enhanced) : blocs sélectionnables ; description dans le
   panneau (bureau) ou dépliée sous le bloc (mobile). */
.flow {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow);
}
.prose .flow-steps,
.flow-steps {
  list-style: none; margin: 0; padding: 0 4px;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .8rem 0;
}
.prose .flow-steps li + li { margin-top: 0; }
.flow-item { display: flex; align-items: center; margin: 0; }
.flow-item + .flow-item::before {
  content: "→";
  font-family: var(--font-mono); color: var(--accent);
  margin: 0 .55rem;
}
.flow-step {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
  min-width: 128px; max-width: 176px;
  padding: .6rem .95rem;
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
/* Ports d'entrée (bleu) et de sortie (orange), comme dans GNU Radio Companion */
.flow-step::before, .flow-step::after {
  content: ""; position: absolute; top: 50%;
  width: 7px; height: 12px; border-radius: 2px;
  transform: translateY(-50%);
}
.flow-step::before { left: -4px; background: var(--accent-2); }
.flow-step::after  { right: -4px; background: var(--accent-warm); }
.flow-item:first-child .flow-step::before,
.flow-item:last-child  .flow-step::after { display: none; }
.flow-step .fs-num  { font-family: var(--font-mono); font-size: .68rem; color: var(--accent); letter-spacing: .08em; }
.flow-step .fs-name { font-family: var(--font-mono); font-size: .82rem; font-weight: 500; line-height: 1.3; }
.flow-step:hover { border-color: var(--accent); }
.flow-step[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.flow-desc { font-size: .92rem; color: var(--text-2); }
.flow-desc p { margin: 0; }

.flow-detail {
  margin-top: 1.1rem; padding: 1rem 1.1rem;
  background: var(--bg-2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  min-height: 90px;
}
.flow-detail:empty { display: none; }
.flow-detail .fd-title { font-family: var(--font-display); font-weight: 600; margin-bottom: .4rem; display: flex; align-items: center; gap: .5rem; }
.flow-detail .fd-title .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.flow-detail p { font-size: .92rem; color: var(--text-2); margin: 0; }
.flow-hint { font-size: .8rem; color: var(--muted); margin-top: .7rem; }

/* Sans JavaScript : liste verticale avec toutes les descriptions */
.flow:not(.is-enhanced) .flow-steps { flex-direction: column; align-items: stretch; }
.flow:not(.is-enhanced) .flow-item { flex-direction: column; align-items: stretch; }
.flow:not(.is-enhanced) .flow-item + .flow-item::before { content: "↓"; text-align: center; margin: .35rem 0; }
.flow:not(.is-enhanced) .flow-step { max-width: none; cursor: default; }
.flow:not(.is-enhanced) .flow-desc { margin: .5rem .2rem 0; }

/* Avec JavaScript : descriptions dans le panneau */
.flow.is-enhanced .flow-desc { display: none; }

/* --- Frise chronologique ------------------------------------------------- */
.timeline { position: relative; margin-top: 1.6rem; padding-left: 1.6rem; }
.timeline::before { content: ""; position: absolute; left: 5px; top: .4rem; bottom: .4rem; width: 2px; background: var(--border-strong); }
.tl-item { position: relative; padding: 0 0 1.3rem; }
.tl-item::before {
  content: ""; position: absolute; left: -1.6rem; top: .35rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.tl-item .tl-date { font-family: var(--font-mono); font-size: .76rem; color: var(--accent); letter-spacing: .06em; }
.tl-item .tl-title { font-weight: 600; margin-top: .15rem; }
.tl-item .tl-desc { font-size: .9rem; color: var(--text-2); margin-top: .2rem; }

/* --- Diagramme de Gantt (HTML/CSS responsive, sans défilement) ----------
   Bureau : libellé | piste avec barre, semaines en abscisse.
   Téléphone : libellé + dates au-dessus d'une piste pleine largeur. */
.gantt {
  --g-lab: 236px;
  --g-avant: #e8833c;
  --g-line: color-mix(in srgb, var(--border) 80%, transparent);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; box-shadow: var(--shadow);
}
.g-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .45rem 1rem; margin-bottom: .9rem;
}
.g-title { font-family: var(--font-display); font-weight: 600; font-size: .92rem; color: var(--text); }
.g-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .74rem; color: var(--text-2); }
.g-legend span { display: inline-flex; align-items: center; gap: .38rem; white-space: nowrap; }
.g-legend .sw { display: inline-block; width: 14px; height: 8px; border-radius: 2px; }
.sw.esq, .g-bar.esq { background: var(--accent-warm); }
.sw.avant, .g-bar.avant { background: var(--g-avant); }
.sw.projet, .g-bar.projet { background: var(--accent); }
.sw.livr, .g-bar.livr { background: var(--accent-2); }
.g-legend .sw.today { height: 0; border-top: 2px dashed var(--danger); border-radius: 0; }

.g-row {
  display: grid; grid-template-columns: var(--g-lab) minmax(0, 1fr);
  align-items: center; column-gap: .8rem; min-height: 22px;
  border-radius: 4px;
}
.g-row:not(.g-axis):hover { background: var(--surface-2); }
.g-row:not(.g-axis):hover .g-label { color: var(--accent); }
.g-label { font-size: .78rem; line-height: 1.25; color: var(--text); padding: .12rem 0 .12rem .2rem; }
.g-phase { margin-top: .5rem; }
.g-phase .g-label {
  font-family: var(--font-display); font-weight: 600; font-size: .74rem;
  text-transform: uppercase; letter-spacing: .07em;
}
/* Dates : lues par les lecteurs d'écran, affichées sur téléphone */
.g-dates {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.g-track {
  position: relative; align-self: stretch; min-height: 22px;
  background-image: repeating-linear-gradient(90deg, var(--g-line) 0 1px, transparent 1px calc(100% / 16));
}
.g-bar {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 12px; min-width: 6px; border-radius: 3px;
}
.g-bar.phase { height: 5px; background: color-mix(in srgb, var(--text-2) 55%, transparent); }
.g-axis { min-height: 22px; margin-bottom: .25rem; }
.g-axis .g-track { background: none; border-bottom: 1px solid var(--border); }
.g-wk, .g-mo {
  position: absolute; bottom: 4px; padding-left: 3px;
  font-family: var(--font-mono); font-size: .66rem; color: var(--muted); white-space: nowrap;
}
.g-mo { display: none; }
/* Ligne de la semaine où le diagramme a été établi */
.g-chart.has-today .g-track::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--today);
  border-left: 2px dashed var(--danger); opacity: .85; pointer-events: none;
}

/* --- Schémas : version large / version téléphone ------------------------- */
.only-narrow { display: none; }
@media (max-width: 700px) {
  .only-wide { display: none; }
  .only-narrow { display: block; }
  .only-narrow svg { max-width: 400px; margin-inline: auto; }
}

/* --- Divers -------------------------------------------------------------- */
.lead-sep { width: 54px; height: 3px; background: var(--accent); border-radius: 2px; margin: 1.2rem 0; }
.pill-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.pill-list .pill { font-family: var(--font-mono); font-size: .76rem; padding: .3rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--text-2); background: var(--surface); }
.dl-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .9rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin: .8rem 0; }
.dl-row svg { width: 22px; height: 22px; color: var(--accent); flex: 0 0 auto; }
.dl-row .dl-meta { flex: 1 1 auto; min-width: 180px; }
.dl-row .dl-name { font-weight: 600; }
.dl-row .dl-sub { font-size: .82rem; color: var(--muted); }

/* ==========================================================================
   Sommaire mobile, colonne latérale, coupures de mots
   ========================================================================== */

/* Aucune URL ni ligne de code ne doit élargir la page */
.prose { overflow-wrap: break-word; }
.prose a, .prose code { overflow-wrap: anywhere; }

/* Colonne latérale (accueil) : toujours visible, sous le contenu sur mobile */
.layout.has-aside { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .layout.has-aside { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
}

/* Sommaire repliable (< 1000 px, là où la colonne latérale est masquée) */
.toc-mobile {
  margin: 0 0 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.toc-mobile summary {
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  min-height: 48px; padding: .7rem 1rem;
  font-family: var(--font-mono); font-size: .76rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-2); cursor: pointer;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after {
  content: ""; width: 9px; height: 9px; flex: 0 0 auto;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s ease;
}
.toc-mobile[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.prose .toc-mobile ol,
.toc-mobile ol { list-style: none; margin: 0; padding: 0 .5rem .4rem; border-top: 1px solid var(--border); }
.prose .toc-mobile li + li { margin-top: 0; }
.toc-mobile a {
  display: block; padding: .75rem .6rem;
  color: var(--text); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.toc-mobile li:last-child a { border-bottom: 0; }
.toc-mobile a:hover { color: var(--accent); }
@media (min-width: 1000px) { .toc-mobile { display: none; } }

/* ==========================================================================
   Adaptation tablette / smartphone
   ========================================================================== */

/* Tablettes et téléphones */
@media (max-width: 760px) {
  /* Pilules de chapitres : une ligne défilante au lieu d'un mur de boutons */
  .chapters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin: 1.1rem -1rem .2rem;
    padding: .25rem 1rem .5rem;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 30px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 30px), transparent 100%);
  }
  .chapters::-webkit-scrollbar { display: none; }
  .chapters a { flex: 0 0 auto; scroll-snap-align: center; padding: .6rem .9rem; }

  .page { padding-top: 1.9rem; }
  .page-head { margin-bottom: 1.4rem; }
  .gantt { padding: .6rem; }
}

/* Tableaux larges → cartes empilées */
@media (max-width: 640px) {
  table.stack-sm thead {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr { padding: .85rem 1rem .5rem; border-bottom: 1px solid var(--border); }
  table.stack-sm tbody tr:last-child { border-bottom: 0; }
  table.stack-sm tbody tr:hover { background: transparent; }
  table.stack-sm td { border: 0; padding: .2rem 0; }
  table.stack-sm td:first-child {
    font-family: var(--font-display); font-weight: 600; font-size: 1rem;
    color: var(--text); padding-bottom: .5rem;
  }
  table.stack-sm td:not(:first-child) {
    padding: .1rem 0 .1rem .8rem; margin-bottom: .55rem;
    border-left: 2px solid var(--border-strong);
  }
  table.stack-sm td[data-label]:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono); font-size: .68rem;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--accent); margin-bottom: .1rem;
  }
}

/* Téléphones */
@media (max-width: 600px) {
  /* Chaîne GNU Radio verticale ; description dépliée sous le bloc actif */
  .flow { padding: .9rem; }
  .flow.is-enhanced .flow-steps { flex-direction: column; align-items: stretch; gap: 0; padding: 4px 0; }
  .flow.is-enhanced .flow-item { flex-direction: column; align-items: stretch; }
  .flow.is-enhanced .flow-item + .flow-item::before { content: "↓"; text-align: center; margin: .3rem 0; }
  .flow-step {
    max-width: none; width: 100%;
    flex-direction: row; align-items: center; gap: .75rem;
    min-height: 50px;
  }
  /* Ports en haut / en bas dans la disposition verticale */
  .flow-step::before, .flow-step::after {
    top: auto; left: 50%; right: auto;
    width: 12px; height: 7px;
    transform: translateX(-50%);
  }
  .flow-step::before { top: -4px; }
  .flow-step::after  { bottom: -4px; }
  .flow.is-enhanced .flow-item.active .flow-desc {
    display: block;
    margin-top: .5rem; padding: .75rem .9rem;
    background: var(--bg-2);
    border: 1px solid var(--border); border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
  }
  .flow.is-enhanced .flow-detail { display: none; }

  /* Formules */
  .formula { padding: .85rem .9rem; }
  .formula .math { font-size: 1.05rem; }

  /* Code : retour à la ligne plutôt que défilement horizontal
     (le bouton « copier » copie toujours la commande d'un seul tenant) */
  .code code { font-size: .8rem; }
  .code pre { padding: .85rem .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }

  /* Gantt : libellé au-dessus, piste pleine largeur, mois en abscisse */
  .gantt { padding: .85rem .8rem .9rem; }
  .g-row { grid-template-columns: minmax(0, 1fr); row-gap: 4px; padding: 4px 0; }
  .g-row:not(.g-axis):hover { background: none; }
  .g-label {
    display: flex; justify-content: space-between; align-items: baseline; gap: .6rem;
    font-size: .82rem; padding: 0;
  }
  .g-dates {
    position: static; width: auto; height: auto; overflow: visible; clip-path: none;
    flex: 0 0 auto; font-family: var(--font-mono); font-size: .7rem; color: var(--muted);
  }
  .g-track { min-height: 10px; }
  .g-bar { height: 8px; }
  .g-bar.phase { height: 4px; }
  .g-phase { margin-top: .8rem; }
  .g-axis { padding: 0; }
  .g-axis .g-label { display: none; }
  .g-axis .g-track { min-height: 20px; }
  .g-wk { display: none; }
  .g-mo { display: block; }

  /* Calculateur */
  .calc { padding: 1rem; }
  .calc-out { grid-template-columns: 1fr 1fr; }
  .calc .stat { padding: .9rem; }
  .calc .stat-val { font-size: 1.35rem; }

  /* Formulaire */
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { justify-content: center; }

  /* Lignes de téléchargement */
  .dl-row .btn { width: 100%; justify-content: center; }

  /* Tableaux standards un peu plus compacts */
  th, td { padding: .6rem .7rem; }
  table { font-size: .88rem; }

  /* Façade YouTube */
  .yt-facade .yt-label { font-size: .9rem; }

  /* Réseaux des membres : cibles tactiles plus grandes */
  .social { width: 42px; height: 42px; }
  .person .p-name { min-width: 0; flex: 1 1 100%; }

  /* Césure des longs mots français sur écran étroit */
  .prose p, .prose li { -webkit-hyphens: auto; hyphens: auto; }
}

/* Petits téléphones */
@media (max-width: 480px) {
  /* Héros */
  .hero { padding-top: 2.6rem; }
  .hero-chain { font-size: .74rem; gap: .45rem .3rem; }
  .hero-chain .node { padding: .28rem .6rem; }
  .hero-cta .btn { flex: 1 1 100%; justify-content: center; }

  /* Résultats clés : 2 colonnes compactes */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .stat { padding: .9rem; }
  .stat .stat-val { font-size: 1.35rem; }
  .stat .stat-label { font-size: .8rem; }

  /* Cartes de chapitres compactes : numéro | titre + description | flèche */
  .card-grid { gap: .6rem; }
  .chapter-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "num title arrow" "num desc arrow";
    column-gap: .9rem; row-gap: .15rem;
    align-items: center;
    padding: .85rem 1rem;
  }
  .chapter-card .cc-num   { grid-area: num; align-self: start; padding-top: .2rem; }
  .chapter-card .cc-title { grid-area: title; font-size: 1rem; }
  .chapter-card .cc-desc  { grid-area: desc; font-size: .82rem; }
  .chapter-card .cc-arrow { grid-area: arrow; margin: 0; }

  /* Pied de page : liens plus faciles à toucher */
  .footer-grid li { padding: 0; }
  .footer-grid a { display: inline-block; padding: .45rem 0; }
  .credits li { padding: 0; }
  .credits a { display: inline-block; padding: .35rem 0; }

  .callout { padding: 1rem 1.05rem; }
  figure.fig { padding: .45rem; }
}

.dl-size { font-weight: 400; color: var(--muted); font-size: .85em; }

/* --- Mentions légales : fiche d'identité et tableau des données ---------- */
.updated { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.prose dl.facts {
  display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  margin-top: 1rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow);
}
.facts dt, .facts dd { padding: .75rem 1rem; border-bottom: 1px solid var(--border); margin: 0; }
.facts dt {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: var(--surface-2); display: flex; align-items: center;
}
.facts dd { color: var(--text); }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
table.data-table th[scope="row"] {
  width: 30%; min-width: 150px; background: var(--surface-2);
  font-family: var(--font-display); font-weight: 600; font-size: .86rem; color: var(--text);
}
table.data-table tbody tr:hover { background: transparent; }
@media (max-width: 600px) {
  .prose dl.facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { border-bottom: 0; padding-bottom: .15rem; background: transparent; }
  .facts dd { padding-top: 0; }
  table.data-table, table.data-table tbody, table.data-table tr,
  table.data-table th, table.data-table td { display: block; width: 100%; }
  table.data-table th[scope="row"] { border-bottom: 0; padding-bottom: .2rem; background: transparent; color: var(--accent); }
  table.data-table td { padding-top: 0; }
}

/* --- Page 404 ------------------------------------------------------------ */
.not-found .nf-code {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(5rem, 3rem + 12vw, 10rem); line-height: .9; letter-spacing: -.04em;
  margin-top: 1rem;
  background: repeating-linear-gradient(0deg, var(--accent) 0 3px, transparent 3px 6px);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: .9;
}
.not-found h1 { margin-top: .4rem; }
@media (prefers-reduced-motion: no-preference) {
  .not-found .nf-code { animation: nf-flicker 4s steps(1) infinite; }
}
@keyframes nf-flicker { 0%, 92%, 100% { opacity: .9; } 94% { opacity: .35; } 96% { opacity: .75; } }
