/* Généré par dev/tools/lib/styles.mjs — sources : dev/site/css/ */

/* ===== /css/reset.css ===== */
/* Reset minimaliste */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

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

body {
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
}

ol,
ul {
  padding: 0;
}

p,
h1,
h2,
h3,
h4 {
  overflow-wrap: break-word;
}

[hidden] {
  display: none !important;
}

/* Sprite d'icônes SVG : présent dans le DOM mais invisible */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ===== /css/variables.css ===== */
/* Design tokens : typographie, espacements, couleurs (clair / sombre / matrix) */
:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2.5rem;

  --gutter: clamp(16px, 4vw, 32px);
  --max-width: 1200px;
  --radius: 20px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 150ms;
  --dur: 300ms;
  --dur-slow: 700ms;

  /* Thème clair */
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --text: #1b1b1f;
  --text-muted: #55555f;
  --border: #dfe4ee;
  --accent: #3451c7;
  --accent-hover: #2a43a8;
  --accent-contrast: #ffffff;
  --accent-soft: #e8ecff;
  --success: #2f9e44;
  /* Statuts du profil (status.js) */
  --status-open: var(--success);
  --status-employed: var(--accent);
  --status-freelance: #7048e8;
  --status-searching: #e8590c;
  --glow: rgba(52, 81, 199, 0.16);
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.04), 0 8px 24px rgba(20, 20, 30, 0.06);
  --terminal-bg: #111216;
  --terminal-text: #d6f5d6;
  --terminal-accent: #7ee787;
}

:root[data-theme="dark"] {
  --bg: #080b14;
  --surface: #11141d;
  --surface-2: #181c27;
  --text: #ececf1;
  --text-muted: #a3a3b0;
  --border: #252a38;
  --accent: #8ea2ff;
  --accent-hover: #aab9ff;
  --accent-contrast: #0f1014;
  --accent-soft: #232845;
  --success: #51cf66;
  --status-freelance: #b197fc;
  --status-searching: #ff922b;
  --glow: rgba(142, 162, 255, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Mode secret activé par le Konami code */
:root.matrix-mode {
  --bg: #000000;
  --surface: rgba(0, 20, 0, 0.82);
  --surface-2: rgba(0, 40, 0, 0.9);
  --text: #b6ffb6;
  --text-muted: #6fdc6f;
  --border: #0f5f0f;
  --accent: #39ff14;
  --accent-hover: #7dff63;
  --accent-contrast: #000000;
  --accent-soft: #062a06;
  --success: #39ff14;
  --glow: rgba(57, 255, 20, 0.2);
  --font-sans: var(--font-mono);
}

/* ===== /css/layout.css ===== */
/* Structure générale : header, grille Bento (mobile-first), footer */
body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.site-header,
.bento,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Grille Bento */
.bento {
  flex: 1;
  width: min(100% - 2 * var(--gutter), var(--max-width));
  margin-inline: auto;
  padding-block: var(--space-4) var(--space-6);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "profile"
    "actions"
    "about"
    "toc"
    "skills"
    "softskills"
    "experience"
    "education"
    "misc"
    "projects";
  outline: none;
}

.card--profile { grid-area: profile; }
.card--actions { grid-area: actions; }
.card--about { grid-area: about; }
.cv-toc { grid-area: toc; }
.card--skills { grid-area: skills; }
.card--softskills { grid-area: softskills; }
.card--experience { grid-area: experience; }
.card--education { grid-area: education; }
.card--misc { grid-area: misc; }
.card--projects { grid-area: projects; }

@media (min-width: 720px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "profile profile"
      "about actions"
      "toc toc"
      "skills skills"
      "softskills softskills"
      "experience experience"
      "education education"
      "misc misc"
      "projects projects";
  }
}

@media (min-width: 1100px) {
  .bento {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "profile profile actions"
      "about about actions"
      "toc toc toc"
      "skills skills skills"
      "softskills softskills softskills"
      "experience experience education"
      "misc misc misc"
      "projects projects projects";
  }
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: min(100% - 2 * var(--gutter), var(--max-width));
  margin-inline: auto;
  padding-block: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.noscript {
  padding: var(--space-4) var(--gutter);
  text-align: center;
}

/* ===== /css/components.css ===== */
/* Composants : cartes, boutons, badges, timeline, toasts, terminal… */

/* Accessibilité */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-contrast);
}

/* Masqué (mais lisible par les lecteurs d'écran) tant qu'il n'a pas le focus clavier.
   Un simple décalage hors écran le laissait apparaître lors du rebond de défilement (macOS). */
.skip-link:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

.icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
}

/* Cartes */
.card {
  position: relative;
  overflow: hidden;
  padding: clamp(var(--space-4), 3vw, var(--space-5));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform var(--dur) var(--ease);
}

/* Halo lumineux qui suit le curseur (déplacé via transform uniquement) */
.card::after {
  content: "";
  position: absolute;
  top: -160px;
  left: -160px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 70%);
  opacity: 0;
  transform: translate(var(--gx, 0px), var(--gy, 0px));
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}

.card.is-hovered::after {
  opacity: 1;
}

.card.is-hovered {
  transition: transform var(--dur-fast) linear;
}

.card-title {
  margin-bottom: var(--space-4);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Profil */
.card--profile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(88px, 18vw, 120px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--accent-contrast);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-text {
  flex: 1 1 260px;
  min-width: 0;
}

.profile-name {
  font-size: var(--fs-xl);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.profile-title {
  margin-top: var(--space-2);
  font-size: var(--fs-lg);
  color: var(--text-muted);
}

.profile-location {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* Statuts du profil (plusieurs possibles) : couleur par data-status, texte toujours en --text */
.status-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
}

.status {
  --status-color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid color-mix(in srgb, var(--status-color) 45%, var(--border));
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--status-color) 10%, var(--surface-2));
  font-size: var(--fs-xs);
  font-weight: 500;
}

.status[data-status="open"] {
  --status-color: var(--status-open);
}

.status[data-status="employed"] {
  --status-color: var(--status-employed);
}

.status[data-status="freelance"] {
  --status-color: var(--status-freelance);
}

.status[data-status="searching"] {
  --status-color: var(--status-searching);
}

.status-dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-color);
}

/* Boutons */
.actions {
  display: grid;
  gap: var(--space-2);
}

.btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.875rem;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease);
}

.btn:hover {
  border-color: var(--accent);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn.is-success {
  border-color: var(--success);
}

.email-plain {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  user-select: all;
  overflow-wrap: anywhere;
}

/* Texte riche (Markdown) */
.prose > * + * {
  margin-top: var(--space-3);
}

.prose ul,
.prose ol {
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: var(--space-1);
}

.prose a {
  color: var(--accent);
  text-underline-offset: 2px;
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.prose blockquote {
  padding-left: var(--space-3);
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}

.prose h4,
.prose h5 {
  font-size: var(--fs-base);
}

/* ---------- Compétences : carte mentale (liens tracés par js/mindmap.js) ---------- */
/* Quatre nuances de bleu partagées par la carte mentale et les soft skills (puis on recommence) */
.mindmap,
.softskills {
  --b0: var(--accent);
  --b1: #0369a1;
  --b2: #0f766e;
  --b3: #4338ca;
}

:root[data-theme="dark"] .mindmap,
:root[data-theme="dark"] .softskills {
  --b1: #38bdf8;
  --b2: #2dd4bf;
  --b3: #a5b4fc;
}

.mindmap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  padding-block: var(--space-2);
}

.mindmap-branches {
  display: contents;
  list-style: none;
}

.mindmap-hub {
  position: relative;
  z-index: 1;
  justify-self: start;
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 6px var(--accent-soft), var(--shadow);
}

.mindmap-branch {
  --branch: var(--b0);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: clamp(1.75rem, 5vw, 3rem);
  /* Mobile : décalage pour laisser passer la colonne vertébrale issue du moyeu */
  margin-left: 3.5rem;
  transition: opacity var(--dur) var(--ease);
}

.mindmap-branch[data-branch="1"] { --branch: var(--b1); }
.mindmap-branch[data-branch="2"] { --branch: var(--b2); }
.mindmap-branch[data-branch="3"] { --branch: var(--b3); }

.mindmap-node {
  flex: 0 1 auto;
  max-width: 10rem;
  padding: 0.5rem 0.95rem;
  border: 1.5px solid var(--branch);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--branch) 10%, var(--surface));
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
}

.mindmap-leaves {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
  list-style: none;
}

/* Compétence + sous-compétences : empilées (mobile), côte à côte sur bureau si la place le permet */
.mindmap-leaf {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.mindmap-leaf-label {
  padding: 0.25rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--branch) 35%, var(--border));
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: var(--fs-xs);
  font-weight: 500;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast);
}

/* Sous-compétences : pastilles plus discrètes, rattachées à leur compétence */
.mindmap-subleaves {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding-left: 1.5rem;
  list-style: none;
}

.mindmap-subleaf {
  padding: 0.1rem 0.55rem;
  border: 1px dashed color-mix(in srgb, var(--branch) 45%, var(--border));
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.mindmap-links {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.mindmap-link {
  fill: none;
  stroke: var(--b0);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.5;
  transition: opacity var(--dur) var(--ease), stroke-width var(--dur) var(--ease), stroke-dashoffset 900ms var(--ease);
}

.mindmap-link.is-trunk {
  stroke-width: 2.25;
}

.mindmap-link.is-sub {
  stroke-width: 1;
}

.mindmap-link[data-branch="1"] { stroke: var(--b1); }
.mindmap-link[data-branch="2"] { stroke: var(--b2); }
.mindmap-link[data-branch="3"] { stroke: var(--b3); }

/* Survol d'une branche : elle s'éclaire, les autres s'estompent */
.mindmap.is-focusing .mindmap-branch:not(.is-active) {
  opacity: 0.35;
}

.mindmap.is-focusing .mindmap-link:not(.is-active) {
  opacity: 0.12;
}

.mindmap .mindmap-link.is-active {
  opacity: 1;
  stroke-width: 2.5;
}

.mindmap-branch.is-active .mindmap-leaf-label,
.mindmap-branch.is-active .mindmap-subleaf {
  border-color: var(--branch);
}

.mindmap-leaf-label:hover {
  transform: translateX(3px);
}

/* Petit écran : compétences sous leur catégorie, pour garder toute la largeur aux libellés */
@media (max-width: 559px) {
  .mindmap-branch {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .mindmap-leaves {
    padding-left: 1.75rem;
  }
}

/* Grand écran : moyeu au centre, branches de part et d'autre */
@media (min-width: 1100px) {
  .mindmap {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-auto-flow: row dense;
    align-items: center;
    column-gap: clamp(3rem, 6vw, 5.5rem);
    row-gap: var(--space-5);
  }

  .mindmap-hub {
    justify-self: center;
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 6rem;
    height: 6rem;
    font-size: 1.5rem;
  }

  .mindmap[data-rows="1"] .mindmap-hub { grid-row: 1; }
  .mindmap[data-rows="3"] .mindmap-hub { grid-row: 1 / span 3; }
  .mindmap[data-rows="4"] .mindmap-hub { grid-row: 1 / span 4; }
  .mindmap[data-rows="5"] .mindmap-hub { grid-row: 1 / span 5; }
  .mindmap[data-rows="6"] .mindmap-hub { grid-row: 1 / span 6; }

  .mindmap-branch {
    margin-left: 0;
  }

  .mindmap-branch.is-right {
    grid-column: 3;
  }

  .mindmap-branch.is-left {
    grid-column: 1;
    flex-direction: row-reverse;
    justify-self: end;
  }

  .mindmap-branch.is-left .mindmap-leaves,
  .mindmap-branch.is-left .mindmap-leaf,
  .mindmap-branch.is-left .mindmap-subleaves {
    align-items: flex-end;
  }

  .mindmap-branch.is-left .mindmap-subleaves {
    padding-left: 0;
    padding-right: 1.5rem;
  }

  /* Côte à côte et sur une ligne, sauf si cela déborde de la carte (.is-stacked, posé par js/mindmap.js) */
  .mindmap:not(.is-stacked) .mindmap-leaf {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
  }

  .mindmap:not(.is-stacked) .mindmap-branch.is-left .mindmap-leaf {
    flex-direction: row-reverse;
  }

  .mindmap:not(.is-stacked) .mindmap-subleaves {
    padding: 0;
  }

  .mindmap-node {
    max-width: 13rem;
  }

  .mindmap:not(.is-stacked) .mindmap-leaf-label,
  .mindmap:not(.is-stacked) .mindmap-subleaf {
    white-space: nowrap;
  }

  .mindmap-branch.is-left .mindmap-leaf-label:hover {
    transform: translateX(-3px);
  }
}

/* Apparition : branches tracées puis feuilles (navigateur avec JS, mouvement autorisé) */
.js .mindmap:not(.is-drawn) .mindmap-leaf-label,
.js .mindmap:not(.is-drawn) .mindmap-subleaf,
.js .mindmap:not(.is-drawn) .mindmap-node {
  opacity: 0;
  transform: scale(0.85);
}

.js .mindmap .mindmap-node,
.js .mindmap .mindmap-leaf-label,
.js .mindmap .mindmap-subleaf {
  transition:
    opacity 500ms var(--ease) var(--delay, 0ms),
    transform 500ms var(--ease) var(--delay, 0ms),
    border-color var(--dur-fast);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
}

.badge {
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
}

.badge--accent {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Timeline (expériences, formation) */
.timeline {
  display: grid;
  gap: var(--space-2);
  list-style: none;
}

.timeline-item {
  position: relative;
  padding-left: var(--space-5);
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: 0.3rem;
  width: 9px;
  height: 9px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
}

.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.35rem;
  bottom: calc(-1 * var(--space-2) + 0.2rem);
  left: calc(0.3rem + 4px);
  width: 1px;
  background: var(--border);
}

.timeline-item > .timeline-panel {
  margin-left: calc(-1 * var(--space-3));
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background-color var(--dur-fast), border-color var(--dur-fast);
}

.timeline-item > details > summary,
.timeline-item > .timeline-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: var(--space-3);
}

.timeline-item > details > summary {
  list-style: none;
  cursor: pointer;
}

.timeline-item > details > summary::-webkit-details-marker {
  display: none;
}

/* Petit écran : la période passe sous le titre (le titre garde toute la largeur) */
@media (max-width: 559px) {
  .timeline-item > details > summary,
  .timeline-item > .timeline-entry {
    grid-template-columns: minmax(0, 1fr);
  }

  .timeline-period {
    margin-top: 0.15rem;
  }
}

/* Expérience dépliable : tout le bloc (en-tête + détail) forme un seul panneau */
.timeline-item > details:hover,
.timeline-item > details[open] {
  background: var(--surface-2);
}

.timeline-item > details[open] {
  border-color: var(--border);
}

.timeline-org,
.timeline-summary,
.timeline-toggle,
.timeline-item .badges {
  grid-column: 1 / -1;
}

.timeline-title {
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.35;
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-org {
  display: block;
  font-size: var(--fs-sm);
  color: var(--accent);
  font-weight: 500;
}

.timeline-summary {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.timeline-item .badges {
  margin-top: var(--space-2);
}

/* Bouton « Voir le détail / Masquer le détail » */
.timeline-toggle {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-3);
  padding: 0.2rem 0.5rem 0.2rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 600;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}

summary:hover .timeline-toggle,
summary:focus-visible .timeline-toggle {
  border-color: var(--accent);
}

.timeline-toggle-label.is-open,
details[open] .timeline-toggle-label.is-closed {
  display: none;
}

details[open] .timeline-toggle-label.is-open {
  display: inline;
}

.timeline-chevron {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur) var(--ease);
}

details[open] .timeline-chevron {
  transform: rotate(180deg);
}

/* Détail : dans le même panneau, séparé de l'en-tête par un filet, apparition en fondu */
.timeline-body {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.timeline-body ul {
  list-style: disc;
}

.timeline-body li::marker {
  color: var(--accent);
}

.timeline-body strong {
  color: var(--text);
}

details[open] > .timeline-body {
  animation: details-in var(--dur) var(--ease);
}

@keyframes details-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.timeline--compact .timeline-title {
  font-size: var(--fs-sm);
}

/* Projets */
.projects {
  display: grid;
  gap: var(--space-3);
  list-style: none;
}

@media (min-width: 720px) {
  .projects {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

.project {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--fs-sm);
}

.project-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-base);
}

.project-title a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  text-decoration: none;
}

.project-title a:hover {
  color: var(--accent);
}

/* Footer */
.hint,
.egg-counter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
}

.hint {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hint:hover {
  color: var(--text);
}

.egg-counter {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* Toasts */
.toast-region {
  position: fixed;
  bottom: var(--space-4);
  left: 50%;
  z-index: 200;
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  width: min(100% - 2 * var(--gutter), 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: var(--shadow);
  text-align: center;
}

/* Terminal */
.terminal {
  width: min(100% - 2 * var(--gutter), 720px);
  max-height: min(80dvh, 560px);
  margin: auto;
  padding: 0;
  border: 1px solid #2b2d35;
  border-radius: var(--radius-sm);
  background: var(--terminal-bg);
  color: var(--terminal-text);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.terminal[open] {
  display: flex;
  flex-direction: column;
}

.terminal::backdrop {
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: #1b1d23;
  color: #9a9cab;
  font-size: var(--fs-xs);
}

.terminal-dots {
  display: inline-flex;
  gap: 6px;
}

.terminal-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}

.terminal-dots i:nth-child(2) { background: #febc2e; }
.terminal-dots i:nth-child(3) { background: #28c840; }

.terminal-title {
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-close {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  font-size: 1.1rem;
  line-height: 1;
}

.terminal-close:hover {
  background: #2b2d35;
  color: #fff;
}

.terminal-output {
  flex: 1;
  min-height: 12rem;
  padding: var(--space-3) var(--space-4) 0;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal-line--cmd {
  color: #fff;
}

.terminal-line--cmd::before {
  content: "$ ";
  color: var(--terminal-accent);
}

.terminal-line--accent {
  color: var(--terminal-accent);
}

.terminal-line--error {
  color: #ff7b72;
}

.terminal-form {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-4);
}

.terminal-prompt {
  color: var(--terminal-accent);
}

.terminal-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  caret-color: var(--terminal-accent);
  outline: none;
}

/* Canvas des effets (pluie Matrix) */
.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- Boutons compacts ---------- */
.btn--small {
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.5rem;
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-sm);
}

.print-only {
  display: none;
}

/* ---------- Fenêtres modales ---------- */
.modal {
  width: min(100% - 2 * var(--gutter), 520px);
  max-height: min(92dvh, 760px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.modal::backdrop {
  background: rgba(10, 12, 20, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal[open] {
  animation: terminal-in var(--dur) var(--ease);
}

.modal-body {
  display: grid;
  gap: var(--space-4);
  padding: clamp(var(--space-4), 4vw, var(--space-5));
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.modal-title {
  font-size: var(--fs-lg);
}

.modal-close {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.modal-intro,
.form-privacy {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.form-privacy {
  font-size: var(--fs-xs);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* ---------- Champs de formulaire ---------- */
.field {
  display: grid;
  gap: var(--space-1);
}

.field label {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.field textarea {
  resize: vertical;
  min-height: 8rem;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field [aria-invalid="true"] {
  border-color: #d9480f;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.field-error {
  color: #d9480f;
  font-size: var(--fs-xs);
  font-weight: 500;
}

:root[data-theme="dark"] .field-error,
:root[data-theme="dark"] .field [aria-invalid="true"] {
  color: #ff922b;
  border-color: #ff922b;
}

.field-count {
  margin-left: auto;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

/* Champ piège : hors écran mais pas display:none (certains robots l'ignoreraient) */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status:empty {
  display: none;
}

.form-status {
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.form-status[data-variant="success"] {
  background: color-mix(in srgb, var(--success) 15%, var(--surface));
  color: var(--text);
}

.form-status[data-variant="error"] {
  background: color-mix(in srgb, #d9480f 14%, var(--surface));
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- QR code ---------- */
.modal--qr {
  width: min(100% - 2 * var(--gutter), 380px);
}

.qr-image {
  width: min(100%, 260px);
  height: auto;
  margin-inline: auto;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: #fff;
}

.qr-url {
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.modal--qr .modal-actions {
  justify-content: center;
}

/* Liens du pied de page (ex. « Comment ce site est construit ») */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.footer-link {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-decoration: none;
  text-underline-offset: 3px;
}

.footer-link:hover,
.footer-link[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
}

/* Cartes ciblées par une ancre (ex. /cv/#skills depuis la palette) : sous l'en-tête collant
   (et le sommaire du CV, dont la hauteur est posée par js/cv-toc.js), mises en valeur */
.card[id] {
  scroll-margin-top: var(--anchor-offset, 6.5rem);
}

.card:target {
  animation: target-flash 1.6s var(--ease) 1;
}

@keyframes target-flash {
  0%,
  40% {
    box-shadow: 0 0 0 3px var(--accent), var(--shadow);
  }
}

/* ---------- Soft skills : une tuile par qualité, liseré coloré ---------- */
.softskills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-3);
  list-style: none;
}

.softskill {
  --tone: var(--b0);
  position: relative;
  overflow: hidden;
  padding: var(--space-3) var(--space-3) var(--space-3) calc(var(--space-3) + 3px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast);
}

.softskill[data-tone="1"] { --tone: var(--b1); }
.softskill[data-tone="2"] { --tone: var(--b2); }
.softskill[data-tone="3"] { --tone: var(--b3); }

.softskill::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--tone);
}

.softskill:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tone) 55%, var(--border));
}

.softskill-title {
  margin-bottom: var(--space-1);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 650;
  line-height: 1.35;
}

.softskill p {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.55;
}

/* Langues, dans la carte des soft skills : sous-titre + pastilles */
.softskills-languages {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.softskills-languages[id] {
  scroll-margin-top: var(--anchor-offset, 6.5rem);
}

.softskills-subtitle {
  margin-bottom: var(--space-3);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.softskills-languages ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.softskills-languages li,
.softskills-languages li + li {
  margin: 0;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.softskills-languages li strong {
  color: var(--text);
}

/* ---------- Divers : blocs titre + pastilles + texte court ---------- */
.misc {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--space-4) var(--space-5);
}

.misc-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.misc-title {
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 650;
}

.misc-block p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

/* ---------- Sommaire du CV (js/cv-toc.js) ---------- */
.cv-toc {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.cv-toc-list {
  display: flex;
  gap: 2px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  list-style: none;
  scrollbar-width: none;
}

.cv-toc-list::-webkit-scrollbar {
  display: none;
}

/* Centré quand tout tient, défilable depuis le début sinon */
.cv-toc-list > li:first-child {
  margin-left: auto;
}

.cv-toc-list > li:last-of-type {
  margin-right: auto;
}

.cv-toc-link {
  display: block;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-fast), background-color var(--dur-fast);
}

.cv-toc-link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.cv-toc-link[aria-current="true"] {
  color: var(--text);
  background: var(--accent-soft);
}

/* Flottante sous l'en-tête une fois la barre dépassée (position et largeur posées par le JS) */
.cv-toc.is-floating .cv-toc-list {
  position: fixed;
  z-index: 9;
  box-shadow: var(--shadow);
  animation: toc-in var(--dur) var(--ease);
}

@keyframes toc-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* ===== /css/header.css ===== */
/*
 * En-tête : barre flottante en verre dépoli (pages CV, projets, blog, stack).
 * Comportements pilotés par js/header.js :
 *  - pastille qui glisse sous le lien survolé / courant (.nav-pill) ;
 *  - curseur de l'interrupteur de langue (.lang-thumb) ;
 *  - ombre renforcée une fois la page défilée (.is-scrolled) ;
 *  - progression de lecture (.header-progress).
 * Animations : transform / translate / opacity (la largeur de la pastille, élément isolé, aussi).
 */

.site-header {
  position: sticky;
  top: var(--space-3);
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "brand . actions"
    "nav nav nav";
  align-items: center;
  gap: var(--space-2) var(--space-3);
  width: min(100% - 2 * var(--gutter), var(--max-width));
  margin: var(--space-3) auto 0;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  transition:
    box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

@media (min-width: 760px) {
  .site-header {
    grid-template-areas: "brand nav actions";
    grid-template-columns: 1fr auto 1fr;
  }
}

.js .site-header {
  animation: header-in 700ms var(--ease) both;
}

/* Glissement sans fondu : la barre est visible dès la première image (rendu et LCP non retardés) */
@keyframes header-in {
  from {
    transform: translateY(-14px) scale(0.98);
  }
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 32px rgba(15, 23, 42, 0.12);
}

/* Progression de lecture, sous la barre */
.header-progress {
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}

.site-header.has-progress .header-progress {
  opacity: 1;
}

/* ---------- Marque ---------- */
.brand {
  grid-area: brand;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  overflow: hidden;
  border-radius: 11px;
  background: var(--text);
  color: var(--bg);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  transition: transform 500ms var(--ease);
}

/* Reflet qui balaie la marque au survol */
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
}

.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.06);
}

.brand:hover .brand-mark::after {
  transform: translateX(120%);
  transition: transform 700ms var(--ease);
}

.brand-name {
  /* Masqué visuellement sur mobile mais lu par les lecteurs d'écran (nom du lien) */
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  transition: transform 500ms var(--ease);
}

.brand:hover .brand-name {
  transform: translateX(3px);
}

@media (min-width: 560px) {
  .brand-name {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
}

/* ---------- Navigation ---------- */
.site-nav {
  grid-area: nav;
  position: relative;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}

@media (min-width: 760px) {
  .site-nav a {
    flex: 0 0 auto;
  }
}

.site-nav a:hover,
.site-nav a.is-target,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

/* Point d'accent sous la page courante */
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot-in 500ms var(--ease) both 400ms;
}

@keyframes dot-in {
  from {
    opacity: 0;
    transform: scale(0);
  }
}

/* Pastille glissante (insérée par header.js) */
.nav-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: var(--pill-width, 0);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), inset 0 0 0 1px var(--border);
  transform: translateX(var(--pill-x, 0));
  opacity: 0;
  transition:
    transform 450ms var(--ease),
    width 450ms var(--ease),
    opacity var(--dur) var(--ease);
  pointer-events: none;
}

.nav-pill.is-visible {
  opacity: 1;
}

.nav-pill.no-transition {
  transition: none;
}

/* Entrée en cascade des liens */
.js .site-nav a {
  animation: nav-item-in 600ms var(--ease) both;
  animation-delay: calc(150ms + var(--i, 0) * 70ms);
}

@keyframes nav-item-in {
  from {
    transform: translateY(-6px);
  }
}

/* ---------- Actions (langue, thème) ---------- */
.header-actions {
  grid-area: actions;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lang-switch {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.lang-switch a {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  min-width: 2.5rem;
  min-height: 2rem;
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color var(--dur) var(--ease);
}

.lang-switch a:hover {
  color: var(--text);
}

.lang-switch a[aria-current="true"] {
  color: var(--bg);
}

/* Curseur de l'interrupteur (inséré par header.js ; repli : fond du bouton actif) */
.lang-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: var(--thumb-width, 2.5rem);
  border-radius: var(--radius-pill);
  background: var(--text);
  transform: translateX(var(--thumb-x, 3px));
  transition:
    transform 450ms var(--ease),
    width 450ms var(--ease);
  pointer-events: none;
}

.lang-switch:not(:has(.lang-thumb)) a[aria-current="true"] {
  background: var(--text);
}

/* Bouton de thème : soleil et lune pivotent l'un dans l'autre */
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  transition: background-color var(--dur) var(--ease), transform 300ms var(--ease);
}

.icon-btn:hover {
  background: var(--surface-2);
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn .icon {
  grid-area: 1 / 1;
  transition:
    transform 600ms var(--ease),
    opacity 300ms var(--ease);
}

:root[data-theme="dark"] .icon--sun,
:root:not([data-theme="dark"]) .icon--moon {
  opacity: 0;
  transform: rotate(-120deg) scale(0.4);
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-nav a,
  .site-nav a::after,
  .nav-pill,
  .lang-thumb,
  .icon-btn .icon,
  .brand-mark,
  .brand-mark::after {
    animation: none !important;
    transition: none !important;
  }

}

/* ===== /css/transitions.css ===== */
/*
 * Transitions entre pages, sans SPA (View Transitions entre documents).
 * Chrome / Edge 126+, Safari 18.2+ ; ailleurs, navigation classique.
 *  - en-tête : reste en place et se transforme (même nom sur toutes les pages) ;
 *  - contenu principal (<main>) : sort vers le haut, le nouveau arrive par le bas ;
 *  - reste de la page (décor, pied de page) : fondu enchaîné par défaut.
 * Couplé au préchargement au survol (Speculation Rules, en-tête HTTP dans .htaccess).
 */
@view-transition {
  navigation: auto;
}

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

main {
  view-transition-name: page-content;
}

::view-transition-group(*) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* L'ancien contenu s'efface vite ; le nouveau n'arrive qu'ensuite (pas de superposition confuse) */
::view-transition-old(page-content) {
  animation: vt-content-out 180ms cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(page-content) {
  animation: vt-content-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) 150ms both;
}

@keyframes vt-content-out {
  to {
    opacity: 0;
    transform: translateY(-14px) scale(0.99);
  }
}

@keyframes vt-content-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.99);
  }
}

/* Arrivée par une transition (classe posée par js/boot.js) : pas d'animation d'entrée en double */
.vt-arrival .site-header,
.vt-arrival .site-nav a,
.vt-arrival .curtain span {
  animation: none !important;
}

.vt-arrival .curtain {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* ===== /css/backdrop.css ===== */
/*
 * Décor animé partagé par toutes les pages : aurore (taches floues qui dérivent),
 * réseau de nœuds (canvas, js/network.js), quadrillage, halo qui suit la souris, grain.
 * Construit par js/backdrop.js. Uniquement transform / opacity animés.
 */

/* Thème sombre (et page d'accueil, toujours sombre) */
:root {
  --bd-c1: #2563eb;
  --bd-c2: #1e40af;
  --bd-c3: #38bdf8;
  --bd-c4: #60a5fa;
  --bd-blob-opacity: 0.5;
  --bd-blend: screen;
  --bd-grid: rgba(255, 255, 255, 0.035);
  --bd-spot: rgba(59, 130, 246, 0.18);
  --bd-grain-opacity: 0.07;
  --bd-grain-blend: normal;
}

/* Pages secondaires en sombre : un peu plus discret que l'accueil (texte par-dessus) */
:root[data-theme="dark"]:not(.home) {
  --bd-blob-opacity: 0.38;
  --bd-spot: rgba(59, 130, 246, 0.12);
}

/* Thème clair : taches pastel en mode normal (« screen » serait invisible sur fond clair) */
:root:not([data-theme="dark"]):not(.home) {
  --bd-c1: #93c5fd;
  --bd-c2: #bfdbfe;
  --bd-c3: #7dd3fc;
  --bd-c4: #a5b4fc;
  --bd-blob-opacity: 0.45;
  --bd-blend: normal;
  --bd-grid: rgba(30, 58, 138, 0.05);
  --bd-spot: rgba(59, 130, 246, 0.1);
  --bd-grain-opacity: 0.05;
  --bd-grain-blend: multiply;
}

/* Le mode Matrix (Konami) a son propre fond */
.matrix-mode .scene {
  display: none;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora {
  position: absolute;
  inset: -15%;
  will-change: transform;
}

.blob {
  position: absolute;
  width: 48vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: var(--bd-blob-opacity);
  mix-blend-mode: var(--bd-blend);
  will-change: transform;
}

.blob--1 {
  top: 0;
  left: 0;
  background: radial-gradient(circle at 30% 30%, var(--bd-c1), transparent 65%);
  animation: drift-1 26s var(--ease-in-out) infinite alternate;
}

.blob--2 {
  top: 10%;
  right: -5%;
  background: radial-gradient(circle at 50% 50%, var(--bd-c2), transparent 65%);
  animation: drift-2 32s var(--ease-in-out) infinite alternate;
}

.blob--3 {
  bottom: -10%;
  left: 20%;
  background: radial-gradient(circle at 50% 50%, var(--bd-c3), transparent 62%);
  opacity: calc(var(--bd-blob-opacity) * 0.64);
  animation: drift-3 28s var(--ease-in-out) infinite alternate;
}

.blob--4 {
  right: 10%;
  bottom: 0;
  width: 32vmax;
  background: radial-gradient(circle at 50% 50%, var(--bd-c4), transparent 65%);
  opacity: calc(var(--bd-blob-opacity) * 0.6);
  animation: drift-4 22s var(--ease-in-out) infinite alternate;
}

@keyframes drift-1 {
  to { transform: translate(25vw, 20vh) scale(1.25) rotate(40deg); }
}
@keyframes drift-2 {
  to { transform: translate(-30vw, 25vh) scale(0.85) rotate(-30deg); }
}
@keyframes drift-3 {
  to { transform: translate(20vw, -30vh) scale(1.2); }
}
@keyframes drift-4 {
  to { transform: translate(-25vw, -20vh) scale(1.3); }
}

.network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Quadrillage qui défile lentement, estompé sur les bords */
.grid-lines {
  position: absolute;
  inset: -64px 0 0;
  background-image:
    linear-gradient(var(--bd-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bd-grid) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
  animation: grid-scroll 6s linear infinite;
}

@keyframes grid-scroll {
  to { transform: translateY(64px); }
}

/* Halo qui suit le curseur (positionné par transform) */
.spotlight {
  position: absolute;
  top: -350px;
  left: -350px;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bd-spot), transparent 60%);
  opacity: 0;
  transition: opacity 600ms var(--ease);
  will-change: transform;
}

.has-pointer .spotlight {
  opacity: 1;
}

/* Grain argentique animé */
.grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--bd-grain-opacity);
  mix-blend-mode: var(--bd-grain-blend);
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-6%, 4%); }
  40% { transform: translate(5%, -7%); }
  60% { transform: translate(-3%, 8%); }
  80% { transform: translate(7%, 2%); }
  100% { transform: translate(-4%, -5%); }
}

@media (prefers-reduced-motion: reduce) {
  .blob,
  .grid-lines,
  .grain {
    animation: none !important;
  }
}

@media print {
  .scene {
    display: none !important;
  }
}

/* ===== /css/animations.css ===== */
/* Animations : uniquement transform / opacity pour rester à 60 FPS */

/* Apparition en cascade (seulement si JS est actif, sinon le contenu reste visible) */
.js .reveal {
  opacity: 0;
  translate: 0 18px;
  transition:
    opacity var(--dur-slow) var(--ease) var(--reveal-delay, 0ms),
    translate var(--dur-slow) var(--ease) var(--reveal-delay, 0ms),
    transform var(--dur) var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  translate: 0 0;
}

/* Filet de sécurité : si le script d'apparition n'a pas démarré (erreur, navigateur ancien…),
   les cartes s'affichent d'elles-mêmes — une page ne doit jamais rester vide */
.js:not(.reveal-ready) .reveal {
  animation: reveal-fallback 600ms var(--ease) 1800ms forwards;
}

@keyframes reveal-fallback {
  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* Point qui pulse pour les statuts « disponible » (ouvert aux opportunités, en recherche active) */
.status:is([data-status="open"], [data-status="searching"]) .status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--status-color);
  animation: pulse 2s var(--ease) infinite;
}

@keyframes pulse {
  from { transform: scale(1); opacity: 0.7; }
  to { transform: scale(2.8); opacity: 0; }
}

/* Easter egg avatar */
.avatar.is-spinning {
  animation: spin 900ms var(--ease);
}

@keyframes spin {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(200deg) scale(0.85); }
  to { transform: rotate(360deg) scale(1); }
}

.avatar:active {
  transform: scale(0.95);
}

/* Toasts */
.toast {
  animation: toast-in var(--dur) var(--ease);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* Feedback "Copié !" */
.btn.is-success .icon {
  animation: pop 400ms var(--ease);
}

@keyframes pop {
  50% { transform: scale(1.35); }
}

/* Terminal */
.terminal[open] {
  animation: terminal-in var(--dur) var(--ease);
}

@keyframes terminal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Accessibilité : pas de mouvement pour qui le demande */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    translate: none;
  }

  .card {
    transform: none !important;
  }
}

/* ===== /css/palette.css ===== */
/*
 * Palette de commandes (js/palette.js) et bouton « Rechercher » des en-têtes.
 * Autonome : fonctionne sur l'accueil (thème sombre propre, sans variables.css) comme sur les autres pages.
 */
.palette {
  --p-surface: var(--surface, #0c1122);
  --p-surface-2: var(--surface-2, #131a30);
  --p-text: var(--text, #f4f4f8);
  --p-muted: var(--text-muted, var(--muted, #a5b4cb));
  --p-border: var(--border, rgba(147, 197, 253, 0.18));
  --p-accent: var(--accent, #60a5fa);
  --p-accent-soft: var(--accent-soft, rgba(96, 165, 250, 0.16));
  width: min(100% - 2rem, 640px);
  max-height: min(70dvh, 560px);
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--p-border);
  border-radius: 18px;
  background: var(--p-surface);
  color: var(--p-text);
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

.palette[open] {
  display: flex;
  flex-direction: column;
  animation: palette-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes palette-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.palette::backdrop {
  background: rgba(2, 6, 23, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.palette-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--p-border);
}

.palette-field .palette-icon {
  color: var(--p-muted);
}

.palette-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--p-text);
  font: inherit;
  font-size: 1.05rem;
  outline: none;
}

.palette-input::placeholder {
  color: var(--p-muted);
}

.palette-esc,
.palette-shortcut {
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--p-border, currentColor);
  border-radius: 6px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  color: var(--p-muted, inherit);
}

.palette-list {
  flex: 1;
  margin: 0;
  padding: 0.4rem;
  overflow-y: auto;
  list-style: none;
}

.palette-group {
  padding: 0.7rem 0.6rem 0.3rem;
  color: var(--p-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.palette-option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
}

.palette-option[aria-selected="true"] {
  background: var(--p-accent-soft);
  color: var(--p-text);
}

.palette-option[aria-selected="true"] .palette-icon {
  color: var(--p-accent);
}

.palette-icon {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--p-muted);
}

.palette-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-hint {
  flex-shrink: 0;
  max-width: 45%;
  overflow: hidden;
  color: var(--p-muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-empty {
  padding: 2rem 1rem;
  color: var(--p-muted);
  text-align: center;
}

.palette-footer {
  margin: 0;
  padding: 0.55rem 1rem;
  border-top: 1px solid var(--p-border);
  color: var(--p-muted);
  font-size: 0.75rem;
}

/* Bouton « Rechercher » (en-tête des pages et accueil) */
.palette-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2, #131a30) 70%, transparent);
  color: var(--text-muted, var(--muted, #a5b4cb));
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 200ms, background-color 200ms;
}

.palette-trigger:hover {
  color: var(--text, #f4f4f8);
}

.palette-trigger svg {
  width: 1.05rem;
  height: 1.05rem;
}

.palette-trigger-label,
.palette-trigger .palette-shortcut {
  display: none;
}

@media (min-width: 1100px) {
  .palette-trigger-label,
  .palette-trigger .palette-shortcut {
    display: inline;
  }
}

/* Accueil : bouton discret dans la barre du haut */
.home .palette-trigger {
  border: 1px solid rgba(147, 197, 253, 0.18);
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@media (prefers-reduced-motion: reduce) {
  .palette[open] {
    animation: none;
  }
}

/* ===== /css/page.css ===== */
/* Pages secondaires : projets, blog, stack (en complément de layout.css et components.css) */

.page-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(100% - 2 * var(--gutter), 820px);
  margin-inline: auto;
  padding-block: var(--space-5) var(--space-6);
  outline: none;
}

.page-header {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.page-title {
  font-size: var(--fs-xl);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.page-lead {
  font-size: var(--fs-lg);
  color: var(--text-muted);
}

.back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
}

.back-link::before {
  content: "←";
  transition: transform var(--dur-fast) var(--ease);
}

.back-link:hover {
  color: var(--accent);
}

.back-link:hover::before {
  transform: translateX(-3px);
}

.loading {
  height: 8rem;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2));
  opacity: 0.6;
}

/* ---------- Pages Projets / Blog : même système que le CV ---------- */
.page-main--grid {
  width: min(100% - 2 * var(--gutter), var(--max-width));
  padding-block: var(--space-4) var(--space-6);
}

.page-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
}

/* Carte titre (équivalent de la carte profil du CV) */
.card--hero {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
}

.card--hero .page-title {
  font-size: var(--fs-xl);
}

.card--hero .page-lead {
  max-width: 68ch;
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
}

/* Liste : cartes en grille */
.entry-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: var(--space-4);
  list-style: none;
}

.entry-card {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  transition: transform var(--dur) var(--ease), border-color var(--dur-fast);
}

.entry-card:hover {
  border-color: var(--accent);
}

.entry-title {
  font-size: var(--fs-lg);
}

.entry-title a {
  text-decoration: none;
}

/* Toute la carte est cliquable */
.entry-title a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.entry-draft {
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: #fff3bf;
  color: #5c4400;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.entry-summary {
  color: var(--text-muted);
}

/* Étude de cas / article : titre en pleine largeur, contenu 2/3, « En bref » 1/3.
   Sur mobile, « En bref » vient juste sous le titre (comme la carte Contact du CV). */
.page-grid--article .card--facts {
  order: 1;
}

.page-grid--article .card--article {
  order: 2;
}

@media (min-width: 1100px) {
  .page-grid--article {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .page-grid--article .card--hero {
    grid-column: 1 / -1;
  }

  .page-grid--article .card--article {
    grid-column: 1 / span 2;
    grid-row: 2;
  }

  .page-grid--article .card--facts {
    grid-column: 3;
    grid-row: 2;
  }

  .card--facts {
    position: sticky;
    top: 104px;
  }
}

/* Carte de lecture : pas d'inclinaison (le texte ne doit pas bouger), le halo reste */
.card--article {
  transform: none !important;
}

.card--facts {
  display: grid;
  gap: var(--space-4);
  justify-items: start;
}

.card--facts .card-title {
  margin-bottom: 0;
}

.facts {
  display: grid;
  gap: var(--space-3);
  width: 100%;
}

.fact {
  display: grid;
  gap: var(--space-1);
}

.fact-label {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.fact-value {
  margin: 0;
  font-size: var(--fs-sm);
}

.article-body {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.article-body > * + * {
  margin-top: var(--space-4);
}

.article-body > :first-child {
  margin-top: 0;
}

.article-body h2 {
  margin-top: var(--space-6);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.article-body h3 {
  margin-top: var(--space-5);
  font-size: 1.2rem;
}

.article-body hr {
  margin-block: var(--space-6);
  border: 0;
  border-top: 1px solid var(--border);
}

.article-body figure img {
  border-radius: var(--radius-sm);
}

.article-body figcaption {
  margin-top: var(--space-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}

/* Blocs de code */
.code-block {
  position: relative;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  overflow-x: auto;
  tab-size: 2;
}

.code-block code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.code-block[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: var(--space-1);
  right: var(--space-3);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tableaux */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.table-wrap th,
.table-wrap td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table-wrap th {
  background: var(--surface-2);
  font-weight: 600;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

/* Schémas Mermaid */
.diagram {
  display: grid;
  place-items: center;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow-x: auto;
}

.diagram svg {
  max-width: 100%;
  height: auto;
}

.diagram-source {
  width: 100%;
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  white-space: pre-wrap;
}

/* ---------- Stack : même grille que le CV et les études de cas ---------- */
/* Mobile : titre, mesures, texte, en-têtes, audit (les mesures montent, comme Contact sur le CV) */
.page-grid--stack .card--metrics { order: 1; }
.page-grid--stack .card--article { order: 2; }
.page-grid--stack .card--headers { order: 3; }
.page-grid--stack .card--report { order: 4; }

@media (min-width: 1100px) {
  .page-grid--stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .page-grid--stack .card--hero,
  .page-grid--stack .card--headers,
  .page-grid--stack .card--report {
    grid-column: 1 / -1;
  }

  .page-grid--stack .card--article {
    grid-column: 1 / span 2;
    grid-row: 2;
  }

  .page-grid--stack .card--metrics {
    grid-column: 3;
    grid-row: 2;
  }

  .header-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #stack-report {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5) var(--space-6);
  }

  #stack-report > .stack-note,
  #stack-report > .report-observatory {
    grid-column: 1 / -1;
  }
}

.stack-note {
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.card--headers .stack-note {
  margin: calc(-1 * var(--space-2)) 0 var(--space-4);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

/* Carte des mesures en pleine largeur (tablette) : 4 tuiles côte à côte */
@media (min-width: 640px) and (max-width: 1099px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-label {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.header-list {
  display: grid;
  gap: var(--space-2);
  list-style: none;
}

.header-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.header-status {
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  font-size: var(--fs-xs);
  font-weight: 700;
}

.is-ok .header-status {
  background: color-mix(in srgb, var(--success) 18%, transparent);
  color: var(--success);
}

.is-missing .header-status {
  background: color-mix(in srgb, #d9480f 15%, transparent);
  color: #d9480f;
}

.header-name {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.header-value {
  grid-column: 2;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  overflow-wrap: anywhere;
}

.scan-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

/* Espacement vertical entre pages auditées (sur une colonne ; en grille, géré par gap) */
@media (max-width: 1099px) {
  .report-page + .report-page {
    margin-top: var(--space-5);
  }
}

.report-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: var(--fs-base);
}

.report-weight {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 400;
}

.scores {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.score {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  text-align: center;
}

.score svg {
  width: clamp(56px, 14vw, 76px);
  transform: rotate(-90deg);
}

.score circle {
  fill: none;
  stroke-width: 3;
}

.score-track {
  stroke: var(--surface-2);
}

.score-ring {
  stroke-linecap: round;
}

.score-ring.is-good { stroke: #2f9e44; }
.score-ring.is-average { stroke: #f08c00; }
.score-ring.is-poor { stroke: #e03131; }

.score-value {
  position: absolute;
  top: clamp(18px, 4.6vw, 25px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.score-label {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.report-observatory {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.grade {
  display: grid;
  place-items: center;
  min-width: 3rem;
  height: 3rem;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  background: #2f9e44;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
}

/* ---------- Page 404 ---------- */
.card--notfound {
  gap: var(--space-4);
  padding-block: clamp(var(--space-5), 6vw, var(--space-6));
}

.notfound-code {
  font-family: var(--font-mono);
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.notfound-en {
  font-size: var(--fs-base);
}

.notfound-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Lien externe discret (carte « En bref » de la page Now) */
.back-link-external {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
}

.back-link-external:hover {
  color: var(--accent);
}
