/* ==========================================================================
   Admu — portfolio
   Un seul fichier CSS, pas de framework. Tout part des variables (tokens)
   définies dans :root : changer une couleur ici la change partout.
   ========================================================================== */

/* ---------- Polices auto-hébergées (pas d'appel à Google = CSP stricte + RGPD) */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jbmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jbmono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* ---------- Tokens : thème clair (par défaut) */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #0e1525;
  --text-2: #3b4456;
  --muted: #667085;
  --border: #e2e6ed;
  --accent: #1854b4;            /* le bleu de ton ancien thème (color-4) */
  --accent-strong: #123f88;
  --accent-soft: rgba(24, 84, 180, 0.08);
  --accent-line: rgba(24, 84, 180, 0.25);
  --ok: #0f8a5f;
  --warn: #b25e09;
  --danger: #c2410c;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

/* ---------- Thème sombre : suit le système, sauf si l'utilisateur a choisi */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --surface: #141a23;
    --surface-2: #1b2330;
    --text: #e8ecf2;
    --text-2: #c1c8d4;
    --muted: #8b95a7;
    --border: #252e3b;
    --accent: #6b9bf2;
    --accent-strong: #93b6f7;
    --accent-soft: rgba(107, 155, 242, 0.1);
    --accent-line: rgba(107, 155, 242, 0.3);
    --ok: #34c08a;
    --warn: #e5a54b;
    --code-bg: #0a0e14;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #141a23;
  --surface-2: #1b2330;
  --text: #e8ecf2;
  --text-2: #c1c8d4;
  --muted: #8b95a7;
  --border: #252e3b;
  --accent: #6b9bf2;
  --accent-strong: #93b6f7;
  --accent-soft: rgba(107, 155, 242, 0.1);
  --accent-line: rgba(107, 155, 242, 0.3);
  --ok: #34c08a;
  --warn: #e5a54b;
  --code-bg: #0a0e14;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

/* ---------- Reset léger */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }
code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 5px;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Header / navigation */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand img { width: 30px; height: 36px; object-fit: contain; }
.brand .a, .brand .dot { color: var(--accent); }
.nav-links { display: flex; gap: 4px; list-style: none; padding: 0; margin-left: auto; }
.nav-links a { color: var(--text-2); font-size: 0.92rem; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--text); background: var(--surface-2); }
.nav-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent-line); }
.icon-btn svg { width: 18px; height: 18px; }
.lang-switch { font-family: var(--mono); font-size: 0.8rem; font-weight: 500; width: auto; padding: 0 10px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .menu-toggle { display: inline-grid; }
  .nav-links {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px; font-size: 1rem; }
  .nav-tools { margin-left: auto; }
}

/* ---------- Boutons, badges, pastilles */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .15s, border-color .15s;
  font-family: inherit; line-height: 1.2;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; transform: translateY(-1px); }
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .btn-primary:hover { color: #0b1220; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary, :root:not([data-theme="light"]) .btn-primary:hover { color: #0b1220; } }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent-line); color: var(--text); transform: translateY(-1px); }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 500; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 0.74rem; font-weight: 500;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 6px; white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 4px 8px; border-radius: 6px;
}
.badge.sev-high { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.badge.wip { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.badge.muted { color: var(--muted); background: var(--surface-2); }

/* ---------- Hero */
.hero { padding: 72px 0 40px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 0%, transparent 70%);
  opacity: 0.6;
}
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 48px; align-items: center; }
.eyebrow { font-family: var(--mono); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 750; margin: 14px 0 18px; }
.hero h1 .accent { color: var(--accent); }
.hero .lead { font-size: 1.15rem; color: var(--text-2); max-width: 36rem; }
.hero .lead strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

.hero-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); overflow: hidden;
}
.hero-card .who { display: flex; gap: 16px; align-items: center; padding: 20px; border-bottom: 1px solid var(--border); }
.avatar {
  width: 76px; height: 76px; border-radius: 50%; flex: none; overflow: hidden;
  background: linear-gradient(160deg, var(--accent-soft), var(--surface-2)); border: 1px solid var(--border);
  display: grid; place-items: end center;
}
.avatar img { width: 82%; }
.who strong { display: block; font-size: 1.05rem; }
.who span { color: var(--muted); font-size: 0.9rem; }
.term { background: var(--code-bg); color: var(--code-text); font-family: var(--mono); font-size: 0.8rem; line-height: 1.75; padding: 16px 20px 18px; }
.term .p { color: #7dd3fc; }
.term .c { color: #94a3b8; }
.term .k { color: #fca5a5; }
.term .g { color: #86efac; }
.term .y { color: #fcd34d; }
.term .cursor { display: inline-block; width: 8px; height: 1em; background: #86efac; vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Bandeau de résultats clés */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin-top: 56px; }
.stat { padding: 20px 22px; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat .v { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.stat .v small { font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.stat .l { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }

/* ---------- Sections */
.section { padding: 88px 0 0; }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 36px; flex-wrap: wrap; }
.section-num { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); letter-spacing: -0.025em; line-height: 1.15; font-weight: 720; }
.section-head p { flex-basis: 100%; color: var(--muted); max-width: 42rem; }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--border); min-width: 40px; align-self: center; }
.section-head p + ::after { display: none; }

/* À propos */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }
.about .prose p + p { margin-top: 14px; }
.prose { color: var(--text-2); }
.prose strong { color: var(--text); }
.facts { list-style: none; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--border); font-size: 0.93rem; }
.facts li:last-child { border-bottom: 0; }
.facts .k { color: var(--muted); }
.facts .v { text-align: right; font-weight: 500; }

/* ---------- Projets */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; color: var(--text);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
a.card:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--shadow); color: var(--text); }
.card-visual { aspect-ratio: 16 / 8; background: var(--surface-2); border-bottom: 1px solid var(--border); overflow: hidden; position: relative; }
.card-visual img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card h3 { font-size: 1.2rem; letter-spacing: -0.01em; line-height: 1.3; }
.card p { color: var(--text-2); font-size: 0.95rem; }
.card .tags { margin-top: auto; padding-top: 6px; }
.card .more { font-size: 0.9rem; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.card .more svg { width: 14px; height: 14px; transition: transform .2s; }
a.card:hover .more svg { transform: translateX(3px); }

.card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr; }
.card.featured .card-visual { aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--border); min-height: 300px; }
.card.featured h3 { font-size: 1.55rem; }

/* visuels "code" générés (pas d'image) */
.code-visual { position: absolute; inset: 0; background: var(--code-bg); color: var(--code-text); font-family: var(--mono); font-size: 0.78rem; line-height: 1.7; padding: 20px 22px; overflow: hidden; }
.code-visual .bar { display: flex; gap: 6px; margin-bottom: 14px; }
.code-visual .bar i { width: 10px; height: 10px; border-radius: 50%; background: #334155; }
.code-visual .t { color: #93c5fd; }
.code-visual .a { color: #fcd34d; }
.code-visual .s { color: #86efac; }
.code-visual .x { color: #fca5a5; }
.code-visual .c { color: #64748b; }
.code-visual .del { text-decoration: line-through; color: #64748b; }
.code-visual .hl { background: rgba(252, 165, 165, 0.12); display: inline-block; padding: 0 4px; border-radius: 4px; outline: 1px dashed rgba(252, 165, 165, 0.45); }
.visual-grid { position: absolute; inset: 0; display: grid; place-items: center; background:
  radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%), var(--surface-2); }
.platforms { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 20px; }
.platforms span { font-family: var(--mono); font-size: 0.8rem; background: var(--surface); border: 1px solid var(--border); padding: 8px 12px; border-radius: 8px; }
.platforms span b { color: var(--accent); font-weight: 500; }

/* Archives */
.archive { margin-top: 40px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.archive summary { cursor: pointer; padding: 16px 20px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; list-style: none; }
.archive summary::-webkit-details-marker { display: none; }
.archive summary span { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.archive summary::after { content: "+"; font-family: var(--mono); color: var(--muted); font-size: 1.2rem; }
.archive[open] summary::after { content: "−"; }
.archive ul { list-style: none; padding: 0; border-top: 1px solid var(--border); }
.archive li { display: grid; grid-template-columns: 70px 1fr auto; gap: 16px; align-items: baseline; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 0.93rem; }
.archive li:last-child { border-bottom: 0; }
.archive .y { font-family: var(--mono); color: var(--muted); font-size: 0.8rem; }
.archive .d { color: var(--muted); }
.archive .n { font-weight: 600; color: var(--text); margin-right: 8px; }

/* ---------- Parcours (timeline) */
.timeline { list-style: none; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 148px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.tl { display: grid; grid-template-columns: 130px 1fr; gap: 36px; padding: 0 0 30px; position: relative; }
.tl::before { content: ""; position: absolute; left: 144px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tl.now::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl .when { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); text-align: right; padding-top: 2px; }
.tl h3 { font-size: 1.05rem; line-height: 1.4; }
.tl .org { color: var(--accent); font-weight: 600; }
.tl .where { color: var(--muted); font-size: 0.88rem; }
.tl p { color: var(--text-2); font-size: 0.94rem; margin-top: 6px; max-width: 46rem; }
.tl .tags { margin-top: 10px; }

/* ---------- Certifs */
.certs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cert { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.cert h3 { font-size: 1.02rem; line-height: 1.35; }
.cert .issuer { color: var(--muted); font-size: 0.9rem; }
.cert .meta { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-top: auto; padding-top: 8px; overflow-wrap: anywhere; }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.progress span { display: block; height: 100%; background: var(--warn); border-radius: 99px; }

/* ---------- Compétences */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.skill-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.skill-group h3 { font-size: 0.95rem; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.skill-group h3 svg { width: 18px; height: 18px; color: var(--accent); }
.skill-group .tags { gap: 8px; }
.skill-group .tag { font-size: 0.8rem; padding: 5px 10px; }
.langs { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 4px; font-size: 0.94rem; color: var(--text-2); }
.langs b { color: var(--text); font-weight: 600; }

/* ---------- Contact */
.contact { display: grid; grid-template-columns: 1fr 1.15fr; gap: 32px; align-items: start; }
.contact-lead { font-size: 1.1rem; color: var(--text-2); }
.links { list-style: none; padding: 0; margin-top: 22px; display: grid; gap: 8px; }
.links a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 500; font-size: 0.95rem; }
.links a:hover { border-color: var(--accent-line); }
.links a svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.links a span { color: var(--muted); font-weight: 400; margin-left: auto; font-family: var(--mono); font-size: 0.8rem; overflow-wrap: anywhere; text-align: right; }
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--text-2); }
.form input, .form textarea {
  font: inherit; font-size: 0.95rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 9px; padding: 11px 12px; width: 100%;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form textarea { min-height: 140px; resize: vertical; }
.form .hp { position: absolute; left: -9999px; }
.form small { color: var(--muted); font-size: 0.8rem; }

/* ---------- Footer */
.site-footer { margin-top: 96px; border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: 0.88rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- Pages projet */
.crumbs { padding-top: 32px; font-size: 0.9rem; }
.crumbs a { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.crumbs a:hover { color: var(--text); }
.crumbs svg { width: 14px; height: 14px; }
.p-hero { padding: 28px 0 8px; }
.p-hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -0.03em; line-height: 1.1; margin: 14px 0 14px; font-weight: 750; }
.p-hero .lead { font-size: 1.15rem; color: var(--text-2); max-width: 46rem; }
.p-hero .hero-actions { margin-top: 22px; }
.p-meta { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 32px 0 8px; overflow: hidden; }
.p-meta div { padding: 16px 18px; border-right: 1px solid var(--border); }
.p-meta div:last-child { border-right: 0; }
.p-meta dt { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.p-meta dd { margin: 4px 0 0; font-weight: 600; font-size: 0.95rem; }
.p-layout { display: grid; grid-template-columns: 1fr 260px; gap: 56px; margin-top: 48px; align-items: start; }
.p-content h2 { font-size: 1.45rem; letter-spacing: -0.02em; margin: 44px 0 14px; scroll-margin-top: 84px; }
.p-content h2:first-child { margin-top: 0; }
.p-content h2 .n { font-family: var(--mono); font-size: 0.85rem; color: var(--accent); margin-right: 10px; font-weight: 500; }
.p-content h3 { font-size: 1.08rem; margin: 26px 0 8px; }
.p-content p, .p-content li { color: var(--text-2); }
.p-content p + p { margin-top: 12px; }
.p-content ul, .p-content ol { padding-left: 1.25rem; margin: 10px 0; display: grid; gap: 6px; }
.p-content strong { color: var(--text); }
.p-content pre {
  background: var(--code-bg); color: var(--code-text); border-radius: 12px; padding: 18px 20px;
  overflow-x: auto; font-size: 0.83rem; line-height: 1.7; margin: 14px 0; border: 1px solid var(--border);
}
.p-content pre .c { color: #64748b; } .p-content pre .t { color: #93c5fd; } .p-content pre .a { color: #fcd34d; }
.p-content pre .s { color: #86efac; } .p-content pre .x { color: #fca5a5; }
.callout { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 12px; padding: 14px 18px; margin: 18px 0; color: var(--text-2); font-size: 0.95rem; }
.callout strong { color: var(--text); }
.callout.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--surface); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 500; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.steps { list-style: none; padding: 0 !important; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; }
.steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 1px; font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 16px 0; }
.gallery figure { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery figcaption { font-size: 0.84rem; color: var(--muted); padding: 9px 12px; }
.aside { position: sticky; top: 88px; display: grid; gap: 16px; }
.aside-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 18px; }
.aside-box h4 { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.toc { list-style: none; padding: 0; display: grid; gap: 4px; }
.toc a { color: var(--text-2); font-size: 0.9rem; display: block; padding: 4px 0; }
.toc a:hover { color: var(--accent); }
.aside-box .links { margin-top: 0; }
.aside-box .links a { padding: 9px 11px; font-size: 0.9rem; }
.p-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; }
.p-nav a { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; background: var(--surface); color: var(--text); font-weight: 600; }
.p-nav a:hover { border-color: var(--accent-line); }
.p-nav a small { display: block; color: var(--muted); font-weight: 400; font-size: 0.8rem; font-family: var(--mono); margin-bottom: 4px; }
.p-nav a.next { text-align: right; grid-column: 2; }

/* ---------- Animations d'apparition (désactivées si reduced-motion) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive */
@media (max-width: 960px) {
  .hero-grid, .about, .contact, .p-layout { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .aside { position: static; }
  .certs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .stats, .p-meta { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2), .p-meta div:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2), .p-meta div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .projects, .skills, .certs, .gallery { grid-template-columns: 1fr; }
  .card.featured { grid-template-columns: 1fr; }
  .card.featured .card-visual { border-right: 0; border-bottom: 1px solid var(--border); min-height: 240px; }
  .timeline::before { left: 4px; }
  .tl { grid-template-columns: 1fr; gap: 4px; padding-left: 26px; }
  .tl::before { left: 0; }
  .tl .when { text-align: left; }
  .form .row { grid-template-columns: 1fr; }
  .archive li { grid-template-columns: 1fr; gap: 2px; }
  .section { padding-top: 64px; }
  .p-nav { grid-template-columns: 1fr; }
  .p-nav a.next { grid-column: auto; }
  .section-head::after { display: none; }
}
.lang-group { margin-top: 16px; }
.facts { align-self: start; }
.section-head::after { order: 1; }
.section-head p { order: 2; }
/* Les enfants de grille ont min-width:auto par défaut : un <pre> large
   élargirait toute la colonne et ferait déborder la page sur mobile. */
.p-layout > *, .hero-grid > *, .about > *, .contact > *, .card, .tl > * { min-width: 0; }
@media (max-width: 760px) {
  .aside .aside-box:first-child { display: none; }
  .archive summary span { display: none; }
  .code-visual { font-size: 0.7rem; padding: 16px; }
}
.video { margin: 16px 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #000; }
.video video { display: block; width: 100%; height: auto; }
.video figcaption { font-size: 0.84rem; color: var(--muted); padding: 9px 12px; background: var(--surface); }

/* ---------- Archives : grille de petites cartes ---------- */
.arc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border-top: 1px solid var(--border); padding: 18px 20px; }
.arc-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.arc-card:hover { border-color: var(--accent-line); color: var(--text); transform: translateY(-2px); transition: transform .15s, border-color .15s; }
.arc-card .y { font-family: var(--mono); font-size: 0.72rem; color: var(--accent); }
.arc-card .n { font-weight: 600; font-size: 0.95rem; }
.arc-card .d { color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
@media (max-width: 760px) { .arc-grid { grid-template-columns: 1fr; } }

/* ---------- Stat cliquable ---------- */
a.stat { color: inherit; display: block; position: relative; transition: background .15s; }
a.stat:hover { background: var(--accent-soft); color: inherit; }
a.stat .v { color: var(--text); }

/* ---------- Write-ups ---------- */
.writeups { display: grid; gap: 10px; margin: 14px 0; }
.wu { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); flex-wrap: wrap; }
.wu:hover { border-color: var(--accent-line); color: var(--text); }
.wu svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.wu-name { font-weight: 600; }
.wu-dl { margin-left: auto; font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }

/* ---------- Visuel plateformes (carte Entraînement offensif) ---------- */
.vp { display: grid; gap: 10px; width: 100%; max-width: 340px; padding: 20px; }
.vp-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.vp-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; }
.vp-ic svg { width: 22px; height: 22px; }
.vp-name { font-weight: 600; font-size: 0.9rem; }
.vp-stat { margin-left: auto; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.vp-htb { color: #7cb800; } .vp-thm { color: #b91c1c; } .vp-rm { color: #c01818; }
