/* ─────────────────────────────────────────────
   Palette : brouillard, encre, cobalt, ambre (alerte)
   ───────────────────────────────────────────── */
:root {
  --fog: #e9edf1;
  --ink: #101820;
  --steel: #556272;
  --line: #c5ced8;
  --cobalt: #1b4fd8;
  --amber: #e8a020;
  --alarm: #d6342c;
  --console: #0f1b2a;
  --console-text: #b8d4e3;
  --console-key: #8fd3e8;
  --code-bg: #dde3ea;

  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 40rem;
  --wide: 62rem;
  --gutter: clamp(1.1rem, 4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fog: #0b121b;
    --ink: #e6ecf2;
    --steel: #93a1b1;
    --line: #243242;
    --cobalt: #7ea2ff;
    --console: #060b12;
    --code-bg: #131e2b;
  }
}

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

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

body {
  margin: 0;
  background: var(--fog);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.1875rem;
  line-height: 1.7;
  font-optical-sizing: auto;
}

a { color: var(--cobalt); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--ink); color: var(--fog);
  padding: 0.5rem 0.9rem; z-index: 10;
}
.skip-link:focus { top: 0.75rem; }

/* ── En-tête ───────────────────────────────── */
.site-header {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.4rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 2rem;
  border-bottom: 1px solid var(--line);
}
.site-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.site-nav { display: flex; gap: 1.6rem; font-family: var(--font-display); font-weight: 500; font-size: 1rem; }
.site-nav a { color: var(--steel); text-decoration: none; padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--amber); }

main { display: block; }

/* ── Accueil : alerte d'ouverture ──────────── */
.hero {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) var(--gutter) 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6.2vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0 0 1.1rem;
  max-width: 17ch;
}
.hero-lede {
  max-width: 34rem;
  font-size: 1.3rem;
  color: var(--steel);
  margin: 0 0 2.2rem;
}

.alert {
  position: relative;
  background: var(--console);
  color: var(--console-text);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.75;
  padding: 1.2rem 1.4rem 1.3rem;
  border-left: 6px solid var(--amber);
  border-radius: 3px;
  overflow-x: auto;
  max-width: 44rem;
}
.alert-bar {
  display: flex; justify-content: space-between; gap: 1rem;
  color: #7e93a6; font-size: 0.75rem; margin-bottom: 0.7rem;
}
.alert-level { color: var(--amber); font-weight: 500; }
.alert .row { display: block; white-space: pre; }
.alert .k { color: var(--console-key); }
.alert .v { color: #eaf3f8; }
.alert .hot { color: var(--amber); }

@media (prefers-reduced-motion: no-preference) {
  .alert .row { opacity: 0; animation: ligne 0.35s ease-out forwards; animation-delay: calc(var(--i) * 0.16s + 0.2s); }
  @keyframes ligne { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
}

/* ── Sections de l'accueil ─────────────────── */
.section {
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter) 0;
}
.section > h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.015em;
  margin: 0 0 1.2rem;
}
.section-more { margin: 1.2rem 0 0; font-family: var(--font-display); font-weight: 500; }

.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.6rem 2.4rem; margin: 0; }
.skills dt { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin-bottom: 0.2rem; }
.skills dd { margin: 0; color: var(--steel); font-size: 1.05rem; line-height: 1.55; }

/* ── Liste d'articles ──────────────────────── */
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post-list li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.2rem 1.5rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}
.post-list time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--steel); padding-top: 0.45rem; }
.post-list h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
.post-list h3 a { color: var(--ink); text-decoration: none; }
.post-list h3 a:hover { color: var(--cobalt); text-decoration: underline; }
.post-list p { grid-column: 2; margin: 0.25rem 0 0; color: var(--steel); font-size: 1.02rem; line-height: 1.55; }
.post-list .cat { font-family: var(--font-mono); font-size: 0.75rem; color: var(--steel); }

@media (max-width: 36rem) {
  .post-list li { grid-template-columns: 1fr; }
  .post-list p { grid-column: 1; }
  .post-list time { padding-top: 0; }
}

/* ── Pages et articles (texte long) ────────── */
.prose {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) 2rem;
}
.prose h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}
.prose h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; letter-spacing: -0.015em; margin: 2.6rem 0 0.6rem; line-height: 1.2; }
.prose h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; margin: 2rem 0 0.4rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15rem; }
.prose li { margin-bottom: 0.3rem; }
.prose img { max-width: 100%; height: auto; border-radius: 3px; }
.prose blockquote {
  margin: 1.5rem 0; padding: 0.1rem 0 0.1rem 1.1rem;
  border-left: 4px solid var(--amber); color: var(--steel); font-style: italic;
}
.prose table { border-collapse: collapse; width: 100%; font-size: 1rem; margin: 1.5rem 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--font-display); font-weight: 700; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.post-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--steel); margin: 0 0 0.9rem; }
.post-lede { font-size: 1.3rem; color: var(--steel); line-height: 1.55; margin: 0 0 2rem; }
.post-footer { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-family: var(--font-display); font-weight: 500; }

/* ── Code ──────────────────────────────────── */
code, pre { font-family: var(--font-mono); }
:not(pre) > code {
  font-size: 0.85em; background: var(--code-bg); padding: 0.12em 0.4em; border-radius: 3px;
}
pre, div.highlighter-rouge {
  margin: 1.4rem 0;
}
div.highlighter-rouge pre.highlight, pre {
  background: var(--console);
  color: #dbe7ef;
  font-size: 0.84rem;
  line-height: 1.65;
  padding: 1rem 1.2rem;
  border-radius: 3px;
  overflow-x: auto;
  margin: 0;
}
div.highlighter-rouge { max-width: calc(100vw - 2 * var(--gutter)); }
pre code { background: none; padding: 0; font-size: inherit; }

/* Coloration syntaxique (Rouge), volontairement sobre */
.highlight .c, .highlight .c1, .highlight .cm { color: #6f869a; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .nt { color: #8fd3e8; }
.highlight .s, .highlight .s1, .highlight .s2 { color: #e8c07a; }
.highlight .na, .highlight .nb { color: #9fc2ff; }
.highlight .m, .highlight .mi { color: #f2a33a; }
.highlight .o, .highlight .p { color: #a9bccb; }

/* ── Projets ───────────────────────────────── */
.project { padding: 1.4rem 0; border-top: 1px solid var(--line); }
.project h2 { margin-top: 0; }
.project .status { font-family: var(--font-mono); font-size: 0.78rem; color: var(--steel); margin: 0 0 0.5rem; }
.project .status.done { color: #1f7a45; }
@media (prefers-color-scheme: dark) { .project .status.done { color: #5fd08a; } }

/* ── Pied de page ──────────────────────────── */
.site-footer {
  max-width: var(--wide);
  margin: 4rem auto 0;
  padding: 1.5rem var(--gutter) 3rem;
  border-top: 1px solid var(--line);
  color: var(--steel);
  font-size: 0.95rem;
  line-height: 1.55;
}
.site-footer p { margin: 0 0 0.6rem; max-width: 44rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-family: var(--font-display); font-weight: 500; }
