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

:root {
  /* ── Thème VERDIGRIS — sombre onyx + accent vert d'eau (teal) ──
     Palette : Onyx #131515 · Graphite #2B2C28 · Verdigris #339989 ·
     Pearl Aqua #7DE2D1 · Snow #FFFAFB. */
  --bg:            #131515;     /* onyx (fond de page) */
  --bg-2:          #181a19;     /* second plan (sections alternées) */
  --bg-elevated:   #1e201e;     /* cartes & surfaces */
  --bg-elevated-2: #2B2C28;     /* Graphite = haut de carte (dégradé de surface) */
  --bg-subtle:     #232523;     /* surfaces contrastées / en-têtes de table */
  --text:          #fffafb;     /* snow */
  --text-muted:    #9aa39f;     /* gris-vert atténué (hiérarchie de lecture) */
  --steel:         #c9d1cd;     /* onglets de navigation */
  --border:        #303330;     /* bordure onyx */
  --hairline:      rgba(255,255,255,.06); /* filet lumineux haut de carte */

  /* Verdigris canonique : #339989 = rgb(51,153,137) — marque / CTA. */
  --primary:       #339989;
  --primary-hover: #7DE2D1;
  --primary-grad:  linear-gradient(135deg, #7DE2D1 0%, #339989 55%, #267c70 100%);
  --primary-soft:  rgba(51,153,137,.12);
  --primary-line:  rgba(51,153,137,.34);
  --primary-text:  #06231f;     /* texte sombre sur bouton teal */
  --accent:        #339989;
  --accent-soft:   rgba(51,153,137,.12);

  /* États sémantiques distincts de la marque teal :
     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:       #5bd6a0;     /* vert clair (= déductible, distinct du teal) */
  --danger-red:    #f87171;     /* rouge erreur */
  --info:          #58a6ff;     /* bleu info froid (distinct du teal) */

  /* 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,.55);          /* 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;
  --measure-lead: 620px;   /* mesure unique pour les chapôs centrés (hero + sections) */
  --space: 1rem;

  /* Échelle d'espacement 4/8 — rythme vertical, gaps et paddings structurels.
     (Les micro-paddings optiques boutons/badges restent réglés à la main.) */
  --space-2xs: .25rem;   /*  4px */
  --space-xs:  .5rem;    /*  8px */
  --space-sm:  .75rem;   /* 12px */
  --space-md:  1rem;     /* 16px */
  --space-lg:  1.5rem;   /* 24px */
  --space-xl:  2rem;     /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  --space-section: 3.5rem; /* respiration verticale d'une <section> */

  /* Échelle typographique — base corps 15px ; titres en rem (root 16px).
     h3/h4 creusés pour séparer franchement titre de carte / sous-titre / corps. */
  --fs-h3: 1.22rem;      /* ~19.5px */
  --fs-h4: 1.05rem;      /* ~16.8px */

  --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; }
/* garantit que l'attribut [hidden] l'emporte sur un display: flex/grid local */
[hidden] { display: none !important; }

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(51,153,137,.16), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* mobile : `fixed` repeint le dégradé à chaque frame de scroll (jank). On le fige
   en scroll normal sous 760px ; le halo reste « fixed » sur desktop, sans coût. */
@media (max-width: 760px) { body { background-attachment: scroll; } }

.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: var(--space-xl); text-align: center; }
h3 { font-size: var(--fs-h3); margin-top: var(--space-lg); }
h4 { font-size: var(--fs-h4); }
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); }

/* Pages de contenu : colonne de lecture CENTRÉE (~65–75 caractères) sous les
   titres centrés, au sein du cadre pleine largeur (--maxw). Ne s'applique qu'aux
   paragraphes/listes de 1er niveau ; tableaux, cartes, callouts et grilles gardent
   toute la largeur de la page. h1 + chapô centrés pour un en-tête d'article cohérent. */
main.section > h1 { text-align: center; }
main.section > p,
main.section > ul:not(.source),
main.section > ol { max-width: 72ch; margin-inline: auto; text-align: center; }
/* listes centrées : puce dans le flux du texte (sinon elle pendrait à gauche du bloc) */
main.section > ul:not(.source),
main.section > ol { list-style-position: inside; padding-left: 0; }

/* ---------- 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; }
/* Titre mené par une icône teal : vrai centrage vertical de l'icône sur la ligne
   du titre via flex (indépendant de la police), au lieu du décalage em approximatif.
   Le `vertical-align` ci-dessus reste en repli pour les navigateurs sans :has(). */
:where(h1, h2, h3, h4):has(> .icon-head:first-child) { display: inline-flex; align-items: center; gap: .4rem; }
:where(h1, h2, h3, h4):has(> .icon-head:first-child) > .icon-head { margin-right: 0; vertical-align: baseline; }
/* 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; width: 44px; height: 44px; margin-right: -.5rem; place-items: center; background: none; border: 0; color: var(--text); font-size: 1.5rem; line-height: 1; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: grid; }
  .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: var(--space-lg); 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(125,226,209,.24);
  box-shadow: var(--shadow), 0 0 36px -12px rgba(0,0,0,.6);
}
.grid { display: grid; gap: var(--space-lg); }
.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: var(--space-section) 0; }
/* Quand <main> est lui-même .wrap.section, .section écrase le padding horizontal
   du .wrap → on le rétablit pour aligner le contenu sur le brand de la barre du haut
   (même colonne centrale) et éviter le collage au bord sur mobile. */
main.section { padding-inline: 1.25rem; }
/* 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: var(--measure-lead); margin: 0 auto 2rem; }
p.lead { font-size: 1.05rem; }

/* Chapô centré sous un <h2 class="center"> : mesure de lecture et rythme vertical
   unifiés (remplace les max-width/margins inline ad-hoc, alignés sur le hero). */
.section-intro { text-align: center; max-width: var(--measure-lead); margin: 0 auto 2.5rem; color: var(--text-muted); }
.section-intro:last-child { margin-bottom: 0; }

/* Gros chiffre de preuve (cartes stats) : taille/poids constants + chiffres tabulaires. */
.stat-num { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--primary); font-variant-numeric: tabular-nums; }
.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); }

/* ---------- Barre de pills rubriques (hub horizontal, inspiration Dribbble) ---------- */
.pillbar { display: flex; flex-wrap: nowrap; justify-content: center; gap: .55rem; max-width: 100%; margin: 0 auto 2rem; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 2px; }
.pillbar::-webkit-scrollbar { display: none; }
.pillbar-top { margin-bottom: 2.6rem; }
.pill {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .58rem 1.1rem; border-radius: 999px;
  font-size: .95rem; font-weight: 600; color: var(--steel); white-space: nowrap; text-decoration: none;
  background: color-mix(in srgb, var(--bg-elevated) 55%, transparent);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.pill .icon { width: 1.1em; height: 1.1em; color: var(--primary); }
.pill:hover { color: var(--text); background: var(--primary-soft); border-color: var(--primary-line); transform: translateY(-2px); text-decoration: none; }
.pill.is-active { background: var(--primary-grad); color: var(--primary-text); border-color: transparent; box-shadow: var(--glow); }
.pill.is-active .icon { color: var(--primary-text); }
.pill.is-active:hover { color: var(--primary-text); }
@media (max-width: 520px) { .pill { font-size: .88rem; padding: .5rem .9rem; } }

/* ---------- 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.3rem; }
.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; cursor: pointer; }
/* Sur écran tactile, la piste de 6px est trop fine à saisir : on agrandit la zone
   tactile verticale sans changer le visuel (padding en content-box autour de la piste). */
@media (pointer: coarse) {
  input[type=range] { box-sizing: content-box; padding-block: .9rem; }
}
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; }

/* ---------- Comparateur v2 : choix du domaine + presets + cartes structures ---------- */
.domain-pick { margin: 1.8rem 0 .6rem; }
.domain-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-top: .7rem; }
@media (max-width: 620px) { .domain-grid { grid-template-columns: repeat(2, 1fr); } }
.domain-card {
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
  padding: 1.15rem .8rem; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg-elevated) 60%, transparent);
  border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.domain-card .icon { width: 1.7rem; height: 1.7rem; color: var(--primary); }
.domain-card:hover { border-color: var(--primary-line); background: var(--primary-soft); transform: translateY(-2px); }
.domain-card.is-active { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--glow); }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1.4rem 0 .2rem; }
.presets-label { font-size: .9rem; }
button.pill { cursor: pointer; font-family: inherit; -webkit-appearance: none; appearance: none; }
.cmp-struct.is-best { border-color: var(--primary-line); box-shadow: var(--glow); }
.cmp-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cmp-head h3 { margin: 0; font-size: 1.08rem; }
.icon-cat-sm { color: var(--primary); }
.cmp-regime { font-size: .82rem; margin: .25rem 0 .9rem; }
.cmp-verdict { font-weight: 600; }
.cmp-verdict.success { color: var(--success); }
.cmp-verdict.danger { color: var(--danger); }
.cmp-verdict.warn { color: var(--warn); }
.cmp-rank { margin: .7rem 0 .5rem; padding-left: 1.2rem; line-height: 1.7; }
.cmp-rank li { margin: .1rem 0; }

/* ---------- 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: min(280px, calc(100vw - 2rem)); 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; }
/* Mobile : la bulle centrée en absolu débordait du viewport (terme dans la moitié
   droite → scroll horizontal sur tout le site). On la fixe en barre basse, pleine
   largeur : un élément `fixed` ne contribue pas à la largeur de défilement. */
@media (max-width: 760px) {
  .gloss .tip {
    position: fixed; left: 1rem; right: 1rem; bottom: 1rem; top: auto;
    transform: none; width: auto; max-width: none;
  }
}

/* ---------- 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); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.footer-bottom::-webkit-scrollbar { display: none; }
@media (max-width: 760px) { .footer-bottom { white-space: normal; overflow-x: visible; } }

/* ---------- 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; }
/* Bouton seul concluant un encadré (« Ce qu'il faut retenir » / callout) :
   centré horizontalement dans la boîte, sur toutes les pages. Ne cible que les
   <p> dont l'unique contenu est un .btn → le texte et les CTA multi-liens ne bougent pas. */
.tldr p:has(> .btn:only-child),
.callout p:has(> .btn:only-child) { text-align: center; }

/* 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; }
.collapsible-head { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: .6rem; border-top: 1px solid var(--border); padding-top: 1.1rem; }
/* espaceur miroir du chevron (même largeur) → le titre se centre entre les deux */
.collapsible-head::before { content: ""; width: 22px; flex: none; }
.collapsible-head .coll-chev { width: 22px; height: 22px; color: var(--text-muted); flex: none; 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); }

/* Sommaire = bouton flottant (FAB) + panneau, en bas à droite. L'article reste pleine largeur. */
.toc-fab-wrap { position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 60; }
.toc-fab { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border); background: var(--primary); color: var(--bg); cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.35); transition: transform .15s var(--ease), filter .15s var(--ease); }
.toc-fab:hover { filter: brightness(1.08); transform: translateY(-1px); }
.toc-fab .icon { width: 24px; height: 24px; }
.toc-fab-wrap.open .toc-fab { transform: rotate(90deg); }
.toc-panel { position: absolute; right: 0; bottom: calc(100% + .7rem); width: min(82vw, 280px); max-height: 70vh; overflow-y: auto; padding: 1rem 1.1rem 1.1rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.toc-panel[hidden] { display: none; }
.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-panel a { display: block; font-size: .9rem; color: var(--text-muted); text-decoration: none; padding: .4rem 0 .4rem .75rem; border-left: 2px solid var(--border); line-height: 1.35; transition: color .15s var(--ease), border-color .15s var(--ease); }
.toc-panel a:hover { color: var(--text); }
.toc-panel a.active { color: var(--primary); border-left-color: var(--primary); }
@media (prefers-reduced-motion: reduce) {
  .toc-fab, .toc-fab-wrap.open .toc-fab { transition: none; transform: none; }
}

/* ---------- Barre de navigation (desktop ≥761px) : horizontale en haut, app-like, vrais liens ---------- */
.sidebar { display: none; }
@media (min-width: 761px) {
  .sidebar {
    display: flex; flex-direction: row; align-items: center; gap: 1.2rem;
    position: sticky; top: 0; left: 0; width: 100%; height: 66px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hairline); z-index: 60;
    /* fond pleine largeur, contenu calé sur la colonne centrale (.wrap = maxw + 1.25rem),
       comme le contenu des pages (main.section) et le footer → brand aligné avec les titres */
    padding: 0 max(1.5rem, calc((100% - var(--maxw)) / 2 + 1.25rem));
  }
  .site-header { display: none; }
  .s-brand { margin: 0; font-size: 1.05rem; flex: none; }
  .s-nav { display: flex; flex-direction: row; align-items: center; gap: .3rem; flex: 1; min-width: 0; }
  .s-link { display: flex; align-items: center; gap: 7px; padding: .5rem .75rem; border-radius: 999px; color: var(--steel); font-size: .95rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
  .s-link .icon { width: 18px; height: 18px; 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 { margin-left: auto; flex: none; color: var(--primary-text); font-weight: 650; white-space: nowrap; }
  .s-cta .icon { width: 18px; height: 18px; color: var(--primary-text); }
  .s-foot { display: none; }
}

.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 { text-align: left; 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; }
