/* ═══════════════════════════════════════════════════════════════════
   custom.css — Crypto & Finance Quantitative — Mars 2026
   Design premium · Montserrat + Inter · Navy/Bleu/Or · Effets pro
   Inspiré style Bassetti Groupe — scroll animations, parallax, glass
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=DM+Serif+Display&display=swap');

/* Hide Rmd auto-generated title (duplicate of hero h1) */
h1.title, .title.toc-ignore, .fluid-row > h1:first-child, #header > h1 { display: none !important; }
.fluid-row:first-child { margin-top: 0 !important; padding-top: 0 !important; }

/* ── Variables ──────────────────────────────────────────────────── */
:root {
  --navy:    #0b1929;
  --navy2:   #102035;
  --blue:    #2558d9;
  --blue-l:  #4a82ff;
  --blue-xl: #93c5fd;
  --gold:    #f5a623;
  --teal:    #00c4d8;
  --green:   #0ab572;
  --red:     #e53e3e;
  --purple:  #7c3aed;
  --white:   #ffffff;
  --bg:      #f0f4fa;
  --bg2:     #e8edf6;
  --text:    #1e2a3a;
  --muted:   #5a6a80;
  --border:  #d8e2f0;
  --r:       12px;
  --sh:      0 2px 18px rgba(11,25,41,0.09);
  --sh-lg:   0 10px 48px rgba(11,25,41,0.18);
}

/* ── Dark mode variables ────────────────────────────────────────── */
body.dark-mode {
  --bg:      #0b1222;
  --bg2:     #101c2e;
  --text:    #d0dae8;
  --muted:   #8a9bb4;
  --white:   #111d2e;
  --border:  #1e3250;
  --navy:    #e2eaf4;
  --navy2:   #0d1a2e;
  --sh:      0 2px 18px rgba(0,0,0,0.30);
  --sh-lg:   0 10px 48px rgba(0,0,0,0.40);
}
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6 { color: #e2eaf4; }
body.dark-mode h3 { color: #c8d8ea !important; }
body.dark-mode p { color: #8a9bb4; }
body.dark-mode code { background: #172236; color: #74b9ff; }
body.dark-mode pre { background: #060e1a !important; }
body.dark-mode #TOC { background: #111d2e; border-color: #1e3250; }
body.dark-mode #TOC a { color: #8a9bb4; }
body.dark-mode .table { background: #111d2e; border-color: #1e3250 !important; color: #d0dae8; }
body.dark-mode .table thead th { color: #d0dae8 !important; background: #0a1525 !important; border-color: #1e3250 !important; }
body.dark-mode .table th[colspan] { color: #d0dae8 !important; background: #070f1c !important; border-color: #1e3250 !important; }
body.dark-mode .table tbody td { border-color: #1a2a42 !important; color: #c0cee0; }
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) { background: #0f1a2c; }
body.dark-mode .table > tbody > tr:hover { background: rgba(74,130,255,0.08) !important; }
body.dark-mode .insight { background: #0e1a2e; color: #a0c0e0; }
body.dark-mode .success-box { background: #0a1e18; color: #7cd4a8; }
body.dark-mode .warning-box { background: #1a1808; color: #d4a852; }
body.dark-mode .danger-box { background: #1e0e0e; color: #e08a7a; }
body.dark-mode .method-box { background: #0e1525; color: #a0b8d4; }
body.dark-mode hr::after { background: var(--bg); }
body.dark-mode .kpi-card { border-top-color: #2a5aaa; }
body.dark-mode .analysis-card { border-top-color: #2a5aaa; }
body.dark-mode .analysis-card h4 { color: #e2eaf4 !important; }
body.dark-mode .analysis-card .card-desc { color: #8a9bb4; }
body.dark-mode .q-card h5 { color: #e2eaf4 !important; }
body.dark-mode .q-number { color: rgba(74,130,255,0.15); }
body.dark-mode .feature-card h5 { color: #e2eaf4 !important; }
body.dark-mode ::selection { background: rgba(74,130,255,0.30); color: #fff; }

/* ══════════════════════════════════════════════════════════════════
   NAVBAR TOGGLE BUTTON — discret, non intrusif (toutes pages)
   Petit bouton circulaire en haut à droite, semi-transparent au repos,
   plein opacité au survol. Le dark-toggle a été supprimé sur demande.
   ══════════════════════════════════════════════════════════════════ */
.dark-toggle-btn { display: none !important; }

.navbar-toggle-btn {
  position: fixed; top: 16px; right: 16px; z-index: 1050;
  width: 26px !important; height: 26px !important; border-radius: 50% !important;
  cursor: pointer;
  border: 1px solid rgba(116,185,255,0.20) !important;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px !important;
  color: rgba(116,185,255,0.85) !important;
  background:
    radial-gradient(circle at 30% 25%, rgba(116,185,255,0.10), transparent 60%),
    linear-gradient(135deg, rgba(15,30,50,0.55), rgba(9,18,32,0.70)) !important;
  backdrop-filter: saturate(140%) blur(4px);
  -webkit-backdrop-filter: saturate(140%) blur(4px);
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.45);
  opacity: 0.40;
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.25s, background 0.25s;
  outline: none;
  left: auto !important;
}
.navbar-toggle-btn:hover {
  opacity: 1;
  transform: scale(1.10);
  border-color: rgba(116,185,255,0.55) !important;
  background:
    radial-gradient(circle at 30% 25%, rgba(116,185,255,0.25), transparent 60%),
    linear-gradient(135deg, rgba(20,40,70,0.90), rgba(12,24,42,0.95)) !important;
  box-shadow:
    0 0 0 3px rgba(116,185,255,0.10),
    0 8px 20px -4px rgba(0,0,0,0.55);
}
.navbar-toggle-btn:active { transform: scale(0.95); }
.navbar-toggle-btn:focus-visible {
  opacity: 1;
  border-color: rgba(116,185,255,0.65) !important;
  box-shadow: 0 0 0 3px rgba(116,185,255,0.25);
}
.navbar-toggle-btn i {
  font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', FontAwesome, sans-serif !important;
  font-weight: 900 !important;
  font-style: normal !important;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.navbar-toggle-btn:hover i { transform: scale(1.15); }

/* Quand la navbar est cachée, le bouton remonte en haut pour rester
   accessible et devient plus visible (single anchor). */
body.navbar-hidden .navbar-toggle-btn {
  top: 12px;
  opacity: 0.65;
  border-color: rgba(116,185,255,0.32) !important;
}
body.navbar-hidden .navbar-toggle-btn:hover { opacity: 1; }

/* Variantes thématiques par page hero (or chaud / kintsugi) */
body:has(.hero-landing) .navbar-toggle-btn {
  border-color: rgba(255,217,110,0.35) !important;
  color: rgba(255,217,110,0.90) !important;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,217,110,0.10), transparent 60%),
    linear-gradient(135deg, rgba(15,25,40,0.55), rgba(7,17,29,0.75)) !important;
}
body:has(.hero-landing) .navbar-toggle-btn:hover {
  border-color: rgba(255,217,110,0.65) !important;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,217,110,0.22), transparent 60%),
    linear-gradient(135deg, rgba(20,35,60,0.92), rgba(12,24,42,0.97)) !important;
  box-shadow: 0 0 0 3px rgba(255,217,110,0.12), 0 8px 20px -4px rgba(0,0,0,0.55);
}
body:has(.th-hub) .navbar-toggle-btn {
  border-color: rgba(212,160,23,0.40) !important;
  color: rgba(245,197,75,0.90) !important;
  background:
    radial-gradient(circle at 30% 25%, rgba(212,160,23,0.10), transparent 60%),
    linear-gradient(135deg, rgba(28,25,23,0.55), rgba(20,17,13,0.75)) !important;
}
body:has(.th-hub) .navbar-toggle-btn:hover {
  border-color: rgba(245,197,75,0.70) !important;
  background:
    radial-gradient(circle at 30% 25%, rgba(245,197,75,0.22), transparent 60%),
    linear-gradient(135deg, rgba(35,30,25,0.92), rgba(25,21,17,0.97)) !important;
  box-shadow: 0 0 0 3px rgba(245,197,75,0.12), 0 8px 20px -4px rgba(0,0,0,0.55);
}
/* Mobile : bouton un peu plus accessible */
@media (max-width: 640px) {
  .navbar-toggle-btn { width: 30px !important; height: 30px !important; font-size: 11px !important; top: 14px; right: 14px; opacity: 0.55; }
}

/* ═════════════════════════════════════════════════════════════════════════
   FIX MOBILE 2026-06-08 : .navbar-toggle-btn (œil hide/show) INTERCEPTE
   le burger Bootstrap au même endroit → burger inutilisable sur tap iPhone.
   Solution : cacher l'œil sur mobile, le hide/show navbar n'a pas de sens
   quand la navbar est déjà collapsed par défaut sur mobile.
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .navbar-toggle-btn { display: none !important; }
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: rgba(37,88,217,0.18); color: var(--navy); }

body {
  font-family: 'Inter', 'Montserrat', system-ui, -apple-system, sans-serif !important;
  background: var(--bg);
  color: var(--text);
  line-height: 1.78;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* ── Titres ─────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif !important;
  color: var(--navy);
  font-weight: 700;
  letter-spacing: -0.3px;
}
h1 { font-size: 2.2em; }
h2 {
  font-size: 1.6em;
  margin-top: 3rem;
  padding-bottom: 16px;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  position: relative;
}
h2 .h2-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-size: 15px; flex-shrink: 0;
}
h3 { font-size: 1.2em; color: #1a2e50; margin-top: 1.8rem; }
h4 { font-size: 1.05em; }
p  { color: var(--muted); }

/* ── Container (overridden below in responsive block) ──────────── */

/* ══════════════════════════════════════════════════════════════════
   NAVBAR — Design premium (glassmorphism, gradients, micro-animations)
   ══════════════════════════════════════════════════════════════════ */

/* Anti-FOUC : masque la navbar plate avant que navbar_regroup.js ne la transforme
   Le script pose data-regrouped="1" sur .navbar-nav une fois les 6 menus thématiques construits */
.navbar-nav:not([data-regrouped="1"]) { visibility: hidden !important; }

/* ── Conteneur principal ───────────────────────────────────────── */
.navbar {
  background:
    radial-gradient(ellipse 600px 100% at 10% 0%, rgba(37,88,217,0.08), transparent 60%),
    radial-gradient(ellipse 500px 100% at 85% 0%, rgba(0,180,216,0.05), transparent 60%),
    rgba(9,18,32,0.72) !important;
  border-bottom: 1px solid rgba(116,185,255,0.10) !important;
  box-shadow:
    0 1px 0 0 rgba(255,255,255,0.03) inset,
    0 12px 40px -8px rgba(0,0,0,0.45) !important;
  min-height: 64px;
  /* PERF · blur abaissé de 28px à 8px. La navbar est position:fixed donc le
     blur se recalcule à chaque frame de scroll (énorme coût sur 60 fps sur
     toutes les pages du site). 8px préserve l'effet glassmorphism — on a
     déjà rgba(9,18,32,0.72) qui assombrit suffisamment derrière. */
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  transition: transform .4s cubic-bezier(.2,.8,.25,1),
              background .4s ease, box-shadow .4s ease,
              border-color .4s ease, min-height .3s ease;
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 1030;
}
.navbar::before {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(116,185,255,.35) 15%, rgba(0,206,201,.35) 50%, rgba(116,185,255,.35) 85%, transparent);
  opacity: .6; pointer-events: none;
}
.navbar.navbar-hidden { transform: translateY(-100%); }
.navbar:hover { transform: translateY(0) !important; }
.navbar.navbar-scrolled {
  min-height: 58px;
  background:
    radial-gradient(ellipse 600px 100% at 10% 0%, rgba(37,88,217,0.10), transparent 60%),
    rgba(9,18,32,0.94) !important;
  border-bottom-color: rgba(116,185,255,0.18) !important;
  box-shadow:
    0 1px 0 0 rgba(255,255,255,0.04) inset,
    0 16px 48px -12px rgba(0,0,0,0.65) !important;
}
body { padding-top: 90px; }

/* ── Brand ─────────────────────────────────────────────────────── */
.navbar-brand {
  color: #fff !important; font-weight: 800 !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 15px !important; padding: 18px 20px !important; letter-spacing: .35px;
  background: linear-gradient(135deg, #ffffff 0%, #a5c9ff 45%, #6fc9d1 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity .3s, letter-spacing .3s;
  position: relative;
}
.navbar-brand::after {
  content: ''; position: absolute; left: 20px; right: 20px; bottom: 10px; height: 1px;
  background: linear-gradient(90deg, rgba(116,185,255,.6), rgba(0,206,201,.3), transparent);
  opacity: 0; transform: scaleX(0); transform-origin: left;
  transition: opacity .3s, transform .4s cubic-bezier(.2,.8,.25,1);
}
.navbar-brand:hover::after { opacity: 1; transform: scaleX(1); }
.navbar-brand .nb-hi { color: #74b9ff; }

/* ── Liens navbar principaux ───────────────────────────────────── */
.navbar-nav > li > a {
  color: rgba(220,230,245,0.70) !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 11.5px !important; font-weight: 600 !important;
  padding: 20px 14px !important;
  letter-spacing: .5px; text-transform: uppercase;
  display: inline-flex !important; align-items: center; gap: 8px;
  transition: color .25s cubic-bezier(.2,.8,.25,1);
  position: relative; background: transparent !important;
}

/* Indicateur actif : barre gradient en BAS, animée */
.navbar-nav > li > a::after {
  content: ''; position: absolute;
  bottom: 10px; left: 50%; right: auto; height: 2px; width: 0;
  background: linear-gradient(90deg, #74b9ff, #00cec9);
  border-radius: 2px; opacity: 0;
  transform: translateX(-50%);
  transition: width .35s cubic-bezier(.2,.8,.25,1), opacity .25s;
  box-shadow: 0 0 10px rgba(116,185,255,.5);
}
.navbar-nav > li > a:hover { color: #fff !important; }
.navbar-nav > li > a:hover::after { width: 60%; opacity: .9; }
.navbar-nav > li.active > a::after,
.nav-dropdown.active > a::after { width: 70%; opacity: 1; }
.navbar-nav > li.active > a,
.nav-dropdown.active > a { color: #fff !important; }

.navbar-right > li > a { color: rgba(220,230,245,0.32) !important; font-size: 10.5px !important; cursor: default; letter-spacing: .8px; }

/* ── Icônes par groupe (accent couleur) ────────────────────────── */
.nav-ico {
  font-size: 12px; opacity: .78;
  transition: opacity .25s, transform .3s cubic-bezier(.2,.8,.25,1), color .25s, filter .3s;
  color: #a5c9ff;
}
.navbar-nav > li > a:hover .nav-ico {
  opacity: 1; transform: translateY(-1px) scale(1.08);
  filter: drop-shadow(0 0 6px rgba(116,185,255,.5));
}
.navbar-nav > li.active > a .nav-ico,
.nav-dropdown.active > a .nav-ico {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(116,185,255,.6));
}
/* Couleur par famille (via ordre dans le DOM : 2=Valo bleu · 3=Macro cyan · 4=Marché or · 5=Narratifs magenta) */
.navbar-nav > li:nth-child(2) .nav-ico { color: #74b9ff; }
.navbar-nav > li:nth-child(3) .nav-ico { color: #00cec9; }
.navbar-nav > li:nth-child(4) .nav-ico { color: #f6b93b; }
.navbar-nav > li:nth-child(5) .nav-ico { color: #e056fd; }
.navbar-nav > li:nth-child(6) .nav-ico { color: #55efc4; }

.nav-txt {
  font-weight: 600; letter-spacing: .45px;
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(220,230,245,.85));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.navbar-nav > li > a:hover .nav-txt,
.navbar-nav > li.active > a .nav-txt,
.nav-dropdown.active > a .nav-txt {
  background: linear-gradient(180deg, #ffffff, #ffffff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-chev {
  font-size: 9px !important; margin-left: 3px; opacity: .5;
  transition: transform .3s cubic-bezier(.2,.8,.25,1), opacity .25s;
}

/* ── Dropdowns ─────────────────────────────────────────────────── */
.nav-dropdown { position: relative; }
.nav-dropdown.open > a .nav-chev,
.nav-dropdown:hover > a .nav-chev { transform: rotate(180deg); opacity: 1; }
.nav-dropdown.open > a,
.nav-dropdown:hover > a { color: #fff !important; }
.nav-dropdown.open > a::after,
.nav-dropdown:hover > a::after { width: 60%; opacity: .9; }

.nav-dropdown-menu {
  position: absolute; top: calc(100% - 4px); left: 0; min-width: 260px;
  list-style: none; padding: 8px; margin: 0;
  background:
    linear-gradient(180deg, rgba(15,30,50,0.96), rgba(9,18,32,0.97)) !important;
  backdrop-filter: saturate(150%) blur(8px);
  -webkit-backdrop-filter: saturate(150%) blur(8px);
  border: 1px solid rgba(116,185,255,0.18);
  border-radius: 14px;
  box-shadow:
    0 1px 0 0 rgba(255,255,255,.05) inset,
    0 20px 60px -12px rgba(0,0,0,.7),
    0 0 0 1px rgba(116,185,255,.04);
  opacity: 0; visibility: hidden;
  transform: translateY(-8px) scale(.97);
  transform-origin: top center;
  transition:
    opacity .25s, visibility .25s,
    transform .3s cubic-bezier(.2,.8,.25,1);
  z-index: 1050;
  overflow: hidden;
}
.nav-dropdown-menu::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(116,185,255,.4) 30%, rgba(0,206,201,.4) 70%, transparent);
  opacity: .7;
}
.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1; visibility: visible;
  transform: translateY(0) scale(1);
}
.nav-dropdown-menu li { list-style: none; position: relative; }
.nav-dropdown-menu li a {
  display: flex !important; align-items: center; gap: 11px;
  padding: 11px 14px !important; border-radius: 9px !important;
  color: rgba(220,230,245,0.82) !important; font-size: 12.5px !important;
  font-family: 'Montserrat', sans-serif !important; font-weight: 500 !important;
  letter-spacing: .25px; text-transform: none !important;
  transition: background .2s, color .2s, transform .25s cubic-bezier(.2,.8,.25,1), padding-left .25s;
  position: relative; overflow: hidden;
}
.nav-dropdown-menu li a::after { display: none !important; }
.nav-dropdown-menu li a::before {
  content: ''; position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0;
  background: linear-gradient(180deg, #74b9ff, #00cec9);
  border-radius: 0 2px 2px 0;
  transition: height .25s cubic-bezier(.2,.8,.25,1);
}
.nav-dropdown-menu li a:hover {
  background: linear-gradient(90deg, rgba(37,88,217,0.22), rgba(37,88,217,0.08)) !important;
  color: #fff !important;
  padding-left: 18px !important;
}
.nav-dropdown-menu li a:hover::before { height: 70%; }
.nav-dropdown-menu li.active a {
  background: linear-gradient(90deg, rgba(37,88,217,0.35), rgba(37,88,217,0.10)) !important;
  color: #fff !important;
  padding-left: 18px !important;
}
.nav-dropdown-menu li.active a::before { height: 70%; }
.nav-dd-ico {
  width: 18px; text-align: center; font-size: 11.5px;
  opacity: .75; color: #74b9ff;
  transition: transform .25s, color .2s;
}
.nav-dropdown-menu li a:hover .nav-dd-ico {
  transform: scale(1.15) rotate(-4deg);
  color: #a5c9ff;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1180px){
  .navbar-nav > li > a { padding: 20px 11px !important; font-size: 11px !important; }
  .nav-txt { letter-spacing: .3px; }
}
@media (max-width: 960px){
  .nav-txt { display: none; }
  .navbar-nav > li > a { padding: 20px 14px !important; }
  .nav-ico { font-size: 15px; }
  .nav-chev { font-size: 8px !important; }
  .nav-dropdown-menu { left: -20px; min-width: 220px; }
}
@media (max-width: 640px){
  .nav-dropdown-menu { left: auto; right: 0; }
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes fadeUp   { from{opacity:0;transform:translateY(32px)} to{opacity:1;transform:none} }
@keyframes fadeDown { from{opacity:0;transform:translateY(-24px)} to{opacity:1;transform:none} }
@keyframes fadeLeft { from{opacity:0;transform:translateX(-40px)} to{opacity:1;transform:none} }
@keyframes fadeRight{ from{opacity:0;transform:translateX(40px)} to{opacity:1;transform:none} }
@keyframes fadeScale{ from{opacity:0;transform:scale(0.92)} to{opacity:1;transform:none} }
@keyframes gradMove { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes float    { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes popDot   { from{r:0;opacity:0} to{opacity:1} }
@keyframes fadeArea { to { opacity: 1; } }
@keyframes shimmer  { from{transform:translateX(-100%)} to{transform:translateX(200%)} }
@keyframes pulse    { 0%,100%{opacity:1} 50%{opacity:0.6} }
@keyframes slideIn  { from{transform:scaleX(0)} to{transform:scaleX(1)} }
@keyframes glowPulse{ 0%,100%{box-shadow:0 0 20px rgba(37,88,217,0.15)} 50%{box-shadow:0 0 40px rgba(37,88,217,0.30)} }
@keyframes particleFloat {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.3); opacity: 0; }
}

/* ── Page transitions ───────────────────────────────────────────── */
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
body {
  animation: pageIn 0.4s ease forwards;
}
body.page-leaving {
  opacity: 0 !important;
  transition: opacity 0.25s ease;
}

/* ── Scroll-triggered reveal (IntersectionObserver) ────────────── */
.reveal, .scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(.16,1,.3,1), transform 0.7s cubic-bezier(.16,1,.3,1);
}
.reveal.reveal-left, .scroll-reveal.reveal-left {
  transform: translateX(-50px);
}
.reveal.reveal-right, .scroll-reveal.reveal-right {
  transform: translateX(50px);
}
.reveal.reveal-scale, .scroll-reveal.reveal-scale {
  transform: scale(0.92);
}
.reveal.is-visible, .scroll-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Staggered children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(.16,1,.3,1), transform 0.6s cubic-bezier(.16,1,.3,1);
}
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.04s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.10s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.22s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.28s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.34s; }
.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: none;
}

/* ── Hero ───────────────────────────────────────────────────────── */
.hero-landing {
  background: radial-gradient(ellipse at 80% 20%, rgba(37,88,217,0.12) 0%, transparent 50%), radial-gradient(ellipse at 20% 80%, rgba(0,196,216,0.06) 0%, transparent 50%), #050a12;
  border-radius: 22px;
  padding: 0;
  margin-top: 24px;
  margin-bottom: 56px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.60);
  display: flex;
  justify-content: center;
  min-height: 420px;
}
/* Grid overlay — disabled */
.hero-landing::before {
  display: none;
}
/* Glow orb top-right */
.hero-landing::after {
  display: none;
}
/* Particles canvas overlay */
.hero-particles {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
  overflow: hidden;
}
.hero-particle {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(74,130,255,0.5);
  animation: particleFloat var(--dur, 8s) linear infinite;
  animation-delay: var(--delay, 0s);
}
.hero-content {
  padding: 64px 68px;
  flex: 1;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.hero-content > * {
  animation: fadeUp 0.8s cubic-bezier(.2,.8,.25,1) both;
}
.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.25s; }
.hero-content > *:nth-child(3) { animation-delay: 0.4s; }
.hero-content > *:nth-child(4) { animation-delay: 0.55s; }
.hero-content > *:nth-child(5) { animation-delay: 0.7s; }
.hero-visual {
  width: 340px; flex-shrink: 0;
  display: flex; align-items: flex-end;
  padding: 0 40px 40px 0;
  position: relative; z-index: 2;
  animation: fadeRight 1s cubic-bezier(.2,.8,.25,1) 0.5s both;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
  font-family: 'Montserrat', sans-serif;
  color: var(--blue-l);
  background: rgba(37,88,217,0.14);
  border: 1px solid rgba(74,130,255,0.28);
  border-radius: 6px; padding: 6px 16px;
  margin-bottom: 20px; width: fit-content;
  backdrop-filter: blur(8px);
}
.hero-eyebrow::before { content: ''; width:6px; height:6px; border-radius:50%; background:var(--blue-l); animation: pulse 2s ease infinite; box-shadow: 0 0 8px var(--blue-l); }
.hero-landing h1 {
  color: #fff !important; border: none !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 3.2em !important; font-weight: 900;
  margin: 0 0 16px; padding: 0;
  line-height: 1.08; letter-spacing: -2px;
}
.hero-landing h1 .h1-light { font-weight: 300; color: var(--blue-xl); }
.hero-sub {
  font-size: 17px; color: #8cb4d8;
  font-family: 'Inter', sans-serif;
  max-width: 580px; line-height: 1.62; margin-bottom: 18px; font-weight: 400;
}
.hero-desc {
  font-size: 14px; color: #638aae;
  font-family: 'Inter', sans-serif;
  line-height: 1.88; max-width: 620px; margin-bottom: 32px;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-tag {
  font-size: 11.5px; font-weight: 600; color: #8cb4d8;
  font-family: 'Montserrat', sans-serif;
  background: rgba(37,88,217,0.10);
  border: 1px solid rgba(74,130,255,0.20);
  border-radius: 6px; padding: 5px 14px;
  transition: all .3s cubic-bezier(.2,.8,.25,1);
  backdrop-filter: blur(4px);
}
.hero-tag {
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: rgba(37,88,217,0.12);
  border: 1px solid rgba(74,130,255,0.22);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.04);
}
.hero-tag:hover { background: rgba(37,88,217,0.30); color: #d0e8f8; transform: translateY(-2px) scale(1.05); box-shadow: 0 6px 24px rgba(37,88,217,0.25), 0 0 12px rgba(74,130,255,0.15); }
/* Source logos */
.hero-src-logo {
  width: 28px; height: 28px; border-radius: 6px;
  filter: grayscale(100%) brightness(0.7);
  transition: all .3s ease;
  cursor: default;
}
.hero-src-logo:hover { filter: grayscale(0%) brightness(1); transform: scale(1.15); }
/* CTA button */
.hero-cta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700; font-family: 'Montserrat', sans-serif;
  color: #93c5fd; letter-spacing: 0.5px;
  background: transparent;
  border: 1.5px solid rgba(147,197,253,0.35);
  border-radius: 10px; padding: 10px 28px;
  text-decoration: none;
  transition: all .35s cubic-bezier(.2,.8,.25,1);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fadeUp .8s ease .8s both;
}
.hero-cta:hover {
  color: #fff; border-color: rgba(147,197,253,0.7);
  background: rgba(37,88,217,0.18);
  box-shadow: 0 0 20px rgba(74,130,255,0.25), 0 4px 16px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

/* ── KPI grid ───────────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px,1fr));
  gap: 16px; margin: 40px 0;
}
.kpi-card {
  background: var(--white); border-radius: var(--r);
  padding: 22px 18px; text-align: center;
  box-shadow: var(--sh); border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  transition: transform .28s ease, box-shadow .28s ease;
  animation: fadeUp .6s ease both;
  position: relative; overflow: hidden;
}
.kpi-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.kpi-card:hover { transform: translateY(-5px); box-shadow: var(--sh-lg); }
.kpi-card:hover::after { transform: scaleX(1); }
.kpi-icon-wrap {
  width: 46px; height: 46px; border-radius: 11px;
  background: rgba(37,88,217,0.09);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; font-size: 18px; color: var(--blue);
  animation: float 3.5s ease-in-out infinite;
}
.kpi-value { font-size: 2.15em; font-weight: 800; color: var(--navy); line-height: 1; display: block; }
.kpi-label { font-size: 11.5px; color: var(--muted); margin-top: 5px; font-weight: 600; letter-spacing: 0.2px; display: block; }

/* ── Section "Questions clés" ───────────────────────────────────── */
.questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
  gap: 18px; margin: 28px 0;
}
.q-card {
  background: var(--white); border-radius: 14px; padding: 24px 22px;
  box-shadow: var(--sh); border: 1px solid var(--border);
  transition: transform .25s, box-shadow .25s;
  position: relative; overflow: hidden;
}
.q-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); }
.q-number {
  font-size: 3em; font-weight: 800; line-height: 1;
  color: rgba(37,88,217,0.10);
  position: absolute; top: 10px; right: 16px;
  font-family: 'DM Serif Display', serif;
}
.q-icon { font-size: 24px; color: var(--blue); margin-bottom: 12px; display: block; }
.q-card h5 { font-size: 14px; font-weight: 700; margin: 0 0 8px; color: var(--navy) !important; }
.q-card p  { font-size: 13px; color: var(--muted); margin: 0 0 14px; line-height: 1.6; }
.q-link    { font-size: 12.5px; font-weight: 700; color: var(--blue); text-decoration: none; transition: gap .2s; display: inline-flex; align-items: center; gap: 5px; }
.q-link:hover { gap: 8px; text-decoration: none; }

/* ── Analysis cards ─────────────────────────────────────────────── */
.nav-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px,1fr));
  gap: 24px; margin: 36px 0;
}
.analysis-card {
  background: var(--white); border-radius: 16px; padding: 30px 28px 26px;
  box-shadow: 0 4px 24px rgba(11,25,41,0.08); border: 1px solid var(--border);
  border-top: 4px solid var(--blue);
  text-decoration: none !important; color: var(--navy);
  display: flex; flex-direction: column;
  transition: transform .35s cubic-bezier(.2,.8,.25,1), box-shadow .35s ease;
  position: relative; overflow: hidden;
}
/* Shimmer effect on hover */
.analysis-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.18) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform .8s cubic-bezier(.2,.8,.25,1);
}
.analysis-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(11,25,41,0.16), 0 0 0 1px rgba(37,88,217,0.10);
  text-decoration: none !important;
}
.analysis-card:hover::before { transform: translateX(200%); }
.card-icon-box {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; margin-bottom: 18px;
  background: rgba(37,88,217,0.09); color: var(--blue);
  transition: transform .35s cubic-bezier(.2,.8,.25,1), box-shadow .35s;
}
.analysis-card:hover .card-icon-box { transform: scale(1.12) rotate(-4deg); box-shadow: 0 6px 20px rgba(37,88,217,0.15); }
.analysis-card h4 { color: var(--navy) !important; margin: 0 0 10px; font-size: 16px; font-weight: 700; line-height: 1.3; font-family: 'Montserrat', sans-serif !important; }
.analysis-card .card-desc { color: var(--muted); font-size: 13.5px; margin: 0; line-height: 1.68; flex: 1; }
.card-cta {
  margin-top: 20px; font-size: 13px; font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  display: inline-flex; align-items: center; gap: 7px;
  transition: gap .3s cubic-bezier(.2,.8,.25,1), transform .3s;
}
.analysis-card:hover .card-cta { gap: 12px; transform: translateX(4px); }

/* ── Feature grid ───────────────────────────────────────────────── */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 15px; margin: 26px 0; }
.feature-card {
  background: var(--white); border-radius: var(--r); padding: 20px 18px;
  box-shadow: var(--sh); border: 1px solid var(--border);
  text-align: center; transition: transform .22s, box-shadow .22s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); }
.feat-icon { font-size: 26px; color: var(--blue); display: block; margin-bottom: 10px; }
.feature-card h5 { font-size: 13.5px; margin: 0 0 5px; color: var(--navy) !important; }
.feature-card p  { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.55; }

/* ── Timeline halvings ──────────────────────────────────────────── */
.halving-timeline { margin: 36px 0; position: relative; }
.halving-timeline::before {
  content: '';
  position: absolute; left: 140px; top: 20px; bottom: 20px; width: 3px;
  background: linear-gradient(180deg, var(--blue), var(--teal), var(--gold));
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(37,88,217,0.20);
}
.tl-item {
  display: flex; align-items: flex-start;
  gap: 0; margin-bottom: 32px;
  position: relative;
}
.tl-left {
  width: 130px; flex-shrink: 0; text-align: right;
  padding-right: 16px; padding-top: 2px;
}
.tl-date { font-size: 12px; font-weight: 700; color: var(--blue); display: block; font-family: 'Montserrat', sans-serif; }
.tl-price { font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }
.tl-dot-wrap {
  width: 22px; flex-shrink: 0;
  display: flex; justify-content: center; padding-top: 4px;
}
.tl-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--blue); border: 3px solid white;
  box-shadow: 0 0 0 3px var(--blue), 0 0 12px rgba(37,88,217,0.30);
  flex-shrink: 0;
  transition: transform 0.3s, box-shadow 0.3s;
}
.tl-item:hover .tl-dot { transform: scale(1.3); }
.tl-dot.gold  { background: var(--gold); box-shadow: 0 0 0 3px var(--gold), 0 0 12px rgba(245,166,35,0.30); }
.tl-dot.teal  { background: var(--teal); box-shadow: 0 0 0 3px var(--teal), 0 0 12px rgba(0,196,216,0.30); }
.tl-dot.green { background: var(--green); box-shadow: 0 0 0 3px var(--green), 0 0 12px rgba(10,181,114,0.30); }
.tl-right {
  flex: 1; background: var(--white); border-radius: 12px;
  padding: 16px 20px; margin-left: 14px;
  box-shadow: 0 4px 20px rgba(11,25,41,0.08); border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  transition: transform 0.3s cubic-bezier(.2,.8,.25,1), box-shadow 0.3s;
}
.tl-item:hover .tl-right { transform: translateX(6px); box-shadow: 0 8px 32px rgba(11,25,41,0.14); }
.tl-right.gold-border  { border-left-color: var(--gold); }
.tl-right.teal-border  { border-left-color: var(--teal); }
.tl-right.green-border { border-left-color: var(--green); }
.tl-right strong { font-size: 14px; color: var(--navy); display: block; margin-bottom: 4px; }
.tl-right p { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.55; }
.tl-perf { font-size: 12px; font-weight: 700; display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 4px; }
.tl-perf.up   { background: rgba(10,181,114,0.12); color: var(--green); }
.tl-perf.down { background: rgba(229,62,62,0.10);  color: var(--red); }

/* ── Info boxes ─────────────────────────────────────────────────── */
.insight, .success-box, .warning-box, .danger-box, .method-box {
  border-radius: var(--r); padding: 20px 26px; margin: 24px 0;
  font-size: 14.5px; line-height: 1.78; animation: fadeUp .5s ease both;
  position: relative;
}
.insight     { background:#eff6ff; border-left:5px solid var(--blue);   color:#1a3060; box-shadow:0 3px 16px rgba(37,88,217,0.08); }
.success-box { background:#f0fdf7; border-left:5px solid var(--green);  color:#064e2a; box-shadow:0 3px 16px rgba(10,181,114,0.08); }
.warning-box { background:#fffbf0; border-left:5px solid #d48000;       color:#6b3f00; box-shadow:0 3px 16px rgba(212,128,0,0.08); }
.danger-box  { background:#fff4f4; border-left:5px solid var(--red);    color:#6b1a10; box-shadow:0 3px 16px rgba(229,62,62,0.08); }
.method-box  { background:#f8f9ff; border-left:5px solid var(--blue);   color:var(--navy); box-shadow:0 3px 16px rgba(37,88,217,0.06); }

/* ── Key quote block ────────────────────────────────────────────── */
.key-quote {
  background: linear-gradient(135deg, var(--navy2) 0%, #0f2a50 100%);
  border-radius: 14px; padding: 28px 32px; margin: 28px 0;
  color: white; position: relative; overflow: hidden;
  box-shadow: 0 8px 32px rgba(11,25,41,0.28);
}
.key-quote::before {
  content: '\201C';
  position: absolute; top: -10px; left: 18px;
  font-size: 100px; color: rgba(37,88,217,0.18);
  font-family: 'DM Serif Display', serif; line-height: 1;
}
.key-quote p { color: #b0c8e4; font-size: 15px; line-height: 1.85; margin: 0; position: relative; z-index: 1; }
.key-quote strong { color: white; }

/* ── Dark section ───────────────────────────────────────────────── */
.section-dark {
  background: var(--navy2);
  border-radius: 14px; padding: 32px 36px; margin: 36px 0;
  color: white; box-shadow: 0 6px 28px rgba(11,25,41,0.24);
}
.section-dark h3 { color: white !important; }
.section-dark p  { color: #8aaac8; }

/* ── Séparateur ─────────────────────────────────────────────────── */
hr {
  border: none; height: 2px; margin: 64px 0; position: relative;
  background: linear-gradient(90deg, transparent 0%, var(--border) 20%, var(--blue) 50%, var(--border) 80%, transparent 100%);
  opacity: 0.5;
}
hr::after {
  content: '\25C6';
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  color: var(--blue); font-size: 11px;
  background: var(--bg); padding: 0 16px;
}

/* ── Code ───────────────────────────────────────────────────────── */
pre {
  background: #0b1929 !important; color: #c4d4e8 !important;
  border: none !important; border-left: 4px solid var(--blue) !important;
  border-radius: 10px !important; font-size: 11.5px !important;
  padding: 16px 20px !important; box-shadow: 0 6px 24px rgba(0,0,0,0.24) !important;
}
code { background:#eef2fc; border-radius:4px; padding:2px 7px; font-size:13px; color:var(--blue); font-weight:600; }
pre code { background:transparent !important; color:#c4d4e8 !important; padding:0; font-weight:400; }

/* ── TOC ────────────────────────────────────────────────────────── */
#TOC { background:var(--white); border-radius:var(--r); padding:16px 18px; box-shadow:var(--sh); border:1px solid var(--border); font-size:13px; }
#TOC a { color:#3a4a64; } #TOC a:hover { color:var(--blue); text-decoration:none; }
#TOC .active { color:var(--blue); font-weight:700; }

/* ── Tables ─────────────────────────────────────────────────────── */
.table { background:var(--white); border-radius:var(--r); overflow:hidden; box-shadow:var(--sh); border:1px solid var(--border) !important; font-size:13.5px; }
.table thead th { font-weight:700 !important; padding:13px 18px !important; text-transform:uppercase; font-size:11px !important; letter-spacing:0.5px; color:#fff !important; background:#1a2744 !important; border-color:#253a5a !important; }
.table thead th span { color: inherit !important; }
.table tbody td { padding:11px 18px !important; vertical-align:middle; }
.table-striped > tbody > tr:nth-of-type(odd) { background:#f8faff; }
.table > tbody > tr:hover { background:rgba(37,88,217,0.04) !important; }
/* kableExtra header groups */
.table th[colspan] { color:#fff !important; background:#0f1d33 !important; border-color:#253a5a !important; }

/* ── Figures ────────────────────────────────────────────────────── */
.figure { border-radius:14px; overflow:hidden; box-shadow:0 10px 44px rgba(11,25,41,0.22); margin:28px 0; background:var(--navy); }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge-new    { background:rgba(0,196,216,0.14); color:#00a8ba; border:1px solid rgba(0,196,216,0.32); border-radius:4px; padding:2px 8px; font-size:10.5px; font-weight:700; letter-spacing:0.5px; margin-left:7px; vertical-align:middle; }
.badge-update { background:rgba(10,181,114,0.14); color:var(--green); border:1px solid rgba(10,181,114,0.32); border-radius:4px; padding:2px 8px; font-size:10.5px; font-weight:700; letter-spacing:0.5px; margin-left:7px; vertical-align:middle; }

/* ── Footer ─────────────────────────────────────────────────────── */
.site-footer {
  background: linear-gradient(135deg, var(--navy) 0%, #0a1525 100%);
  color:#6a8ab0; text-align:center; padding:56px 40px;
  margin-top:100px; border-radius:22px; font-size:13.5px; line-height:2;
  border-top:3px solid var(--blue);
  box-shadow: 0 -8px 40px rgba(11,25,41,0.22), inset 0 1px 0 rgba(37,88,217,0.15);
  position:relative; overflow:hidden;
}
.site-footer::before {
  content:''; position:absolute; inset:0;
  background-image: linear-gradient(rgba(37,88,217,0.04) 1px,transparent 1px), linear-gradient(90deg,rgba(37,88,217,0.04) 1px,transparent 1px);
  background-size:40px 40px; pointer-events:none;
}
/* Glow orb in footer */
.site-footer::after {
  content:''; position:absolute; bottom:-80px; left:50%; transform:translateX(-50%);
  width:500px; height:250px;
  background:radial-gradient(ellipse, rgba(37,88,217,0.12) 0%, transparent 70%);
  pointer-events:none;
}
.footer-brand {
  font-family: 'Montserrat', sans-serif;
  font-size:1.85em; font-weight:900; color:#fff; letter-spacing:-0.5px; display:block; margin-bottom:6px;
  position: relative; z-index: 1;
}
.footer-sub { font-size:12.5px; color:#3a5a7a; margin-bottom:20px; display:block; position:relative; z-index:1; }
.footer-links { position:relative; z-index:1; }
.footer-links a {
  color:#5a9cde; margin:0 12px; font-size:13px; font-weight:500;
  transition: color .3s, transform .3s; display:inline-block;
}
.footer-links a:hover { color:white; transform: translateY(-2px); text-decoration: none; }
.footer-sep { color:#1e3a5a; margin:0 2px; }

/* ── Container max-width ─────────────────────────────────────────── */
.main-container { max-width: 1260px !important; padding: 40px 32px 100px; }

/* ── Smooth page entrance ──────────────────────────────────────── */
.main-container > .hero-landing { animation: fadeScale 0.8s cubic-bezier(.2,.8,.25,1) both; }

/* ── Enhanced h2 bottom gradient line ──────────────────────────── */
h2::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--teal) 40%, transparent 100%);
  border-radius: 2px;
}

/* ── Print ───────────────────────────────────────────────────────── */
@media print { .navbar,#TOC,.site-footer{display:none} .main-container{max-width:100% !important} }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width:960px){
  .hero-visual{display:none} .hero-content{padding:42px 28px}
  .hero-landing h1{font-size:2.2em !important} .main-container{padding:0 18px 60px}
  .nav-cards-grid{grid-template-columns:1fr} .kpi-row{grid-template-columns:repeat(3,1fr)}
  .halving-timeline::before{left:110px}
  .tl-left{width:100px}
  .hero-landing{min-height:340px;border-radius:16px;}
}
@media (max-width:600px){
  .kpi-row{grid-template-columns:repeat(2,1fr)} .hero-landing h1{font-size:1.75em !important}
  .questions-grid{grid-template-columns:1fr}
  .hero-content{padding:32px 22px}
}

/* ── Large screen (PC fixe / ultrawide >= 1600px) ──────────────────
   Adapte la largeur max du contenu pour mieux exploiter les grands ecrans
   sans modifier le rendu sur MacBook (1440-1512px). La variable --max-w
   pilote .ca-section et .ca-kintsugi (accueil.css), .main-container ici. */
@media (min-width: 1600px) {
  :root { --max-w: 1700px; }
  .main-container { max-width: 1700px !important; }
}

/* ── Reduce motion for accessibility ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .reveal-stagger > * { opacity: 1; transform: none; }
}

/* ── Google Trends Widget Styling ─────────────────────────────── */
/* Target the Google Trends widget containers and their iframes */
[id^="gt-w-"] {
  min-height: 300px;
}
[id^="gt-w-"] iframe {
  width: 100% !important;
  min-height: 300px !important;
  height: 320px !important;
  border: none !important;
  display: block !important;
}
/* Fix Google Trends widget internal overflow */
[id^="gt-w-"] > div {
  width: 100% !important;
}

/* ── Navbar hidden : masque et ajuste padding (boutons dock gérés plus haut) ──── */
body.navbar-hidden .navbar-fixed-top,
body.navbar-hidden .navbar {
  transform: translateY(-100%);
  opacity: 0; pointer-events: none;
  transition: transform .35s cubic-bezier(.2,.8,.25,1), opacity .3s;
}
body.navbar-hidden .main-container { padding-top: 10px !important; }
body.navbar-hidden #TOC { top: 10px !important; }

/* ════════════════════════════════════════════════════════════════
   PERF GLOBAL · pause animations + GPU compositing
   Appliqué à toutes les pages du site (mai 2026)
   ════════════════════════════════════════════════════════════════ */

/* 1. Quand l'onglet n'est pas visible, pause toutes les animations infinite.
      La classe html.tab-hidden est posée par perf-utils.js (cf <script>
      inline dans la navbar). */
html.tab-hidden *,
html.tab-hidden *::before,
html.tab-hidden *::after {
  animation-play-state: paused !important;
}

/* 2. PERF DÉSACTIVÉ · contain: paint sur Plotly empêchait l'affichage des
      graphes sur certains Chrome (clipping incorrect du SVG). */
/* .plotly, .plot-container, .js-plotly-plot { contain: layout paint; } */

/* 3. Particules hero · réduit la quantité animée. Les particles infinite
      coûtent en GPU même si chacune est simple ; à l'unité c'est OK, à 20
      simultanées sur certains hero c'est sensible. */
.hero-particle:nth-child(n+8) { display: none; }

/* 4. Respecte prefers-reduced-motion : coupe les animations infinite
      (Apple+Microsoft accessibility setting). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   NAVBAR · OVERRIDES PAGES HERO
   1. Accueil principal (body:has(.hero-landing))  → aurora navy + or chaud
   2. Thèse hub (body:has(.th-hub))                → marble & kintsugi
   Les autres pages gardent la navbar tech navy par défaut.
   ════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────
   1. NAVBAR ACCUEIL PRINCIPAL — Aurora Navy + Or Chaud
   Cinéma : fond navy cosmique avec aurore verte/violette en bas,
   wordmark serif doré, liens dorés caps espacés, transparente
   pour fondu avec l'image hero.
   ────────────────────────────────────────────────────────────── */
body:has(.hero-landing) .navbar {
  background:
    /* Aurore subtile en bas de la navbar — vert teal + violet */
    linear-gradient(180deg,
      transparent 0%,
      rgba(110, 230, 200, 0.04) 70%,
      rgba(160, 120, 255, 0.05) 88%,
      rgba(255, 217, 110, 0.10) 100%
    ),
    /* Brume étoilée */
    radial-gradient(ellipse 1200px 100% at 50% 0%, rgba(20, 35, 60, 0.55), transparent 80%),
    /* Base bleu nuit profond */
    rgba(7, 17, 29, 0.85) !important;
  border-bottom: 1px solid rgba(255, 217, 110, 0.20) !important;
  box-shadow:
    0 1px 0 0 rgba(255, 217, 110, 0.15) inset,
    0 12px 40px -8px rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  position: relative;
}
/* Ligne aurore subtile animée en bas de la navbar */
body:has(.hero-landing) .navbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(110, 230, 200, 0.0) 10%,
    rgba(110, 230, 200, 0.5) 30%,
    rgba(255, 217, 110, 0.8) 50%,
    rgba(160, 120, 255, 0.5) 70%,
    rgba(160, 120, 255, 0.0) 90%,
    transparent 100%);
  background-size: 200% 100%;
  animation: navAuroraSlide 18s linear infinite;
  pointer-events: none;
  opacity: 0.7;
}
@keyframes navAuroraSlide {
  0%   { background-position:   0% 50%; }
  100% { background-position: 200% 50%; }
}
/* Wordmark "Crypto & Finance Quantitative" en haut à gauche — serif doré */
body:has(.hero-landing) .navbar-brand,
body:has(.hero-landing) .navbar-header .navbar-brand {
  font-family: 'DM Serif Display', 'Playfair Display', serif !important;
  font-size: 22px !important;
  font-weight: 400 !important;
  letter-spacing: 0.02em !important;
  background: linear-gradient(135deg, #ffe9a3 0%, #ffd96e 35%, #ff9d3d 75%, #f5a623 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  text-shadow: 0 0 24px rgba(255, 217, 110, 0.15);
  text-transform: none !important;
}
body:has(.hero-landing) .navbar-brand:hover {
  filter: brightness(1.12) drop-shadow(0 0 8px rgba(255, 217, 110, 0.4));
}
/* Liens du menu — caps espacés couleur crème, accent or au hover */
body:has(.hero-landing) .navbar-nav > li > a {
  font-family: 'JetBrains Mono', 'Public Sans', sans-serif !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase !important;
  color: rgba(245, 236, 213, 0.85) !important;
  padding: 22px 18px !important;
  position: relative;
  transition: color 0.3s ease, transform 0.25s ease;
}
body:has(.hero-landing) .navbar-nav > li > a::before {
  content: '';
  position: absolute;
  left: 18px; right: 18px; bottom: 14px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 217, 110, 0), rgba(255, 217, 110, 0.9), rgba(255, 217, 110, 0));
  transform: scaleX(0);
  transition: transform 0.4s cubic-bezier(.2,.8,.25,1);
}
body:has(.hero-landing) .navbar-nav > li > a:hover,
body:has(.hero-landing) .navbar-nav > li.active > a {
  color: #ffe9a3 !important;
  background: transparent !important;
}
body:has(.hero-landing) .navbar-nav > li > a:hover::before,
body:has(.hero-landing) .navbar-nav > li.active > a::before {
  transform: scaleX(1);
}
/* Dropdown menus harmonisés à l'aurore */
body:has(.hero-landing) .nav-dropdown-menu {
  background:
    linear-gradient(180deg, rgba(7, 17, 29, 0.96), rgba(5, 12, 22, 0.98)) !important;
  border: 1px solid rgba(255, 217, 110, 0.22) !important;
  box-shadow:
    0 12px 40px -8px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 217, 110, 0.10) inset !important;
}
body:has(.hero-landing) .nav-dropdown-menu a {
  font-family: 'JetBrains Mono', sans-serif;
  color: rgba(245, 236, 213, 0.75) !important;
  letter-spacing: 0.05em;
}
body:has(.hero-landing) .nav-dropdown-menu a:hover {
  background: rgba(255, 217, 110, 0.08) !important;
  color: #ffe9a3 !important;
}

/* ──────────────────────────────────────────────────────────────
   2. NAVBAR THÈSE HUB — Marble & Kintsugi
   Charbon cosmique + texture marbre subtile + or kintsugi.
   Wordmark Playfair Display, souligns animés au hover.
   ────────────────────────────────────────────────────────────── */
body:has(.th-hub) .navbar {
  background:
    /* Veines kintsugi très subtiles */
    linear-gradient(95deg,
      transparent 30%, rgba(212, 160, 23, 0.05) 41%, rgba(245, 197, 75, 0.08) 42%, rgba(212, 160, 23, 0.05) 43%, transparent 54%
    ),
    linear-gradient(80deg,
      transparent 50%, rgba(212, 160, 23, 0.03) 64%, rgba(245, 197, 75, 0.06) 65%, transparent 80%
    ),
    /* Halo or central */
    radial-gradient(ellipse 800px 80% at 50% 0%, rgba(212, 160, 23, 0.07), transparent 75%),
    /* Charbon profond stratifié */
    linear-gradient(180deg, #1c1917 0%, #14110d 100%) !important;
  border-bottom: 1px solid rgba(212, 160, 23, 0.28) !important;
  box-shadow:
    0 1px 0 0 rgba(245, 197, 75, 0.10) inset,
    0 16px 50px -10px rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: saturate(150%) blur(6px);
  -webkit-backdrop-filter: saturate(150%) blur(6px);
  position: relative;
  min-height: 68px;
}
/* Marbre subtil — texture SVG turbulence inline, 4% opacity */
body:has(.th-hub) .navbar::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='80'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23m)' opacity='0.7'/></svg>");
  background-size: 300px 80px;
  opacity: 0.04;
  mix-blend-mode: overlay;
  pointer-events: none;
}
/* Ligne or kintsugi fine en bas */
body:has(.th-hub) .navbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(212, 160, 23, 0.0) 8%,
    rgba(212, 160, 23, 0.4) 25%,
    rgba(245, 197, 75, 0.85) 50%,
    rgba(212, 160, 23, 0.4) 75%,
    rgba(212, 160, 23, 0.0) 92%,
    transparent 100%);
  pointer-events: none;
}
/* Wordmark "CAPITAL ANTIFRAGILE" — Playfair caps + kintsugi gold */
body:has(.th-hub) .navbar-brand,
body:has(.th-hub) .navbar-header .navbar-brand {
  font-family: 'Playfair Display', 'DM Serif Display', serif !important;
  font-size: 19px !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  background: linear-gradient(180deg, #f5c54b 0%, #d4a017 55%, #8a6710 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  padding: 18px 24px !important;
  position: relative;
  text-shadow: none;
}
/* Eyebrow " · THÈSE · " sous le wordmark (placé via pseudo) */
body:has(.th-hub) .navbar-brand::after {
  content: '·  THÈSE  ·';
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.42em;
  color: rgba(212, 160, 23, 0.7);
  margin-top: 1px;
  -webkit-text-fill-color: rgba(212, 160, 23, 0.7);
  text-transform: uppercase;
}
body:has(.th-hub) .navbar-brand:hover {
  filter: brightness(1.10);
}
/* Liens du menu — mono caps espacés, kintsugi underline au hover */
body:has(.th-hub) .navbar-nav > li > a {
  font-family: 'JetBrains Mono', 'Public Sans', sans-serif !important;
  font-size: 10.5px !important;
  font-weight: 500 !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  color: rgba(240, 236, 224, 0.75) !important;
  padding: 24px 18px !important;
  position: relative;
  transition: color 0.35s ease, transform 0.25s ease;
}
body:has(.th-hub) .navbar-nav > li > a::before {
  content: '';
  position: absolute;
  left: 50%; right: 50%; bottom: 16px;
  height: 1.5px;
  background: linear-gradient(90deg,
    rgba(245, 197, 75, 0) 0%,
    rgba(245, 197, 75, 1) 30%,
    rgba(212, 160, 23, 1) 70%,
    rgba(212, 160, 23, 0) 100%);
  box-shadow: 0 0 8px rgba(245, 197, 75, 0.6);
  transition: left 0.45s cubic-bezier(.2,.8,.25,1), right 0.45s cubic-bezier(.2,.8,.25,1);
}
body:has(.th-hub) .navbar-nav > li > a:hover,
body:has(.th-hub) .navbar-nav > li.active > a {
  color: #ffe9a3 !important;
  background: transparent !important;
}
body:has(.th-hub) .navbar-nav > li > a:hover::before,
body:has(.th-hub) .navbar-nav > li.active > a::before {
  left: 18px; right: 18px;
}
/* Dropdown menus — fond charbon avec veines or */
body:has(.th-hub) .nav-dropdown-menu {
  background:
    linear-gradient(95deg, transparent 30%, rgba(212,160,23,0.06) 50%, transparent 70%),
    linear-gradient(180deg, rgba(28, 25, 23, 0.97), rgba(20, 17, 13, 0.99)) !important;
  border: 1px solid rgba(212, 160, 23, 0.30) !important;
  box-shadow:
    0 16px 48px -10px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(245, 197, 75, 0.10) inset !important;
}
body:has(.th-hub) .nav-dropdown-menu a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(240, 236, 224, 0.78) !important;
}
body:has(.th-hub) .nav-dropdown-menu a:hover {
  background: rgba(212, 160, 23, 0.10) !important;
  color: #ffe9a3 !important;
}

/* ── Toggle button styling pour les deux pages héros ─────────── */
body:has(.hero-landing) .dark-toggle-btn,
body:has(.hero-landing) .navbar-toggle-btn {
  border-color: rgba(255, 217, 110, 0.35) !important;
  color: #ffd96e !important;
}
body:has(.th-hub) .dark-toggle-btn,
body:has(.th-hub) .navbar-toggle-btn {
  border-color: rgba(212, 160, 23, 0.40) !important;
  color: #d4a017 !important;
}

/* ═════════════════════════════════════════════════════════════════════════════
   MOBILE GLOBAL — Refonte 2026-06-08 (site-wide, toutes les pages)
   ═════════════════════════════════════════════════════════════════════════════
   custom.css est chargé partout (vs accueil.css uniquement sur Accueil), donc
   on met ici toutes les règles mobile qui doivent s'appliquer à TOUTES les
   pages : navbar burger + overlay, typographie lisible, tables scrollables,
   images max-width, etc.
   Desktop ≥768px : aucune règle ici n'active, tout reste @media (max-width:767px).
   ═════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px){
  /* ─── BURGER BUTTON (badge cyan visible avec label MENU) ─────────────── */
  .navbar-toggle,
  .navbar-default .navbar-toggle,
  .navbar-inverse .navbar-toggle{
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    position: relative !important;
    margin: 10px 12px !important;
    padding: 9px 14px 9px 12px !important;
    border: 1.5px solid rgba(30, 197, 255, 0.55) !important;
    border-radius: 8px !important;
    background: rgba(7, 17, 29, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(30, 197, 255, 0.10) !important;
    z-index: 100 !important;
    float: right !important;
    cursor: pointer !important;
  }
  .navbar-toggle:hover, .navbar-toggle:focus{
    background: rgba(30, 197, 255, 0.18) !important;
    border-color: rgba(30, 197, 255, 0.85) !important;
  }
  .navbar-toggle .icon-bar,
  .navbar-default .navbar-toggle .icon-bar,
  .navbar-inverse .navbar-toggle .icon-bar{
    background: #5dd6ff !important;
    width: 18px !important;
    height: 2.5px !important;
    margin-top: 4px !important;
    border-radius: 1.5px !important;
    box-shadow: 0 0 4px rgba(93, 214, 255, 0.4) !important;
  }
  .navbar-toggle .icon-bar:first-child{ margin-top: 0 !important; }
  .navbar-toggle::after{
    content: 'MENU';
    display: inline-block !important;
    font-family: 'JetBrains Mono', 'Inter', monospace !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.18em !important;
    color: #5dd6ff !important;
    margin-left: 4px !important;
  }

  /* ─── NAVBAR FULL-SCREEN OVERLAY ─────────────────────────────────────── */
  .navbar-collapse{
    position: fixed !important;
    top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #07111d 0%, #0a1424 60%, #0f1d33 100%) !important;
    transform: translateX(100%) !important;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: block !important;
    visibility: hidden !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 1100 !important;
    box-shadow: none !important;
    border: none !important;
  }
  .navbar-collapse.in, .navbar-collapse.collapsing{
    visibility: visible !important;
    transform: translateX(0) !important;
  }
  .navbar-collapse .navbar-nav{
    padding: max(env(safe-area-inset-top, 16px), 16px) 0
             max(env(safe-area-inset-bottom, 24px), 24px) 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }
  .navbar-collapse::before{
    content: 'CAPITAL ANTIFRAGILE';
    position: absolute !important;
    top: max(env(safe-area-inset-top, 22px), 22px) !important;
    left: 24px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 800 !important;
    font-size: 13.5px !important;
    letter-spacing: 0.18em !important;
    color: #eaf2fb !important;
    z-index: 2 !important;
    pointer-events: none !important;
  }
  /* IMPORTANT : .navbar-nav (Bootstrap) a display:none par défaut sur mobile,
     même quand .navbar-collapse est .in. On force display:block sur les items
     pour qu'ils apparaissent dans l'overlay fullscreen. */
  .navbar-collapse .navbar-nav{
    display: block !important;
    width: 100% !important;
    float: none !important;
  }
  .navbar-collapse .navbar-nav > li{
    display: block !important;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(30, 197, 255, 0.06) !important;
    position: relative !important;
  }
  .navbar-collapse .navbar-nav > li:last-child{ border-bottom: none !important; }
  .navbar-collapse .navbar-nav > li > a,
  .navbar-default .navbar-collapse .navbar-nav > li > a,
  .navbar-inverse .navbar-collapse .navbar-nav > li > a{
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 18px 24px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: #cfd8e8 !important;
    background: transparent !important;
    border: none !important;
    line-height: 1.3 !important;
    min-height: 56px !important;
    box-sizing: border-box !important;
    transition: background 0.15s ease, color 0.15s ease, padding 0.15s ease !important;
  }
  .navbar-collapse .navbar-nav > li > a::after{
    content: '›';
    display: inline-block !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 22px !important;
    font-weight: 300 !important;
    color: rgba(116, 185, 255, 0.35) !important;
    line-height: 1 !important;
    transition: transform 0.2s ease, color 0.2s ease !important;
  }
  .navbar-collapse .navbar-nav > li > a:hover,
  .navbar-collapse .navbar-nav > li > a:active,
  .navbar-collapse .navbar-nav > li > a:focus{
    background: rgba(30, 197, 255, 0.06) !important;
    color: #ffffff !important;
    padding-left: 28px !important;
  }
  .navbar-collapse .navbar-nav > li > a:hover::after{
    color: rgba(116, 185, 255, 0.85) !important;
    transform: translateX(3px) !important;
  }
  .navbar-collapse .navbar-nav > li.active > a,
  .navbar-default .navbar-collapse .navbar-nav > li.active > a,
  .navbar-inverse .navbar-collapse .navbar-nav > li.active > a{
    color: #5dd6ff !important;
    background: rgba(30, 197, 255, 0.08) !important;
    font-weight: 600 !important;
  }
  .navbar-collapse .navbar-nav > li.active > a::before{
    content: '';
    position: absolute !important;
    left: 0 !important; top: 12px !important; bottom: 12px !important;
    width: 3px !important;
    background: linear-gradient(180deg, #1ec5ff 0%, #5dd6ff 100%) !important;
    border-radius: 0 2px 2px 0 !important;
    box-shadow: 0 0 12px rgba(30, 197, 255, 0.6) !important;
  }
  .navbar-default .navbar-collapse .navbar-nav > li.active > a::after,
  .navbar-inverse .navbar-collapse .navbar-nav > li.active > a::after{
    content: '›' !important;
    position: static !important;
    left: auto !important; right: auto !important; top: auto !important; bottom: auto !important;
    width: auto !important; height: auto !important;
    background: none !important;
    box-shadow: none !important;
    color: #5dd6ff !important;
    font-size: 22px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    border-radius: 0 !important;
  }
  .navbar-collapse .navbar-nav::after{
    content: 'Capital Antifragile · 2026';
    display: block !important;
    text-align: center !important;
    padding: 32px 24px max(env(safe-area-inset-bottom, 20px), 20px) !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 9.5px !important;
    letter-spacing: 0.18em !important;
    color: rgba(116, 185, 255, 0.4) !important;
    text-transform: uppercase !important;
  }
  body:has(.navbar-collapse.in){ overflow: hidden !important; }
  .navbar-collapse.collapse,
  .navbar-collapse.collapsing{
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
    height: 100vh !important;
  }

  /* ─── LISIBILITÉ GLOBALE PAGES ───────────────────────────────────────── */
  /* Container Bootstrap : padding latéral correct sur mobile */
  .container, .container-fluid, .main-container{
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  /* Typographie de base */
  body{
    font-size: 15px !important;
    line-height: 1.55 !important;
  }
  h1{ font-size: clamp(22px, 5.5vw, 32px) !important; line-height: 1.2 !important; }
  h2{ font-size: clamp(19px, 4.5vw, 26px) !important; line-height: 1.25 !important; margin-top: 1.5em !important; }
  h3{ font-size: clamp(16px, 4vw, 22px) !important; line-height: 1.3 !important; }
  h4{ font-size: 15px !important; }
  p{ font-size: 14.5px !important; line-height: 1.6 !important; }

  /* Tables : scrollables horizontalement (sinon débordent et cassent layout) */
  .table-responsive, .table-wrapper, .dataTables_wrapper{
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  table:not(.no-mobile-scroll){
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    font-size: 12px !important;
  }
  table th, table td{
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  /* Images : never overflow */
  img:not(.no-mobile-fluid){
    max-width: 100% !important;
    height: auto !important;
  }

  /* Plotly graphs : forcer responsive et hauteur acceptable */
  .plotly, .plotly-graph-div, .js-plotly-plot{
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .plotly .main-svg{ max-width: 100% !important; }

  /* Hide native tooltip/labels qui dépassent */
  .plotly .legend{ font-size: 9px !important; }

  /* Tabs (Bootstrap nav-tabs) : scroll horizontal sur mobile */
  .nav-tabs, .nav-pills{
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
    border-bottom: 1px solid rgba(116,185,255,0.1) !important;
  }
  .nav-tabs > li, .nav-pills > li{
    flex-shrink: 0 !important;
    float: none !important;
  }
  .nav-tabs > li > a, .nav-pills > li > a{
    padding: 8px 12px !important;
    font-size: 12.5px !important;
  }

  /* DataTables filtres + pagination : stack vertical */
  .dataTables_filter, .dataTables_length, .dataTables_info, .dataTables_paginate{
    float: none !important;
    text-align: left !important;
    margin-bottom: 8px !important;
  }
  .dataTables_filter input{ width: 100% !important; max-width: none !important; }

  /* Iframes (TradingView etc.) : full-width */
  iframe{
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Hide elements explicitly tagged for desktop-only */
  .hide-on-mobile, .desktop-only{ display: none !important; }

  /* Pre/code blocks scrollables */
  pre, code{
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    font-size: 11.5px !important;
  }

  /* Cards / sections padding réduit */
  .card, .panel{ padding: 12px !important; }

  /* Boutons : tap-friendly */
  button, .btn, input[type="button"], input[type="submit"]{
    min-height: 44px !important;
  }

  /* Forms */
  input, select, textarea{
    font-size: 16px !important; /* Évite zoom iOS sur focus */
  }
}

/* ─── HORS @media : assurer que body.navbar-hidden ne casse pas le burger ─── */
body.navbar-hidden .navbar-toggle{ display: flex !important; }

/* ═════════════════════════════════════════════════════════════════════════
   MOBILE GLOBAL ROUND 2 — 2026-06-08 soir (anti-vides + titres)
   ════════════════════════════════════════════════════════════════════════
   Plusieurs pages ont des sections min-height 100vh qui créent des vides
   énormes sur mobile (Macro_Trends, TradFi_Tracker, Modeles_Valorisation,
   etc., 15 000+ px de hauteur CSS). On cap intelligemment.
   ════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px){
  /* ─── Cap les min-height excessifs (sections forcées 100vh) ──────────── */
  /* Sur desktop ces hauteurs forcées créent un effet "1 section = 1 écran"
     qui marche bien. Sur mobile portrait, elles font des vides énormes
     quand le contenu est court. On force max 60vh pour qu'il y ait toujours
     du contenu visible quand on scroll. */
  section[style*="min-height:100vh"],
  section[style*="min-height: 100vh"],
  div[style*="min-height:100vh"],
  div[style*="min-height: 100vh"],
  .nar-page,
  .l1-page,
  .bia-page,
  .per-page,
  .bt-v2-root{
    min-height: auto !important;
  }

  /* Sections génériques avec min-height vh : cap à 50vh max */
  section, .section, [class*="section-"]{
    min-height: auto !important;
  }

  /* Plotly charts : limiter hauteur pour éviter 800px+ vides sur mobile */
  .plotly-graph-div,
  .js-plotly-plot,
  div[class*="plotly"]{
    max-height: 480px !important;
    min-height: 0 !important;
  }

  /* Charts custom (Chart.js, lightweight-charts) : pareil */
  .chartjs-render-monitor,
  canvas{
    max-width: 100% !important;
  }
  .chart-container,
  .chart-wrap,
  [class*="chart-wrap"]:not(.bm-chartwrap){
    max-height: 480px !important;
  }

  /* ─── Titres h1 trop longs : force wrap propre ──────────────────────── */
  h1, .h1, [class*="hero-title"], [class*="page-title"]{
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    -webkit-hyphens: auto !important;
    max-width: 100% !important;
    font-size: clamp(20px, 5.5vw, 32px) !important;
    line-height: 1.15 !important;
  }
  /* Spécifique titres avec span colorés (gradient text) : tenir sur une ou
     2 lignes au max, pas plus */
  h1 > span, h1 > em, h1 > b{
    display: inline !important;
    max-width: 100% !important;
  }

  /* ─── Padding sections excessif → réduire ───────────────────────────── */
  section, .section, .container-fluid > *, .main-container > *{
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  /* Header pages : réduire padding-top excessif (souvent 80-120px desktop) */
  .page-header, .ca-page-header, [class*="-hero"]{
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }

  /* Plus de marges aggressives mobile pour blocs */
  .row{ margin-left: 0 !important; margin-right: 0 !important; }
  .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6,
  .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12,
  .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6,
  .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12{
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}

/* ═════════════════════════════════════════════════════════════════════════
   NAVBAR MOBILE POLISH ROUND 3 — 2026-06-08 (UX app-native)
   ════════════════════════════════════════════════════════════════════════
   - Burger → X transformation (affordance close claire)
   - Icônes Font Awesome devant chaque item (scan visuel)
   - Header sticky brand + close en haut du menu
   - Animation cubic-bezier polish
   ════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  /* ─── BURGER → X transformation quand menu ouvert ─────────────────────── */
  /* On utilise body:has(.navbar-collapse.in) pour détecter l'état */
  body:has(.navbar-collapse.in) .navbar-toggle{
    /* Quand menu ouvert : déplace le bouton dans l'overlay */
    position: fixed !important;
    top: max(env(safe-area-inset-top, 14px), 14px) !important;
    right: 14px !important;
    z-index: 1200 !important;
    margin: 0 !important;
    background: rgba(30, 197, 255, 0.12) !important;
    border-color: rgba(30, 197, 255, 0.7) !important;
  }
  /* Masque le label MENU quand ouvert (remplacé par X visuel) */
  body:has(.navbar-collapse.in) .navbar-toggle::after{
    content: 'FERMER' !important;
    color: #5dd6ff !important;
  }
  /* Transform 3 barres → X */
  body:has(.navbar-collapse.in) .navbar-toggle .icon-bar{
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
  }
  body:has(.navbar-collapse.in) .navbar-toggle .icon-bar:nth-child(1),
  body:has(.navbar-collapse.in) .navbar-toggle .icon-bar:nth-child(2){
    /* Première barre devient ligne haut du X */
    transform: translateY(6px) rotate(45deg) !important;
  }
  body:has(.navbar-collapse.in) .navbar-toggle .icon-bar:nth-child(3){
    /* Barre du milieu : masquée */
    opacity: 0 !important;
  }
  body:has(.navbar-collapse.in) .navbar-toggle .icon-bar:nth-child(4){
    /* Dernière barre devient ligne bas du X */
    transform: translateY(-6px) rotate(-45deg) !important;
  }
  /* Animation des barres au close aussi (transition baseline) */
  .navbar-toggle .icon-bar{
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
  }

  /* ─── ICÔNES Font Awesome devant chaque onglet (via attribute selector) ─── */
  /* On utilise content: '\fXXX' avec Font Awesome 6 Free Solid (font-weight 900) */
  .navbar-collapse .navbar-nav > li > a{
    position: relative !important;
    padding-left: 56px !important; /* libère 32px pour icon + 12px gap */
  }
  .navbar-collapse .navbar-nav > li > a::before{
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', FontAwesome !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-size: 14px !important;
    color: rgba(116, 185, 255, 0.55) !important;
    width: 24px !important;
    text-align: center !important;
    position: absolute !important;
    left: 22px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    transition: color 0.2s ease !important;
  }
  /* Hover/active : icône cyan brighter */
  .navbar-collapse .navbar-nav > li > a:hover::before,
  .navbar-collapse .navbar-nav > li.active > a::before{
    color: #5dd6ff !important;
  }
  /* Override le ::before active de la règle ROUND 2 (border-left cyan) qui
     entre en conflit avec mon nouveau ::before icon. On déplace en ::after-2
     impossible, donc on utilise border-left direct sur l'<a>. */
  .navbar-collapse .navbar-nav > li.active > a{
    border-left: 3px solid #5dd6ff !important;
    box-shadow: inset 0 0 14px rgba(30, 197, 255, 0.12),
                -3px 0 12px -3px rgba(30, 197, 255, 0.5) !important;
  }
  /* Cancel le previous ::before active (border accent) qui crée doublon icon */
  .navbar-collapse .navbar-nav > li.active > a::before{
    /* Remet le ::before en mode icon FA (pas border accent) */
    content: '\f015' !important; /* default: home, sera override par règle href spécifique */
  }

  /* MAPPING ICÔNES PAR ONGLET (via href) */
  .navbar-collapse a[href="index.html"]::before                       { content: '\f015' !important; } /* home */
  .navbar-collapse a[href="Indicateur.html"]::before                  { content: '\f200' !important; } /* chart-pie */
  .navbar-collapse a[href="Bulle_IA.html"]::before                    { content: '\f544' !important; } /* robot */
  .navbar-collapse a[href="Cycle_Tracker.html"]::before               { content: '\f1da' !important; } /* history */
  .navbar-collapse a[href="Valorisation_L1_Blockchain.html"]::before  { content: '\f0c1' !important; } /* link */
  .navbar-collapse a[href="Modeles_Valorisation_Crypto.html"]::before { content: '\f201' !important; } /* chart-line */
  .navbar-collapse a[href="Comparaison_PER_Crypto_TradFi.html"]::before { content: '\f24e' !important; } /* balance-scale */
  .navbar-collapse a[href="Macro_Trends.html"]::before                { content: '\f201' !important; } /* chart-line */
  .navbar-collapse a[href="Correlations_Macro_Crypto.html"]::before   { content: '\f5fd' !important; } /* layer-group */
  .navbar-collapse a[href="OrderFlow_Crypto.html"]::before            { content: '\f362' !important; } /* exchange */
  .navbar-collapse a[href="Stablecoins_Flows.html"]::before           { content: '\f155' !important; } /* dollar */
  .navbar-collapse a[href="ETF_Crypto.html"]::before                  { content: '\f4d3' !important; } /* funnel-dollar */
  .navbar-collapse a[href="News_Crypto.html"]::before                 { content: '\f1ea' !important; } /* newspaper */
  .navbar-collapse a[href="Google_Trends.html"]::before               { content: '\f002' !important; } /* search */
  .navbar-collapse a[href="Backtest.html"]::before                    { content: '\f0d0' !important; } /* magic */
  .navbar-collapse a[href="Narrative_Tracker.html"]::before           { content: '\f02b' !important; } /* tag */
  .navbar-collapse a[href="TradFi_Tracker.html"]::before              { content: '\f19c' !important; } /* university */
  .navbar-collapse a[href="Ecosysteme_Crypto.html"]::before           { content: '\f5fc' !important; } /* sitemap */
  .navbar-collapse a[href="AI_Models.html"]::before                   { content: '\f7d9' !important; } /* microchip */

  /* ─── HEADER STICKY EN HAUT DU MENU (brand + indicateur) ────────────────── */
  /* Le brand "CAPITAL ANTIFRAGILE" déjà via ::before, on l'enrichit */
  .navbar-collapse::before{
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: max(env(safe-area-inset-top, 60px), 60px) !important;
    width: 100% !important;
    padding: max(env(safe-area-inset-top, 18px), 18px) 24px 0 !important;
    background: linear-gradient(180deg, rgba(7, 17, 29, 0.95) 0%, rgba(7, 17, 29, 0.85) 80%, transparent 100%) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(30, 197, 255, 0.08) !important;
    z-index: 1 !important;
    box-sizing: border-box !important;
  }
  /* Pad le contenu pour pas qu'il passe sous le sticky header */
  .navbar-collapse .navbar-nav{
    padding-top: calc(max(env(safe-area-inset-top, 60px), 60px) + 12px) !important;
  }
}

/* ═════════════════════════════════════════════════════════════════════════
   MOBILE NAV ENHANCE — Round 4 (2026-06-08 fin de soirée)
   ════════════════════════════════════════════════════════════════════════
   CSS pour le JS d'enhancement (mobile_nav_enhance.js) :
   - Section headers (catégories : Tableaux de bord, Crypto, TradFi, etc.)
   - Search input + clear button
   - Tab bar bottom fixed (Accueil, Indicateur, Bulle IA, Backtest, Menu)
   - Animation overlay accélérée (200ms au lieu de 320ms)
   ════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  /* ─── ANIMATION OVERLAY SNAPPY 200ms ─────────────────────────────────── */
  .navbar-collapse,
  .navbar-collapse.collapse,
  .navbar-collapse.collapsing{
    transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1) !important;
  }

  /* ─── SECTION HEADERS (catégories) ───────────────────────────────────── */
  .navbar-collapse .navbar-nav > li.mne-section-header{
    display: block !important;
    width: 100% !important;
    padding: 18px 24px 6px !important;
    margin: 0 !important;
    border: none !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.22em !important;
    text-transform: uppercase !important;
    color: rgba(116, 185, 255, 0.45) !important;
    background: transparent !important;
    pointer-events: none !important;
  }
  /* Premier header : moins de padding-top (collé au header sticky) */
  .navbar-collapse .navbar-nav > li.mne-section-header:first-of-type{
    padding-top: 12px !important;
  }

  /* ─── SEARCH BAR EN HAUT DU MENU ─────────────────────────────────────── */
  .navbar-collapse .navbar-nav > li.mne-search-wrap{
    display: block !important;
    width: 100% !important;
    padding: 8px 14px 4px !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    /* sticky pendant le scroll du menu */
    position: sticky !important;
    top: max(env(safe-area-inset-top, 60px), 60px) !important;
    z-index: 2 !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }
  .navbar-collapse .mne-search{
    position: relative !important;
    width: 100% !important;
  }
  .navbar-collapse .mne-search-input{
    width: 100% !important;
    padding: 11px 38px 11px 38px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(30, 197, 255, 0.18) !important;
    border-radius: 10px !important;
    color: #eaf2fb !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) inset !important;
    transition: border-color 0.2s ease, background 0.2s ease !important;
  }
  .navbar-collapse .mne-search-input::placeholder{
    color: rgba(180, 200, 230, 0.45) !important;
  }
  .navbar-collapse .mne-search-input:focus{
    border-color: rgba(30, 197, 255, 0.5) !important;
    background: rgba(255, 255, 255, 0.09) !important;
  }
  /* Loupe icon (Font Awesome via ::before sur span.mne-search-icon) */
  .navbar-collapse .mne-search-icon::before{
    content: '\f002' !important;  /* magnifying-glass */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', FontAwesome !important;
    font-weight: 900 !important;
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: rgba(116, 185, 255, 0.55) !important;
    font-size: 13px !important;
    pointer-events: none !important;
  }
  /* Clear button (×) */
  .navbar-collapse .mne-search-clear{
    position: absolute !important;
    right: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    border: none !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cfd8e8 !important;
    font-size: 18px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    transition: background 0.15s ease !important;
  }
  .navbar-collapse .mne-search-wrap.has-query .mne-search-clear{
    display: flex !important;
  }
  .navbar-collapse .mne-search-clear:hover{
    background: rgba(255, 255, 255, 0.15) !important;
  }

  /* ─── TAB BAR BOTTOM (style Instagram/Twitter) ───────────────────────── */
  .mne-tabbar{
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 1050 !important;
    background: linear-gradient(180deg, rgba(7, 17, 29, 0.92) 0%, rgba(7, 17, 29, 0.98) 100%) !important;
    backdrop-filter: blur(14px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(160%) !important;
    border-top: 1px solid rgba(30, 197, 255, 0.15) !important;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.4) !important;
    padding: 6px 4px max(env(safe-area-inset-bottom, 6px), 6px) !important;
    box-sizing: border-box !important;
  }
  .mne-tab{
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 6px 4px !important;
    min-height: 50px !important;
    text-decoration: none !important;
    color: rgba(180, 200, 230, 0.6) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em !important;
    transition: color 0.18s ease, background 0.18s ease !important;
    border-radius: 8px !important;
    margin: 0 2px !important;
  }
  .mne-tab:hover, .mne-tab:active, .mne-tab:focus{
    color: #eaf2fb !important;
    background: rgba(30, 197, 255, 0.07) !important;
    text-decoration: none !important;
  }
  .mne-tab.active{
    color: #5dd6ff !important;
    background: rgba(30, 197, 255, 0.10) !important;
  }
  .mne-tab-icon{
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', FontAwesome !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-size: 18px !important;
    line-height: 1 !important;
  }
  .mne-tab-label{
    font-size: 10px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }
  .mne-tab.active .mne-tab-icon{
    color: #5dd6ff !important;
  }
  /* Decale le contenu du body pour pas qu'il passe SOUS la tab bar */
  body{
    padding-bottom: calc(56px + max(env(safe-area-inset-bottom, 6px), 6px)) !important;
  }
}

/* Desktop : pas de tabbar */
@media (min-width: 768px) {
  .mne-tabbar{ display: none !important; }
}
