/* ────────────────────────────────────────────────────────────
   kratox.fr — feuille de style unique
   Concept : un dossier technique. Colonne de lecture, métadonnées
   en marge gauche, filets fins, une seule couleur d'accent.
   ──────────────────────────────────────────────────────────── */

@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --ink: #151922;
  --muted: #565E6D;
  --rule: #D8DCE3;
  --rule-strong: #A9B0BC;
  --accent: #284A84;
  --accent-soft: #E3E9F4;
  --ok: #2B6449;
  --ok-soft: #E1EEE7;
  --bad: #A3332F;

  --cover-bg: #E6E7EA;
  --cover-ink: #1A1D24;
  --cover-line: #9A2F33;

  --f-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --s-1: 1.2rem;
  --s-2: 1.5rem;
  --s-3: clamp(1.8rem, 1.35rem + 1.8vw, 2.4rem);
  --s-4: clamp(2.1rem, 1.4rem + 3vw, 3.5rem);

  --max: 1120px;
  --meta: 190px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1217;
    --surface: #161A21;
    --ink: #E5E8ED;
    --muted: #9AA2AF;
    --rule: #272C35;
    --rule-strong: #485160;
    --accent: #93B1E6;
    --accent-soft: #1C2638;
    --ok: #8FCCA9;
    --ok-soft: #17261E;
    --bad: #F08A82;
    --cover-bg: #D9DBDF;
    color-scheme: dark;
  }
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.012em; text-wrap: balance; margin: 0; }
p, ul, ol, dl, dd, figure { margin: 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }
strong { font-weight: 600; }
code { font-family: var(--f-mono); }

.skip { position: absolute; left: 16px; top: -100px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 3px; z-index: 20; }
.skip:focus { top: 12px; }

.bar {
  --gx: 20px;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(var(--gx), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gx), env(safe-area-inset-right, 0px));
}
@media (min-width: 760px) { .bar { --gx: 40px; } }

.label { font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--f-mono); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.kicker { color: var(--muted); font-size: 0.95rem; }

.chip {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.chip-ok { background: var(--ok-soft); color: var(--ok); }

.stack { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--f-mono); font-size: 0.8rem; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center;
  font: 500 0.95rem var(--f-body);
  padding: 10px 16px;
  border-radius: 4px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  transition: background-color 120ms, border-color 120ms;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { background: transparent; border-color: var(--ink); }
.more { font-weight: 500; }
.more::after { content: " →"; }

/* ── En-tête et pied de page ─────────────────────────────── */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-block: 18px; }
.brand { font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.nav { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; padding-block: 6px; display: inline-block; }
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

.site-footer { border-top: 1px solid var(--rule); margin-top: 32px; }
.footer-grid { display: grid; gap: 16px 40px; padding-block: 32px 48px; font-size: 0.9rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1fr auto; } }
.footer-name { font-weight: 600; }
.footer-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--ink); }
.footer-date { font-size: 0.85rem; }

/* ── Sections ────────────────────────────────────────────── */
.section { padding-block: 56px; position: relative; }
/* Filet aligné sur la colonne de texte, pas sur les marges */
.section::before { content: ""; position: absolute; top: 0; height: 1px; background: var(--rule); left: max(var(--gx, 0px), env(safe-area-inset-left, 0px)); right: max(var(--gx, 0px), env(safe-area-inset-right, 0px)); }
.bar .section::before { left: 0; right: 0; }
.sec-head { display: grid; gap: 10px; align-content: start; margin-bottom: 32px; max-width: 62ch; }
.sec-head h2 { font-size: var(--s-3); }
.split { display: grid; gap: 8px 48px; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); }
  .split .sec-head { margin-bottom: 0; }
}
.prose { display: grid; gap: 14px; max-width: 64ch; min-width: 0; }
.prose p:first-child { font-size: 1.08rem; }

/* Accueil */
.hero { padding-block: 64px 56px; }
.hero .label { margin-bottom: 20px; }
.hero h1 { font-size: var(--s-4); max-width: 21ch; }
.lede { font-size: 1.12rem; max-width: 60ch; margin-top: 24px; }
.lede-2 { margin-top: 12px; font-size: 1rem; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px 32px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--rule); }
.facts > div { display: grid; gap: 4px; align-content: start; min-width: 0; }
.facts dd { font-size: 0.95rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.rows { display: grid; }
.row { display: grid; gap: 10px 40px; padding-block: 28px; border-top: 1px solid var(--rule); }
.row:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 760px) { .row { grid-template-columns: var(--meta) minmax(0, 1fr); } }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
@media (min-width: 760px) { .row-meta { flex-direction: column; align-items: flex-start; } }
.row-body { display: grid; gap: 8px; min-width: 0; max-width: 66ch; }
.row-body h3 { font-size: var(--s-2); }
.row-body h3 a { color: var(--ink); text-decoration: none; }
.row-body h3 a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; }
.row-body .kicker { margin-top: -4px; }
.row-body .stack { margin-top: 4px; }

.aside-list { margin-top: 24px; padding-top: 28px; border-top: 1px solid var(--rule); display: grid; gap: 16px; }
@media (min-width: 760px) { .aside-list { grid-template-columns: var(--meta) minmax(0, 1fr); column-gap: 40px; } }
.aside-list h3 { font-size: var(--s-1); }
.mini { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px 32px; }
.mini li { display: grid; gap: 4px; min-width: 0; }
.mini span { color: var(--muted); font-size: 0.93rem; }

.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px 40px; }
.skills > div { display: grid; gap: 6px; align-content: start; min-width: 0; }
.skills dt { font-weight: 600; }
.skills dd { color: var(--muted); font-size: 0.95rem; }

.timeline { list-style: none; padding: 0; display: grid; margin-bottom: 24px; }
.timeline li { display: grid; gap: 2px 40px; padding-block: 14px; border-top: 1px solid var(--rule); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 760px) { .timeline li { grid-template-columns: var(--meta) minmax(0, 1fr); } }
.timeline .when { color: var(--muted); }

.teaser-covers { display: flex; gap: 16px; margin-bottom: 20px; width: max-content; max-width: 100%; }
.teaser-covers img { width: 110px; border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 10px 22px -12px rgba(0,0,0,.45); transition: transform 160ms ease; }
@media (prefers-reduced-motion: no-preference) { .teaser-covers:hover img { transform: translateY(-3px); } }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px 40px; }
.contact-grid > div { display: grid; gap: 6px; align-content: start; min-width: 0; }
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mail code { font-size: 1rem; overflow-wrap: anywhere; user-select: all; }
.copy { font: 500 0.8rem var(--f-body); border: 1px solid var(--rule-strong); background: transparent; color: var(--ink); padding: 4px 10px; border-radius: 3px; cursor: pointer; }
.copy:hover { border-color: var(--ink); }

/* ── Pages intérieures ───────────────────────────────────── */
.page-head { padding-block: 56px 16px; display: grid; gap: 14px; max-width: 64ch; }
.page-head h1 { font-size: var(--s-4); }
.page-head .lede { margin-top: 4px; }
.h-section { font-size: var(--s-3); margin-bottom: 28px; }

.crumbs { padding-top: 28px; font-size: 0.9rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.project-head { padding-block: 36px 8px; display: grid; gap: 14px; max-width: 64ch; }
.project-head h1 { font-size: var(--s-4); }
.project-head .lede { margin-top: 0; }
.project-facts { margin-top: 28px; margin-bottom: 20px; }
.figure { font-family: var(--f-display); font-weight: 600; font-size: 1.6rem; line-height: 1.1; }

.diagram-wrap { margin-top: 40px; padding: 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; display: grid; gap: 12px; }
.diagram-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.diagram { display: block; width: 100%; min-width: 640px; height: auto; }
.diagram-wrap figcaption { font-size: 0.85rem; }
.scroll-hint { display: none; }
@media (max-width: 699px) { .scroll-hint { display: inline; } .diagram-wrap { padding: 14px; } }
.d-node rect { fill: var(--surface); stroke: var(--rule-strong); stroke-width: 1; }
.d-node.d-accent rect { stroke: var(--accent); stroke-width: 1.5; }
.d-zone rect { fill: none; stroke: var(--rule-strong); stroke-dasharray: 4 4; }
.d-title { font-family: var(--f-body); font-weight: 600; font-size: 14px; fill: var(--ink); }
.d-sub { font-family: var(--f-mono); font-size: 12px; fill: var(--muted); }
.d-label { font-family: var(--f-mono); font-size: 12px; fill: var(--muted); }
.d-line { stroke: var(--muted); stroke-width: 1.3; fill: none; }
.d-line.d-block { stroke: var(--bad); stroke-dasharray: 5 4; }
.d-head { fill: var(--muted); }
.d-head-block { fill: var(--bad); }
.d-cross { stroke: var(--bad); stroke-width: 2.2; }
.d-label.d-ok { fill: var(--ok); }
.d-label.d-bad { fill: var(--bad); }

.project-sections { display: grid; gap: 40px; margin-top: 48px; max-width: 68ch; }
.project-sections section { display: grid; gap: 12px; }
.project-sections h2 { font-size: var(--s-2); }
.project-sections ul, .entry-body ul { padding-left: 1.15em; display: grid; gap: 6px; }
.project-sections li::marker, .entry-body li::marker { color: var(--muted); }

.pager { margin-top: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.pager a { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 4px; color: var(--ink); text-decoration: none; font-weight: 500; }
.pager a:last-child { text-align: right; }
.pager a:hover { border-color: var(--accent); color: var(--accent); }

.entry { display: grid; gap: 10px 40px; padding-block: 28px; border-top: 1px solid var(--rule); scroll-margin-top: 16px; }
.entry:first-of-type { border-top: 0; padding-top: 0; }
@media (min-width: 760px) { .entry { grid-template-columns: var(--meta) minmax(0, 1fr); } }
.entry-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.9rem; }
@media (min-width: 760px) { .entry-meta { flex-direction: column; } }
.entry-body { display: grid; gap: 10px; min-width: 0; max-width: 66ch; }
.entry-body h3 { font-size: var(--s-1); }
.entry-body .kicker { margin-top: -6px; }
.langs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 32px; margin-bottom: 28px; }
.section .langs + p { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }

/* Livres */
.shelf { display: grid; gap: 48px; padding-top: 24px; padding-bottom: 56px; }
.book { display: grid; gap: 24px 40px; align-items: start; }
@media (min-width: 760px) { .book { grid-template-columns: 280px minmax(0, 1fr); } }
.book-info { display: grid; gap: 10px; justify-items: start; max-width: 60ch; min-width: 0; padding-top: 4px; }
.book-info h2 { font-size: var(--s-3); }
.cover { width: 100%; max-width: 280px; aspect-ratio: 2 / 3; border-radius: 2px 5px 5px 2px; box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 14px 30px -14px rgba(0,0,0,.5); object-fit: cover; }
.cover-type {
  background: var(--cover-bg); color: var(--cover-ink);
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 28px 24px; position: relative; overflow: hidden;
}
.cover-type::before { content: ""; position: absolute; left: 24px; top: 46%; width: 48px; height: 2px; background: var(--cover-line); }
.cover-vol { position: absolute; top: 24px; left: 24px; font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; }
.cover-title { font-family: var(--f-display); font-weight: 600; font-size: 2.6rem; letter-spacing: 0.08em; line-height: 1; margin-top: -18%; }
.cover-sub { font-style: italic; margin-top: 18px; }
.cover-author { position: absolute; bottom: 24px; left: 24px; font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }

.notfound { padding-block: 80px 48px; }
.links-404 { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 8px; }

@media print {
  .site-header nav, .skip, .copy, .pager { display: none; }
  body { background: #fff; color: #000; }
}
