/* ============================================================
   SimulateurFiscal.fr — Design system
   CSS custom properties uniquement · dark mode natif · WCAG AA
   ============================================================ */

:root {
  /* ── Thème ÉCLIPSE — sombre froid (bleu-nuit) + accent menthe ──
     Aucune teinte chaude : l'or est remplacé par une menthe émeraude. */
  --bg:            #0d1117;     /* bleu-nuit froid */
  --bg-2:          #11161f;     /* second plan (sections alternées) */
  --bg-elevated:   #161b22;     /* cartes & surfaces */
  --bg-elevated-2: #1b212b;     /* haut de carte (dégradé de surface) */
  --bg-subtle:     #1c2330;     /* surfaces contrastées / en-têtes de table */
  --text:          #e6edf3;     /* blanc froid */
  --text-muted:    #8b95a3;     /* gris-bleu froid (hiérarchie de lecture) */
  --steel:         #c9d1d9;     /* onglets de navigation */
  --border:        #2a313c;     /* bordure slate */
  --hairline:      rgba(255,255,255,.06); /* filet lumineux haut de carte */

  /* Menthe canonique : #34d399 = rgb(52,211,153) — marque / CTA. */
  --primary:       #34d399;
  --primary-hover: #5eead4;
  --primary-grad:  linear-gradient(135deg, #6ee7b7 0%, #34d399 52%, #10b981 100%);
  --primary-soft:  rgba(52,211,153,.10);
  --primary-line:  rgba(52,211,153,.32);
  --primary-text:  #052e22;     /* texte sombre sur bouton menthe */
  --accent:        #34d399;
  --accent-soft:   rgba(52,211,153,.10);

  /* États sémantiques distincts de la marque menthe :
     ambre = vigilance, rouge = vrai piège. */
  --warn:          #fbbf24;     /* ambre = vigilance / conseil */
  --warn-soft:     rgba(251,191,36,.08);
  --warn-line:     rgba(251,191,36,.34);
  --danger:        #f87171;     /* rouge = vrai piège / coût */
  --danger-soft:   rgba(248,113,113,.09);
  --danger-line:   rgba(248,113,113,.40);

  /* Couleurs fonctionnelles des icônes */
  --success:       #34d399;     /* vert menthe (= marque) */
  --danger-red:    #f87171;     /* rouge erreur */
  --info:          #58a6ff;     /* bleu info froid */

  /* Ombres multi-couches douces (profondeur premium) */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 1px 1px rgba(0,0,0,.4), 0 10px 24px -12px rgba(0,0,0,.7), 0 30px 60px -30px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 18px 40px -16px rgba(0,0,0,.75), 0 48px 90px -40px rgba(0,0,0,.7);
  --glow:      0 8px 26px -12px rgba(0,0,0,.6);          /* lift neutre, sans teinte verte */
  --ring:      0 0 0 3px rgba(230,237,243,.30);          /* focus clavier neutre (clair) */

  /* Typo & espacements */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", "Iowan Old Style", "Palatino Linotype", serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --space: 1rem;
  --ease: cubic-bezier(.22, 1, .36, 1); /* easing « soigné » pour les micro-interactions */
}

/* Thème noir unique : le fond reste noir quel que soit le réglage système.
   (Pour réactiver un mode clair, restaurer un bloc @media prefers-color-scheme.) */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  /* halo or très diffus en haut + voile navy : profondeur sans texture lourde */
  /* Fond sobre, sans teinte verte : léger dégradé slate froid pour la profondeur. */
  background-image:
    radial-gradient(1100px 600px at 80% -5%, rgba(27,33,43,.55), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Typographie ---------- */
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.22; font-weight: 700; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: clamp(1.8rem, 3.8vw, 2.5rem); letter-spacing: -.012em; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); letter-spacing: -.008em; margin-top: 2.2rem; }
h3 { font-size: 1.16rem; margin-top: 1.4rem; }
h4 { font-size: 1.02rem; }
p { margin: 0 0 1rem; }
a { color: var(--primary); text-decoration: underline; text-underline-offset: .16em; text-decoration-thickness: 1px; transition: color .15s var(--ease); }
a:hover { color: var(--primary-hover); }

/* Mesure de lecture confortable (~65–75 caractères) sur la prose d'article.
   Ne s'applique qu'aux paragraphes/listes de premier niveau — pas aux tableaux,
   cartes, callouts ou grilles, qui gardent toute la largeur. */
main.section > p,
main.section > ul:not(.source) { max-width: 72ch; }

/* ---------- Icônes (sprite SVG inline, injecté par main.js) ---------- */
.icon {
  width: 1.05em; height: 1.05em; flex: none;
  display: inline-block; vertical-align: -.15em;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-success { color: var(--success); }
.icon-danger  { color: var(--danger-red); }
.icon-warn    { color: var(--warn); }
.icon-info    { color: var(--info); }
/* icône de catégorie (cartes marchés) */
.icon-cat  { width: 1.85rem; height: 1.85rem; color: var(--primary); stroke-width: 1.75; }
/* icône en tête de titre h3 */
.icon-head { width: 1.15em; height: 1.15em; color: var(--primary); margin-right: .15rem; vertical-align: -.18em; }
/* statut inline (✅ Oui / ❌ Aucune) : léger filet d'air après l'icône */
.icon-stat { margin-right: .2rem; vertical-align: -.18em; }
/* éléments <a> stylés en non-lien : pas de soulignement */
.brand, .nav-links a, .market-card, .btn, .skip-link, .footer-col a { text-decoration: none; }
small { color: var(--text-muted); }
strong { font-weight: 700; }

/* ---------- Accessibilité : focus visible soigné ---------- */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--primary-grad);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.35);
  display: grid; place-items: center; color: var(--primary-text); font-size: .95rem; font-weight: 800;
}
.nav-links { display: flex; gap: 1.3rem; align-items: center; }
.nav-links a { color: var(--steel); font-size: .95rem; font-weight: 500; }
.nav-links a:hover { color: var(--primary); text-decoration: none; }
/* le CTA de la nav garde le texte foncé du bouton (sinon il hérite du gris des liens, illisible sur le vert) */
.nav-links a.btn-primary { color: var(--primary-text); font-weight: 650; white-space: nowrap; }
.nav-links a.btn-primary:hover { color: var(--primary-text); }
/* marqueur "vous êtes ici" : la rubrique courante passe en menthe + petit halo */
.nav-links a.is-active { color: var(--primary); position: relative; }
.nav-links a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 2px;
  background: var(--primary); border-radius: 2px;
  box-shadow: 0 0 8px 1px var(--primary);
}
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg-elevated);
    border-bottom: 1px solid var(--border); padding: .5rem 1.25rem 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .6rem 0; width: 100%; border-bottom: 1px solid var(--border); }
  /* en colonne, le marqueur passe en barre verticale à gauche */
  .nav-links a.is-active::after {
    bottom: auto; top: 50%; transform: translateY(-50%);
    left: -12px; right: auto; width: 3px; height: 55%;
  }
}

/* ---------- Boutons ---------- */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.3rem; border-radius: 999px;
  font-weight: 650; font-size: .98rem; letter-spacing: -.01em; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary-grad); color: var(--primary-text); box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.4); }
.btn-primary:hover { box-shadow: 0 14px 34px -10px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.5); }
/* sheen : reflet qui traverse le bouton au survol */
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .6s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost { background: color-mix(in srgb, var(--bg-elevated) 50%, transparent); color: var(--text); border-color: var(--border); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: var(--bg-elevated); border-color: var(--primary-line); }
.btn-accent { background: var(--primary-grad); color: var(--primary-text); box-shadow: var(--glow); }
.btn-lg { padding: .95rem 1.8rem; font-size: 1.05rem; }

/* ---------- Cartes & layout ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-elevated-2), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1.6rem; box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
/* filet lumineux en haut de carte (détail « tactile » premium) */
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, var(--hairline) 20%, var(--hairline) 80%, transparent);
  z-index: 1;
}
/* Halo lumineux « spotlight » : suit le curseur sur la rubrique survolée
   (--mx/--my posés par main.js) ; fallback haut-centre au focus clavier. */
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  opacity: 0; transition: opacity .35s var(--ease);
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.06), transparent 62%);
}
.card:hover::after, .card:focus-within::after { opacity: 1; }
.card:hover, .card:focus-within {
  border-color: rgba(230,237,243,.20);
  box-shadow: var(--shadow), 0 0 36px -12px rgba(0,0,0,.6);
}
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 820px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.section { padding: 3.6rem 0; }
/* rythme vertical : fond alterné pour séparer les sections (respiration premium) */
.section-alt { background: var(--bg-2); }
.center { text-align: center; }
.muted { color: var(--text-muted); }

/* ---------- Hero ---------- */
.hero { padding: 5rem 0 3.5rem; text-align: center; }
.hero h1 { max-width: 16ch; margin-left: auto; margin-right: auto; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary);
  background: var(--primary-soft); border: 1px solid var(--primary-line);
  padding: .4rem .9rem; border-radius: 999px; margin-bottom: 1.5rem;
}
.hero .eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); box-shadow: var(--glow);
}
.hero p.lead { font-size: 1.12rem; line-height: 1.6; color: var(--text-muted); max-width: 620px; margin: 0 auto 2rem; }
p.lead { font-size: 1.05rem; }
.cmp-scn + .cmp-scn { border-top: 1px dashed var(--border); margin-top: .6rem; padding-top: .5rem; }
.cmp-scn-t { font-weight: 700; font-size: .82rem; color: var(--primary); margin: .1rem 0 .3rem; text-transform: uppercase; letter-spacing: .03em; }
.cmp-card .badge { float: right; }
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Pills marchés ---------- */
.market-card { display: block; color: var(--text); height: 100%; }
.market-card:hover { text-decoration: none; border-color: var(--primary-line); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.market-card .emoji { font-size: 1.9rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 600; letter-spacing: .01em; padding: .25rem .6rem; border-radius: 999px; background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border); }
.badge.live { background: var(--accent-soft); color: var(--accent); border-color: var(--primary-line); }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: var(--glow); }
.badge.soon { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }

/* ---------- Encart cross-promo (Spin Analyzer) ---------- */
.promo-spin {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--primary-line);
  background:
    radial-gradient(130% 130% at 100% 0%, var(--primary-soft), transparent 55%),
    var(--bg-elevated-2);
  box-shadow: 0 0 0 1px var(--primary-line), 0 18px 44px -18px rgba(52,211,153,.45);
}
.promo-spin::before {            /* bandeau d'accent en haut */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: var(--primary-grad);
}
.promo-spin h3 { font-size: 1.18rem; }
.promo-spin .icon-head { width: 1.35em; height: 1.35em; }
.promo-spin .promo-tag {
  position: absolute; top: 1rem; right: 1rem;
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--primary-text); background: var(--primary-grad);
  border-radius: 999px; padding: .26rem .6rem; box-shadow: var(--glow);
}
.promo-spin .promo-tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary-text);
}

/* ---------- Simulateur ---------- */
.sim-layout { display: grid; grid-template-columns: 1fr 360px; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .sim-layout { grid-template-columns: 1fr; } }
.field { margin-bottom: 1.4rem; }
.field label { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: .5rem; }
.field .val { color: var(--primary); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--primary); height: 6px; }
input[type=number], select {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-2); color: var(--text); font-size: 1rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input[type=number]:focus, select:focus {
  outline: none; border-color: var(--primary-line); box-shadow: var(--ring);
}
.toggle-row { display: flex; align-items: center; gap: .7rem; margin: .6rem 0; }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: .2s; cursor: pointer;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: var(--bg-elevated); border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Panneau résultats */
.results { position: sticky; top: 78px; }
.metric { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.metric:last-child { border-bottom: 0; }
.metric .k { color: var(--text-muted); font-size: .85rem; }
.metric .v { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric.total .v { color: var(--accent); font-size: 1.3rem; }
.metric.cost .v { color: var(--danger); }
.metric.ventil { padding: .25rem 0; border-bottom: 0; }
.metric.ventil .k { font-size: .8rem; }
.metric.ventil .v { color: var(--accent); font-size: .9rem; }

/* ---------- Arbre de décision ---------- */
.tree-step { display: none; }
.tree-step.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tree-progress { height: 6px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; margin-bottom: 1.5rem; }
.tree-progress span { display: block; height: 100%; background: var(--primary); transition: width .3s ease; }
.tree-choices { display: flex; gap: .8rem; flex-wrap: wrap; }
.tree-choices .btn { flex: 1; justify-content: center; min-width: 120px; }
.tree-result { padding: 1.5rem; border-radius: var(--radius); border: 2px solid var(--border); }
.tree-result.imposable { border-color: var(--warn); background: var(--warn-soft); }
.tree-result.libre { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- FAQ accordéon ---------- */
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .2rem 1.1rem; margin-bottom: .7rem;
  background: linear-gradient(180deg, var(--bg-elevated-2), var(--bg-elevated));
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.faq details:hover { border-color: rgba(230,237,243,.20); }
.faq details[open] { border-color: rgba(230,237,243,.20); box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; font-weight: 600; padding: .9rem 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--primary); font-weight: 700; }
.faq details[open] summary::after { content: "−"; }
.faq details > p { margin-top: 0; padding-bottom: .9rem; color: var(--text-muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text); background: var(--bg-subtle); }

/* ---------- Glossaire tooltip ---------- */
.gloss {
  border-bottom: 1px dotted var(--primary); cursor: help; position: relative;
}
.gloss .tip {
  visibility: hidden; opacity: 0; position: absolute; bottom: 140%; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 280px; background: var(--text); color: var(--bg);
  padding: .6rem .75rem; border-radius: var(--radius-sm); font-size: .85rem; line-height: 1.45;
  font-weight: 400; z-index: 60; box-shadow: var(--shadow); transition: .15s; pointer-events: none;
}
.gloss:hover .tip, .gloss:focus .tip { visibility: visible; opacity: 1; }

/* ---------- Indicateur de source (petit point survolable) ---------- */
.src {
  position: relative; display: inline-block; width: .9rem; height: .9rem;
  margin-left: .15rem; vertical-align: super; cursor: help;
}
.src::before {
  content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: .5rem; height: .5rem; border-radius: 50%; background: var(--primary); transition: box-shadow .15s;
}
.src:hover::before, .src:focus::before { box-shadow: 0 0 0 3px rgba(230,237,243,.14); }
.src .tip {
  visibility: hidden; opacity: 0; position: fixed; top: 0; left: 0;
  width: max-content; max-width: 300px; background: var(--text); color: var(--bg);
  padding: .6rem .75rem; border-radius: var(--radius-sm); font-size: .82rem; line-height: 1.45;
  font-weight: 400; text-align: left; z-index: 60; box-shadow: var(--shadow); transition: opacity .15s; pointer-events: none;
}
.src:hover .tip, .src:focus .tip { visibility: visible; opacity: 1; }

/* ---------- Étapes / timeline ---------- */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 3.2rem; margin-bottom: 1.8rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 2.2rem; height: 2.2rem;
  background: var(--primary-grad); color: var(--primary-text); border-radius: 50%;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.4);
  display: grid; place-items: center; font-weight: 800;
}

/* ---------- Disclaimer / footer ---------- */
.callout {
  position: relative; border: 1px solid var(--primary-line);
  background: var(--primary-soft);
  padding: 1.1rem 1.3rem 1.1rem 1.5rem; border-radius: var(--radius-sm); margin: 1.5rem 0;
}
.callout::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--primary-grad);
}
.callout.warn { border-color: var(--warn-line); background: var(--warn-soft); }
.callout.warn::before { background: var(--warn); }
/* vrai piège (ex. micro-BNC) : se lit en rouge, distinct de la simple vigilance or */
.callout.danger { border-color: var(--danger-line); background: var(--danger-soft); }
.callout.danger::before { background: var(--danger); }
.disclaimer-block, .affiliation-disclaimer {
  font-size: .85rem; color: var(--text-muted); background: var(--bg-subtle);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; margin-top: 2rem;
}
.affiliation-disclaimer { font-style: italic; }
.site-footer { border-top: 1px solid var(--hairline); margin-top: 4rem; padding: 3.2rem 0 2.5rem; background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between; }
.footer-col h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.footer-col a { display: block; color: var(--text); padding: .25rem 0; font-size: .92rem; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-muted); }

/* ---------- Utilitaires ---------- */
.tldr { background: var(--accent-soft); border: 1px solid var(--primary-line); border-radius: var(--radius); padding: 1.3rem 1.5rem; margin: 1.5rem 0; }
.tldr h3 { margin-top: 0; }

/* Respecter la préférence système : couper les animations non essentielles */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .btn:hover, .market-card:hover, .card:hover { transform: none; }
}
.source { font-size: .82rem; color: var(--text-muted); }
/* citation entre crochets liée au document officiel (règle 5) :
   discrète dans le texte muet, vire au menthe au survol/focus */
.source a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.source a:hover, .source a:focus-visible { color: var(--primary); }

/* ---------- Blog hub : carte à la une + roadmap atténuée ---------- */
/* ---------- Sommaire ancré (TOC) + sections repliables ---------- */
main h2 { scroll-margin-top: 1.5rem; }
.para-gap { display: block; height: .7rem; }
.toc-rail { display: none; }
.collapsible-head { cursor: pointer; display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; border-top: 1px solid var(--border); padding-top: 1.1rem; }
.collapsible-head .coll-chev { width: 22px; height: 22px; color: var(--text-muted); flex: none; margin-top: .2rem; transition: transform .2s var(--ease); }
.collapsible-head.open .coll-chev { transform: rotate(180deg); }
.collapsible-head:hover { color: var(--primary); }
.collapsible-head:hover .coll-chev { color: var(--primary); }
@media (min-width: 1100px) {
  main.has-toc { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 2.8rem; align-items: start; }
  .toc-rail { display: block; }
  .toc { position: sticky; top: 1.6rem; }
  .toc-title { font-family: var(--font); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; margin: 0 0 .7rem; }
  .toc a { display: block; font-size: .85rem; color: var(--text-muted); text-decoration: none; padding: .34rem 0 .34rem .75rem; border-left: 2px solid var(--border); line-height: 1.3; transition: color .15s var(--ease), border-color .15s var(--ease); }
  .toc a:hover { color: var(--text); }
  .toc a.active { color: var(--primary); border-left-color: var(--primary); }
}

/* ---------- Sidebar (desktop ≥761px) : navigation app-like en vrais liens ---------- */
.sidebar { display: none; }
@media (min-width: 761px) {
  .sidebar {
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; width: 240px; height: 100vh;
    background: var(--bg-2); border-right: 1px solid var(--border);
    padding: 1.5rem 1.1rem; z-index: 60; overflow-y: auto;
  }
  .site-header { display: none; }
  body { padding-left: 240px; }
  .s-brand { margin: 0 .3rem 1.7rem; font-size: 1.1rem; }
  .s-nav { display: flex; flex-direction: column; gap: .25rem; }
  .s-link { display: flex; align-items: center; gap: 11px; padding: .62rem .7rem; border-radius: var(--radius-sm); color: var(--steel); font-size: .95rem; font-weight: 500; text-decoration: none; }
  .s-link .icon { width: 19px; height: 19px; color: var(--text-muted); flex: none; }
  .s-link:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
  .s-link:hover .icon { color: var(--primary); }
  .s-link.is-active { background: var(--primary-soft); color: var(--primary); }
  .s-link.is-active .icon { color: var(--primary); }
  .s-link.is-active::after { content: none; }
  .s-cta { width: 100%; justify-content: center; margin-top: .9rem; color: var(--primary-text); font-weight: 650; }
  .s-cta .icon { width: 18px; height: 18px; color: var(--primary-text); }
  .s-foot { margin-top: auto; padding-top: 1.3rem; font-size: .78rem; color: var(--text-muted); line-height: 1.85; }
  .s-foot a { color: var(--text-muted); text-decoration: none; border-bottom: 1px solid var(--border); }
  .s-foot a:hover { color: var(--primary); text-decoration: none; }
  .s-copy { display: block; margin-top: .45rem; opacity: .8; }
}

.featured-post {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.8rem; align-items: center;
  border-color: var(--primary-line); color: var(--text); text-decoration: none;
  background: linear-gradient(180deg, var(--primary-soft), var(--bg-elevated));
}
.featured-post, .featured-post * { text-decoration: none; }
.featured-post:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.featured-post .fp-body { min-width: 0; }
.featured-post h2 { margin: .5rem 0 .6rem; font-size: clamp(1.45rem, 2.4vw, 2rem); line-height: 1.12; color: var(--text); }
.featured-post .fp-body p { color: var(--text-muted); margin: 0 0 1.1rem; }
.featured-post .fp-aside { display: flex; align-items: center; justify-content: center; }
.featured-post .fp-aside .icon { width: 92px; height: 92px; color: var(--primary); opacity: .85; }
@media (max-width: 820px) {
  .featured-post { grid-template-columns: 1fr; }
  .featured-post .fp-aside { display: none; }
}

/* méta d'article (tag · badge · durée · date) */
.post-meta { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; font-size: .8rem; color: var(--text-muted); }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); opacity: .55; }

/* tag de marché (distinct des badges live/soon) */
.tag { display: inline-flex; align-items: center; font-size: .7rem; font-weight: 600; letter-spacing: .01em; padding: .18rem .55rem; border-radius: 999px; background: var(--bg-subtle); color: var(--steel); border: 1px solid var(--border); }
.tag.poker  { color: var(--primary); border-color: var(--primary-line); background: var(--primary-soft); }
.tag.stream { color: var(--info); border-color: rgba(88,166,255,.32); background: rgba(88,166,255,.10); }

/* roadmap « au programme » : items compacts et volontairement atténués */
.soon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 820px) { .soon-grid { grid-template-columns: 1fr; } }
.soon-item { display: flex; gap: .75rem; align-items: flex-start; padding: .95rem 1.05rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg-2); opacity: .6; transition: opacity .25s var(--ease), border-color .25s var(--ease); }
.soon-item:hover, .soon-item:focus-within { opacity: .9; border-color: var(--primary-line); }
.soon-item .icon { width: 20px; height: 20px; color: var(--text-muted); flex: none; margin-top: .15rem; }
.soon-item h3 { font-size: .92rem; margin: .3rem 0 .15rem; }
.soon-item p { margin: 0; font-size: .8rem; color: var(--text-muted); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: .5rem; background: var(--primary); color: var(--primary-text); padding: .5rem 1rem; border-radius: 6px; z-index: 100; }
