/* ==========================================================================
   Pages statiques — feuille partagée
   Les jetons reprennent src/styles/tokens.css et theme-light.css : mêmes
   couleurs, même typographie, pour qu'une fiche et le globe se reconnaissent.
   Pas de dépendance au bundle : la page tient toute seule.
   ========================================================================== */

:root {
  --bg: #05070c;
  --bg-deep: #03050a;
  --surface-1: #0b0f17;
  --surface-2: #111621;
  --surface-3: #171d2b;
  --surface-hover: #1c2331;
  --glass-strong: rgba(8, 11, 18, 0.94);
  --stroke: rgba(255, 255, 255, 0.07);
  --stroke-mid: rgba(255, 255, 255, 0.12);
  --stroke-strong: rgba(255, 255, 255, 0.2);
  --text: #e9eef7;
  --text-dim: #96a3b8;
  --text-faint: #626f84;
  --accent-economy: #f2a65a;
  --accent-geopolitics: #e2647f;
  --accent-ecology: #4fd1a5;
  --accent-social: #6fa8ff;
  --accent-human: #b4d95f;
  --accent-all: #a78bfa;
  --accent: var(--accent-all);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 42%, transparent);
  --good: #4fd1a5;
  --bad: #f2647a;
  --warn: #f2b441;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-num: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  --shadow-2: 0 8px 24px -8px rgba(0, 0, 0, 0.7);
  --r-md: 10px;
  --r-lg: 14px;
  --header-h: 56px;
}

[data-domain='economy'] { --accent: var(--accent-economy); }
[data-domain='geopolitics'] { --accent: var(--accent-geopolitics); }
[data-domain='ecology'] { --accent: var(--accent-ecology); }
[data-domain='social'] { --accent: var(--accent-social); }
[data-domain='human'] { --accent: var(--accent-human); }
[data-domain='all'] { --accent: var(--accent-all); }

:root[data-theme='light'] {
  --bg: #f2f5f9;
  --bg-deep: #e7ecf4;
  --surface-1: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #eceff6;
  --surface-hover: #e2e8f2;
  --glass-strong: rgba(252, 253, 255, 0.93);
  --stroke: rgba(17, 30, 54, 0.09);
  --stroke-mid: rgba(17, 30, 54, 0.16);
  --stroke-strong: rgba(17, 30, 54, 0.32);
  --text: #0f1826;
  --text-dim: #4b5a71;
  --text-faint: #63728a;
  --accent-economy: #b8651b;
  --accent-geopolitics: #c32f54;
  --accent-ecology: #0e8f6b;
  --accent-social: #2361cf;
  --accent-human: #5d7f16;
  --accent-all: #6b46e0;
  --good: #0e8f6b;
  --bad: #cf2b4c;
  --warn: #9a6b06;
  --shadow-2: 0 8px 24px -8px rgba(15, 26, 45, 0.2);
}

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

html { scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  background:
    radial-gradient(1100px 700px at 12% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
b, strong { font-weight: 600; }
.num, td.num, .tile-value { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.skip {
  position: absolute; left: -999px; top: 8px; padding: 8px 12px;
  background: var(--surface-1); border-radius: var(--r-md); z-index: 100;
}
.skip:focus { left: 8px; }

/* --- En-tête ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--glass-strong);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--stroke);
}
.site-header-inner {
  max-width: 1140px; margin: 0 auto; height: var(--header-h);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { display: block; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 35%, transparent)); }
.brand b { font-weight: 700; }
.brand-sub { color: var(--text-faint); font-weight: 500; }
.site-nav { display: flex; gap: 2px; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 6px 10px; border-radius: var(--r-md); color: var(--text-dim);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.site-nav a:hover, .site-nav a[aria-current] { background: var(--surface-2); color: var(--text); text-decoration: none; }
.site-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px 12px; border: 0; border-radius: var(--r-md);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--stroke);
  color: var(--text-dim); font: inherit; font-size: 13px; font-weight: 500;
  white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.btn-accent { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); color: var(--accent); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--accent); }
.btn-icon { width: 30px; height: 30px; padding: 0; }

/* --- Corps -------------------------------------------------------------- */
main { max-width: 1140px; margin: 0 auto; padding: 20px 16px 56px; }
.breadcrumb { font-size: 12px; color: var(--text-faint); margin-bottom: 20px; }
.breadcrumb a:hover { color: var(--text); }

.hero { display: grid; gap: 12px; margin-bottom: 24px; }
.hero h1 { font-size: 2.1rem; letter-spacing: -0.02em; max-width: 22ch; }
.hero .lead, .lead { color: var(--text-dim); max-width: 72ch; font-size: 1.02rem; }
.hero-row { display: flex; align-items: center; gap: 14px; }
.hero-flag { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 1px var(--stroke-mid); flex-shrink: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-faint); font-size: 13px; }
.meta a { color: var(--text-dim); }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 4px; }
.tile {
  display: grid; gap: 4px; padding: 14px;
  background: var(--surface-1); border: 1px solid var(--stroke); border-radius: var(--r-lg);
}
.tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }
.tile-value { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }
.tile-hint { font-size: 12px; color: var(--text-dim); }

section { margin-top: 36px; }
section > h2 { font-size: 1.3rem; margin-bottom: 10px; }
section > .lead { margin-bottom: 14px; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
.prose { max-width: 72ch; display: grid; gap: 12px; }
.prose p { color: var(--text); }
.prose .note, .note { color: var(--text-dim); font-size: 14px; }
.card { background: var(--surface-1); border: 1px solid var(--stroke); border-radius: var(--r-lg); padding: 16px 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

/* --- Tableaux ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--stroke); border-radius: var(--r-lg); background: var(--surface-1); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data caption { text-align: left; padding: 10px 12px 0; color: var(--text-faint); font-size: 12px; }
table.data th, table.data td { padding: 8px 12px; text-align: left; vertical-align: middle; }
table.data thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
  color: var(--text-faint); border-bottom: 1px solid var(--stroke-mid); white-space: nowrap;
}
table.data tbody th { font-weight: 500; }
table.data tbody tr { border-top: 1px solid var(--stroke); }
table.data tbody tr:first-child { border-top: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .num, table.data th.num { text-align: right; white-space: nowrap; }
table.data .rank { color: var(--text-faint); font-family: var(--font-num); width: 1%; white-space: nowrap; }
table.data .year { color: var(--text-faint); font-size: 12px; }
.bar { display: inline-block; width: 100%; min-width: 60px; height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.good > i { background: var(--good); }
.bar.bad > i { background: var(--bad); }
td.barcell { width: 26%; min-width: 90px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; background: var(--surface-3); color: var(--text-dim); vertical-align: middle; }
.tag.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.tag.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.tag.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.delta-up { color: var(--good); } .delta-down { color: var(--bad); }

details { margin-top: 10px; }
details > summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: 8px 0; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '▸ '; }
details[open] > summary::before { content: '▾ '; }

/* --- Courbes ------------------------------------------------------------ */
.sparkline { margin: 0; }
.sparkline svg { display: block; width: 100%; height: auto; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--accent); }
.sparkline figcaption { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); font-family: var(--font-num); }
.trajectory { display: grid; gap: 8px; }
.trajectory-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.trajectory-head b { font-size: 14px; }
.trajectory-head .num { color: var(--text-dim); font-size: 13px; }

/* --- Listes de liens ---------------------------------------------------- */
.linklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; }
.linklist li { padding: 6px 0; border-bottom: 1px solid var(--stroke); font-size: 14px; }
.linklist .hint { color: var(--text-faint); font-size: 12px; }
.linklist a:hover { color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card-link { display: grid; gap: 6px; padding: 16px; background: var(--surface-1); border: 1px solid var(--stroke); border-radius: var(--r-lg); transition: border-color 120ms, transform 120ms; }
.card-link:hover { border-color: var(--accent-line); text-decoration: none; transform: translateY(-1px); }
.card-link b { font-size: 15px; }
.card-link .hint { color: var(--text-dim); font-size: 13px; }
.card-link .tagline { color: var(--text-faint); font-size: 12px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a, .chips span { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--stroke); font-size: 13px; color: var(--text-dim); }
.chips a:hover { color: var(--text); text-decoration: none; background: var(--surface-hover); }

/* --- Fiche événement ---------------------------------------------------- */
.timeline { display: grid; gap: 6px; }
.timeline li { display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--stroke); }
.timeline .when { color: var(--accent); font-family: var(--font-num); font-size: 13px; }
dl.pairs { display: grid; gap: 8px; margin: 0; }
dl.pairs div { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--stroke); }
dl.pairs dt { font-weight: 600; }
dl.pairs dd { margin: 0; color: var(--text-dim); font-size: 14px; }
blockquote.takeaway { margin: 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-lg) var(--r-lg) 0; font-size: 1.05rem; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prevnext a { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--stroke); border-radius: var(--r-lg); background: var(--surface-1); }
.prevnext a:hover { border-color: var(--accent-line); text-decoration: none; }
.prevnext .dir { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }
.prevnext .next { text-align: right; }

/* --- Étapes de lecture -------------------------------------------------- */
.steps { display: grid; gap: 14px; counter-reset: step; }
.step { padding: 18px 20px; background: var(--surface-1); border: 1px solid var(--stroke); border-radius: var(--r-lg); display: grid; gap: 8px; }
.step h2 { font-size: 1.1rem; }
.step h2::before { counter-increment: step; content: counter(step) '. '; color: var(--accent); }
.step p { color: var(--text); max-width: 72ch; }

/* --- Pied --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--stroke); margin-top: 24px; padding: 28px 16px 40px; color: var(--text-dim); font-size: 13px; }
.site-footer-inner { max-width: 1140px; margin: 0 auto; display: grid; gap: 12px; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer-links a:hover { color: var(--text); }

@media (max-width: 720px) {
  .site-header-inner { flex-wrap: wrap; height: auto; padding: 8px 12px; row-gap: 4px; }
  .site-nav { order: 3; flex-basis: 100%; }
  .site-actions { margin-left: auto; }
  .hero h1 { font-size: 1.55rem; }
  .tile-value { font-size: 1.2rem; }
  .site-actions .btn-accent { padding: 6px 9px; font-size: 12px; }
  .brand-sub { display: none; }
  .prevnext { grid-template-columns: 1fr; }
  .prevnext .next { text-align: left; }
  table.data th, table.data td { padding: 7px 8px; }
  td.barcell { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card-link { transition: none; }
}
