/* ===== Anas Ameziane : l'essai et le carnet =====
   Une seule colonne, la typographie porte tout. Polices systeme uniquement :
   le serif pour lire, la monospace pour les metadonnees et les libelles,
   jamais pour le corps. Un seul accent, rouge profond. */

:root {
  --bg: #fdfdfb;
  --ink: #141414;
  --muted: #4a4a48;
  --soft: #7a7a76;
  --accent: #a4282c;
  --accent-hover: #7d1d20;
  --on-accent: #fdfdfb;
  --border: #dcdad4;
  --code-bg: #f3f2ee;
  --max-w: 680px;
  --header-w: 820px;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --ink: #ecebe6;
    --muted: #bdbab3;
    --soft: #8f8c86;
    --accent: #e28a84;
    --accent-hover: #f0aaa5;
    --on-accent: #161514;
    --border: #33312e;
    --code-bg: #201f1d;
  }
}

* { box-sizing: border-box; }

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: 0.4em 0.8em; z-index: 10; }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.005em;
  margin: 1.8em 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: 2.15rem; margin-top: 0.2em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }

p { margin: 0 0 1.1em; }
.muted { color: var(--muted); font-size: 0.94rem; }
.note { margin-top: 3rem; }

ul, ol { padding-left: 1.3em; }
li { margin: 0.35em 0; }

code, pre, kbd { font-family: var(--mono); font-size: 0.84em; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; overflow-wrap: anywhere; }
pre {
  background: var(--code-bg);
  padding: 1em;
  border-radius: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
  line-height: 1.5;
}
pre code { background: none; padding: 0; overflow-wrap: normal; }

hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }

blockquote {
  margin: 1.6em 0;
  padding: 0;
  font-style: italic;
  font-size: 1.15rem;
  text-align: center;
}
blockquote p:last-child { margin-bottom: 0; }

.mermaid { margin: 1.6em 0; overflow-x: auto; text-align: center; }

/* ===== Libelles monospace (le "carnet") ===== */

.eyebrow, .label, .site-sub, .experiment dt, .timeline .dates,
.chapters li::before, .chapters .todo {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.meta, .topic, .translation, .signature {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.eyebrow { color: var(--accent); margin: 0 0 1em; }
.label { color: var(--soft); margin: 0 0 0.4em; }

/* ===== Layout ===== */

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* ===== Header / nav ===== */

.site-header { border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; }
.site-header .inner {
  max-width: var(--header-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem 1.5rem;
  flex-wrap: wrap;
}
.site-title {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.site-title:hover { color: var(--accent); }
.site-sub { font-size: 0.66rem; font-weight: 400; letter-spacing: 0.08em; color: var(--soft); }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
  font-size: 0.98rem;
}
.site-nav a { color: var(--muted); text-decoration: none; padding: 0.2em 0; }
.site-nav a:hover { color: var(--accent); }
.site-nav a.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

/* ===== Footer ===== */

.site-footer { border-top: 1px solid var(--border); padding: 2rem 1.25rem; font-size: 0.88rem; color: var(--soft); }
.site-footer .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
}
.site-footer .links { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }
.site-footer a { color: var(--soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ===== Home ===== */

.hero { padding: 2.5rem 0 1rem; }
.hero h1 {
  font-size: clamp(2.1rem, 6.4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.55em;
}
.hero .lede { font-size: 1.14rem; line-height: 1.6; }

.signature { color: var(--soft); margin-top: 2.2em; }

.actions { display: flex; flex-wrap: wrap; gap: 0.8rem 1.4rem; align-items: center; margin: 1.8em 0 0; }
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.6em 1.1em;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " ->"; }

.section { margin-top: 4rem; padding-top: 2rem; }
.section > h2 { margin-top: 0.2em; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1.4em; }
.pair > div { border-top: 2px solid var(--ink); padding: 0.8em 0 0; }
.pair h3 { margin: 0 0 0.5em; }
.pair p { margin: 0; font-size: 0.97rem; color: var(--muted); }

/* ===== Listes d'articles ===== */

.entries { list-style: none; padding: 0; margin: 1em 0 0; }
.entries li { padding: 1.2em 0; border-bottom: 1px solid var(--border); margin: 0; }
.entries li:last-child { border-bottom: none; }
.entries .title {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  margin: 0.25em 0 0.35em;
}
.entries .title:hover { color: var(--accent); }
.entries p { margin: 0; font-size: 0.97rem; color: var(--muted); }

.meta { color: var(--soft); display: flex; flex-wrap: wrap; gap: 0.2em 0.9em; margin: 0; }
.topic { color: var(--accent); text-decoration: none; }
.topic:hover { text-decoration: underline; }

.topics { margin-top: 3.5rem; }
.topics section { margin-top: 2.2em; }
.topics h2 { font-size: 1.15rem; margin: 0 0 0.1em; scroll-margin-top: 1rem; }
.topics .blurb { color: var(--muted); font-size: 0.95rem; margin: 0 0 0.4em; }
.topics ul { margin: 0; }

/* ===== Article ===== */

.post-head { margin-bottom: 2.2em; }
.post-head h1 { margin: 0.45em 0 0.4em; }
.dek { font-size: 1.12rem; color: var(--muted); line-height: 1.55; margin: 0 0 0.8em; }
.translation { margin: 0; }
.post h3 { margin-top: 2em; }

.related { margin-top: 2.5em; }
.related ul { margin: 0; }
.back { margin-top: 2.5em; font-size: 0.94rem; }

/* ===== Appel a l'action ===== */

.cta { margin: 3.5em 0 0; padding: 1em 0 0; border-top: 2px solid var(--ink); }
.cta-text { margin: 0 0 0.6em; }
.cta-links { margin: 0; display: flex; flex-wrap: wrap; gap: 0.3em 1.2em; font-weight: 600; }
.cta-form { display: flex; flex-wrap: wrap; gap: 0.6em; align-items: center; }
.cta-form label { position: absolute; left: -9999px; }
.cta-form input {
  flex: 1 1 14em;
  font: inherit;
  padding: 0.55em 0.8em;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
}
.cta-form button {
  font: inherit;
  font-weight: 600;
  padding: 0.55em 1.1em;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}

/* ===== Labo ===== */

.experiment { padding: 1.6em 0; border-bottom: 1px solid var(--border); }
.experiment:last-of-type { border-bottom: none; }
.experiment h2 { margin: 0.3em 0 0.6em; font-size: 1.25rem; }
.experiment h2 a { color: var(--ink); text-decoration: none; }
.experiment h2 a:hover { color: var(--accent); }
.experiment dl { margin: 0; }
.experiment dt { color: var(--soft); margin-top: 0.9em; }
.experiment dd { margin: 0.15em 0 0; }

/* ===== Playbook ===== */

.chapters { list-style: none; padding: 0; counter-reset: ch; }
.chapters li { counter-increment: ch; padding: 0.9em 0 0.9em 2.6em; border-bottom: 1px solid var(--border); position: relative; margin: 0; }
.chapters li::before {
  content: counter(ch, decimal-leading-zero);
  position: absolute; left: 0; top: 1.15em;
  color: var(--soft);
}
.chapters strong { display: block; }
.chapters span { color: var(--muted); font-size: 0.95rem; }
.chapters .todo { color: var(--soft); }

/* ===== Parcours ===== */

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 1.2em 0; border-bottom: 1px solid var(--border); margin: 0; }
.timeline li:last-child { border-bottom: none; }
.timeline .role { font-weight: 700; font-size: 1.05rem; }
.timeline .org { color: var(--muted); }
.timeline .dates { display: block; color: var(--soft); margin: 0.15em 0 0.5em; }
.timeline p { margin: 0.3em 0 0; font-size: 0.97rem; }

/* ===== Mobile ===== */

@media (max-width: 600px) {
  html, body { font-size: 17px; }
  .wrap { padding: 1.8rem 1rem 3rem; }
  .site-header, .site-footer { padding-left: 1rem; padding-right: 1rem; }
  .site-nav { gap: 0.1rem 0.9rem; font-size: 0.92rem; }
  .hero { padding-top: 1.2rem; }
  .hero .lede { font-size: 1.06rem; }
  .pair { grid-template-columns: 1fr; }
  h1 { font-size: 1.85rem; }
  .section { margin-top: 3rem; }
}
