/* sn0walice.dev : design system v2.
 *
 * Une seule feuille pour tout le site. Fond noir, un accent (vert), deux
 * polices : JetBrains Mono pour les labels, donnees et titres, la sans-serif
 * systeme pour les phrases. Chaque page est faite des memes briques :
 *
 *   .plate     panneau d'en-tete encadre (barre, corps, statusline, hexdump)
 *   .sec       section : numero + nom + meta a gauche, contenu a droite
 *   .meta      lignes cle/valeur
 *
 * Les classes .post-* sont emises par le Rust (src/helper/cache.rs) : ne pas
 * les renommer sans toucher au rendu.
 */

@font-face { font-family: 'JetBrains Mono'; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/webfonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/webfonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #000;
  --panel: #0a0a0a;
  --line: #1f1f1f;
  --line-2: #2c2c2c;
  --fg: #f1f1ef;
  --text: #c9c9c5;
  --dim: #8a8a86;
  --faint: #55554f;
  --accent: #00ff6a;
  --accent-soft: rgba(0,255,106,.1);
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --side: clamp(240px, 20vw, 320px);
  --ease: cubic-bezier(.2,.7,.2,1);
  /* utilises par les visualisations SVG inline (Tor, projets) */
  --viz-line: #2c2c2c;
  --viz-accent: #00ff6a;
}

/* --- base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { background: var(--bg); color-scheme: dark; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; color: var(--fg); font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
main { flex: 1; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, svg { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #000; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
html { scrollbar-color: var(--line-2) var(--bg); }

.mono, .label, .rail, .meta, .statusline, .btn, .k, .plate__bar { font-family: var(--mono); }
.label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.accent { color: var(--accent); }
.dim { color: var(--dim); }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -40px; z-index: 50; padding: 8px 14px; background: var(--fg); color: #000; font: 12px var(--mono); text-decoration: none; }
.skip:focus { top: 12px; }

/* --- fond : grille de points + spot qui suit le curseur ---------------- */
body::before, body::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-size: 22px 22px; background-position: 11px 11px; }
body::before { background-image: radial-gradient(circle, #1c1c1c 1px, transparent 1.4px);
  -webkit-mask: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%);
          mask: radial-gradient(ellipse 90% 70% at 50% 30%, #000 40%, transparent 100%); }
body::after { background-image: radial-gradient(circle, rgba(0,255,106,.55) 1px, transparent 1.6px); opacity: 0; transition: opacity .4s;
  -webkit-mask: radial-gradient(200px circle at var(--mx, 50%) var(--my, -999px), #000, transparent 70%);
          mask: radial-gradient(200px circle at var(--mx, 50%) var(--my, -999px), #000, transparent 70%); }
body.spot::after { opacity: 1; }

/* --- top bar ---------------------------------------------------------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(0,0,0,.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 14px var(--mono); white-space: nowrap; }
.brand img { width: 26px; height: 26px; border-radius: 50%; outline: 1px solid var(--line-2); outline-offset: 2px; transition: outline-color .3s; }
.brand:hover img { outline-color: var(--accent); }
.crumb { font: 12px var(--mono); color: var(--faint); white-space: nowrap; text-transform: uppercase; }
.crumb b { color: var(--accent); font-weight: 400; }
.nav ul { display: flex; gap: 24px; list-style: none; font: 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.nav a { position: relative; display: block; padding: 6px 0; text-decoration: none; color: var(--dim); transition: color .2s; }
.nav a:hover, .nav a[aria-current] { color: var(--fg); }
.nav a[aria-current]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -13px; height: 1px; background: var(--accent); }
/* menu mobile : <details>, zero JS */
.navm { display: none; position: relative; }
.navm summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line-2); font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.navm summary::-webkit-details-marker { display: none; }
.navm summary::before { content: '≡'; font-size: 14px; line-height: 1; color: var(--accent); }
.navm[open] summary { color: var(--fg); border-color: var(--fg); }
.navm[open] summary::before { content: '×'; }
.navm ul { position: absolute; right: 0; top: calc(100% + 10px); min-width: 200px; list-style: none; padding: 6px; background: rgba(5,5,5,.96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line-2); }
.navm a { display: flex; justify-content: space-between; padding: 10px 12px; font: 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--dim); }
.navm a::after { content: attr(data-n); color: var(--faint); }
.navm a:hover, .navm a[aria-current] { color: var(--fg); background: var(--accent-soft); }
.navm a[aria-current]::after { color: var(--accent); }

/* --- plate : panneau d'en-tete ---------------------------------------- */
.plate { position: relative; overflow: hidden; margin: 24px auto 0; width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--max) - 2 * var(--gutter) + 40px);
  border: 1px solid var(--line); background: rgba(10,10,10,.72); }
.plate > :not(.hex) { position: relative; z-index: 1; }
.plate::before, .plate::after { content: ''; position: absolute; width: 14px; height: 14px; z-index: 2; border: 0 solid var(--accent); pointer-events: none; }
.plate::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.plate::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
.plate__bar { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; font-size: 12px; color: var(--dim); text-transform: uppercase; }
.plate__bar a { text-decoration: none; transition: color .2s; }
.plate__bar a:hover { color: var(--accent); }
.plate__body { display: grid; grid-template-columns: 1fr clamp(240px, 22vw, 340px); gap: 40px; align-items: center; padding: 32px 20px 44px; }
.plate h1 { font: 700 clamp(40px, 7vw, 88px)/.95 var(--mono); letter-spacing: -.04em; overflow-wrap: anywhere; }
.plate h1 .zero, .plate h1 .hash { color: var(--accent); }
.plate__lead { margin-top: 20px; max-width: 56ch; font-size: 18px; line-height: 1.55; color: var(--text); }
.plate__sub { margin-top: 20px; font: 13px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.plate__cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* hexdump en filigrane, genere par site.js depuis data-msg */
.hex { position: absolute; inset: 0; margin: 0; padding: 48px 20px; font: 12px/1.75 var(--mono); color: #242422; white-space: pre; overflow: hidden; user-select: none; pointer-events: none;
  -webkit-mask: radial-gradient(ellipse 70% 80% at 60% 50%, #000 10%, transparent 80%);
          mask: radial-gradient(ellipse 70% 80% at 60% 50%, #000 10%, transparent 80%); }
.hex b { font-weight: 400; transition: color 1.2s; }
.hex b.hot { color: var(--accent); transition: none; }
.hex .off { color: #383835; }

.statusline { display: flex; justify-content: space-between; gap: 16px; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 11px; letter-spacing: .04em; color: var(--dim); white-space: nowrap; overflow: hidden; text-transform: uppercase; }
.statusline .on::before { content: '● '; color: var(--accent); animation: blink 2.2s steps(1) infinite; }

/* figure "plaque" : illustration ou photo encadree avec legende */
.fig { border: 1px solid var(--line); padding: 8px; background: var(--panel); }
.fig img { width: 100%; }
.fig--art img { aspect-ratio: 1; object-fit: contain; padding: 6%; background:
  radial-gradient(circle, #161616 1px, transparent 1.4px) 0 0 / 14px 14px, #050505; }
.fig figcaption { display: flex; justify-content: space-between; gap: 8px; font: 10px var(--mono); color: var(--dim); padding: 8px 2px 0; letter-spacing: .1em; text-transform: uppercase; }
.fig figcaption span:first-child { color: var(--accent); }

/* home : hero plus large */
.plate--hero .plate__body { grid-template-columns: 150px 1fr clamp(220px, 20vw, 300px); gap: 24px; padding: 40px 20px 56px; }
.plate--hero h1 { font-size: clamp(44px, 9vw, 128px); line-height: .9; }
.rail { font-size: 11px; color: var(--dim); display: grid; gap: 28px; border-left: 1px solid var(--line-2); padding-left: 12px; }
.rail div::before { content: '├── '; color: var(--faint); }
.rail b { color: var(--fg); font-weight: 400; margin-left: 6px; }
.levels { font: 11px var(--mono); color: var(--dim); display: grid; gap: 6px; }
.levels div { display: grid; grid-template-columns: 30px 1fr 64px; gap: 8px; align-items: center; }
.levels span:last-child { text-align: right; }
@property --v { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
.levels i { height: 6px; background: linear-gradient(90deg, var(--fg) var(--v), var(--line-2) var(--v)); animation: fill 1.4s var(--ease) both; }
.levels div:nth-child(2) i { animation-delay: .08s; } .levels div:nth-child(3) i { animation-delay: .16s; }
.levels div:nth-child(4) i { animation-delay: .24s; } .levels div:nth-child(5) i { animation-delay: .32s; }
.levels div:nth-child(6) i { animation-delay: .4s; }
@keyframes fill { from { --v: 0%; } }
.cur { display: inline-block; width: .5em; height: .1em; margin-left: .08em; background: var(--accent); vertical-align: baseline; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --- boutons et liens d'action ---------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; border: 1px solid var(--line-2); transition: border-color .2s, background .2s, color .2s; }
.btn:hover { border-color: var(--fg); }
.btn--solid { background: var(--fg); color: #000; border-color: var(--fg); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); }
.go { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; font: 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--fg); }
.go::after { content: '▸'; color: var(--accent); transition: transform .25s var(--ease); }
.go:hover { color: var(--accent); }
.go:hover::after { transform: translateX(4px); }

/* --- sections --------------------------------------------------------- */
.sec { position: relative; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); gap: clamp(40px, 4vw, 72px); padding: 72px 0; border-top: 1px solid var(--line); }
.sec:first-child { border-top: 0; }
/* panneau givre derriere chaque colonne : les points disparaissent sous le
   texte. Le padding + marge negative garde l'alignement de la grille. */
.sec > * { --bleed: 20px; padding: var(--bleed); margin: calc(-1 * var(--bleed)); border-radius: 8px;
  background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sec:not(:first-child)::before, .sec:not(:first-child)::after { content: '+'; position: absolute; top: -.8em; font: 14px/1.5 var(--mono); color: var(--faint); background: var(--bg); padding: 0 4px; }
.sec::before { left: -10px; } .sec::after { right: -10px; }
.sec__head { align-self: start; }
.sec--sticky .sec__head { position: sticky; top: 80px; }
.sec__num { font: 12px var(--mono); color: var(--accent); }
.sec__name { font: 700 22px/1.25 var(--mono); letter-spacing: .02em; text-transform: uppercase; margin-top: 10px; overflow-wrap: anywhere; }
.sec__tag { font-size: 22px; line-height: 1.3; margin-top: 10px; text-wrap: balance; }
.meta { margin-top: 28px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.meta div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--dim); }
.meta div:last-child { border-bottom: 1px solid var(--line); }
.meta b { color: var(--fg); font-weight: 400; text-align: right; }
.meta a { text-decoration: none; }
.meta a:hover { color: var(--accent); }
.lead { font-size: clamp(20px, 1.5vw, 24px); line-height: 1.45; max-width: 52ch; text-wrap: pretty; }
.lead span { color: var(--dim); }
.prose p { color: var(--text); max-width: 68ch; margin-top: 16px; }

/* reveal : seulement si le JS tourne, sinon tout reste visible */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .7s, transform .7s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* lignes numerotees (home: fields) */
.rows { list-style: none; }
.rows li { display: grid; grid-template-columns: 48px 200px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); transition: background .25s; }
.rows li:last-child { border-bottom: 1px solid var(--line); }
.rows li:hover { background: linear-gradient(90deg, rgba(0,255,106,.04), transparent 60%); }
.rows .k { font-size: 12px; color: var(--faint); padding-top: 4px; }
.rows h3 { font: 600 17px var(--mono); }
.rows p { color: var(--dim); }

/* puces "arbre" (security, privacy) */
.ticks { list-style: none; max-width: 64ch; }
.ticks li { position: relative; padding: 14px 0 14px 40px; border-top: 1px solid var(--line); color: var(--text); }
.ticks li:last-child { border-bottom: 1px solid var(--line); }
.ticks li::before { content: '├──'; position: absolute; left: 0; top: 14px; font: 13px/1.6 var(--mono); color: var(--faint); }
.ticks li:last-child::before { content: '└──'; }
.ticks a { color: var(--fg); text-decoration-color: var(--accent); }
.ticks a:hover { color: var(--accent); }
.ticks b { color: var(--fg); font-weight: 600; }
code { font: .88em var(--mono); padding: .1em .35em; border: 1px solid var(--line-2); background: #0b0b0b; border-radius: 4px; color: var(--fg); }

/* grille de modules (mlab) */
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 24px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.mods > * { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--dim); text-decoration: none; transition: color .2s, background .2s; }
.mods a:hover { color: var(--accent); background: var(--accent-soft); }

/* grep : filtre de liste */
.grep { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font: 14px var(--mono); cursor: text; }
.grep input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--fg); caret-color: var(--accent); }
.grep input::placeholder { color: var(--faint); }
.grep input::-webkit-search-cancel-button { filter: invert(1) brightness(.6); }
.grep output { font-size: 11px; color: var(--faint); white-space: nowrap; }
.grep:focus-within { border-bottom-color: var(--accent); }
.nomatch { padding: 16px 0; font: 13px var(--mono); color: var(--dim); }

/* liste de repos compacte (home) */
.repos { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; list-style: none; }
.repos a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font: 14px var(--mono); text-decoration: none; transition: color .2s; }
.repos a:hover { color: var(--accent); }
.repos small { color: var(--faint); font-size: 12px; white-space: nowrap; }
.org { color: var(--faint); }

/* --- cartes de repo (projects) ---------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 14px; border: 1px solid var(--line); background: rgba(8,8,8,.6); text-decoration: none; transition: border-color .25s, background .25s, transform .25s var(--ease); }
.card:hover { border-color: var(--line-2); background: rgba(14,14,14,.9); transform: translateY(-2px); }
.card::after { content: '↗'; position: absolute; top: 14px; right: 16px; font: 13px var(--mono); color: var(--faint); transition: color .2s, transform .25s var(--ease); }
.card:hover::after { color: var(--accent); transform: translate(2px, -2px); }
.card__name { font: 600 15px var(--mono); padding-right: 24px; overflow-wrap: anywhere; }
.card__desc { flex: 1; font-size: 14px; line-height: 1.55; color: var(--dim); }
.card__foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px dashed var(--line-2); font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.card__lang::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--dim); vertical-align: 1px; }
.card .repo-card__stars { color: var(--dim); }

/* projet vedette */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 28vw, 420px); gap: 40px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.chips span { padding: 4px 10px; border: 1px solid var(--line-2); font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.viz { position: relative; aspect-ratio: 1; border: 1px solid var(--line); background:
  radial-gradient(circle, #161616 1px, transparent 1.4px) 0 0 / 14px 14px, #050505; }
.viz svg { width: 100%; height: 100%; }
.viz__label { position: absolute; left: 10px; bottom: 8px; font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.viz__label b { color: var(--accent); font-weight: 400; }
/* reseau (mlab.sh) */
.v-link { stroke: var(--line-2); stroke-width: 1.2; }
.v-pulse { stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 4 160; animation: pulse 2.8s linear infinite; animation-delay: var(--d, 0s); opacity: .9; }
@keyframes pulse { from { stroke-dashoffset: 164; } to { stroke-dashoffset: 0; } }
.v-node { fill: #0a0a0a; stroke: var(--line-2); stroke-width: 1.2; animation: lite 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes lite { 0%, 70%, 100% { stroke: var(--line-2); } 80% { stroke: var(--accent); } }
.v-core { fill: #0a0a0a; stroke: var(--fg); stroke-width: 1.2; }
.v-core-t { fill: var(--fg); font: 11px var(--mono); }
/* atlas (altpunk) : matrice de cases qui s'allument */
.atlas { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; position: absolute; inset: 14%; }
.atlas i { border: 1px solid var(--line-2); animation: cell 4.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes cell { 0%, 80%, 100% { background: transparent; border-color: var(--line-2); } 88% { background: var(--accent-soft); border-color: var(--accent); } }

/* --- liste d'articles (markup emis par le Rust) ----------------------- */
.post-list { display: grid; }
.post-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); text-decoration: none; transition: background .25s; }
.post-list .post-card:last-child { border-bottom: 1px solid var(--line); }
.post-card:hover { background: linear-gradient(90deg, rgba(0,255,106,.04), transparent 60%); }
.post-card__meta { grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 4px; padding-top: 3px; font: 12px var(--mono); color: var(--dim); }
.post-card__reading { color: var(--faint); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.post-card__title { font: 500 18px/1.35 var(--sans); text-wrap: balance; transition: color .2s; }
.post-card:hover .post-card__title { color: var(--accent); }
.post-card__desc { margin-top: 6px; font-size: 14px; color: var(--dim); max-width: 70ch; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.post-tag { padding: 3px 8px; border: 1px solid var(--line-2); font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); text-decoration: none; transition: color .2s, border-color .2s; }
a.post-tag:hover { color: var(--accent); border-color: var(--accent); }
.empty-state { padding: 24px 0; font: 13px var(--mono); color: var(--dim); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* --- article ---------------------------------------------------------- */
.post-head .post-tags { margin-top: 24px; }
.post-body { max-width: 70ch; font-size: 17px; line-height: 1.75; color: var(--text); }
.post-body > * + * { margin-top: 1.1em; }
.post-body h2 { position: relative; margin-top: 2.4em; padding-top: 1.1em; border-top: 1px solid var(--line); font: 700 19px/1.35 var(--mono); letter-spacing: -.01em; color: var(--fg); counter-increment: h2; }
.post-body h2::before { content: counter(h2, decimal-leading-zero); display: block; margin-bottom: 6px; font-size: 11px; letter-spacing: .1em; color: var(--accent); font-weight: 400; }
.post-body { counter-reset: h2; }
.post-body h3 { margin-top: 2em; font: 600 16px/1.4 var(--mono); color: var(--fg); }
.post-body h3::before { content: '# '; color: var(--faint); }
.post-body strong { color: var(--fg); font-weight: 600; }
.post-body a { color: var(--fg); text-decoration-color: var(--accent); }
.post-body a:hover { color: var(--accent); }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li + li { margin-top: .4em; }
.post-body ul li::marker { content: '▪  '; color: var(--faint); }
.post-body ol li::marker { font-family: var(--mono); color: var(--faint); }
.post-body blockquote { padding: 4px 0 4px 20px; border-left: 2px solid var(--accent); color: var(--dim); }
.post-body hr { border: 0; height: 1px; margin: 2.4em 0; background: var(--line); overflow: visible; text-align: center; }
.post-body hr::after { content: '+ + +'; position: relative; top: -.75em; padding: 0 10px; background: #000; font: 12px var(--mono); color: var(--faint); letter-spacing: .4em; }
.post-body img { border: 1px solid var(--line); }
.post-body table { width: 100%; border-collapse: collapse; font: 13px/1.5 var(--mono); display: block; overflow-x: auto; }
.post-body th, .post-body td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.post-body th { color: var(--dim); font-weight: 400; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; border-bottom-color: var(--line-2); }
.post-body .footnote-definition { font-size: 14px; color: var(--dim); }
/* blocs de code : syntect pose un fond inline, on l'aligne sur la charte */
.code-block, .code-plain { position: relative; margin-top: 1.4em; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: #070707; }
.code-block pre, pre.code-plain { margin: 0; padding: 18px 20px; overflow-x: auto; background: #070707 !important; font: 13.5px/1.65 var(--mono); tab-size: 4; }
.code-block pre::-webkit-scrollbar, pre.code-plain::-webkit-scrollbar { height: 8px; }
.code-block pre::-webkit-scrollbar-thumb, pre.code-plain::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
pre.code-plain code, .code-block code { padding: 0; border: 0; background: none; font: inherit; }
.copy { position: absolute; top: 8px; right: 8px; z-index: 1; padding: 4px 10px; border: 1px solid var(--line-2); background: rgba(7,7,7,.9); font: 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); cursor: pointer; opacity: 0; transition: opacity .2s, color .2s, border-color .2s; }
.code-block:hover .copy, .code-plain:hover .copy, .copy:focus-visible { opacity: 1; }
.copy:hover { color: var(--fg); border-color: var(--fg); }
.copy.ok { color: var(--accent); border-color: var(--accent); opacity: 1; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 64px; }
.post-nav__link { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); text-decoration: none; transition: border-color .25s, background .25s; }
.post-nav__link--newer { text-align: right; }
a.post-nav__link:hover { border-color: var(--line-2); background: rgba(14,14,14,.9); }
.post-nav__link--empty { border-style: dashed; border-color: #141414; }
.post-nav__dir { font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.post-nav__title { font-size: 15px; line-height: 1.4; }
.progress { position: fixed; left: 0; top: 0; z-index: 30; height: 2px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* --- visu Tor (privacy) ----------------------------------------------- */
.tor-viz .tor-bg { fill: #161616; stroke: var(--viz-line); stroke-width: 1; }
.tor-viz .tor-link { stroke: var(--viz-line); stroke-width: 1.4; fill: none; }
.tor-viz .tor-flow { stroke: var(--viz-accent); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-dasharray: 5 11; opacity: .6; animation: tor-flow 1.3s linear infinite; }
@keyframes tor-flow { to { stroke-dashoffset: -16; } }
.tor-viz .tor-hop { fill: #0a0a0a; stroke: var(--viz-line); stroke-width: 1.4; animation: tor-lite 4s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes tor-lite { 0%, 22%, 100% { fill: #0a0a0a; stroke: var(--viz-line); } 8% { fill: var(--viz-accent); stroke: var(--viz-accent); } }
.tor-viz .tor-glow { fill: var(--viz-accent); opacity: .18; }
.tor-viz .tor-packet { fill: var(--viz-accent); }

/* --- home ------------------------------------------------------------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 20vw, 320px); gap: 40px; align-items: start; }
.fig--photo img { filter: grayscale(1) contrast(1.05); aspect-ratio: 3/4; object-fit: cover; transition: filter .6s; }
.fig--photo:hover img { filter: grayscale(0); }
.secret { margin-top: 32px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font: 15px var(--mono); }
.secret output { letter-spacing: .1em; min-width: 18ch; }
.secret button { font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 14px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; transition: color .2s, border-color .2s; }
.secret button:hover, .secret button:active { color: var(--fg); border-color: var(--fg); }
.secret button::before { content: '● '; color: var(--accent); }

/* --- 404 -------------------------------------------------------------- */
.incident { margin-top: 24px; }
.incident .meta { max-width: 520px; }
.incident .meta div { display: grid; grid-template-columns: 96px 1fr; }
.incident .meta b { text-align: left; text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 14px; }

/* --- footer ----------------------------------------------------------- */
.foot { margin-top: 48px; border-top: 1px solid var(--line); background: rgba(0,0,0,.7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 48px var(--gutter) 40px; }
.foot__brand p { margin-top: 12px; max-width: 36ch; font-size: 14px; color: var(--dim); }
.foot h2 { margin-bottom: 12px; font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.foot ul { list-style: none; display: grid; gap: 8px; font: 13px var(--mono); }
.foot ul a { text-decoration: none; color: var(--dim); transition: color .2s; }
.foot ul a:hover { color: var(--accent); }
.foot .statusline { border-top: 1px solid var(--line); padding: 12px var(--gutter); max-width: var(--max); margin: 0 auto; }
.foot .statusline a { text-decoration: none; }
.foot .statusline a:hover { color: var(--fg); }

/* --- responsive ------------------------------------------------------- */
@media (max-width: 960px) {
  .plate--hero .plate__body { grid-template-columns: 120px 1fr; }
  .plate--hero .levels { display: none; }
  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature .viz { max-width: 340px; }
}
@media (max-width: 860px) {
  .crumb, .nav { display: none; }
  .navm { display: block; }
  .plate__body, .plate--hero .plate__body { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 28px 20px 36px; }
  .plate--hero .rail { display: none; }
  .plate__body .fig { max-width: 220px; }
  .plate__bar span:last-child:not(:first-child) { display: none; }
  .sec { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 56px 0; }
  .sec > * { --bleed: 12px; }
  .sec--sticky .sec__head { position: static; }
  .about { grid-template-columns: 1fr; }
  .fig--photo { max-width: 260px; }
  .rows li { grid-template-columns: 36px 1fr; }
  .rows li p { grid-column: 2; }
  .repos, .cards { grid-template-columns: 1fr; }
  .post-card { grid-template-columns: 1fr; }
  .post-card__meta { grid-row: auto; flex-direction: row; gap: 14px; margin-bottom: 6px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav__link--empty { display: none; }
  .post-body { font-size: 16px; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
  .statusline span:not(:first-child):not(:last-child) { display: none; }
  .copy { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  body::after { display: none; }
}
@media print {
  body::before, body::after, .top, .foot, .hex, .progress, .copy { display: none !important; }
  html, body { background: #fff; color: #000; }
  .sec > * { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* --- ajouts par page -------------------------------------------------- */
.plate .grep { margin-top: 28px; max-width: 520px; }
.nomatch--page { padding: 48px 0 0; }

/* article : titre long, sommaire, ancres */
.plate--post .plate__body { grid-template-columns: minmax(0, 1fr); }
.plate--post h1 { max-width: 22ch; font-size: clamp(30px, 4.6vw, 56px); line-height: 1.06; letter-spacing: -.025em; text-wrap: balance; overflow-wrap: normal; }
.plate--post .plate__lead { max-width: 62ch; }
.toc { margin-top: 14px; }
.toc:empty { display: none; }
.toc ol { list-style: none; display: grid; gap: 2px; counter-reset: t; }
.toc a { display: grid; grid-template-columns: 26px 1fr; gap: 6px; padding: 6px 8px; margin: 0 -8px; font-size: 13px; line-height: 1.4; text-decoration: none; color: var(--dim); border-left: 1px solid transparent; transition: color .2s, background .2s, border-color .2s; }
.toc a::before { counter-increment: t; content: counter(t, decimal-leading-zero); font: 11px/1.7 var(--mono); color: var(--faint); }
.toc a:hover { color: var(--fg); }
.toc a.on { color: var(--fg); border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), transparent); }
.toc a.on::before { color: var(--accent); }
.post-body h2 a.anchor, .post-body h3 a.anchor { margin-left: 10px; color: var(--faint); text-decoration: none; opacity: 0; transition: opacity .2s, color .2s; }
.post-body h2:hover a.anchor, .post-body h3:hover a.anchor, .post-body a.anchor:focus-visible { opacity: 1; }
.post-body a.anchor:hover { color: var(--accent); }
@media (max-width: 860px) { .toc { display: none; } }
.nc { text-transform: none; }

/* terminal (projects : Hack In The Shell) */
.term { border: 1px solid var(--line-2); border-radius: 10px; background: #070707; overflow: hidden; }
.term__bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 11px var(--mono); color: var(--dim); }
.term__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.term__bar span { margin-left: auto; }
.term pre { padding: 18px 20px; font: 13px/1.75 var(--mono); color: var(--dim); white-space: pre-wrap; overflow-wrap: anywhere; }
.term .p { color: var(--accent); }
.term .w { color: var(--fg); }
.term .c { color: var(--faint); }
.feature .mods, .feature .chips { margin-top: 22px; }
/* sommaire de page dans le plate (projects) */
.toc-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; list-style: none; }
.toc-inline a { display: inline-flex; gap: 10px; padding: 8px 14px; border: 1px solid var(--line-2); font: 12px var(--mono); letter-spacing: .06em; text-decoration: none; transition: border-color .2s, color .2s; }
.toc-inline a span { color: var(--accent); }
.toc-inline a:hover { border-color: var(--accent); }
