/* =====================================================================
   Qui sera président ? — feuille de style unique (design v1)
   Aucune police distante, aucun framework : un seul fichier, ~9 Ko.
   Les valeurs sont centralisées en variables pour faciliter le passage
   au design v2.
   ===================================================================== */

:root {
  --bg:        #f7f8fa;
  --surface:   #ffffff;
  --ink:       #10151f;
  --ink-soft:  #5a6473;
  --line:      #e4e7ec;
  --line-soft: #eef0f4;
  --accent:    #1d4ed8;
  --up:        #0f8a4d;
  --down:      #c02626;

  --radius:    14px;
  --shadow:    0 1px 2px rgba(16, 21, 31, .05), 0 8px 24px -12px rgba(16, 21, 31, .14);
  --wrap:      1120px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --num:  ui-monospace, "SF Mono", "Segoe UI Mono", "Roboto Mono", Menlo, monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0d1117;
    --surface:   #151b24;
    --ink:       #e9edf3;
    --ink-soft:  #9aa5b4;
    --line:      #252d38;
    --line-soft: #1d242e;
    --accent:    #7aa2ff;
    --up:        #3dd68c;
    --down:      #ff6b6b;
    --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.1rem + 2.6vw, 2.9rem); }
h2 { font-size: clamp(1.3rem, 1.05rem + 1vw, 1.75rem); }
h3 { font-size: 1.05rem; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.muted { color: var(--ink-soft); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--surface); padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 10;
}
.skip:focus { left: 0; top: 0; }

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

/* ---------------------------------------------------------------- header */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}
.site-header .wrap { display: flex; align-items: center; min-height: 62px; }

.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; }
.brand-mark {
  width: 12px; height: 26px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #16a34a);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1rem; letter-spacing: -.02em; }
.brand-text small { color: var(--ink-soft); font-size: .76rem; }

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

.hero { padding: clamp(2.2rem, 5vw, 4rem) 0 1.5rem; }
.hero h1 { max-width: 20ch; }

.eyebrow {
  margin: 0 0 .9rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent);
}
.lede { max-width: 62ch; font-size: 1.06rem; color: var(--ink-soft); }

.stats {
  display: grid; gap: 1px; margin: 2.2rem 0 0; padding: 0;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat { background: var(--surface); padding: 1rem 1.15rem; }
.stat dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); }
.stat dd {
  margin: .25rem 0 0; font-family: var(--num);
  font-size: clamp(1.15rem, .9rem + .8vw, 1.55rem); font-weight: 600; letter-spacing: -.02em;
}
.stat-sub { margin: .1rem 0 0; font-size: .8rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- panels */

.panel { padding: 1.6rem 0; }
.panel-head { margin-bottom: 1.1rem; }
.panel-head p { margin: 0; font-size: .9rem; }

.page-head { padding: clamp(2rem, 5vw, 3.4rem) 0 .5rem; }

.panel > .wrap > .table-scroll,
.panel > .wrap > .chart-figure,
.panel-method > .wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ----------------------------------------------------------------- chart */

.chart-figure { margin: 0; padding: 1rem .5rem .25rem; }
.chart-box { position: relative; }

.chart { display: block; width: 100%; height: clamp(260px, 38vw, 420px); overflow: visible; }
.chart-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round;
              vector-effect: non-scaling-stroke; transition: opacity .15s; }
.chart-dot  { vector-effect: non-scaling-stroke; }
.chart-grid line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis-y { fill: var(--ink-soft); font-size: 13px; text-anchor: end; font-family: var(--num); }
.chart-axis-x text { fill: var(--ink-soft); font-size: 13px; text-anchor: middle; }
.chart-cursor { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 3;
                vector-effect: non-scaling-stroke; }

/* Mise en retrait des séries désactivées via la légende */
.chart-line.is-off, .chart-dot.is-off { opacity: .12; }

.chart-empty {
  margin: 0; padding: 2.5rem 1rem; text-align: center; color: var(--ink-soft);
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
}

.chart-tip {
  position: absolute; pointer-events: none; z-index: 2;
  min-width: 172px; padding: .6rem .7rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  font-size: .82rem; line-height: 1.45;
}
.chart-tip b { display: block; margin-bottom: .35rem; font-size: .78rem; color: var(--ink-soft);
               font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.chart-tip .row { display: flex; align-items: center; gap: .45rem; white-space: nowrap; }
.chart-tip .row span:last-child { margin-left: auto; font-family: var(--num); font-weight: 600; }
.chart-tip .dot { width: 8px; height: 8px; }

.legend { display: flex; flex-wrap: wrap; gap: .4rem .5rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.legend-item {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .3rem .7rem .3rem .55rem;
  font: inherit; font-size: .85rem; color: inherit;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; cursor: pointer;
}
.legend-item[aria-pressed="false"] { opacity: .45; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }

/* ----------------------------------------------------------------- table */

.table-scroll { overflow-x: auto; }

.ranking { width: 100%; border-collapse: collapse; font-size: .94rem; }
.ranking th, .ranking td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
.ranking thead th {
  position: sticky; top: 62px;
  background: var(--surface);
  font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft);
  font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ranking tbody tr:last-child th, .ranking tbody tr:last-child td { border-bottom: 0; }
.ranking tbody tr:hover { background: var(--line-soft); }

.c-rank { width: 3rem; font-family: var(--num); color: var(--ink-soft); text-align: center; }
.c-num  { text-align: right; font-family: var(--num); white-space: nowrap; }
.c-num.strong { font-weight: 600; }
.c-spark { width: 110px; }

.c-name { font-weight: 400; }
.c-name { display: flex; align-items: center; gap: .65rem; }
.chip { width: 4px; align-self: stretch; min-height: 30px; border-radius: 2px; background: var(--c); flex: none; }
.name { display: flex; flex-direction: column; line-height: 1.25; }
.name a { color: inherit; text-decoration: none; font-weight: 600; }
.name a:hover { color: var(--accent); text-decoration: underline; }
.name small { color: var(--ink-soft); font-size: .78rem; font-weight: 400; }

.up   { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--ink-soft); }

.spark { display: block; width: 96px; height: 28px; }
.spark polyline { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; opacity: .85; }

/* ----------------------------------------------------------------- prose */

.panel-method > .wrap { padding: 1.5rem 1.6rem; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.5rem; color: var(--ink-soft); text-transform: uppercase;
            font-size: .78rem; letter-spacing: .08em; }
.prose p, .prose li { color: var(--ink-soft); }
.prose strong { color: var(--ink); }
.prose ul { padding-left: 1.1rem; }
.prose li { margin-bottom: .35rem; }

.cols { max-width: none; columns: 2; column-gap: 2.5rem; }
.cols p { break-inside: avoid; margin-top: 0; }

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

.site-footer { margin-top: 2.5rem; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid {
  display: grid; gap: 1.5rem; padding: 2rem 0;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  font-size: .88rem;
}
.footer-brand { margin: 0 0 .2rem; }
.footer-grid p { margin: 0; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.footer-links a { color: inherit; text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-legal { line-height: 1.7; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 720px) {
  .cols { columns: 1; }
  .ranking { font-size: .88rem; }
  .ranking th, .ranking td { padding: .6rem .5rem; }
  .ranking thead th { position: static; }
  .c-spark, th.c-spark { display: none; }
  .site-header { position: static; }
}

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

/* ================================================================== */
/*  Photos de profil                                                  */
/*  Servies localement (assets/img/profiles/) : les URL du CDN        */
/*  Instagram expirent sous ~5 jours et transmettraient l'IP du       */
/*  visiteur à Meta.                                                  */
/* ================================================================== */

/* Extrémité de courbe. Posée en HTML et non dans le SVG : celui-ci est
   étiré pour remplir son cadre, ce qui ovaliserait toute image placée
   à l'intérieur. */
.chart-avatar {
  position: absolute;
  width: 34px; height: 34px;
  margin: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--c, var(--accent));
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--surface), var(--shadow);
  object-fit: cover;
  pointer-events: none;
  transition: opacity .15s;
}
.chart-avatar.is-off { opacity: .12; }

.avatar {
  width: 36px; height: 36px; flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line-soft);
}

.legend-avatar {
  width: 20px; height: 20px; flex: none;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--c, var(--accent));
  background: var(--line-soft);
}

.verified {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: .2rem;
  font-size: 10px; font-weight: 700; line-height: 1;
  color: var(--surface); background: var(--accent);
  border-radius: 50%; vertical-align: 1px;
}

.name small { display: block; }

@media (max-width: 720px) {
  .avatar { width: 30px; height: 30px; }
  .chart-avatar { width: 26px; height: 26px; }
}

/* Un compte repassé en privé cesse d'exposer son nombre d'abonnés :
   le signaler vaut mieux que d'afficher une valeur figée sans explication. */
.flag-private { color: var(--down); font-weight: 600; }

/* Statut de candidature. Affiché uniquement quand la candidature n'est
   pas fermement déclarée : signaler le cas ordinaire sur chaque ligne
   n'apporterait rien et brouillerait la lecture du tableau. */
.tag {
  display: inline-block; margin-left: .35rem;
  padding: .05rem .4rem;
  font-size: .68rem; font-weight: 600; letter-spacing: .02em;
  border-radius: 4px; white-space: nowrap;
  border: 1px solid currentColor;
}
.tag-primaire { color: #a16207; }
.tag-possible { color: var(--ink-soft); }

@media (prefers-color-scheme: dark) {
  .tag-primaire { color: #fbbf24; }
}
