
/* Plan : atlas d'archives — encre bleu de fer sur papier gris froid, ocre pour les chiffres, rouge sombre pour les mises en garde.
   Layout : bandeau de navigation fixe, colonne de lecture ~68ch, outils (frise, tableau) en pleine largeur. */
:root{
  --paper:#f3f4f2;
  --panel:#ffffff;
  --ink:#1b2431;
  --muted:#5b6574;
  --rule:#d5d9dd;
  --accent:#1f4f7a;
  --ochre:#a86a12;
  --warn:#8e2b2b;
  --chip:#e7ebef;
  --display:"Source Serif 4", Georgia, "Times New Roman", serif;
  --body:"IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --paper:#12161c; --panel:#1a2029; --ink:#e4e7eb; --muted:#9aa4b2; --rule:#2c3440;
    --accent:#7fb0dd; --ochre:#e0a64a; --warn:#e48b8b; --chip:#232b36; color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --paper:#12161c; --panel:#1a2029; --ink:#e4e7eb; --muted:#9aa4b2; --rule:#2c3440;
  --accent:#7fb0dd; --ochre:#e0a64a; --warn:#e48b8b; --chip:#232b36; color-scheme:dark;
}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--paper);color:var(--ink);font-family:var(--body);font-size:16px;line-height:1.6}
a{color:var(--accent)}
a:focus-visible,button:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid var(--ochre);outline-offset:2px}
h1,h2,h3{font-family:var(--display);line-height:1.2;text-wrap:balance;margin:0}
h1{font-size:clamp(2rem,5vw,3.1rem);font-weight:700}
h2{font-size:1.7rem;font-weight:600}
h3{font-size:1.2rem;font-weight:600}
p{margin:0}
.wrap{max-width:1100px;margin:0 auto;padding:0 20px}
.read{max-width:68ch}
.stack{display:flex;flex-direction:column;gap:16px}
.stack-lg{display:flex;flex-direction:column;gap:40px}

/* Navigation */
header.top{position:sticky;top:0;z-index:5;background:var(--paper);border-bottom:1px solid var(--rule)}
header.top .wrap{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;flex-wrap:wrap}
.brand{font-family:var(--display);font-weight:700;font-size:1.15rem;color:var(--ink);text-decoration:none}
nav.main{display:flex;gap:4px;flex-wrap:wrap}
nav.main a{color:var(--muted);text-decoration:none;padding:6px 10px;border-radius:6px;font-size:.92rem;font-weight:500}
nav.main a[aria-current="page"]{color:var(--ink);background:var(--chip)}
.proto{background:var(--chip);color:var(--muted);font-size:.82rem;text-align:center;padding:6px 16px}
.proto strong{color:var(--warn)}

main{padding:40px 0 72px}


.eyebrow{font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;color:var(--ochre);font-weight:600}
.lead{font-size:1.15rem;color:var(--ink)}
.muted{color:var(--muted)}

/* Chiffres clés */
.figures{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}
.fig{background:var(--panel);border:1px solid var(--rule);border-radius:8px;padding:18px;display:flex;flex-direction:column;gap:6px}
.fig .n{font-family:var(--display);font-size:2rem;font-weight:700;color:var(--ochre);font-variant-numeric:tabular-nums;line-height:1.1}
.fig .l{font-weight:600}
.fig .s{font-size:.85rem;color:var(--muted)}

/* Frise */
.frise{background:var(--panel);border:1px solid var(--rule);border-radius:8px;padding:18px;overflow-x:auto}
.frise-inner{min-width:760px;display:flex;flex-direction:column;gap:5px}
.frow{display:grid;grid-template-columns:200px 1fr;align-items:center;gap:12px}
.frow .name{font-size:.84rem;text-align:right;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.track{position:relative;height:16px;background:repeating-linear-gradient(90deg,transparent 0 calc(10% - 1px),var(--rule) calc(10% - 1px) 10%)}
.bar{position:absolute;top:2px;height:12px;border-radius:3px;background:var(--accent);opacity:.85;border:0;padding:0;cursor:pointer}
.bar.race{background:var(--warn)}
.bar:hover{opacity:1}
.axis{display:grid;grid-template-columns:200px 1fr;gap:12px;margin-top:4px}
.axis .ticks{position:relative;height:18px;font-size:.72rem;color:var(--muted);font-variant-numeric:tabular-nums}
.axis .ticks span{position:absolute;transform:translateX(-50%);white-space:nowrap}
.legend{display:flex;gap:18px;flex-wrap:wrap;font-size:.82rem;color:var(--muted);margin-top:10px}
.legend i{display:inline-block;width:14px;height:10px;border-radius:2px;margin-right:6px;vertical-align:middle}

/* Cartes civilisations */
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px}
.card{background:var(--panel);border:1px solid var(--rule);border-radius:8px;padding:14px 16px;display:flex;flex-direction:column;gap:4px;text-decoration:none;color:var(--ink)}
.card .per{font-size:.8rem;color:var(--muted);font-variant-numeric:tabular-nums}
.card.live{border-left:4px solid var(--ochre)}
.card .soon{font-size:.75rem;color:var(--muted)}
.card.live .soon{color:var(--ochre);font-weight:600}

.principles{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}
.principles div{border-top:2px solid var(--accent);padding-top:10px;display:flex;flex-direction:column;gap:6px}

/* Comparer */
.filters{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;background:var(--panel);border:1px solid var(--rule);border-radius:8px;padding:14px}
.filters label{display:flex;flex-direction:column;gap:4px;font-size:.8rem;color:var(--muted);font-weight:500}
.filters select,.filters input[type=search]{font:inherit;font-size:.92rem;padding:7px 9px;border:1px solid var(--rule);border-radius:6px;background:var(--paper);color:var(--ink);min-width:170px}
.filters .chk{flex-direction:row;align-items:center;gap:6px;color:var(--ink);font-size:.9rem;padding-bottom:7px}
.count{font-size:.88rem;color:var(--muted)}
.tablewrap{overflow-x:auto;background:var(--panel);border:1px solid var(--rule);border-radius:8px}
table{border-collapse:collapse;width:100%;min-width:980px;font-size:.88rem}
th,td{text-align:left;vertical-align:top;padding:10px 12px;border-bottom:1px solid var(--rule)}
th{font-weight:600;font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);background:var(--chip);position:sticky;top:0}
th button{all:unset;cursor:pointer}
th button:focus-visible{outline:2px solid var(--ochre)}
td.num{font-variant-numeric:tabular-nums;white-space:nowrap}
td .civ{font-weight:600}
.pill{display:inline-block;font-size:.72rem;font-weight:600;padding:1px 7px;border-radius:999px;background:var(--chip);color:var(--muted);margin:2px 4px 0 0;white-space:nowrap}
.pill.oui{color:var(--warn)}
.pill.flag{border:1px solid var(--rule);background:transparent}
.yes{color:var(--warn);font-weight:600}

/* Page modèle */
.fiche{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1px;background:var(--rule);border:1px solid var(--rule);border-radius:8px;overflow:hidden}
.fiche div{background:var(--panel);padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.fiche dt{font-size:.75rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:600}
.fiche dd{margin:0;font-weight:500}
.callout{border-left:4px solid var(--warn);background:var(--panel);padding:14px 16px;border-radius:0 8px 8px 0;display:flex;flex-direction:column;gap:8px}
.callout.blue{border-left-color:var(--accent)}
.debate{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}
.debate>div{background:var(--panel);border:1px solid var(--rule);border-radius:8px;padding:16px;display:flex;flex-direction:column;gap:8px}
.scale{display:flex;flex-direction:column;gap:8px;background:var(--panel);border:1px solid var(--rule);border-radius:8px;padding:16px}
.srow{display:grid;grid-template-columns:minmax(120px,210px) 1fr auto;gap:10px;align-items:center;font-size:.86rem}
.sbar{height:14px;background:var(--chip);border-radius:3px;position:relative;overflow:hidden}
.sbar span{position:absolute;top:0;bottom:0;background:var(--accent);border-radius:3px}
.sbar span.range{background:var(--ochre);opacity:.55}
.srow .v{font-variant-numeric:tabular-nums;color:var(--muted);white-space:nowrap}
ul.src{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px;font-size:.9rem}
.back{font-size:.88rem;text-decoration:none;font-weight:500}
ol.timeline{list-style:none;margin:0;padding:0;border-left:2px solid var(--rule);display:flex;flex-direction:column;gap:14px;max-width:72ch}
ol.timeline li{display:grid;grid-template-columns:110px 1fr;gap:12px;position:relative;padding-left:16px}
ol.timeline li::before{content:"";position:absolute;left:-6px;top:8px;width:10px;height:10px;border-radius:50%;background:var(--ochre)}
ol.timeline .yr{font-family:var(--display);font-weight:700;font-variant-numeric:tabular-nums;color:var(--accent)}
@media (max-width:560px){ ol.timeline li{grid-template-columns:1fr;gap:2px} }
footer{border-top:1px solid var(--rule);padding:24px 0;font-size:.85rem;color:var(--muted)}
@media (max-width:560px){
  nav.main{flex-wrap:nowrap;overflow-x:auto;width:100%;padding-bottom:6px;-webkit-overflow-scrolling:touch}
  nav.main a{white-space:nowrap}
  .srow{grid-template-columns:1fr auto}
  .srow .sbar{grid-column:1 / -1;order:3}
}
@media (prefers-reduced-motion:no-preference){ .bar{transition:opacity .15s} }
