/* richesse-data — récit « La richesse, en clair » (templates/recit.php)
 *
 * Même identité que le thème expli et que les récits climat et finances : fond
 * bleu encre, une seule famille (Archivo) jouée sur sa chasse, couleur réservée
 * aux données. La couleur du dossier est l'or (--or). */

:root {
	--fond: #0e1b2c;
	--fond-2: #132439;
	--fond-3: #1a2e48;
	--trame: #233650;
	--texte: #e8eef5;
	--texte-2: #a9b8cc;
	--texte-3: #71849e;
	--or: #f2c14e;        /* couleur du dossier, milliardaires */
	--haut: #e76f51;      /* les plus riches */
	--bas: #7da7f7;       /* les autres */

	--f: "Archivo", "Helvetica Neue", Arial, sans-serif;
	--large: 125;
	--etroit: 72;

	--gouttiere: clamp(16px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }

body {
	margin: 0; background: var(--fond); color: var(--texte);
	font: 400 clamp(16px, 1.05vw, 18px)/1.6 var(--f); font-variation-settings: "wdth" 100;
	-webkit-font-smoothing: antialiased; overflow-x: hidden;
}
strong { font-weight: 700; }
a { color: inherit; text-underline-offset: .18em; }

/* ── Barre du haut ─────────────────────────────────────────────── */
.topbar {
	position: fixed; inset: 0 0 auto; z-index: 50;
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; row-gap: 4px;
	padding: 14px var(--gouttiere) 10px; pointer-events: none;
	background: linear-gradient(rgba(14, 27, 44, .9), rgba(14, 27, 44, 0));
}
.topbar a { pointer-events: auto; color: var(--texte); text-decoration: none; }
.topbar__logo { font-size: 21px; font-weight: 800; font-variation-settings: "wdth" var(--large); letter-spacing: -.03em; }
.topbar__logo span { font-weight: 300; }
.topbar__nav { display: none; gap: 20px; font-size: 15px; font-weight: 500; font-variation-settings: "wdth" var(--etroit); }
.topbar__nav a { color: var(--texte-2); }
.topbar__nav a.is-active, .topbar__nav a:hover { color: var(--texte); }
.topbar__fil { flex-basis: 100%; order: 3; }
.topbar__fil ol { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; font-size: 14px; font-variation-settings: "wdth" var(--etroit); }
.topbar__fil li { color: var(--texte-2); }
.topbar__fil li + li::before { content: "/"; margin: 0 8px; color: var(--texte-3); }
.topbar__fil a { color: inherit; }
.topbar__fil a:hover, .topbar__fil [aria-current] { color: var(--texte); }
.topbar__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--trame); }
.topbar__progress span { display: block; height: 100%; width: 100%; background: var(--texte); transform-origin: 0 50%; transform: scaleX(0); }
@media (min-width: 768px) { .topbar__nav { display: flex; } }
.admin-bar .topbar { top: 32px; }
@media (max-width: 782px) { .admin-bar .topbar { top: 46px; } }

/* ── Chapitres ────────────────────────────────────────────────── */
.chapter { position: relative; }
.stage { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: var(--fond); }

.chapter__head {
	position: absolute; z-index: 3; left: var(--gouttiere); top: clamp(96px, 15vh, 150px);
	max-width: min(30rem, calc(100% - 2 * var(--gouttiere)));
}
.chapter__head h2 {
	margin: 0 0 14px; font-size: clamp(36px, 5vw, 76px); line-height: .95; font-weight: 900;
	font-variation-settings: "wdth" var(--large); letter-spacing: -.035em;
}
.chapter__head p { margin: 0; color: var(--texte-2); }
.chapter__head--static { position: relative; left: auto; top: auto; max-width: 44rem; }

.source {
	position: absolute; z-index: 3; left: var(--gouttiere); bottom: 16px; margin: 0; max-width: calc(100% - 2 * var(--gouttiere));
	font-size: 14px; font-variation-settings: "wdth" var(--etroit); color: var(--texte-3);
}
.source a { color: var(--texte-2); }
.source--statique { position: static; margin-top: 10px; }
.note-bas { margin: 14px 0 0; max-width: 60rem; font-size: 14px; line-height: 1.45; font-variation-settings: "wdth" var(--etroit); color: var(--texte-3); }

/* ── Infobulle ────────────────────────────────────────────────── */
.bulle {
	position: fixed; z-index: 60; pointer-events: none; padding: 7px 10px; border-radius: 4px;
	background: var(--texte); color: var(--fond); font-size: 14px; line-height: 1.35; font-variation-settings: "wdth" var(--etroit); white-space: nowrap;
	transform: translate(-50%, calc(-100% - 14px));
}
.bulle b { font-weight: 800; font-variation-settings: "wdth" 100; }
.bulle i { display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: middle; font-style: normal; }
.bulle[hidden] { display: none; }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; justify-content: center; padding: 0 var(--gouttiere); pointer-events: none; }
.hero__title {
	margin: 0; font-size: clamp(60px, 12vw, 210px); line-height: .82; font-weight: 900;
	font-variation-settings: "wdth" var(--large); letter-spacing: -.05em; text-shadow: 0 4px 60px rgba(14, 27, 44, .55);
}
.hero__lede { margin: 28px 0 0; max-width: 34ch; font-size: clamp(18px, 1.5vw, 23px); text-shadow: 0 2px 20px rgba(14, 27, 44, .9); }
.scroll-cue { position: absolute; left: 50%; bottom: 28px; width: 2px; height: 54px; background: rgba(232, 238, 245, .25); overflow: hidden; }
.scroll-cue span { position: absolute; left: 0; top: -40%; width: 100%; height: 40%; background: var(--texte); animation: cue 1.8s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes cue { to { top: 100%; } }

/* ── Carte des milliardaires ──────────────────────────────────── */
.carte { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.carte .terre { fill: var(--fond-3); stroke: var(--fond); stroke-width: .5; }
.carte .terre.is-survol { fill: var(--trame); }
.carte .rond { fill: var(--or); fill-opacity: .55; stroke: var(--or); stroke-width: 1; }
.carte .rond.is-survol { fill-opacity: .9; }
.carte .rond.is-ancien { fill-opacity: .14; stroke-opacity: .7; stroke-dasharray: 3 3; }
.carte .rond.is-ancien.is-survol { fill-opacity: .35; }
.carte .etiquette { font: 700 12px var(--f); font-variation-settings: "wdth" var(--etroit); fill: var(--texte); text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: var(--fond); stroke-width: 3px; }

.readout {
	position: absolute; z-index: 3; right: var(--gouttiere); bottom: clamp(52px, 9vh, 100px);
	display: flex; flex-direction: column; align-items: flex-end; text-align: right; pointer-events: none;
	text-shadow: 0 2px 30px rgba(14, 27, 44, .8);
}
.readout__year { font-size: clamp(64px, 11vw, 190px); line-height: .8; font-weight: 900; font-variation-settings: "wdth" var(--large); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.readout__value { margin-top: 10px; font-size: clamp(24px, 2.8vw, 42px); line-height: 1; font-weight: 700; font-variation-settings: "wdth" var(--etroit); font-variant-numeric: tabular-nums; color: var(--or); }
.readout__label { max-width: 30rem; margin-top: 8px; font-size: 15px; line-height: 1.3; font-variation-settings: "wdth" var(--etroit); color: var(--texte-2); }

.classement {
	position: absolute; z-index: 3; left: var(--gouttiere); bottom: clamp(52px, 9vh, 100px); margin: 0; padding: 0; list-style: none;
	width: min(17rem, 44vw); font-size: 15px; line-height: 1.75; font-variation-settings: "wdth" var(--etroit); color: var(--texte-2);
}
.classement li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--trame); }
.classement b { color: var(--texte); font-variant-numeric: tabular-nums; }
.classement .is-ancien { opacity: .5; }
@media (max-width: 767px) {
	/* Petit écran : les trois premiers pays en haut, l'année au-dessus des sources. */
	.classement { top: clamp(104px, 15vh, 140px); bottom: auto; display: flex; flex-wrap: wrap; gap: 0 16px; width: calc(100% - 2 * var(--gouttiere)); font-size: 14px; }
	.classement li { border: 0; gap: 6px; }
	.classement li:nth-child(n+4) { display: none; }
	.readout { bottom: 92px; }
	.readout__year { font-size: 64px; }
	.readout__value { font-size: 22px; }
	.readout__label { max-width: 20rem; font-size: 13px; }
}

/* ── Commandes : bascules, puces, réglages ────────────────────── */
.commandes { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.bascule { display: inline-flex; padding: 3px; border-radius: 20px; background: var(--fond-3); }
.bascule button { padding: 7px 14px; border: 0; border-radius: 17px; background: none; color: var(--texte-2); font: 600 15px var(--f); font-variation-settings: "wdth" var(--etroit); cursor: pointer; }
.bascule button[aria-pressed="true"] { background: var(--texte); color: var(--fond); }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puces[hidden] { display: none; }
.puces button {
	display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--trame); border-radius: 18px;
	background: none; color: var(--texte-3); font: 600 14px var(--f); font-variation-settings: "wdth" var(--etroit); cursor: pointer;
}
.puces button::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: var(--q, var(--texte-3)); opacity: .35; }
.puces button[aria-pressed="true"] { border-color: var(--texte-3); color: var(--texte); }
.puces button[aria-pressed="true"]::before { opacity: 1; }
.puces button:hover { border-color: var(--texte-2); }
.puces button:focus-visible, .bascule button:focus-visible, .reglage input:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
.reglage { display: flex; align-items: center; gap: 12px; font-size: 16px; font-variation-settings: "wdth" var(--etroit); }
.reglage[hidden] { display: none; }
.reglage input { width: min(320px, 50vw); accent-color: var(--or); }
.reglage output { min-width: 4ch; font-size: 24px; font-weight: 900; font-variation-settings: "wdth" var(--large); color: var(--or); }

/* ── Graphes ──────────────────────────────────────────────────── */
.graphe { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.graphe--grand { height: clamp(320px, 56vh, 620px); margin-top: 20px; }
.graphe text { font: 400 13px var(--f); font-variation-settings: "wdth" var(--etroit); fill: var(--texte-3); }
.graphe .grille line { stroke: var(--trame); }
.graphe .note { font-weight: 600; font-size: 14px; fill: var(--texte); paint-order: stroke; stroke: var(--fond); stroke-width: 4px; }
.graphe .guide { stroke: var(--texte-3); stroke-dasharray: 3 4; }
.bloc { padding: clamp(110px, 16vh, 170px) var(--gouttiere) 80px; }
.bloc--clair { background: var(--fond-2); }
.bloc--clair .graphe .note { stroke: var(--fond-2); }

/* ── Années de SMIC ───────────────────────────────────────────── */
.carres { position: absolute; z-index: 1; left: var(--gouttiere); right: var(--gouttiere); top: 0; bottom: 0; width: calc(100% - 2 * var(--gouttiere)); height: 100%; }
.compteur { position: absolute; z-index: 3; right: var(--gouttiere); bottom: clamp(52px, 9vh, 100px); text-align: right; pointer-events: none; text-shadow: 0 2px 30px rgba(14, 27, 44, .9); }
.compteur__n { display: block; font-size: clamp(72px, 12vw, 200px); line-height: .8; font-weight: 900; font-variation-settings: "wdth" var(--large); letter-spacing: -.05em; color: var(--or); font-variant-numeric: tabular-nums; }
.compteur__l { font-size: 17px; font-variation-settings: "wdth" var(--etroit); color: var(--texte-2); }
.stage--salaires .chapter__head { text-shadow: 0 2px 24px rgba(14, 27, 44, 1), 0 0 4px rgba(14, 27, 44, 1); }
.stage--salaires .chapter__head p { color: var(--texte); }

.sous-titre { margin: 0 0 14px; font-size: clamp(30px, 3.6vw, 52px); line-height: 1; font-weight: 900; font-variation-settings: "wdth" var(--large); letter-spacing: -.03em; }

/* ── Suite ────────────────────────────────────────────────────── */
.outro { padding: 120px var(--gouttiere) 140px; background: var(--fond-2); }
.outro h2 { margin: 0 0 24px; font-size: clamp(44px, 8vw, 128px); line-height: .88; font-weight: 900; font-variation-settings: "wdth" var(--large); letter-spacing: -.045em; }
.outro__updated { margin: 0; max-width: 40rem; font-size: 15px; font-variation-settings: "wdth" var(--etroit); color: var(--texte-3); }

@media (prefers-reduced-motion: reduce) { .scroll-cue span { animation: none; } }

/* ── Ce que les plus riches ne paient pas ─────────────────────── */
.manque { margin-top: 26px; }
.manque__chiffre { margin: 0; line-height: .9; }
.manque__n { font-size: clamp(64px, 10vw, 150px); font-weight: 900; font-variation-settings: "wdth" var(--large); letter-spacing: -.045em; color: var(--haut); font-variant-numeric: tabular-nums; }
.manque__u { font-size: clamp(18px, 2vw, 26px); font-weight: 700; font-variation-settings: "wdth" var(--etroit); }
.manque__l { margin: 6px 0 0; color: var(--texte-2); }
.bascule--manque { flex-wrap: wrap; border-radius: 22px; }
.graphe--manque, .graphe--plancher { margin-top: 20px; height: auto; }
.intro-bas { max-width: 44rem; margin: 0 0 6px; color: var(--texte-2); }
.ailleurs { max-width: 52rem; margin: 10px 0 0; padding: 0; list-style: none; }
.ailleurs li { padding: 12px 0; border-top: 1px solid var(--trame); color: var(--texte-2); }
.ailleurs b { margin-right: 6px; font-size: 20px; font-weight: 900; font-variation-settings: "wdth" var(--large); color: var(--texte); }
.ailleurs a { color: var(--texte-2); }
#ch-impots .sous-titre { margin-top: 64px; }

/* ── Poids des milliardaires, millionnaires ───────────────────── */
.graphe--pyr { margin-top: 18px; height: auto; }
.lecteur-simple { display: flex; align-items: center; gap: 12px; margin-top: 24px; font-size: 16px; font-variation-settings: "wdth" var(--etroit); }
.lecteur-simple input { width: min(360px, 60vw); accent-color: var(--or); }
.lecteur-simple output { font-size: 26px; font-weight: 900; font-variation-settings: "wdth" var(--large); color: var(--or); }
.bascule--poids + .puces { flex-basis: 100%; }
#puces-poids button { max-width: 100%; white-space: normal; text-align: left; }
