:root {
  --paper: #f3f1ec;
  --card: #ffffff;
  --ink: #221f1b;
  --ink-soft: #625c53;
  --line: #ddd8ce;
  --water: #3d7ea6;
  --dry: #c8452c;
  --focus: #e0a526;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 var(--sans); font-variant-numeric: tabular-nums;
}
a { color: var(--water); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem clamp(1rem, 4vw, 3rem);
  background: rgba(243, 241, 236, .92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { font: 1.35rem var(--serif); color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 1.1rem; overflow-x: auto; }
.top nav a { color: var(--ink-soft); text-decoration: none; font-size: .9rem; white-space: nowrap; }
.top nav a:hover { color: var(--ink); }

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem) 4rem; }

.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 2.5rem; }
.hero h1 {
  font: 400 clamp(2.2rem, 5.2vw, 4.1rem)/1.04 var(--serif);
  letter-spacing: -.01em; max-width: 17ch; margin: 0 0 1.4rem;
}
.lede { max-width: 62ch; font-size: 1.08rem; color: var(--ink-soft); margin: 0 0 2.2rem; }
.lede em { font-style: normal; color: var(--ink); font-weight: 600; }

.budget-bar {
  position: relative; height: 54px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, #d9d3c8 0 2px, #ebe6dc 2px 9px);
  overflow: hidden;
}
.budget-cons {
  position: absolute; inset: 0 auto 0 0; background: var(--dry);
  transform-origin: left; animation: grow 1.4s .3s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes grow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .budget-cons { animation: none; } }
.budget-legend { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: .55rem; font-size: .92rem; color: var(--ink-soft); }
.budget-legend b { color: var(--ink); }
.budget-legend .cons b { color: var(--dry); }

.chapter { padding-top: 3.5rem; border-top: 1px solid var(--line); margin-top: 2.5rem; }
.chapter-head h2, .sources h2 { font: 400 clamp(1.8rem, 3.4vw, 2.6rem)/1.1 var(--serif); margin: 0 0 .5rem; }
.chapter-head p { max-width: 68ch; color: var(--ink-soft); margin: 0 0 1.5rem; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; margin-bottom: 1.2rem; }
.seg button {
  font: 500 .88rem var(--sans); color: var(--ink); background: transparent;
  border: 0; padding: .45rem 1rem; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--ink); }
.seg button[aria-selected="true"] { background: var(--ink); color: #fff; }

.stack { display: flex; height: 76px; border-radius: 4px; overflow: hidden; }
.stack div {
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: .45rem .55rem; color: #fff; font-size: .8rem; line-height: 1.2;
  transition: flex-grow .6s cubic-bezier(.2,.7,.2,1); min-width: 0; overflow: hidden;
}
.stack div b { font-size: 1.25rem; font-weight: 600; }
.stack div span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { .stack div { transition: none; } }
.note { max-width: 70ch; color: var(--ink-soft); margin: .8rem 0 1.8rem; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.grid2.wide-left { grid-template-columns: 1.35fr 1fr; }
@media (max-width: 860px) { .grid2, .grid2.wide-left { grid-template-columns: 1fr; } }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.1rem; margin: 0 0 1.2rem; }
figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .8rem; font-weight: 600; font-size: .95rem; margin-bottom: .6rem; }
figcaption small { flex-basis: 100%; font-weight: 400; color: var(--ink-soft); font-size: .8rem; }
select { font: .85rem var(--sans); color: var(--ink); padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 4px; background: #fff; max-width: 100%; }
input[type=range] { accent-color: var(--ink); width: min(260px, 100%); }

.chart svg, .map svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text, .map text { font: 11px var(--sans); fill: var(--ink-soft); }
.chart .axis line, .chart .grid line { stroke: var(--line); }
.chart .zero { stroke: var(--ink); stroke-width: 1; }
.map path { stroke: #fff; stroke-width: .6; cursor: pointer; }
.map path:hover, .map path.sel { stroke: var(--ink); stroke-width: 1.6; }
.map path.sel { paint-order: stroke; }

.legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .78rem; color: var(--ink-soft); margin-top: .5rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.legend .ramp { display: flex; align-items: center; gap: .4rem; width: 100%; }
.legend .ramp span.bar { flex: 1; height: 10px; border-radius: 2px; }

.detail h3 { font: 400 1.7rem/1.1 var(--serif); margin: 0 0 .2rem; }
.detail .sub { color: var(--ink-soft); font-size: .88rem; margin: 0 0 .9rem; }
.detail .empty { color: var(--ink-soft); margin: 0; }
.strip { display: grid; grid-template-columns: repeat(36, 1fr); gap: 1px; margin: .3rem 0 .2rem; }
.strip span { height: 22px; }
.strip-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-soft); margin-bottom: 1rem; }
.stations { list-style: none; padding: 0; margin: 0 0 .8rem; font-size: .85rem; }
.stations li { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; border-top: 1px solid var(--line); }
.stations button { all: unset; cursor: pointer; flex: 1; }
.stations button:focus-visible { outline: 3px solid var(--focus); }
.stations li.on button { font-weight: 600; }
.stations i { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.stations small { color: var(--ink-soft); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.2rem 2rem; margin: 1rem 0 1.6rem; }
.fact b { display: block; font: 400 2.1rem/1 var(--serif); margin-bottom: .3rem; }
.fact p { margin: 0; font-size: .88rem; color: var(--ink-soft); }
.fact.dry b { color: var(--dry); }
.fact.wet b { color: var(--water); }

.sources dl { display: grid; grid-template-columns: 11rem 1fr; gap: .8rem 1.5rem; max-width: 900px; font-size: .9rem; }
.sources dt { font-weight: 600; }
.sources dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 640px) { .sources dl { grid-template-columns: 1fr; } .sources dd { margin-bottom: .6rem; } }
.stamp { color: var(--ink-soft); font-size: .8rem; margin-top: 2rem; }

#tip {
  position: fixed; z-index: 20; pointer-events: none; max-width: 260px;
  background: var(--ink); color: #fff; font-size: .8rem; line-height: 1.35;
  padding: .45rem .6rem; border-radius: 4px;
}
#tip b { font-weight: 600; }
.loading { color: var(--ink-soft); font-size: .9rem; padding: 2rem 0; }

.stack div b { white-space: nowrap; }
@media (max-width: 640px) { .stack div span { display: none; } .stack div b { font-size: 1rem; } .stack div { padding: .4rem .3rem; } }

/* ---- CO2energie ---- */
.budget-bar .budget-cons { background: linear-gradient(90deg, #3b3b3b, #8e5a3c 55%, #c8452c); }
.chart.tall svg { min-height: 300px; }
.ctrls { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 400; font-size: .85rem; }
.yl { font: 400 1.5rem var(--serif); min-width: 3ch; }
.flow-wrap { width: 100%; overflow-x: auto; }
#flow { display: block; width: 100%; min-width: 620px; height: 540px; }
#flow text { font-family: var(--sans); fill: var(--ink); }
#flow .sub { fill: var(--ink-soft); font-size: 11.5px; }
#flow .col { fill: var(--ink-soft); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
#flow path.link:hover { opacity: .9 !important; }
.prose h3 { font: 400 1.5rem/1.1 var(--serif); margin: 0 0 .7rem; }
.prose p { margin: 0 0 .7rem; font-size: .92rem; }
.prose .muted { color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: .7rem; }
.insight { margin: .8rem 0 0; font-size: .95rem; max-width: 80ch; }
.multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-top: .8rem; }
.multiples .panel { margin: 0; padding: .8rem .9rem; }
.multiples h4 { margin: 0; font: 400 1.3rem/1.1 var(--serif); }
.multiples .m-sub { font-size: .78rem; color: var(--ink-soft); margin: .1rem 0 .4rem; }
.levers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }
.lever { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.2rem; border-top: 4px solid var(--c, var(--ink)); }
.lever .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.lever b { display: block; font: 400 2.4rem/1 var(--serif); margin: .4rem 0; color: var(--c, var(--ink)); }
.lever p { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.lever p + p { margin-top: .5rem; color: var(--ink); }
.chart circle.pt { stroke: #fff; stroke-width: .8; }
.chart text.lab { fill: var(--ink); font-size: 10.5px; font-weight: 600; }


/* ---- FranceAgricole ---- */
:root { --pos: #5b8548; --neg: #c8452c; }
.hero h1 { max-width: 20ch; }
.duo { display: grid; gap: .5rem; }
.duo-row { display: grid; grid-template-columns: 3.2rem 1fr 6.5rem; align-items: center; gap: .7rem; }
.duo-l { font: 400 1.4rem var(--serif); }
.duo-bar { height: 30px; border-radius: 4px; background: repeating-linear-gradient(90deg, #d9d3c8 0 2px, #ebe6dc 2px 9px); overflow: hidden; }
.duo-bar i { display: block; height: 100%; min-width: 3px; background: var(--pos); transform-origin: left; animation: grow 1.2s .2s cubic-bezier(.2,.7,.2,1) both; }
@media (prefers-reduced-motion: reduce) { .duo-bar i { animation: none; } }
.duo-row b { font-weight: 600; text-align: right; white-space: nowrap; }
.chapter-head p em { font-style: italic; color: var(--ink); }
.chart .row-hit { cursor: pointer; }
.chart .row-hit:hover + rect, .chart rect.sel { stroke: var(--ink); stroke-width: 1.5; }
.chart text.val { fill: var(--ink); font-weight: 600; }
.chart text.rowlab { fill: var(--ink); font-size: 12px; }
.chart text.rowlab.sel { font-weight: 700; }
.detail { position: sticky; top: 70px; }
.detail .big { font: 400 2.6rem/1 var(--serif); margin: .2rem 0 .1rem; }
.detail .big.pos { color: var(--pos); } .detail .big.neg { color: var(--neg); }
.detail table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: .7rem 0 .9rem; }
.detail td { padding: .3rem 0; border-top: 1px solid var(--line); }
.detail td:last-child { text-align: right; font-weight: 600; }
.detail ul { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
.detail li { margin-bottom: .4rem; }
.legend i.dot { border-radius: 50%; background: var(--ink); width: 10px; height: 10px; }
.cause { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; align-items: start; padding: 1.6rem 0; border-top: 1px solid var(--line); }
.cause:first-of-type { border-top: 0; padding-top: .4rem; }
@media (max-width: 860px) { .cause { grid-template-columns: 1fr; gap: .8rem; } .detail { position: static; } }
.cause .k, .lever .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.cause h3 { font: 400 1.6rem/1.12 var(--serif); margin: .35rem 0 .7rem; }
.cause p { margin: 0 0 .7rem; font-size: .95rem; }
.cause .panel { margin: 0; }
.lever b { font-size: 1.55rem; line-height: 1.1; }
.facts.wide { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.facts.wide .fact b { font-size: 1.7rem; line-height: 1.05; }
.multiples h4 small { font: 400 .78rem var(--sans); color: var(--ink-soft); }
.stack { height: 88px; }
.top nav { scrollbar-width: none; }
.chart text.val { paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
@media (max-width: 640px) {
  .multiples { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .multiples .panel { padding: .6rem .6rem; }
  .multiples h4 { font-size: 1.05rem; }
  .multiples .m-sub { font-size: .7rem; }
}
