:root {
  --bg: #fbfaf7;
  --fg: #1f1f1f;
  --muted: #6b6b6b;
  --rule: #e5e2dc;
  --link: #2d3a8c;
  --link-hover: #4f5fc4;
  --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --maxw: 640px;
}

html[data-theme="dark"] {
  --bg: #14141a;
  --fg: #e8e6e1;
  --muted: #8a8a8a;
  --rule: #25252a;
  --link: #a9b4f5;
  --link-hover: #c4cdff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 9vw, 96px) clamp(20px, 5vw, 32px) 96px;
}

header {
  margin-bottom: 56px;
}

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5.5vw, 2.625rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
  font-variation-settings: "opsz" 60;
}

p {
  margin: 0 0 16px;
  max-width: 60ch;
  font-variation-settings: "opsz" 14;
}

section {
  margin: 44px 0;
}

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: -0.005em;
  margin: 0 0 16px;
  font-variation-settings: "opsz" 24;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--link-hover); }

ul {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}
ul li {
  padding: 4px 0;
}

/* Theme toggle - iOS-style switch, like dario */
.theme {
  position: fixed;
  top: 22px; right: 22px;
  background: transparent;
  border: 0;
  padding: 6px;
  cursor: pointer;
  z-index: 10;
}
.theme-track {
  display: inline-block;
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--rule);
  position: relative;
  transition: background .2s ease;
}
.theme-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  transition: transform .2s ease, background .2s ease;
}
html[data-theme="dark"] .theme-track { background: #4a4a52; }
html[data-theme="dark"] .theme-thumb { transform: translateX(16px); background: #f4f1eb; }
.theme:hover .theme-track { background: #d6d3cd; }
html[data-theme="dark"] .theme:hover .theme-track { background: #5a5a62; }

.mail-reveal {
  font: inherit;
  color: var(--link);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.mail-reveal:hover { color: var(--link-hover); }

.writing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.writing-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.writing-item:last-child { border-bottom: none; }
.writing-text {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  font-variation-settings: "opsz" 14;
  color: var(--fg);
}
.writing-arrow {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  transition: border-color .25s, color .25s, transform .2s;
}
.writing-arrow:hover {
  border-color: var(--link);
  color: var(--link);
  transform: translateX(3px);
}
.writing-arrow svg { display: block; }

/* Manifesto article */
article p {
  margin: 0 0 22px;
  max-width: none;
  font-variation-settings: "opsz" 16;
}
article p:first-child {
  font-size: 1.05em;
}
.manifesto-cta {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.manifesto-cta p {
  margin: 0;
  font-size: 0.95rem;
}

::selection { background: var(--link); color: var(--bg); }

@media (max-width: 480px) {
  html, body { font-size: 17px; }
  section { margin: 36px 0; }
}

/* ============================================================
   Responsive des pages article (24-Aug-2026)
   Les styles d'article sont declares en <style> inline, dupliques dans les 7
   pages, et sans aucune regle mobile. Plutot que d'editer 7 blocs identiques,
   on corrige ici. ATTENTION: l'inline vient APRES ce fichier dans le head,
   donc a specificite egale c'est lui qui gagne. Chaque selecteur ci-dessous
   est donc volontairement plus specifique que son equivalent inline
   (un ancetre en plus). Les media queries n'ajoutent aucune specificite.
   ============================================================ */

/* L'icone de marque etait figee a 22px. En em, elle suit la taille du texte
   de marque au lieu de l'ecraser quand la police de base monte a 17px. */
header .article-header img { width: 1.7em; height: 1.7em; flex-shrink: 0; }

/* La barre marque + selecteur de langue est un flex avec margin-left:auto.
   Sur ecran etroit elle deborde: on l'autorise a passer a la ligne. */
header .article-header { flex-wrap: wrap; row-gap: 8px; }

main article { overflow-wrap: break-word; }
main article pre, main article code { overflow-x: auto; max-width: 100%; }
main article img, main article table { max-width: 100%; height: auto; }

@media (max-width: 480px) {
  header .article-header { margin-bottom: 26px; gap: 8px; }
  header .article-header a.brand { font-size: 0.9rem; }
  header .lang-switch { margin-left: 0; font-size: 0.85rem; }
  /* Les marges negatives supposaient un h1 sur une seule ligne. Sur mobile il
     passe sur 3 ou 4 lignes, la marge negative mangeait le titre. */
  header .article-meta { margin: -8px 0 24px; font-size: 0.85rem; }
  header .article-dek, main article .article-dek { margin: -2px 0 26px; font-size: 1.02rem; }
  main article h2 { font-size: 1.18rem; margin: 32px 0 12px; }
  main article ul { padding-left: 18px; }
  main article blockquote { margin: 20px 0; padding-left: 14px; }
  main .article-footer { margin-top: 44px; padding-top: 22px; }
  main .other-articles { margin-top: 40px; }
  main .other-articles h2 { font-size: 1.05rem; }
}

@media (max-width: 340px) {
  header .article-header img { width: 1.5em; height: 1.5em; }
  main article h2 { font-size: 1.1rem; }
}
