:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --ink: #1a1814;
  --ink-2: #4a4540;
  --ink-3: #7a736a;
  --accent: #2d6a4f;
  --accent-light: #e8f5ee;
  --accent-mid: #52b788;
  --border: #e0dbd2;
  --code-bg: #1e1c18;
  --code-fg: #a8d8a8;
  --warn: #7b3f00;
  --warn-bg: #fdf3e7;
  --radius: 6px;
  --max: 780px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(1rem, 5vw, 3rem);
  height: 56px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.01em;
}

/* ── HERO ── */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: clamp(3rem, 8vw, 5rem) clamp(1rem, 5vw, 3rem);
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
}
.hero-tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}
h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1.25rem;
  max-width: 680px;
}
h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero-intro {
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 620px;
  margin-bottom: 2rem;
  line-height: 1.65;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.hero-meta span { display: flex; align-items: center; gap: 0.4rem; }
.hero-meta svg { opacity: 0.6; }

/* ── SOMMAIRE ── */
.toc {
  max-width: var(--max);
  margin: 2.5rem auto;
  padding: 0 clamp(1rem, 5vw, 3rem);
  position: static;
}
.toc-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-mid);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
}
.toc-title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.9rem;
}
.toc-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.3rem 2rem;
}
.toc-list a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  transition: color 0.15s;
}
.toc-list a::before {
  content: "→";
  color: var(--accent-mid);
  font-size: 0.75rem;
  flex-shrink: 0;
}
.toc-list a:hover { color: var(--accent); }

/* ── ARTICLE ── */
article {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 3rem) 4rem;
}

section { margin-bottom: 3.5rem; }

h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1rem;
  margin-top: 0.5rem;
  line-height: 1.25;
}
h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.6rem;
  margin-top: 1.8rem;
}

p { margin-bottom: 1.1rem; color: var(--ink-2); }
p:last-child { margin-bottom: 0; }

strong { color: var(--ink); font-weight: 500; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

/* ── SECTION DIVIDER ── */
.section-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ── HIGHLIGHT BOX ── */
.highlight {
  background: var(--accent-light);
  border: 1px solid #b7dfc8;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.highlight p { color: var(--accent); margin: 0; font-size: 0.95rem; }
.highlight strong { color: var(--accent); }

/* ── WARN BOX ── */
.warn {
  background: var(--warn-bg);
  border: 1px solid #f0c897;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.warn-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warn);
  margin-bottom: 0.4rem;
}
.warn p { color: #5c3000; margin: 0; font-size: 0.95rem; }

/* ── CODE ── */
code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.82em;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 2px 7px;
  border-radius: 4px;
}
pre {
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
pre code {
  background: none;
  padding: 0;
  font-size: 0.87rem;
  color: var(--code-fg);
  line-height: 1.7;
}
.code-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.4rem;
  display: block;
}

/* ── CARDS GRILLE ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
  border-color: var(--accent-mid);
  box-shadow: 0 2px 12px rgba(45,106,79,0.08);
}
.card-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.card-lang {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--bg);
  color: var(--ink-3);
  padding: 2px 8px;
  border-radius: 100px;
  margin-bottom: 0.6rem;
}
.card p { font-size: 0.88rem; color: var(--ink-2); margin: 0; }

/* ── LICENCE TABLE ── */
.licence-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.licence-table th {
  text-align: left;
  padding: 0.6rem 0.9rem;
  background: var(--bg);
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
}
.licence-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink-2);
  vertical-align: top;
}
.licence-table tr:last-child td { border-bottom: none; }
.licence-table tr:hover td { background: var(--accent-light); }
.badge-yes { color: #2d6a4f; font-weight: 500; }
.badge-no { color: #c0392b; font-weight: 500; }
.badge-cond { color: #7b3f00; font-weight: 500; }

/* ── CHECKLIST ── */
.checklist {
  list-style: none;
  margin: 1rem 0;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--ink-2);
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: "✓";
  color: var(--accent-mid);
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── FAQ ── */
.faq-list { margin: 1rem 0; }
details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  background: var(--surface);
  transition: box-shadow 0.15s;
}
details[open] {
  box-shadow: 0 2px 12px rgba(45,106,79,0.07);
  border-color: var(--accent-mid);
}
summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.97rem;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--accent-mid);
  flex-shrink: 0;
  transition: transform 0.2s;
}
details[open] summary::after {
  transform: rotate(45deg);
}
.faq-answer {
  padding: 0 1.25rem 1.1rem;
  font-size: 0.93rem;
  color: var(--ink-2);
  line-height: 1.7;
}

/* ── CONCLUSION ── */
.conclusion {
  background: var(--ink);
  color: #f5f3ee;
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  margin: 2rem 0;
}
.conclusion h2 {
  font-family: 'DM Serif Display', serif;
  color: #f5f3ee;
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
}
.conclusion p { color: #c8c0b5; margin-bottom: 0.8rem; }
.conclusion p:last-child { margin: 0; }
.conclusion strong { color: #e8e4de; font-weight: 500; }

/* ── FOOTER ── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem;
  font-size: 0.82rem;
  color: var(--ink-3);
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .toc-list { grid-template-columns: 1fr; }
  .licence-table { font-size: 0.8rem; }
  .licence-table th, .licence-table td { padding: 0.5rem 0.6rem; }
}
