/* Fichier généré par scripts/build-css.mjs — NE PAS ÉDITER.
   Sources : 01-tokens.css, 02-reset.css, 03-base.css, 04-layout.css, 05-components.css, 06-hero.css, 07-motion.css, 08-utilities.css, 09-case.css
   Commande : npm run build:css */

/* ===== 01-tokens.css ===== */
/* ==========================================================================
   Design tokens
   Source unique de vérité pour couleurs, typographie, espacements, motion.
   Aucune valeur brute ne doit apparaître ailleurs que dans ce fichier.

   Couleurs en OKLCH : espace perceptuellement uniforme, ce qui garantit
   qu'un même écart de luminosité est perçu identiquement quelle que soit
   la teinte. Indispensable pour dériver une palette claire cohérente.
   ========================================================================== */

:root {
  color-scheme: dark light;

  /* --- Teintes de base ---------------------------------------------------
     Un seul neutre (bleu très désaturé) décliné en 8 paliers de luminosité.
     Le cast froid évite le gris « sale » du neutre pur. */
  --hue-neutral: 250;
  --chroma-neutral: 0.012;

  /* Accent : cyan technique. Lisible sur fond sombre comme clair. */
  --hue-accent: 195;

  /* --- Surfaces (thème sombre par défaut) -------------------------------- */
  --color-bg:            oklch(16% var(--chroma-neutral) var(--hue-neutral));
  --color-surface:       oklch(20% var(--chroma-neutral) var(--hue-neutral));
  --color-surface-raised:oklch(24% var(--chroma-neutral) var(--hue-neutral));
  --color-border:        oklch(30% var(--chroma-neutral) var(--hue-neutral));
  --color-border-strong: oklch(42% var(--chroma-neutral) var(--hue-neutral));

  /* --- Texte -------------------------------------------------------------
     3 niveaux seulement. Au-delà, la hiérarchie se brouille. */
  --color-text:      oklch(96% 0.004 var(--hue-neutral));
  --color-text-muted:oklch(72% 0.008 var(--hue-neutral));
  --color-text-faint:oklch(56% 0.010 var(--hue-neutral));

  /* --- Accent ------------------------------------------------------------ */
  --color-accent:        oklch(78% 0.13 var(--hue-accent));
  --color-accent-strong: oklch(86% 0.15 var(--hue-accent));
  --color-accent-dim:    oklch(78% 0.13 var(--hue-accent) / 0.12);

  /* --- Sémantique (badges de statut, métriques) -------------------------- */
  --color-success: oklch(78% 0.15 155);
  --color-warning: oklch(82% 0.14 85);
  --color-danger:  oklch(72% 0.17 25);

  /* --- Typographie -------------------------------------------------------
     Pile système : zéro requête réseau, zéro FOUT, rendu natif sur chaque
     plateforme. Choix de perf assumé et documenté dans le README. */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono",
               Menlo, Consolas, monospace;

  /* Échelle fluide : interpole entre 360px et 1440px de viewport.
     Supprime le besoin de media queries sur la typographie. */
  --step--1: clamp(0.8125rem, 0.79rem + 0.10vw, 0.875rem);
  --step-0:  clamp(1rem,      0.97rem + 0.13vw, 1.0625rem);
  --step-1:  clamp(1.1875rem, 1.12rem + 0.32vw, 1.375rem);
  --step-2:  clamp(1.4375rem, 1.32rem + 0.55vw, 1.75rem);
  --step-3:  clamp(1.75rem,   1.55rem + 0.90vw, 2.25rem);
  --step-4:  clamp(2.125rem,  1.80rem + 1.45vw, 3rem);
  --step-5:  clamp(2.5rem,    1.95rem + 2.45vw, 4rem);

  --leading-tight: 1.15;
  --leading-snug:  1.35;
  --leading-normal:1.65;

  --tracking-tight: -0.02em;
  --tracking-wide:  0.08em;

  /* --- Espacements -------------------------------------------------------
     Échelle géométrique en rem. Les sections utilisent des valeurs fluides
     pour respirer sur grand écran sans étouffer sur mobile. */
  --space-2xs: 0.25rem;
  --space-xs:  0.5rem;
  --space-sm:  0.75rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  --space-4xl: clamp(5rem, 3rem + 8vw, 9rem);

  /* --- Mise en page ------------------------------------------------------ */
  --width-prose: 68ch;   /* longueur de ligne lisible */
  --width-content: 72rem;
  --gutter: clamp(1.25rem, 0.9rem + 1.6vw, 2.5rem);

  /* --- Rayons ------------------------------------------------------------ */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-full: 999px;

  /* --- Élévation ---------------------------------------------------------
     Sur fond sombre l'ombre porte mal : l'élévation passe d'abord par la
     bordure et la luminosité de surface, l'ombre n'est qu'un appoint. */
  --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.30);
  --shadow-md: 0 4px 16px -4px oklch(0% 0 0 / 0.40);
  --shadow-lg: 0 16px 48px -12px oklch(0% 0 0 / 0.55);

  /* --- Motion ------------------------------------------------------------
     Durées courtes, easing sortant : l'interface répond, elle ne défile pas. */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 120ms;
  --duration-base: 220ms;
  --duration-slow: 420ms;
}

/* --- Thème clair ---------------------------------------------------------
   Redéfinit uniquement les tokens de surface et de texte : la structure,
   les espacements et la typographie sont invariants.
   Deux sélecteurs : préférence système, puis choix explicite de l'utilisateur
   (qui doit gagner dans les deux sens). */

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --color-bg:             oklch(98.5% 0.003 var(--hue-neutral));
    --color-surface:        oklch(100% 0 0);
    --color-surface-raised: oklch(100% 0 0);
    --color-border:         oklch(90% 0.006 var(--hue-neutral));
    --color-border-strong:  oklch(78% 0.010 var(--hue-neutral));

    --color-text:       oklch(22% 0.015 var(--hue-neutral));
    --color-text-muted: oklch(45% 0.014 var(--hue-neutral));
    --color-text-faint: oklch(58% 0.012 var(--hue-neutral));

    --color-accent:        oklch(52% 0.13 var(--hue-accent));
    --color-accent-strong: oklch(44% 0.14 var(--hue-accent));
    --color-accent-dim:    oklch(52% 0.13 var(--hue-accent) / 0.10);

    --color-success: oklch(50% 0.14 155);
    --color-warning: oklch(58% 0.13 85);
    --color-danger:  oklch(52% 0.18 25);

    --shadow-sm: 0 1px 2px oklch(50% 0.02 var(--hue-neutral) / 0.08);
    --shadow-md: 0 4px 16px -4px oklch(50% 0.02 var(--hue-neutral) / 0.12);
    --shadow-lg: 0 16px 48px -12px oklch(50% 0.02 var(--hue-neutral) / 0.18);
  }
}

:root[data-theme="light"] {
  --color-bg:             oklch(98.5% 0.003 var(--hue-neutral));
  --color-surface:        oklch(100% 0 0);
  --color-surface-raised: oklch(100% 0 0);
  --color-border:         oklch(90% 0.006 var(--hue-neutral));
  --color-border-strong:  oklch(78% 0.010 var(--hue-neutral));

  --color-text:       oklch(22% 0.015 var(--hue-neutral));
  --color-text-muted: oklch(45% 0.014 var(--hue-neutral));
  --color-text-faint: oklch(58% 0.012 var(--hue-neutral));

  --color-accent:        oklch(52% 0.13 var(--hue-accent));
  --color-accent-strong: oklch(44% 0.14 var(--hue-accent));
  --color-accent-dim:    oklch(52% 0.13 var(--hue-accent) / 0.10);

  --color-success: oklch(50% 0.14 155);
  --color-warning: oklch(58% 0.13 85);
  --color-danger:  oklch(52% 0.18 25);

  --shadow-sm: 0 1px 2px oklch(50% 0.02 var(--hue-neutral) / 0.08);
  --shadow-md: 0 4px 16px -4px oklch(50% 0.02 var(--hue-neutral) / 0.12);
  --shadow-lg: 0 16px 48px -12px oklch(50% 0.02 var(--hue-neutral) / 0.18);
}

/* ===== 02-reset.css ===== */
/* ==========================================================================
   Reset
   Minimal et justifié : chaque règle corrige un comportement par défaut
   réellement gênant, aucune n'est là « par habitude ».
   ========================================================================== */

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

/* Marges par défaut supprimées : l'espacement est piloté par les composants
   et le flux (voir .flow), jamais hérité du user-agent. */
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100svh;
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Les médias sont bloc par défaut : supprime l'espace fantôme sous les images
   dû à leur alignement sur la ligne de base du texte. */
img, picture, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

/* Exposants et indices sans effet sur l'interligne : sans cela, « 2<sup>e</sup> »
   écarte la ligne qui le contient des lignes voisines. */
sub, sup { font-size: 0.7em; line-height: 0; position: relative; vertical-align: baseline; }
sup { top: -0.5em; }
sub { bottom: -0.25em; }

/* Évite les débordements horizontaux sur les mots longs (URL, identifiants). */
p, li, h1, h2, h3, h4 { overflow-wrap: break-word; }

/* Ancres : compense la hauteur de l'en-tête collant lors d'un saut d'ancre. */
:target { scroll-margin-top: var(--space-3xl); }

/* Respect strict de la préférence système : on neutralise les animations
   plutôt que de les raccourcir — une animation à 1ms reste une animation. */
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

/* ===== 03-base.css ===== */
/* ==========================================================================
   Base : typographie, liens, focus, sélection
   ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  background-color: var(--color-bg);
  color: var(--color-text);
}

h1, h2, h3, h4 {
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 650;
  text-wrap: balance;      /* évite les titres à un mot orphelin sur la dernière ligne */
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { text-wrap: pretty; }   /* évite les veuves en fin de paragraphe */

a {
  color: inherit;
  text-decoration-color: color-mix(in oklch, currentColor 35%, transparent);
  text-underline-offset: 0.2em;
  transition: color var(--duration-fast) var(--ease-out),
              text-decoration-color var(--duration-fast) var(--ease-out);
}

a:hover { text-decoration-color: currentColor; }

/* Focus : visible uniquement au clavier (:focus-visible), jamais supprimé.
   Double contour clair/sombre pour rester perceptible sur toute surface. */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

::selection {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

/* Barre de défilement accordée au thème (WebKit + Firefox). */
* { scrollbar-color: var(--color-border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: var(--color-border-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg);
}

code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.925em; }

code {
  background-color: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.12em 0.36em;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-2xl);
}

/* Lien d'évitement : premier élément focusable de chaque page. */
.skip-link {
  position: absolute;
  inset-inline-start: var(--space-md);
  inset-block-start: var(--space-md);
  z-index: 100;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-accent);
  color: var(--color-bg);
  font-weight: 600;
  border-radius: var(--radius-md);
  transform: translateY(-200%);
  transition: transform var(--duration-base) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* Réservé aux lecteurs d'écran. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ===== 04-layout.css ===== */
/* ==========================================================================
   Mise en page : conteneurs, flux vertical, en-tête, pied de page
   ========================================================================== */

/* --- Conteneurs -----------------------------------------------------------
   Une seule source de gouttière (--gutter), fluide. Aucune media query. */
.container {
  width: 100%;
  max-width: var(--width-content);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-3xl); }
.section--tight { padding-block: var(--space-2xl); }

/* --- Flux vertical --------------------------------------------------------
   Espacement entre frères, sans marge sur le premier élément : évite les
   effondrements de marges et les `:first-child { margin-top: 0 }` partout. */
.flow > * + * { margin-block-start: var(--flow-space, var(--space-md)); }
.flow--lg > * + * { --flow-space: var(--space-lg); }

/* --- En-tête --------------------------------------------------------------
   Collant, avec fond translucide flouté. La bordure n'apparaît qu'une fois
   la page défilée (classe posée par assets/js/lib/header.js). */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: color-mix(in oklch, var(--color-bg) 82%, transparent);
  border-block-end: 1px solid transparent;
  transition: border-color var(--duration-base) var(--ease-out),
              background-color var(--duration-base) var(--ease-out);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-header {
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    backdrop-filter: blur(12px) saturate(140%);
  }
}
.site-header[data-scrolled="true"] { border-block-end-color: var(--color-border); }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  min-height: 4rem;
}

.site-header__brand {
  font-weight: 680;
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
  margin-inline-end: auto;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(var(--space-sm), 2vw, var(--space-lg));
}
.site-nav a {
  font-size: var(--step--1);
  color: var(--color-text-muted);
  text-decoration: none;
  padding-block: var(--space-2xs);
  position: relative;
}
.site-nav a:hover { color: var(--color-text); }
.site-nav a[aria-current="page"] { color: var(--color-text); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: -2px;
  height: 2px;
  background-color: var(--color-accent);
  border-radius: var(--radius-full);
}

/* --- Pied de page --------------------------------------------------------- */
.site-footer {
  border-block-start: 1px solid var(--color-border);
  margin-block-start: var(--space-4xl);
  padding-block: var(--space-2xl);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-xl);
  align-items: center;
  justify-content: space-between;
}
.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-lg);
}
.site-footer a { color: var(--color-text-muted); text-decoration: none; }

.social { display: flex; gap: var(--space-xs); list-style: none; padding: 0; margin: 0; }
.site-footer a:hover { color: var(--color-text); }

/* --- Grilles génériques ---------------------------------------------------
   `auto-fit` + `minmax` : le nombre de colonnes se déduit de la largeur
   disponible. Pas de point de rupture à maintenir. */
.grid-auto {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(min(var(--col-min, 20rem), 100%), 1fr));
}
.grid-auto--sm { --col-min: 14rem; }

/* ===== 05-components.css ===== */
/* ==========================================================================
   Composants
   ========================================================================== */

/* --- Étiquette technique --------------------------------------------------
   Monospace + majuscules : marque visuellement tout ce qui est « donnée
   technique » (stack, métrique, rôle) par opposition au texte rédigé.
   Coût réseau nul : aucune police n'est téléchargée. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
}

.lede {
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
  max-width: 54ch;
  text-wrap: pretty;
}

/* --- Boutons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background-color: transparent;
  color: var(--color-text);
  font-size: var(--step--1);
  font-weight: 560;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.btn:hover { background-color: var(--color-surface-raised); border-color: var(--color-text-faint); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: oklch(18% 0.02 var(--hue-neutral));
  font-weight: 620;
}
.btn--primary:hover {
  background-color: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
  color: oklch(18% 0.02 var(--hue-neutral));
}

.btn--ghost { border-color: transparent; padding-inline: 0.5rem; }
.btn--ghost:hover { background-color: var(--color-surface-raised); border-color: transparent; }

/* Icône du bouton : suit la taille du texte plutôt qu'une taille fixe. */
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

/* --- Bouton-icône ---------------------------------------------------------
   Carré de 2.25rem : bouton de thème et liens vers les réseaux. */
.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.25rem; height: 2.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out);
}
.icon-btn:hover { color: var(--color-text); border-color: var(--color-border-strong); }
.icon-btn svg { width: 1.05rem; height: 1.05rem; }

/* Libellé d'un bouton-icône : invisible au repos, affiché en infobulle au survol
   et au focus clavier. C'est aussi le nom accessible du lien — un aria-label en
   plus le ferait lire deux fois. Libellés courts obligatoires : même invisible,
   l'infobulle occupe de la place et déborderait de l'écran près d'un bord. */
.icon-btn__label {
  position: absolute;
  inset-block-end: calc(100% + 0.45rem);
  inset-inline-start: 50%;
  translate: -50% 0.25rem;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  background-color: var(--color-text);
  color: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-out),
              translate var(--duration-fast) var(--ease-out);
}
.icon-btn:hover .icon-btn__label,
.icon-btn:focus-visible .icon-btn__label { opacity: 1; translate: -50% 0; }

/* --- Bouton de thème ------------------------------------------------------ */
/* L'icône affichée dépend du thème effectif : une seule est visible. */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun,
:root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon,
:root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun  { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: block; }
}
:root[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* --- Pastilles de stack --------------------------------------------------- */
.tags { display: flex; flex-wrap: wrap; gap: var(--space-xs); }

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  background-color: var(--color-surface);
  white-space: nowrap;
}
.tag--accent {
  color: var(--color-accent);
  border-color: color-mix(in oklch, var(--color-accent) 40%, transparent);
  background-color: var(--color-accent-dim);
}

/* --- Carte projet --------------------------------------------------------- */
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
.project-card:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
/* Le focus clavier doit rendre la carte entière visible, pas seulement le lien. */
.project-card:has(a:focus-visible) {
  border-color: var(--color-accent);
  transform: translateY(-3px);
}
.project-card:has(a:focus-visible) a::after { outline: none; }

.project-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background-color: var(--color-bg);
  border-block-end: 1px solid var(--color-border);
  overflow: hidden;
}
.project-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform var(--duration-slow) var(--ease-out);
}
.project-card:hover .project-card__media img { transform: scale(1.03); }

.project-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  flex: 1;
}
.project-card__title { font-size: var(--step-1); }

/* Lien étendu : toute la carte est cliquable, mais un seul lien existe dans
   l'arbre d'accessibilité (pas de duplication pour les lecteurs d'écran). */
.project-card__title a { text-decoration: none; }
.project-card__title a::after { content: ""; position: absolute; inset: 0; }

.project-card__summary { color: var(--color-text-muted); font-size: var(--step--1); flex: 1; }

.project-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-faint);
}

/* --- Bandeau de métriques -------------------------------------------------
   Le chiffre porte l'information : il est plus grand que son libellé et
   aligné sur une grille tabulaire pour rester stable pendant l'animation. */
.metrics {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr));
}
.metric {
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
}
.metric__value {
  font-family: var(--font-mono);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}
.metric__label {
  margin-block-start: var(--space-2xs);
  font-size: var(--step--1);
  color: var(--color-text-muted);
  line-height: var(--leading-snug);
}

/* --- Bloc d'étude de cas --------------------------------------------------
   Barre latérale colorée : signale d'un coup d'œil la nature du bloc
   (problème / décision / difficulté / résultat) sans dépendre du seul texte. */
.case-block {
  border-inline-start: 2px solid var(--color-border-strong);
  padding-inline-start: var(--space-lg);
}
.case-block + .case-block { margin-block-start: var(--space-2xl); }
.case-block--problem  { border-inline-start-color: var(--color-warning); }
.case-block--decision { border-inline-start-color: var(--color-accent); }
.case-block--hurdle   { border-inline-start-color: var(--color-danger); }
.case-block--result   { border-inline-start-color: var(--color-success); }

.case-block__title {
  font-size: var(--step-1);
  margin-block-end: var(--space-sm);
}

/* --- Décision technique (choix + alternative écartée) --------------------- */
.decision {
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
}
.decision + .decision { margin-block-start: var(--space-md); }
.decision__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-sm);
  margin-block-end: var(--space-sm);
}
.decision__title { font-size: var(--step-0); font-weight: 640; }
.decision__rejected {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-text-faint);
  text-decoration: line-through;
  text-decoration-color: var(--color-danger);
}
.decision p { color: var(--color-text-muted); font-size: var(--step--1); }

/* --- Schéma d'architecture ------------------------------------------------ */
.diagram {
  margin-block: var(--space-xl);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface);
  overflow-x: auto;
}
.diagram svg { width: 100%; min-width: 34rem; height: auto; }
.diagram figcaption {
  margin-block-start: var(--space-md);
  font-size: var(--step--1);
  color: var(--color-text-faint);
  text-align: center;
}
/* Le SVG hérite des couleurs du thème : un seul schéma pour clair et sombre. */
.diagram .d-surface { fill: var(--color-bg); }
.diagram .d-box     { fill: var(--color-surface-raised); stroke: var(--color-border-strong); }
.diagram .d-box-accent { fill: var(--color-accent-dim); stroke: var(--color-accent); }
.diagram .d-line    { stroke: var(--color-border-strong); fill: none; }
.diagram .d-line-accent { stroke: var(--color-accent); fill: none; }
.diagram .d-text    { fill: var(--color-text); font-family: var(--font-mono); font-size: 11px; }
.diagram .d-text-muted { fill: var(--color-text-muted); font-family: var(--font-mono); font-size: 9.5px; }
.diagram .d-zone    { fill: none; stroke: var(--color-border); stroke-dasharray: 4 4; }

/* --- Capture d'écran d'application --------------------------------------- */
.shot {
  margin-block: var(--space-xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--color-surface);
}
.shot img { width: 100%; }
.shot figcaption {
  padding: var(--space-sm) var(--space-md);
  border-block-start: 1px solid var(--color-border);
  font-size: var(--step--1);
  color: var(--color-text-muted);
}

/* --- Encart d'avertissement ----------------------------------------------- */
.callout {
  padding: var(--space-md) var(--space-lg);
  border: 1px solid color-mix(in oklch, var(--color-warning) 35%, transparent);
  border-radius: var(--radius-md);
  background-color: color-mix(in oklch, var(--color-warning) 8%, transparent);
  font-size: var(--step--1);
}
.callout strong { color: var(--color-warning); }

/* --- Liste de faits (clé / valeur) ---------------------------------------- */
.facts {
  display: grid;
  gap: var(--space-sm) var(--space-lg);
  grid-template-columns: auto 1fr;
  font-size: var(--step--1);
}
.facts dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-faint);
  padding-block-start: 0.15em;
}
.facts dd { margin: 0; color: var(--color-text); }

@media (max-width: 30rem) {
  .facts { grid-template-columns: 1fr; gap: var(--space-2xs); }
  .facts dd + dt { margin-block-start: var(--space-sm); }
}

/* --- Table des matières d'étude de cas ------------------------------------ */
.toc {
  position: sticky;
  top: calc(4rem + var(--space-md));
  align-self: start;
  font-size: var(--step--1);
}
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-xs); }
.toc a {
  color: var(--color-text-faint);
  text-decoration: none;
  display: block;
  padding-inline-start: var(--space-sm);
  border-inline-start: 2px solid var(--color-border);
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}
.toc a:hover { color: var(--color-text); }
.toc a[data-active="true"] { color: var(--color-accent); border-inline-start-color: var(--color-accent); }

/* ===== 06-hero.css ===== */
/* ==========================================================================
   Section d'accueil
   ========================================================================== */

.hero {
  position: relative;
  display: grid;
  align-content: center;
  /* Hauteur fluide plutôt que 100vh : sur mobile en paysage, 100vh remplit
     l'écran et pousse tout le contenu hors champ. `svh` + min() borne le cas. */
  min-height: min(38rem, 82svh);
  padding-block: var(--space-4xl) var(--space-3xl);
  overflow: hidden;
}

/* Grille technique de fond, générée en CSS (aucune image, aucun octet). */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--color-border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--color-border) 1px, transparent 1px);
  background-size: 3.5rem 3.5rem;
  /* Estompe la grille vers les bords : elle suggère sans distraire. */
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 20%, transparent 78%);
  opacity: 0.55;
}

.hero__inner { display: grid; gap: var(--space-lg); max-width: 46rem; }

.hero__title {
  font-size: var(--step-5);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* Le rôle est la première information lue : il est accentué, pas le nom. */
.hero__title em {
  font-style: normal;
  color: var(--color-accent);
}

.hero__subtitle {
  font-size: var(--step-1);
  color: var(--color-text-muted);
  max-width: 44ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-block-start: var(--space-sm);
}

/* Bandeau d'état : signale une disponibilité, format « données ». */
.status-line {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--color-text-muted);
}
.status-line__dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--color-success);
  flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .status-line__dot { animation: pulse 2.4s var(--ease-in-out) infinite; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--color-success) 55%, transparent); }
  55%      { box-shadow: 0 0 0 0.32rem color-mix(in oklch, var(--color-success) 0%, transparent); }
}

/* ===== 07-motion.css ===== */
/* ==========================================================================
   Micro-interactions
   Principe : l'animation sert à situer un élément dans l'espace ou le temps.
   Aucune animation décorative, aucune durée au-delà de 420 ms.
   ========================================================================== */

/* --- Apparition au défilement ---------------------------------------------
   L'état initial n'est appliqué QUE si JavaScript est actif (classe posée sur
   <html> par le script d'amorçage). Sans JS, le contenu est visible d'emblée :
   aucune régression si le script échoue ou est bloqué. */
.js .reveal {
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.js .reveal[data-revealed="true"] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}

/* --- Transitions de page (View Transitions API) ---------------------------
   Amélioration progressive : ignorée par les navigateurs qui ne l'implémentent
   pas, qui affichent alors une navigation classique. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  ::view-transition-old(root) {
    animation: vt-out 140ms var(--ease-in-out) both;
  }
  ::view-transition-new(root) {
    animation: vt-in 220ms var(--ease-out) both;
  }
}

@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(0.5rem); } }

/* Le titre de l'étude de cas se déplace d'une page à l'autre plutôt que de
   disparaître : la continuité rend la navigation lisible. */
.vt-title { view-transition-name: case-title; }

/* Étagement des apparitions.
   Réalisé en CSS via :nth-child plutôt qu'en JavaScript : le CSP interdit les
   styles en ligne, et l'information « position dans la grille » est déjà
   connue du sélecteur. Plafonné au 5e élément — au-delà, le décalage est
   perçu comme une latence et non comme un effet. */
.js .reveal:nth-child(2) { transition-delay: 60ms; }
.js .reveal:nth-child(3) { transition-delay: 120ms; }
.js .reveal:nth-child(4) { transition-delay: 180ms; }
.js .reveal:nth-child(n + 5) { transition-delay: 240ms; }

/* ===== 08-utilities.css ===== */
/* ==========================================================================
   Utilitaires
   Volontairement peu nombreux : ils couvrent l'espacement vertical entre
   blocs et quelques variantes de composants. Tout le reste appartient à un
   composant nommé.

   Note : le CSP du site interdit les styles en ligne (`style-src 'self'`,
   voir public/_headers). Ces classes ne sont donc pas une préférence
   esthétique — aucun attribut `style=""` ne peut exister dans ce projet.
   ========================================================================== */

.mt-sm  { margin-block-start: var(--space-sm); }
.mt-md  { margin-block-start: var(--space-md); }
.mt-lg  { margin-block-start: var(--space-lg); }
.mt-xl  { margin-block-start: var(--space-xl); }
.mt-2xl { margin-block-start: var(--space-2xl); }

.h-sm { font-size: var(--step-0); }

/* Borne la largeur d'un bloc de texte sans le recentrer : son bord gauche reste
   aligné sur la grille de la page. */
.measure { max-width: 46rem; }

/* Grille des cartes projet : colonnes un peu plus larges que la valeur par
   défaut, pour que la capture d'écran reste lisible. */
.grid-auto--cards { --col-min: 22rem; }

/* Variante « schéma » de la zone média d'une carte : pas de capture d'écran,
   un diagramme vectoriel centré. */
.project-card__media--diagram {
  display: grid;
  place-items: center;
  padding: var(--space-lg);
  color: var(--color-text-muted);
}
.project-card__media--diagram svg { width: 100%; height: auto; }

/* Sentinelle de l'en-tête (voir assets/js/lib/header.js) : élément de 1 px
   observé en haut de page. Défini ici plutôt qu'en JS, styles en ligne interdits. */
.scroll-sentinel {
  position: absolute;
  inset-block-start: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}

/* ===== 09-case.css ===== */
/* ==========================================================================
   Étude de cas
   ========================================================================== */

.case-hero { padding-block: var(--space-3xl) var(--space-xl); }

.case-hero__title {
  font-size: var(--step-4);
  max-width: 20ch;
  margin-block-start: var(--space-sm);
}

.case-hero__lede {
  font-size: var(--step-1);
  color: var(--color-text-muted);
  max-width: 58ch;
  margin-block-start: var(--space-lg);
  text-wrap: pretty;
}

/* Bandeau de faits : rôle, période, stack, état. Première chose lue après le
   titre — un recruteur doit situer le projet sans lire un paragraphe. */
.case-facts {
  margin-block-start: var(--space-xl);
  padding-block: var(--space-lg);
  border-block: 1px solid var(--color-border);
}

/* Disposition à deux colonnes : sommaire collant + contenu.
   Sous 64rem, le sommaire disparaît : sur mobile la lecture est linéaire et
   une navigation secondaire coûterait plus d'écran qu'elle n'en fait gagner.
   Le contenu reste atteignable par ses titres (landmarks + hiérarchie h2/h3). */
/* minmax(0, 1fr) et non la piste implicite `auto` : un élément de grille a
   `min-width: auto` par défaut et s'élargit jusqu'à la largeur minimale de son
   contenu. Sans ce correctif, un schéma de 34rem étire la colonne au-delà de
   l'écran mobile au lieu de défiler dans son propre conteneur. */
.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2xl);
}

@media (min-width: 64rem) {
  .case-layout {
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: var(--space-3xl);
    align-items: start;
  }
}
@media (max-width: 63.99rem) {
  .case-layout__aside { display: none; }
}

.case-section + .case-section { margin-block-start: var(--space-3xl); }

.case-section__title {
  font-size: var(--step-2);
  padding-block-end: var(--space-sm);
  border-block-end: 1px solid var(--color-border);
  margin-block-end: var(--space-lg);
}

.case-section p { color: var(--color-text-muted); max-width: var(--width-prose); }
.case-section p + p { margin-block-start: var(--space-md); }

.case-section ul:not(.tags) {
  color: var(--color-text-muted);
  max-width: var(--width-prose);
  padding-inline-start: 1.15rem;
  margin-block-start: var(--space-md);
}
.case-section ul:not(.tags) li + li { margin-block-start: var(--space-xs); }
.case-section ul:not(.tags) li::marker { color: var(--color-accent); }

.case-section strong { color: var(--color-text); font-weight: 620; }

/* Navigation de fin de page vers l'étude de cas suivante. */
.case-next {
  margin-block-start: var(--space-3xl);
  padding-block-start: var(--space-xl);
  border-block-start: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
}

/* Portrait : taille bornée, jamais étiré sur la largeur de la colonne. */
.portrait {
  width: min(16rem, 60%);
  margin-block-end: var(--space-xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--color-surface);
}
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; }
