@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap; src: url("../fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 800; font-display: swap; src: url("../fonts/jetbrains-mono-latin-800-normal.woff2") format("woff2"); }

:root {
  --bg: #020a05;
  --bg-2: #04120a;
  --green: #3df06b;
  --green-dim: #1f7a3a;
  --mint: #b8f0c8;
  --lilac: #b794f6;
  --line: rgba(61, 240, 107, .22);
  --mono: "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: 80px; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  background: radial-gradient(ellipse at 50% 0%, #06200f 0%, var(--bg) 60%);
  color: var(--mint);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-shadow: 0 0 8px var(--green); }
::selection { background: var(--green); color: #000; }

/* Fond fixe sur son propre calque GPU */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; transform: translateZ(0);
  background: radial-gradient(ellipse at 50% 0%, #06200f 0%, var(--bg) 60%); }

/* ===== Effet CRT : lignes de balayage + vignette + léger scintillement ===== */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
  animation: flicker 6s infinite; will-change: opacity; transform: translateZ(0);
}
body::after { /* barre de balayage qui descend lentement */
  content: ""; position: fixed; left: 0; right: 0; top: -20vh; height: 20vh; z-index: 99; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(61,240,107,.05), transparent);
  animation: sweep 7s linear infinite; will-change: transform;
}
@keyframes sweep { to { transform: translateY(140vh); } }
@keyframes flicker { 0%,100%{opacity:1} 92%{opacity:1} 93%{opacity:.9} 94%{opacity:1} 97%{opacity:.94} }

/* ===== Barre haute (comme l'en-tête des posts) ===== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; transform: translateZ(0);
  background: rgba(2,10,5,.94);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1040px; margin: auto; padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.handle { font-weight: 800; color: var(--green); letter-spacing: .5px; text-shadow: 0 0 10px rgba(61,240,107,.5); }
.menu { display: flex; gap: 20px; list-style: none; }
.menu a { color: var(--green-dim); font-size: 13px; transition: color .2s; }
.menu a:hover, .menu a.active { color: var(--green); }
.counter { color: var(--green-dim); font-size: 14px; letter-spacing: 1px; white-space: nowrap; }
.counter b { color: var(--green); font-weight: 400; }
.burger { display: none; background: none; border: 1px solid var(--line); color: var(--green);
  font-family: var(--mono); padding: 3px 10px; cursor: pointer; }

/* barre de progression de lecture */
.progress { position: fixed; top: 56px; left: 0; height: 2px; width: 0; background: var(--green);
  box-shadow: 0 0 10px var(--green); z-index: 51; will-change: width; }

/* ===== Mise en page ===== */
main { max-width: 1040px; margin: auto; padding: 0 24px; }
section { padding: 100px 0 20px; }
section:not(#hero) { content-visibility: auto; contain-intrinsic-size: auto 900px; }
.kicker { color: var(--green); font-weight: 700; letter-spacing: 3px; font-size: 13px; text-transform: uppercase; margin-bottom: 14px; }
.kicker::before { content: "* "; }
h2.big, .big {
  font-size: clamp(34px, 7vw, 68px); line-height: 1.08; font-weight: 800; color: var(--lilac);
  text-shadow: 0 0 18px rgba(183,148,246,.45); letter-spacing: -1px; margin-bottom: 30px;
}
h3 { color: var(--green); font-size: 16px; font-weight: 700; }
p { color: var(--mint); }
.dim { color: var(--green-dim); }

/* ===== Hero ===== */
#hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-top: 90px; }
.prompt-line { color: var(--green-dim); margin-bottom: 18px; }
.prompt-line .p { color: var(--green); }
#hero .big { font-size: clamp(40px, 9vw, 92px); margin-bottom: 20px; }
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%; overflow: hidden;
  clip-path: inset(0 0 0 0); opacity: 0;
}
.glitch::before { color: var(--green); transform: translate(-3px, 0); text-shadow: none; }
.glitch::after { color: #6ee7ff; transform: translate(3px, 0); text-shadow: none; }
.glitch.run::before { animation: glitch1 .7s steps(2) 1; }
.glitch.run::after { animation: glitch2 .7s steps(2) 1; }
@keyframes glitch1 { 0%{opacity:.8; clip-path: inset(10% 0 70% 0)} 30%{clip-path: inset(60% 0 10% 0)} 60%{clip-path: inset(30% 0 40% 0)} 100%{opacity:0} }
@keyframes glitch2 { 0%{opacity:.8; clip-path: inset(70% 0 5% 0)} 40%{clip-path: inset(20% 0 55% 0)} 70%{clip-path: inset(45% 0 30% 0)} 100%{opacity:0} }

.sub { font-size: clamp(16px, 2.4vw, 22px); color: var(--mint); margin-bottom: 28px; min-height: 2em; }
.cursor { display: inline-block; width: .6em; height: 1.05em; background: var(--green); vertical-align: text-bottom;
  box-shadow: 0 0 8px var(--green); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Bloc plein vert (comme "Suis le journal de bord.") */
.block {
  display: block; position: relative; background: var(--green); color: #021008; padding: 22px 28px;
  box-shadow: 0 0 30px rgba(61,240,107,.25); transition: transform .2s, box-shadow .2s;
}
.block:hover { transform: translateY(-3px); box-shadow: 0 0 44px rgba(61,240,107,.5); text-shadow: none; }
.block strong { display: block; font-size: clamp(20px, 3.4vw, 30px); font-weight: 800; color: #021008; }
.block span { font-weight: 700; font-size: 14px; color: #021008; }
.block::after { content: "→"; position: absolute; right: 26px; top: 50%; transform: translateY(-50%); font-size: 28px; font-weight: 800; transition: right .2s; }
.block:hover::after { right: 18px; }

/* Cadre pointillé (comme "days_smoke_free") */
.dashed { border: 1px dashed var(--green); padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; }
.dashed .k { color: var(--green); }
.dashed .k::before { content: "> "; color: var(--green-dim); }
.dashed .v { color: var(--green); font-size: clamp(24px, 4vw, 36px); font-weight: 800; text-shadow: 0 0 12px rgba(61,240,107,.5); }

.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.btn { display: inline-block; padding: 11px 20px; border: 1px solid var(--green); color: var(--green);
  font-family: var(--mono); font-size: 14px; font-weight: 700; background: transparent; cursor: pointer; transition: .2s; }
.btn:hover { background: var(--green); color: #021008; box-shadow: 0 0 20px rgba(61,240,107,.5); text-shadow: none; }
.btn.alt { border-color: var(--lilac); color: var(--lilac); }
.btn.alt:hover { background: var(--lilac); color: #0b0414; box-shadow: 0 0 20px rgba(183,148,246,.5); }

/* ===== Lignes "status --all" ===== */
.rows { margin: 8px 0 24px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 14px 0;
  border-bottom: 1px dotted var(--line); font-size: clamp(15px, 2.2vw, 20px); }
.row .l { color: var(--mint); }
.row .r { color: var(--green); font-weight: 800; text-align: right; text-shadow: 0 0 10px rgba(61,240,107,.35); }

/* ===== Chips ===== */
.skills { display: flex; flex-wrap: wrap; gap: 10px; }
.skill { padding: 5px 13px; border: 1px solid var(--line); color: var(--mint); font-size: 13px; transition: .2s; }
.skill:hover { border-color: var(--green); color: var(--green); box-shadow: 0 0 12px rgba(61,240,107,.25); }
.skill b { color: var(--green); font-weight: 400; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
.cols h3 { margin-bottom: 14px; letter-spacing: 2px; text-transform: uppercase; font-size: 13px; }

/* ===== Timeline ===== */
.timeline { border-left: 1px solid var(--line); padding-left: 28px; }
.t-item { position: relative; margin-bottom: 34px; }
.t-item::before { content: ""; position: absolute; left: -33px; top: 9px; width: 9px; height: 9px; background: var(--green);
  box-shadow: 0 0 12px var(--green); }
.t-date { color: var(--lilac); font-size: 13px; letter-spacing: 1px; }
.t-item h3 { font-size: 18px; margin: 2px 0 6px; color: #fff; }
.t-item p { color: var(--mint); opacity: .8; font-size: 14px; }

/* ===== Cartes tutos : format "slide" ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 22px; }
.card { position: relative; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(61,240,107,.04), transparent);
  padding: 24px; display: flex; flex-direction: column; min-height: 280px; transition: .25s; }
.card:hover { border-color: var(--green); box-shadow: 0 0 28px rgba(61,240,107,.18); transform: translateY(-4px); }
.card .no { color: var(--green-dim); font-size: 13px; letter-spacing: 2px; }
.card h3 { color: var(--lilac); font-size: 22px; font-weight: 800; margin: 10px 0 8px; text-shadow: 0 0 14px rgba(183,148,246,.35); }
.card p { opacity: .8; font-size: 14px; flex: 1; }
.tag { display: inline-block; font-size: 11px; padding: 1px 9px; border: 1px solid var(--line); color: var(--green); margin: 10px 8px 0 0; }
.more { margin-top: 16px; font-weight: 700; }

/* ===== Veille : posts 4:5 ===== */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.post { aspect-ratio: 4/5; border: 1px solid var(--line); background: linear-gradient(160deg, #04160b, #020a05);
  padding: 18px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; transition: .25s; }
.post:hover { border-color: var(--green); box-shadow: 0 0 26px rgba(61,240,107,.2); transform: translateY(-4px); }
.post img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post .h { display: flex; justify-content: space-between; font-size: 11px; color: var(--green-dim); }
.post .h b { color: var(--green); }
.post .t { color: var(--lilac); font-weight: 800; font-size: clamp(16px, 2.2vw, 24px); line-height: 1.15; text-shadow: 0 0 12px rgba(183,148,246,.4); }
.post .f { font-size: 11px; color: var(--green); font-weight: 700; }

/* ===== Contact ===== */
.term { border: 1px solid var(--line); background: rgba(4,18,10,.7); }
.term-bar { padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--green-dim); font-size: 12px; }
.term-body { padding: 22px; }
.term-body div { margin-bottom: 4px; }
.prompt { color: var(--green-dim); }
.key { color: var(--lilac); }

footer { text-align: center; color: var(--green-dim); font-size: 13px; padding: 60px 20px 40px; }

/* ===== Pages tuto ===== */
.tuto { max-width: 820px; margin: auto; padding: 110px 24px 60px; }
.tuto h1 { font-size: clamp(30px, 6vw, 52px); font-weight: 800; color: var(--lilac); text-shadow: 0 0 18px rgba(183,148,246,.45); line-height: 1.1; margin-bottom: 10px; }
.meta { color: var(--green-dim); font-size: 13px; margin-bottom: 30px; }
.tuto h2 { color: var(--green); font-size: 14px; letter-spacing: 3px; text-transform: uppercase; margin: 44px 0 14px; }
.tuto h2::before { content: "* "; }
.tuto p, .tuto li { margin-bottom: 10px; }
.tuto ul, .tuto ol { padding-left: 24px; }
.back { display: inline-block; margin-bottom: 20px; font-size: 14px; }
pre { background: #010603; border: 1px dashed var(--green-dim); padding: 14px 16px; overflow-x: auto; margin: 14px 0; color: var(--green); font-size: 13px; }
pre code::before { content: "> "; color: var(--green-dim); }
code { color: var(--green); font-size: 13px; background: rgba(61,240,107,.08); padding: 1px 6px; }
pre code { background: none; padding: 0; }
.note { border: 1px dashed var(--lilac); padding: 12px 16px; margin: 16px 0; font-size: 14px; }
.shot { border: 1px dashed var(--line); padding: 40px 10px; text-align: center; color: var(--green-dim); margin: 14px 0; }
.shot img { max-width: 100%; }

/* ===== Apparition au scroll ===== */
.reveal { opacity: 0; transform: translate3d(0,22px,0); transition: opacity .7s ease, transform .7s ease; will-change: opacity, transform; }
.reveal.show { opacity: 1; transform: none; will-change: auto; }

@media (max-width: 820px) {
  .menu { display: none; position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; gap: 14px;
    background: var(--bg); padding: 18px 24px; border-bottom: 1px solid var(--line); }
  .menu.open { display: flex; }
  .burger { display: block; }
  .cols { grid-template-columns: 1fr; }
  .posts { grid-template-columns: 1fr; max-width: 380px; margin: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before, body::after, .cursor { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
