:root {
  --ground: #F3F6F1;
  --surface: #FFFFFF;
  --surface-2: #E9EFE6;
  --ink: #16241D;
  --ink-soft: #52645A;
  --ink-faint: #7B8C82;
  --rule: #D4DDD1;
  --rule-strong: #B6C4B2;
  --accent: #1B6A49;
  --accent-deep: #0F4A32;
  --accent-wash: #E2EEE7;
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0D1411;
    --surface: #141C18;
    --surface-2: #1B241F;
    --ink: #E7EEE8;
    --ink-soft: #9CAEA2;
    --ink-faint: #7A8C81;
    --rule: #263029;
    --rule-strong: #384439;
    --accent: #58C793;
    --accent-deep: #9EDCBD;
    --accent-wash: #162C21;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding-inline: 20px;
}

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 50;
}
.skip:focus { left: 0; }

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 16px;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.2vw, 1.85rem);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.wordmark span {
  font-family: var(--font-mono);
  font-size: clamp(0.66rem, 1.9vw, 0.78rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.masthead nav { display: flex; gap: 24px; font-size: 0.86rem; }
.masthead nav a { color: var(--ink-soft); text-decoration: none; }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { color: var(--accent); }

@media (max-width: 820px) { .masthead nav { display: none; } }

/* ---------- sections ---------- */

section { padding-block: 64px; }
section + section { border-top: 1px solid var(--rule); }

.folio {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 26px;
}

.prose { max-width: 60ch; }
.prose p + p { margin-top: 16px; }

h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin-bottom: 18px; }
h3 { font-size: 1.12rem; font-weight: 600; margin-bottom: 6px; }

.lede { color: var(--ink-soft); font-size: 1.04rem; }

/* ---------- hero ---------- */

.hero { padding-block: clamp(46px, 8vw, 84px) 64px; }

.hero-grid {
  display: grid;
  gap: 44px;
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.08fr 0.92fr; gap: 60px; }
}

.hero h1 {
  font-size: clamp(2.1rem, 5.6vw, 3.5rem);
  letter-spacing: -0.02em;
  max-width: 17ch;
}

.hero .lede {
  margin-top: 22px;
  max-width: 54ch;
  font-size: clamp(1.02rem, 1.7vw, 1.18rem);
}

.anchor-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 2px solid var(--rule-strong);
  max-width: 54ch;
}

.anchor-price b {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.anchor-price em { font-style: normal; color: var(--ink-soft); font-size: 0.95rem; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 3px;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-deep); color: #FFFFFF; }
.btn-ghost { border-color: var(--rule-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

@media (prefers-color-scheme: dark) {
  .btn-primary { color: #0D1411; }
  .btn-primary:hover { color: #0D1411; }
}

/* ---------- illustration ---------- */

.illo { display: block; width: 100%; max-width: 400px; height: auto; margin-inline: auto; }
.illo .sheet-back { fill: var(--surface-2); stroke: var(--rule); stroke-width: 1; }
.illo .sheet-front { fill: var(--surface); stroke: var(--rule-strong); stroke-width: 1; }
.illo .bar { fill: var(--rule); }
.illo .rule-line { stroke: var(--rule-strong); stroke-width: 1; }
.illo .rule-thin { stroke: var(--rule); stroke-width: 1; }
.illo .check { stroke: var(--accent); stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.illo .num { font-family: var(--font-mono); font-size: 9.5px; fill: var(--ink-soft); font-variant-numeric: tabular-nums; }
.illo .cap { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.13em; fill: var(--ink-faint); }
.illo .total { font-family: var(--font-mono); font-size: 12px; font-weight: 500; fill: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- included grid ---------- */

.included {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0 48px;
  margin-top: 8px;
}

.included div { padding-block: 16px; border-top: 1px solid var(--rule); }
.included p { color: var(--ink-soft); font-size: 0.93rem; }

/* ---------- tables ---------- */

/* Les enfants de grille doivent pouvoir rétrécir, sinon un tableau large
   élargit toute la page au lieu de défiler dans son propre conteneur. */
.hero-grid > *, .tables > *, .contact-grid > * { min-width: 0; }

.ledger-scroll { overflow-x: auto; margin-top: 4px; max-width: 100%; }

table { width: 100%; min-width: 360px; border-collapse: collapse; font-variant-numeric: tabular-nums; }

caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.2;
  color: var(--ink);
  padding-bottom: 6px;
}

caption::after {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  margin-top: 12px;
  margin-bottom: 18px;
  background: var(--accent);
  border-radius: 2px;
}

th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--rule-strong);
}

td { padding-block: 15px; border-bottom: 1px solid var(--rule); font-size: 0.95rem; }
th:last-child, td:last-child { text-align: right; }
td:last-child { font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }

tr.base td { background: var(--accent-wash); font-weight: 600; }
tr.base td:first-child { box-shadow: inset 3px 0 0 var(--accent); padding-left: 14px; }
tr.base td:last-child { color: var(--accent); padding-right: 14px; }

.tag {
  display: inline-block;
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 400;
  vertical-align: 1px;
}

.note { margin-top: 18px; font-size: 0.88rem; color: var(--ink-soft); max-width: 62ch; }
.note strong { color: var(--ink); font-weight: 600; }

.tables { display: grid; gap: 52px; grid-template-columns: 1fr; }
@media (min-width: 880px) { .tables { grid-template-columns: 1.15fr 1fr; gap: 56px; } }

/* ---------- steps ---------- */

ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }

ol.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  padding-block: 20px;
  border-top: 1px solid var(--rule);
  align-items: start;
}

ol.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  padding-top: 3px;
}

ol.steps p { color: var(--ink-soft); font-size: 0.94rem; max-width: 56ch; }

/* ---------- contact ---------- */

.contact-grid { display: grid; gap: 44px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 880px) { .contact-grid { grid-template-columns: 1.1fr 0.9fr; gap: 56px; } }

form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.row2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }

label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 11px 12px;
  width: 100%;
}

textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

.coords { border-top: 1px solid var(--rule); }

.coord {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 16px;
  border-bottom: 1px solid var(--rule);
}

.coord div { display: grid; gap: 3px; }

.coord .k {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.coord .v { font-size: 0.97rem; font-weight: 500; word-break: break-word; }
.coord .v a { color: var(--ink); text-decoration: none; }
.coord .v a:hover { color: var(--accent); }

.form-msg {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent-wash);
  font-size: 0.93rem;
}

.form-msg.error { border-color: #B4442E; background: transparent; }

/* ---------- article pages ---------- */

.article { padding-block: clamp(40px, 6vw, 68px) 40px; }

.article-head { max-width: 62ch; }

.article-head h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  letter-spacing: -0.018em;
}

.article-head .lede { margin-top: 18px; font-size: 1.08rem; }

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--ink-faint); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.body-copy { max-width: 66ch; margin-top: 12px; }
.body-copy h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); margin-top: 44px; margin-bottom: 14px; }
.body-copy h3 { margin-top: 30px; margin-bottom: 8px; }
.body-copy p { margin-top: 14px; color: var(--ink-soft); }
.body-copy p strong { color: var(--ink); }
.body-copy ul { margin-top: 14px; padding-left: 20px; color: var(--ink-soft); }
.body-copy li { margin-top: 8px; }
.body-copy .ledger-scroll { margin-top: 26px; }
.body-copy table { min-width: 340px; }

.callout {
  margin-top: 34px;
  padding: 24px 26px;
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  background: var(--surface);
}

.callout h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.callout p { margin-top: 0; }
.callout .actions { margin-top: 18px; }

.related { border-top: 1px solid var(--rule); padding-block: 44px 8px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.related li { border-top: 1px solid var(--rule); }
.related li:first-child { border-top: none; }
.related a { display: block; padding-block: 16px; text-decoration: none; color: var(--ink); font-weight: 600; }
.related a:hover { color: var(--accent); }
.related span { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.9rem; margin-top: 3px; }

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--rule); padding-block: 36px 48px; font-size: 0.84rem; color: var(--ink-soft); }
footer .wrap { display: grid; gap: 10px; }
footer a { color: var(--ink-soft); }
footer .legal { color: var(--ink-faint); font-size: 0.78rem; max-width: 70ch; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
