:root {
  color-scheme: dark;
  --ink: #eef8f1;
  --muted: #aebbb4;
  --dim: #7e8a84;
  --bg: #090d0b;
  --bg-soft: #0f1512;
  --surface: #131b17;
  --surface-2: #18221d;
  --line: #26342d;
  --line-strong: #3d5448;
  --green: #b9f3ce;
  --green-2: #77c99a;
  --lilac: #cbb7ff;
  --lilac-2: #9d83e4;
  --amber: #f5d88d;
  --red: #f2a6b0;
  --max: 1180px;
  --reading: 760px;
  --radius: 18px;
  --shadow: 0 22px 70px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 82% 8%, rgba(203, 183, 255, .08), transparent 27rem),
    radial-gradient(circle at 15% 22%, rgba(185, 243, 206, .06), transparent 24rem),
    var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

a { color: var(--green); text-underline-offset: .22em; }
a:hover { color: #d2fbe0; }

img, svg { display: block; max-width: 100%; }
button, input { font: inherit; }

::selection { background: var(--lilac); color: #14101c; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: .75rem;
  left: .75rem;
  padding: .7rem 1rem;
  transform: translateY(-160%);
  border-radius: 999px;
  background: var(--green);
  color: #07100a;
  font-weight: 800;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 40;
  top: 0;
  border-bottom: 1px solid rgba(61, 84, 72, .62);
  background: rgba(9, 13, 11, .88);
  backdrop-filter: blur(18px);
}

.nav {
  width: min(calc(100% - 2rem), var(--max));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 780;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--green);
  border-radius: 50%;
  box-shadow: .45rem .38rem 0 -2px var(--lilac);
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .12rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  padding: .45rem .62rem;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-size: .88rem;
  font-weight: 650;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: var(--surface);
  color: var(--green);
}

.theme-toggle {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .4rem .72rem;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 750;
}

main { overflow: clip; }

.shell { width: min(calc(100% - 2rem), var(--max)); margin-inline: auto; }
.reading { width: min(100%, var(--reading)); }

.hero {
  position: relative;
  min-height: 72vh;
  padding: clamp(4.5rem, 9vw, 9rem) 0 5rem;
  display: grid;
  align-items: end;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 4vw 4rem auto;
  width: clamp(9rem, 24vw, 20rem);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49.7%, var(--line) 50%, transparent 50.3%),
    linear-gradient(transparent 49.7%, var(--line) 50%, transparent 50.3%);
  opacity: .65;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--green);
  font: 800 .76rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1 {
  max-width: 980px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.4rem, 9vw, 8.7rem);
  font-weight: 500;
  line-height: .88;
  letter-spacing: -.065em;
  text-wrap: balance;
}

.hero h1 em { color: var(--lilac); font-style: italic; font-weight: 400; }

.hero-lead {
  max-width: 760px;
  margin: 2rem 0 0;
  color: #d5dfd9;
  font-size: clamp(1.12rem, 2vw, 1.46rem);
  line-height: 1.55;
}

.hero-meta {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .7rem 1.4rem;
  color: var(--dim);
  font: 650 .76rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.page-hero {
  padding: clamp(4rem, 9vw, 8rem) 0 4rem;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 { max-width: 950px; font-size: clamp(3rem, 7.5vw, 7rem); }
.page-hero .lead { max-width: 780px; margin-top: 1.6rem; }

.section { padding: clamp(4.5rem, 8vw, 8rem) 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }

.section-head {
  display: grid;
  grid-template-columns: minmax(12rem, .65fr) minmax(0, 1.35fr);
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
}

.section-no {
  color: var(--dim);
  font: 650 .78rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h2, h3, h4 { text-wrap: balance; }

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5.5vw, 5rem);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.045em;
}

h3 { margin: 0 0 .8rem; font-size: 1.2rem; line-height: 1.35; }
h4 { margin: 1.8rem 0 .5rem; font-size: 1rem; }
p { margin: 0 0 1.25rem; }
.lead { color: #d7e1db; font-size: 1.22rem; line-height: 1.6; }
.muted { color: var(--muted); }
.small { font-size: .82rem; line-height: 1.55; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.balance { text-wrap: balance; }

.argument {
  max-width: 900px;
  margin: 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4.4vw, 3.7rem);
  line-height: 1.15;
  letter-spacing: -.035em;
}

.argument strong { color: var(--green); font-weight: 500; }

.signal-grid,
.case-grid,
.source-grid,
.axis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.signal,
.card,
.case,
.source-card {
  min-width: 0;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(24,34,29,.88), rgba(15,21,18,.78));
}

.signal { min-height: 230px; display: flex; flex-direction: column; }
.signal .value {
  margin: auto 0 .8rem;
  color: var(--green);
  font: 500 clamp(2.6rem, 5vw, 4.4rem)/.92 Georgia, "Times New Roman", serif;
  letter-spacing: -.045em;
}
.signal .label { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.signal .source-ref { margin-top: 1rem; }

.source-ref,
.status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .26rem .55rem;
  color: var(--muted);
  font: 750 .68rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .05em;
  text-decoration: none;
  text-transform: uppercase;
}

.source-ref:hover { border-color: var(--green-2); color: var(--green); }
.status[data-status="etabli"] { border-color: #3e7b57; color: var(--green); background: #152a1d; }
.status[data-status="nuance"] { border-color: #7969a0; color: var(--lilac); background: #241d31; }
.status[data-status="corrige"] { border-color: #8d7043; color: var(--amber); background: #2b2417; }
.status[data-status="mesurer"] { border-color: #77515a; color: var(--red); background: #291a1e; }

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.compare > article { padding: clamp(1.5rem, 4vw, 3rem); }
.compare > article + article { border-left: 1px solid var(--line-strong); }
.compare .side-label { margin-bottom: 2.5rem; color: var(--dim); font: 760 .72rem/1.2 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .12em; }
.compare .big { margin: 0 0 .5rem; font: 500 clamp(2.4rem, 6vw, 5.2rem)/.9 Georgia, serif; letter-spacing: -.04em; }
.compare article:first-child .big { color: var(--lilac); }
.compare article:last-child .big { color: var(--green); }

.fact-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.fact-list li { padding: .8rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.fact-list strong { display: block; color: var(--ink); font-weight: 700; }

.lens {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.lens > div { padding: 1.4rem; border-left: 3px solid var(--green-2); background: rgba(185,243,206,.04); }
.lens > div:nth-child(even) { border-color: var(--lilac-2); background: rgba(203,183,255,.04); }
.lens strong { display: block; margin-bottom: .35rem; }

.flow-list { counter-reset: flow; list-style: none; padding: 0; margin: 0; }
.flow-list li {
  counter-increment: flow;
  display: grid;
  grid-template-columns: 3.6rem 1fr;
  gap: 1.1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}
.flow-list li::before { content: "0" counter(flow); color: var(--lilac); font: 700 .78rem/1.5 ui-monospace, monospace; }

.callout {
  margin: 2.5rem 0;
  padding: 1.5rem 1.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(203,183,255,.055);
}
.callout.green { background: rgba(185,243,206,.05); }
.callout p:last-child { margin-bottom: 0; }

.quote {
  margin: 3rem 0;
  padding-left: 1.4rem;
  border-left: 3px solid var(--lilac);
  font-family: Georgia, serif;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 1.35;
}

.table-wrap { margin: 2rem 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 720px; background: rgba(15,21,18,.7); }
th, td { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--green); font: 750 .75rem/1.35 ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
td { color: #d3ddd7; }

.case { display: flex; flex-direction: column; min-height: 300px; }
.case .case-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.6rem; }
.case h3 { margin-top: auto; font-family: Georgia, serif; font-size: 1.55rem; font-weight: 500; letter-spacing: -.025em; }
.case p { color: var(--muted); font-size: .92rem; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1.5rem;
}

.filter-bar button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .5rem .78rem;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 750;
}

.filter-bar button:hover,
.filter-bar button[aria-pressed="true"] { border-color: var(--green-2); color: var(--green); }
.is-hidden { display: none !important; }

.toc {
  margin: 2rem 0;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.toc ol { columns: 2; gap: 2.5rem; margin: .5rem 0 0; padding-left: 1.3rem; }
.toc li { break-inside: avoid; padding: .25rem 0; }
.toc a { color: var(--muted); }

.definition { display: grid; grid-template-columns: minmax(10rem, .7fr) 1.5fr; gap: 1rem 2rem; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.definition dt { color: var(--green); font-weight: 760; }
.definition dd { margin: 0; color: var(--muted); }

.source-card { min-height: 180px; }
.source-card h3 { font-size: 1rem; }
.source-card p { color: var(--muted); font-size: .86rem; }
.source-card a { overflow-wrap: anywhere; }

.source-list { list-style: none; margin: 2rem 0; padding: 0; }
.source-list li { display: grid; grid-template-columns: 3.3rem 1fr; gap: 1rem; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.source-list .sid { color: var(--lilac); font: 750 .74rem/1.5 ui-monospace, monospace; }
.source-list cite { color: var(--ink); font-style: normal; font-weight: 650; }
.source-list p { color: var(--muted); font-size: .9rem; margin: .35rem 0 0; }

details { border-top: 1px solid var(--line); padding: 1rem 0; }
summary { cursor: pointer; color: var(--ink); font-weight: 730; }
details p { color: var(--muted); margin: .8rem 0 0; }

.footer {
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-grid { display: grid; grid-template-columns: 1.4fr .6fr; gap: 2rem; }
.footer strong { color: var(--ink); }
.footer a { color: var(--muted); }

.back-top { display: inline-block; margin-top: 1rem; font-size: .82rem; }

@media (max-width: 900px) {
  body { font-size: 16px; }
  .nav { width: min(calc(100% - 1.2rem), var(--max)); }
  .brand span:last-child { display: none; }
  .nav-links { order: 3; width: 100%; margin-left: 0; }
  .nav { flex-wrap: wrap; padding: .7rem 0; gap: .45rem; }
  .theme-toggle { margin-left: auto; }
  .section-head { grid-template-columns: 1fr; gap: .75rem; }
  .signal-grid, .case-grid, .source-grid, .axis-grid { grid-template-columns: 1fr 1fr; }
  .hero::after { opacity: .35; }
}

@media (max-width: 640px) {
  .shell { width: min(calc(100% - 1.25rem), var(--max)); }
  .hero { min-height: auto; padding-top: 4.5rem; }
  .hero h1, .page-hero h1 { letter-spacing: -.05em; }
  .hero::after { display: none; }
  .signal-grid, .case-grid, .source-grid, .axis-grid, .compare, .lens, .footer-grid { grid-template-columns: 1fr; }
  .compare > article + article { border-left: 0; border-top: 1px solid var(--line-strong); }
  .toc ol { columns: 1; }
  .definition { grid-template-columns: 1fr; gap: .35rem; }
  .source-list li { grid-template-columns: 2.5rem 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

html[data-theme="light"] {
  color-scheme: light;
  --ink: #172019;
  --muted: #536159;
  --dim: #6b776f;
  --bg: #f3f7f3;
  --bg-soft: #eaf1ec;
  --surface: #ffffff;
  --surface-2: #e5eee8;
  --line: #cad8cf;
  --line-strong: #a9beb0;
  --green: #17693b;
  --green-2: #2b8a53;
  --lilac: #7252b8;
  --lilac-2: #8065bd;
  --amber: #805c10;
  --red: #9a3546;
  --shadow: 0 18px 60px rgba(30, 55, 38, .11);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 82% 8%, rgba(114,82,184,.07), transparent 27rem),
    radial-gradient(circle at 15% 22%, rgba(23,105,59,.06), transparent 24rem),
    var(--bg);
}

html[data-theme="light"] .site-header { background: rgba(243,247,243,.9); }
html[data-theme="light"] .hero-lead,
html[data-theme="light"] .lead,
html[data-theme="light"] td { color: #38473d; }
html[data-theme="light"] .status[data-status="etabli"] { color: #17693b; background: #e4f5e9; }
html[data-theme="light"] .status[data-status="nuance"] { color: #6645ae; background: #efe9ff; }
html[data-theme="light"] .status[data-status="corrige"] { color: #805c10; background: #fff4d6; }
html[data-theme="light"] .status[data-status="mesurer"] { color: #9a3546; background: #fde8ec; }

@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --bg-soft: #fff; --ink: #111; --muted: #444; --line: #bbb; --green: #164f30; --lilac: #543b88; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .site-header, .theme-toggle, .filter-bar, .back-top { display: none !important; }
  .hero, .page-hero, .section { padding: 1.2cm 0; }
  a { color: inherit; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; overflow-wrap: anywhere; }
  .case, .signal, .card, .source-card, .compare { break-inside: avoid; box-shadow: none; }
}
