:root {
  --bg: #f4f2ec; --panel: #eeece4; --fg: #111110;
  --muted: #6b6a64; --faint: #a8a69d;
  --rule: #111110; --rule-faint: #cfcdc3;
  --sans: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--mono); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content:''; position: fixed; inset: 0;
  background-image: radial-gradient(var(--rule-faint) 1px, transparent 1px);
  background-size: 24px 24px; opacity: .35; pointer-events: none; z-index: 0;
}
a { color: inherit; text-decoration: none; }

.page { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: 40px 32px 140px; }
.page.post-page { max-width: 1100px; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--rule); padding: 10px 14px;
  margin-bottom: 56px; background: var(--bg);
}
.topbar .brand { color: var(--fg); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: baseline; gap: 4px; }
.topbar .brand::before { content: '▮ '; }
.topbar nav { display: flex; gap: 22px; }
.topbar nav a:hover,
.topbar nav a[aria-current="page"] { color: var(--fg); }
.topbar nav a[aria-current="page"]::before { content: '→ '; }
.topbar .langswitch { display: inline-flex; gap: 22px; }
.topbar .langswitch a:hover,
.topbar .langswitch a[aria-current="true"] { color: var(--fg); }
.topbar .langswitch a[aria-current="true"]::before { content: '→ '; }

header.masthead {
  border: 1px solid var(--rule); padding: 28px 28px 24px;
  margin-bottom: 64px; background: var(--bg); position: relative;
}
header.masthead::before {
  content: 'ID'; position: absolute; top: -1px; left: 20px;
  transform: translateY(-50%); background: var(--bg); padding: 0 8px;
  font-size: 10px; letter-spacing: 0.2em; color: var(--muted);
}
.id-grid { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: start; }
.id-grid h1 { font-family: var(--mono); font-weight: 600; font-size: 36px; line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 16px; }
.id-grid h1 .caret { color: var(--muted); margin-right: 6px; }
.id-grid .bio { font-family: var(--sans); font-size: 15px; color: var(--muted); line-height: 1.5; margin: 0; max-width: 56ch; }
.id-grid .bio b { color: var(--fg); font-weight: 500; }
.id-grid .side { font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap; }
.id-grid .side div + div { margin-top: 4px; }
.id-grid .side b { color: var(--fg); font-weight: 500; }

.section-label { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 0 0 20px; display: flex; align-items: baseline; gap: 14px; }
.section-label::before { content: '###'; color: var(--fg); }
.section-label .count { margin-left: auto; color: var(--faint); font-size: 11px; }
.section-label hr { flex: 1; border: none; border-top: 1px dashed var(--rule-faint); }

.posts { list-style: none; padding: 0; margin: 0 0 80px; border-top: 1px solid var(--rule); }
.post-item { display: grid; grid-template-columns: 110px 1fr 90px; gap: 24px; padding: 20px 8px; border-bottom: 1px solid var(--rule-faint); align-items: baseline; transition: background .12s; }
.post-item:hover { background: var(--panel); }
.post-item:last-child { border-bottom: 1px solid var(--rule); }
.post-item .date { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.post-item .body h2 { font-family: var(--mono); font-weight: 500; font-size: 15px; line-height: 1.35; margin: 0 0 4px; }
.post-item .body h2 a::before { content: './'; color: var(--muted); margin-right: 2px; }
.post-item .body h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-item .dek { font-family: var(--sans); font-size: 13.5px; color: var(--muted); margin: 0 0 8px; line-height: 1.5; max-width: 62ch; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.tags span { border: 1px solid var(--rule-faint); padding: 1px 6px; }
.post-item .reading { font-family: var(--mono); font-size: 11px; color: var(--faint); text-align: right; }

footer.colophon { margin-top: 80px; padding-top: 20px; border-top: 1px dashed var(--rule-faint); display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); }
footer.colophon .links { display: flex; gap: 18px; }
footer.colophon a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* ---- Résumé / CV ---- */
.resume { margin-top: 40px; }
.resume-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--rule); background: var(--bg);
}
.resume-cols > div { padding: 24px 22px; }
.resume-cols > div + div { border-left: 1px solid var(--rule); }
.col-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 18px; padding-bottom: 10px;
  border-bottom: 1px dashed var(--rule-faint);
}
.col-label::before { content: '// '; color: var(--fg); }
.entry { padding: 12px 0; border-bottom: 1px dashed var(--rule-faint); }
.entry:last-child { border-bottom: none; padding-bottom: 0; }
.entry:first-child { padding-top: 0; }
.entry .head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; font-family: var(--mono); font-size: 13px; line-height: 1.35;
  margin-bottom: 6px;
}
.entry .head strong { font-weight: 500; flex: 1; min-width: 0; }
.entry .head .yr { flex-shrink: 0; color: var(--muted); font-size: 11px; }
.entry .org { font-family: var(--sans); font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.entry .desc { font-family: var(--sans); font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.entry ul { margin: 0; padding-left: 14px; font-family: var(--sans); font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.entry ul li { margin-bottom: 2px; }
.entry ul li::marker { color: var(--faint); }
.skills {
  border: 1px solid var(--rule); border-top: none;
  padding: 22px 22px 24px; background: var(--bg);
}
.skills .col-label { margin-bottom: 14px; }
.skills-grid {
  display: grid; grid-template-columns: 120px 1fr;
  gap: 12px 20px; font-family: var(--mono); font-size: 12px;
}
.skills-grid dt { color: var(--muted); }
.skills-grid dd { margin: 0; }
.skills-grid dd .chip {
  display: inline-block; border: 1px solid var(--rule-faint);
  padding: 1px 7px; margin: 0 4px 4px 0; font-size: 11px; white-space: nowrap;
}

/* ---- Tags terms page ---- */
.tag-list { list-style: none; padding: 0; margin: 0 0 80px; border-top: 1px solid var(--rule); }
.tag-item {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 8px; border-bottom: 1px solid var(--rule-faint);
  font-family: var(--mono); font-size: 13px; transition: background .12s;
}
.tag-item:last-child { border-bottom: 1px solid var(--rule); }
.tag-item:hover { background: var(--panel); }
.tag-item a { display: flex; justify-content: space-between; align-items: baseline; width: 100%; gap: 20px; }
.tag-name::before { content: '#'; color: var(--muted); margin-right: 2px; }
.tag-count { font-size: 11px; color: var(--faint); }
.tags a { border: 1px solid var(--rule-faint); padding: 1px 6px; color: var(--muted); }

/* ---- Article ---- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--rule-faint); z-index: 100; }
.progress .bar { height: 100%; background: var(--fg); width: 0%; transition: width .08s linear; }

.article.with-toc { display: grid; grid-template-columns: 180px 1fr; gap: 36px; }
.article.with-toc .toc-col { padding-top: 22px; }
.article.with-toc .main-col { min-width: 0; max-width: 760px; }

.toc { position: sticky; top: 30px; font-family: var(--mono); font-size: 11px; }
.toc .label { color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px dashed var(--rule-faint); }
.toc .label::before { content: '// '; color: var(--fg); }
.toc ol, .toc ul { list-style: none; padding: 0; margin: 0; }
.toc > nav > ol { display: flex; flex-direction: column; gap: 7px; }
.toc a { color: var(--muted); display: block; padding: 3px 0 3px 8px; border-left: 1px solid transparent; margin-left: -9px; line-height: 1.4; transition: color .12s, border-color .12s; }
.toc a:hover { color: var(--fg); }
.toc a.active { color: var(--fg); border-left-color: var(--fg); }

/* Top-level entries (H2) — bolder, primary */
.toc > nav > ol > li > a { color: var(--fg); font-weight: 500; letter-spacing: 0.01em; }

/* Nested entries (H3) — indented with a vertical guide */
.toc ol ol { margin: 5px 0 2px; padding-left: 14px; position: relative; display: flex; flex-direction: column; gap: 4px; }
.toc ol ol::before { content: ''; position: absolute; left: 4px; top: 4px; bottom: 4px; border-left: 1px dashed var(--rule-faint); }
.toc ol ol a { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.toc ol ol a::before { content: '─ '; color: var(--faint); }
.toc ol ol a.active::before { color: var(--fg); }

.hero { border: 1px solid var(--rule); padding: 30px 32px 26px; margin: 0 0 28px; background: var(--bg); position: relative; }
.hero::before { content: 'ARTICLE'; position: absolute; top: -1px; left: 22px; transform: translateY(-50%); background: var(--bg); padding: 0 8px; font-size: 10px; letter-spacing: 0.2em; color: var(--muted); }
.hero .post-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 14px; display: flex; gap: 18px; flex-wrap: wrap; }
.hero .post-meta span + span::before { content: '·'; color: var(--faint); margin-right: 18px; margin-left: -16px; }
.hero h1 { font-family: var(--mono); font-weight: 600; font-size: 24px; line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 14px; text-wrap: balance; overflow-wrap: break-word; hyphens: none; }
.hero h1::before { content: '# '; color: var(--muted); }
.hero .post-dek { font-family: var(--sans); font-size: 15px; line-height: 1.55; color: var(--muted); margin: 0; max-width: 62ch; }

.tldr { border: 1px solid var(--rule); border-left: 3px solid var(--fg); padding: 14px 18px 16px; margin: 0 0 28px; background: var(--panel); }
.tldr .label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.tldr .label::before { content: '/// '; color: var(--fg); }
.tldr ul { margin: 0; padding-left: 18px; font-family: var(--sans); font-size: 14.5px; line-height: 1.55; }
.tldr li { margin-bottom: 4px; }
.tldr li::marker { color: var(--muted); }

.post-body { font-family: var(--sans); font-size: 15.5px; line-height: 1.72; }
.post-body p { text-align: justify; hyphens: auto; }
.post-body > * + * { margin-top: 1em; }
.post-body h2 { font-family: var(--mono); font-weight: 600; font-size: 17px; line-height: 1.25; margin: 2.2em 0 0.6em; scroll-margin-top: 30px; }
.post-body h2::before { content: '## '; color: var(--muted); }
.post-body h3 { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 1.8em 0 0.4em; scroll-margin-top: 30px; }
.post-body h3::before { content: '> '; color: var(--fg); }
.post-body p { margin: 0; }
.post-body a { border-bottom: 1px solid var(--fg); }
.post-body blockquote { border-left: 2px solid var(--rule); padding: 4px 0 4px 18px; color: var(--muted); font-family: var(--mono); font-size: 14px; margin: 1.2em 0; }
.post-body pre { font-family: var(--mono); font-size: 12.5px; line-height: 1.65; background: var(--panel); border: 1px solid var(--rule-faint); border-left: 2px solid var(--fg); padding: 16px 18px; overflow-x: auto; margin: 1.6em 0; color: var(--fg); position: relative; }
.post-body code { font-family: var(--mono); font-size: 0.92em; background: var(--panel); padding: 1px 5px; border: 1px solid var(--rule-faint); }
.post-body pre code { background: none; padding: 0; border: none; }
.post-body figure { margin: 1.8em 0; }
.post-body figcaption { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.post-body img { display: block; max-width: 480px; width: 100%; height: auto; margin: 1.8em auto; border: 1px solid var(--rule-faint); }
.post-body figure { text-align: center; }
.post-body figure img { max-width: 480px !important; width: auto !important; }
.post-body img.wide, .post-body figure.wide img { max-width: 100% !important; width: 100% !important; }
.post-body table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; margin: 1.6em 0; }
.post-body th, .post-body td { text-align: left; padding: 9px 14px; border-bottom: 1px dashed var(--rule-faint); }
.post-body th { font-weight: 500; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.share { margin-top: 48px; border: 1px solid var(--rule); padding: 14px 18px; background: var(--bg); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-family: var(--mono); font-size: 11px; color: var(--muted); position: relative; }
.share::before { content: 'PARTAGE'; position: absolute; top: -1px; left: 16px; transform: translateY(-50%); background: var(--bg); padding: 0 8px; font-size: 10px; letter-spacing: 0.2em; color: var(--muted); }
.share .spacer { flex: 1; }
.share button, .share a.btn { border: 1px solid var(--rule); padding: 5px 10px; font-family: var(--mono); font-size: 11px; color: var(--fg); background: transparent; cursor: pointer; text-decoration: none; transition: background .12s, color .12s; }
.share button:hover, .share a.btn:hover { background: var(--fg); color: var(--bg); }

.next-read { margin-top: 40px; border: 1px solid var(--rule); position: relative; background: var(--bg); }
.next-read::before { content: 'À LIRE ENSUITE'; position: absolute; top: -1px; left: 18px; transform: translateY(-50%); background: var(--bg); padding: 0 8px; font-size: 10px; letter-spacing: 0.2em; color: var(--muted); }
.next-read ul { list-style: none; padding: 0; margin: 0; }
.next-read li { display: grid; grid-template-columns: 100px 1fr auto; gap: 20px; padding: 16px 20px; border-bottom: 1px dashed var(--rule-faint); align-items: baseline; transition: background .12s; }
.next-read li:last-child { border-bottom: none; }
.next-read li:hover { background: var(--panel); }
.next-read .date { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.next-read .title { font-family: var(--mono); font-size: 13.5px; color: var(--fg); }
.next-read .title::before { content: './'; color: var(--muted); margin-right: 2px; }
.next-read .dek { display: block; font-family: var(--sans); font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.next-read .reading { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.refs { margin-top: 32px; border-top: 1px dashed var(--rule-faint); padding-top: 20px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); line-height: 1.65; }
.refs .label { letter-spacing: 0.18em; text-transform: uppercase; font-size: 10px; margin-bottom: 10px; }
.refs .label::before { content: '## '; color: var(--fg); }
.refs ol { padding-left: 20px; margin: 0; }

@media (max-width: 900px) {
  .article.with-toc { grid-template-columns: 1fr; }
  .toc { position: static; margin-bottom: 20px; }
}
@media (max-width: 720px) {
  .page { padding: 28px 20px 90px; }
  .id-grid { grid-template-columns: 1fr; }
  .id-grid h1 { font-size: 28px; }
  .id-grid .side { text-align: left; }
  .post-item { grid-template-columns: 1fr; gap: 4px; }
  .post-item .reading { text-align: left; }
  .resume-cols { grid-template-columns: 1fr; }
  .resume-cols > div + div { border-left: none; border-top: 1px solid var(--rule); }
}
