/* ==========================================================================
   FinaPilot — design system « Éclat »

   Parti pris : la lumière. Un papier clair et chaud, de l'encre profonde,
   et la couleur tenue pour ce qui compte — la marque, la donnée, l'action.
   Les surfaces flottent sur des ombres en couches plutôt que sur des traits ;
   les rayons sont généreux ; la typographie respire.

   Le thème sombre n'a pas disparu : il est passé en option, sous
   `[data-theme="dark"]`. Toutes les couleurs sont des variables, donc une
   seule bascule suffit à retourner le site.
   ========================================================================== */

:root {
  color-scheme: light;

  /* ------------------------------------------------------------ papier */
  --paper: #FBFAF9;          /* fond de page, blanc chaud */
  --paper-2: #F4F2EF;        /* creux, bandeaux */
  --surface: #FFFFFF;        /* cartes */
  --surface-2: #FBFAF9;

  /* ------------------------------------------------------------- encre */
  --ink: #0B0E14;
  --ink-2: #545C6B;
  --ink-3: #8A92A2;
  --ink-inv: #FFFFFF;

  /* ------------------------------------------------------------ traits */
  --line: rgba(11, 14, 20, 0.08);
  --line-2: rgba(11, 14, 20, 0.14);
  --line-3: rgba(11, 14, 20, 0.24);

  /* ------------------------------------------------------------ accent
     Un indigo électrique, et sa version claire pour les fonds. */
  --accent: #4F3DF5;
  --accent-2: #7B6BFF;
  --accent-ink: #2A1FA8;
  --accent-soft: rgba(79, 61, 245, 0.09);
  --accent-line: rgba(79, 61, 245, 0.24);
  --accent-glow: rgba(79, 61, 245, 0.28);

  /* ------------------------------------------------------------ marché */
  --up: #00A16A;
  --up-ink: #00754D;
  --up-soft: rgba(0, 161, 106, 0.10);
  --down: #E0364A;
  --down-ink: #A81F30;
  --down-soft: rgba(224, 54, 74, 0.09);
  --warn: #C8791A;
  --warn-soft: rgba(245, 165, 36, 0.12);

  /* --------------------------------------------------------- dégradés
     La palette vive du site : elle n'apparaît que par touches — halo du
     héros, liserés, états actifs. Jamais en aplat sur du texte long. */
  --grad: linear-gradient(120deg, #4F3DF5 0%, #8B5CF6 34%, #EC4899 66%, #FB923C 100%);
  --grad-soft: linear-gradient(120deg, rgba(79,61,245,.16), rgba(139,92,246,.14) 34%, rgba(236,72,153,.12) 66%, rgba(251,146,60,.12));
  --grad-up: linear-gradient(120deg, #00A16A, #34D399);
  --grad-down: linear-gradient(120deg, #E0364A, #FB7185);

  /* ------------------------------------------------------------ ombres
     Trois couches : contact, portée, ambiance. C'est ce qui fait « posé »
     plutôt que « collé ». */
  --sh-1: 0 1px 2px rgba(11, 14, 20, 0.05), 0 2px 6px rgba(11, 14, 20, 0.04);
  --sh-2: 0 1px 2px rgba(11, 14, 20, 0.05), 0 6px 16px rgba(11, 14, 20, 0.06), 0 14px 40px rgba(11, 14, 20, 0.05);
  --sh-3: 0 2px 4px rgba(11, 14, 20, 0.06), 0 12px 28px rgba(11, 14, 20, 0.09), 0 32px 72px rgba(11, 14, 20, 0.10);
  --sh-accent: 0 6px 18px rgba(79, 61, 245, 0.28), 0 16px 44px rgba(79, 61, 245, 0.18);

  /* ------------------------------------------------------------ rayons */
  --r-xs: 6px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --nav-h: 68px;
  --pad: clamp(20px, 5vw, 52px);
  --max: 1280px;
  --rail: 0px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo,
    Consolas, monospace;

  /* Courbes : une élastique franche pour les entrées, une douce pour le reste */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================================== thème sombre */

[data-theme="dark"] {
  color-scheme: dark;

  --paper: #0A0C12;
  --paper-2: #0E1119;
  --surface: #131722;
  --surface-2: #171C28;

  --ink: #F2F4F8;
  --ink-2: #A2AABB;
  --ink-3: #6C7484;
  --ink-inv: #0A0C12;

  --line: rgba(242, 244, 248, 0.10);
  --line-2: rgba(242, 244, 248, 0.16);
  --line-3: rgba(242, 244, 248, 0.28);

  --accent: #7B6BFF;
  --accent-2: #9C90FF;
  --accent-ink: #C7C0FF;
  --accent-soft: rgba(123, 107, 255, 0.14);
  --accent-line: rgba(123, 107, 255, 0.34);
  --accent-glow: rgba(123, 107, 255, 0.40);

  --up: #2CD68F;
  --up-ink: #6EE7B7;
  --up-soft: rgba(44, 214, 143, 0.13);
  --down: #FF5C6E;
  --down-ink: #FDA4AF;
  --down-soft: rgba(255, 92, 110, 0.13);
  --warn: #F5B942;
  --warn-soft: rgba(245, 185, 66, 0.14);

  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  --sh-2: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 20px rgba(0, 0, 0, 0.4);
  --sh-3: 0 2px 6px rgba(0, 0, 0, 0.6), 0 20px 50px rgba(0, 0, 0, 0.5);
  --sh-accent: 0 6px 20px rgba(123, 107, 255, 0.34), 0 18px 48px rgba(123, 107, 255, 0.22);

  --grad-soft: linear-gradient(120deg, rgba(123,107,255,.22), rgba(139,92,246,.18) 34%, rgba(236,72,153,.14) 66%, rgba(251,146,60,.12));
}

/* --------------------------------------------------------------- reset -- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  background: var(--paper);
}

body {
  margin: 0;
  position: relative;
  isolation: isolate;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 640;
  letter-spacing: -0.032em;
  line-height: 1.1;
  text-wrap: balance;
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
::selection { background: var(--accent); color: #fff; }

/* ============================================================== décor === */

/* Aurore : trois voiles de couleur qui dérivent lentement. C'est elle qui
   empêche le fond clair d'être un simple aplat blanc. */
.aurora {
  position: fixed; inset: -25%; z-index: -3; pointer-events: none;
  filter: blur(80px) saturate(130%);
  opacity: 0.5;
}
[data-theme="dark"] .aurora { opacity: 0.32; filter: blur(90px) saturate(150%); }
.aurora span {
  position: absolute; display: block;
  width: 46vw; height: 46vw; min-width: 380px; min-height: 380px;
  border-radius: 50%;
  will-change: transform;
}
.aurora span:nth-child(1) { background: radial-gradient(circle, #6D5BFF, transparent 68%); top: -6%; left: 4%; animation: drift-a 26s ease-in-out infinite; }
.aurora span:nth-child(2) { background: radial-gradient(circle, #EC4899, transparent 68%); top: 18%; right: -4%; animation: drift-b 32s ease-in-out infinite; }
.aurora span:nth-child(3) { background: radial-gradient(circle, #FB923C, transparent 68%); bottom: -8%; left: 28%; animation: drift-c 38s ease-in-out infinite; }

@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(12vw, 8vh, 0) scale(1.18); }
}
@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.1); }
  50% { transform: translate3d(-14vw, 12vh, 0) scale(0.92); }
}
@keyframes drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(0.95); }
  50% { transform: translate3d(10vw, -10vh, 0) scale(1.2); }
}

#backdrop {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -2; opacity: 0; pointer-events: none;
  transition: opacity 1.8s var(--ease);
}
#backdrop.is-ready { opacity: 0.55; }
[data-theme="dark"] #backdrop.is-ready { opacity: 0.85; }

/* Grain : très discret en clair, il casse juste le lissé des dégradés. */
.grain {
  position: fixed; inset: -50%; z-index: 3; pointer-events: none;
  opacity: 0.022; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 6s steps(6) infinite;
}
[data-theme="dark"] .grain { mix-blend-mode: overlay; opacity: 0.05; }
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-4%, 3%); }
  50% { transform: translate(3%, -5%); }
  75% { transform: translate(-3%, -2%); }
  100% { transform: translate(0, 0); }
}

/* Halo qui suit le curseur : la page réagit à la présence. */
.spot {
  position: fixed; z-index: -1; pointer-events: none;
  width: 620px; height: 620px; margin: -310px 0 0 -310px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 62%);
  opacity: 0; filter: blur(30px);
  transition: opacity 0.7s var(--ease);
}
.spot.is-on { opacity: 0.5; }

/* Battement du marché + progression de lecture, sur un même filet */
@property --pulse { syntax: '<percentage>'; inherits: false; initial-value: 50%; }
.pulse {
  position: fixed; inset: 0 auto auto 0; z-index: 70;
  height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--up) var(--pulse, 50%), var(--down) var(--pulse, 50%));
  opacity: 0.85;
  transition: --pulse 1.4s var(--ease);
}
.readbar {
  position: fixed; inset: 3px auto auto 0; z-index: 71;
  height: 2px; width: 100%; transform-origin: left; transform: scaleX(0);
  background: var(--grad);
}
@supports (animation-timeline: scroll()) {
  .readbar { animation: draw-x linear both; animation-timeline: scroll(root block); }
}

/* --------------------------------------------------------- utilitaires -- */

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }

.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.up { color: var(--up-ink); }
.down { color: var(--down-ink); }
[data-theme="dark"] .up { color: var(--up); }
[data-theme="dark"] .down { color: var(--down); }
.dim { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Micro-titre : une pastille de couleur plutôt qu'un filet gris */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent-ink);
}
[data-theme="dark"] .eyebrow { color: var(--accent-2); }
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--grad); flex: none;
}

.h-display {
  font-size: clamp(2.9rem, 7.6vw, 5.8rem);
  letter-spacing: -0.05em; line-height: 0.96; font-weight: 660;
}
.h1 { font-size: clamp(2.1rem, 4.8vw, 3.5rem); letter-spacing: -0.042em; }
.h2 { font-size: clamp(1.5rem, 2.9vw, 2.15rem); letter-spacing: -0.034em; }
.h3 { font-size: clamp(1.08rem, 1.7vw, 1.28rem); letter-spacing: -0.024em; }
.lede { font-size: clamp(1.04rem, 1.4vw, 1.2rem); color: var(--ink-2); max-width: 62ch; line-height: 1.62; }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }

/* Le mot mis en couleur : dégradé sur le texte, réservé aux titres */
.shine {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

section { position: relative; }
.section { padding-block: clamp(68px, 10vw, 132px); }
.section-tight { padding-block: clamp(44px, 6vw, 76px); }

.head { max-width: 780px; margin-bottom: clamp(32px, 4vw, 52px); }
.head .h1 + .lede, .head .h2 + .lede { margin-top: 18px; }
.head .eyebrow + * { margin-top: 22px; }

.runhead {
  position: relative;
  display: flex; align-items: baseline; gap: 16px;
  padding-bottom: 14px; margin-bottom: clamp(28px, 3.6vw, 44px);
  border-bottom: 1px solid var(--line);
}
.runhead .idx {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  color: transparent; background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  flex: none;
}
.runhead .lbl {
  font-size: 12px; font-weight: 650; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-2);
}
.runhead .meta { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g-3, .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------- boutons -- */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-line: var(--line-2);
  --btn-sh: var(--sh-1);
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; min-height: 46px;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-line); border-radius: 999px;
  box-shadow: var(--btn-sh);
  font-size: 15px; font-weight: 570; letter-spacing: -0.012em;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.35s var(--spring), box-shadow 0.35s var(--ease),
              background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s;
}
.btn:hover { transform: translateY(-2px); --btn-sh: var(--sh-2); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Reflet qui balaie le bouton au survol */
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}
.btn:hover::after { transform: translateX(120%); }

.btn-primary {
  --btn-bg: var(--grad);
  --btn-fg: #fff;
  --btn-line: transparent;
  --btn-sh: var(--sh-accent);
  background-size: 160% 100%;
  font-weight: 620;
}
.btn-primary:hover { background-position: 100% 0; }

.btn-ghost { --btn-bg: transparent; --btn-line: transparent; --btn-sh: none; color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); --btn-bg: var(--accent-soft); }

.btn-sm { padding: 9px 16px; min-height: 38px; font-size: 13.5px; }
.btn-lg { padding: 17px 30px; min-height: 56px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-up { --btn-bg: var(--grad-up); --btn-fg: #fff; --btn-line: transparent; --btn-sh: 0 6px 18px rgba(0,161,106,.3); font-weight: 620; }
.btn-down { --btn-bg: var(--grad-down); --btn-fg: #fff; --btn-line: transparent; --btn-sh: 0 6px 18px rgba(224,54,74,.3); font-weight: 620; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 580; color: var(--accent-ink);
  padding-bottom: 3px;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1.5px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease), color 0.3s;
}
[data-theme="dark"] .link-arrow { color: var(--accent-2); }
.link-arrow:hover { background-size: 100% 1.5px; }
.link-arrow svg { transition: transform 0.35s var(--spring); }
.link-arrow:hover svg { transform: translateX(5px); }

/* ------------------------------------------------------------ surfaces -- */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(22px, 2.5vw, 30px);
  box-shadow: var(--sh-1);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease),
              border-color 0.35s var(--ease);
}
.card-flat { background: var(--paper-2); box-shadow: none; }
.card-pad-sm { padding: 20px; }

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-3);
  border-color: var(--accent-line);
}

/* Liseré en dégradé qui se révèle au survol */
.card-mark::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; padding: 1.5px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.card-mark:hover::before { opacity: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 12px; font-weight: 580; letter-spacing: 0.01em;
  color: var(--ink-2); white-space: nowrap;
}
.badge-up { background: var(--up-soft); border-color: transparent; color: var(--up-ink); }
.badge-down { background: var(--down-soft); border-color: transparent; color: var(--down-ink); }
.badge-accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.badge-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
[data-theme="dark"] .badge-up { color: var(--up); }
[data-theme="dark"] .badge-down { color: var(--down); }
[data-theme="dark"] .badge-accent { color: var(--accent-2); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot-live { background: var(--up); animation: pulse-dot 2.2s ease-out infinite; }
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(0, 161, 106, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(0, 161, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 161, 106, 0); }
}

/* ----------------------------------------------------------- navigation -- */

.nav {
  position: fixed; inset: 5px 0 auto 0; z-index: 60;
  height: var(--nav-h); display: flex; align-items: center;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease),
              backdrop-filter 0.4s, height 0.4s var(--ease);
}
.nav.is-stuck {
  height: 58px;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 var(--line), 0 8px 28px rgba(11, 14, 20, 0.06);
}
[data-theme="dark"] .nav.is-stuck { box-shadow: 0 1px 0 var(--line), 0 8px 28px rgba(0, 0, 0, 0.4); }
.nav .wrap { display: flex; align-items: center; gap: 12px; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 660; letter-spacing: -0.038em; font-size: 19px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad); background-size: 150% 150%;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(79, 61, 245, 0.34);
  transition: transform 0.5s var(--spring);
  animation: shift-grad 8s ease-in-out infinite;
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }
.brand-mark svg { width: 17px; height: 17px; }
.brand-mark svg * { stroke: #fff !important; }
@keyframes shift-grad {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 30px; }
.nav-links a {
  position: relative; padding: 9px 15px; border-radius: 999px;
  font-size: 15px; font-weight: 520; color: var(--ink-2);
  transition: color 0.25s, background 0.25s;
}
.nav-links a:hover { color: var(--ink); background: var(--accent-soft); }
.nav-links a.is-active { color: var(--ink); font-weight: 600; }
.nav-links a.is-active::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 3px;
  height: 2px; border-radius: 2px; background: var(--grad);
}
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; }

/* Bascule de thème */
.theme-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px;
  cursor: pointer; box-shadow: var(--sh-1);
  transition: transform 0.5s var(--spring), color 0.3s, border-color 0.3s;
}
.theme-btn:hover { transform: rotate(-18deg) scale(1.06); color: var(--accent); border-color: var(--accent-line); }
.theme-btn svg { width: 17px; height: 17px; }

@media (max-width: 980px) {
  .nav-links {
    position: fixed; inset: calc(var(--nav-h) + 5px) 10px auto 10px;
    flex-direction: column; align-items: stretch; gap: 2px;
    margin: 0; padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--sh-3);
    transform: translateY(-12px) scale(0.98); opacity: 0; pointer-events: none;
    transition: opacity 0.3s var(--ease), transform 0.4s var(--spring);
  }
  .nav-links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 14px 16px; font-size: 16px; border-radius: var(--r-sm); }
  .nav-links a.is-active::after { display: none; }
  .nav-links a.is-active { background: var(--accent-soft); }
  .nav-toggle {
    display: inline-grid; place-items: center;
    width: 40px; height: 40px;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line-2); border-radius: 999px;
    box-shadow: var(--sh-1); cursor: pointer;
  }
  .nav-actions .btn { padding: 10px 16px; min-height: 40px; font-size: 14px; }
  .hide-sm { display: none !important; }
}
@media (max-width: 560px) {
  .nav-actions .btn-primary { display: none; }
}

.rail { display: none; }

/* --------------------------------------------------------------- héros -- */

.hero {
  position: relative;
  min-height: min(94vh, 900px);
  display: flex; align-items: center;
  padding-top: calc(var(--nav-h) + 56px);
  padding-bottom: clamp(48px, 7vw, 96px);
}
#scene {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; opacity: 0; transition: opacity 1.6s var(--ease);
}
#scene.is-ready { opacity: 1; }

/* Les pièces vivent dans la bande centrale : jamais sur le titre à gauche,
   jamais sur le panneau de cotations à droite. */
@media (min-width: 1021px) {
  /* Les pièces occupent toute la moitié droite : le panneau de cotations,
     opaque, les recouvre là où il se trouve — inutile de les masquer deux
     fois. Seul le titre, à gauche, est protégé. */
  #scene {
    -webkit-mask-image: linear-gradient(100deg, transparent 38%, #000 56%);
    mask-image: linear-gradient(100deg, transparent 38%, #000 56%);
  }
}
/* Le panneau passe devant les pièces */
.hero-side { position: relative; z-index: 3; }
.hero .wrap { position: relative; z-index: 2; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(28px, 4vw, 64px); align-items: center; }
@media (max-width: 1020px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

.hero-copy .h-display { margin-top: 26px; max-width: 14ch; }
.hero-lede { max-width: 48ch; margin-top: 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 36px;
  font-size: 13.5px; color: var(--ink-2);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { color: var(--up); }

/* La colonne de droite garde son propre empilement : sans ce conteneur,
   l'étiquette et le panneau se chevauchaient sur les écrans étroits. */
.hero-side { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }

/* Colonne de cotations : une carte flottante, pas un tableau */
.hero-quotes {
  width: 300px; display: grid; gap: 2px;
  padding: 10px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
}
@media (max-width: 1020px) { .hero-quotes { width: 100%; max-width: 440px; } }
.hero-quote {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 3px 12px;
  padding: 12px 14px; border-radius: var(--r-sm);
  transition: background 0.25s;
}
.hero-quote:hover { background: var(--accent-soft); }
.hero-quote b { font-size: 14px; font-weight: 620; letter-spacing: -0.01em; }
.hero-quote .px { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.hero-quote .ch { font-family: var(--mono); font-size: 12px; grid-column: 2; }
.hero-quote .nm { font-size: 12px; color: var(--ink-3); grid-column: 1; }

/* -------------------------------------------------------------- ticker -- */

.ticker {
  position: relative; overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--surface);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker-track { display: flex; width: max-content; animation: slide 64s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }
.ticker-item {
  display: inline-flex; align-items: baseline; gap: 10px;
  padding: 14px 24px; white-space: nowrap; font-size: 14px;
  border-right: 1px solid var(--line);
  transition: background 0.25s;
}
.ticker-item:hover { background: var(--accent-soft); }
.ticker-item b { font-weight: 640; letter-spacing: -0.01em; }
.ticker-item .px { font-family: var(--mono); color: var(--ink-2); }

/* -------------------------------------------------------------- tables -- */

.table-wrap {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--sh-1);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table.mkt { width: 100%; border-collapse: collapse; min-width: 780px; }
table.mkt th, table.mkt td {
  padding: 15px 20px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.mkt th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface);
  font-size: 11.5px; font-weight: 640; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); user-select: none;
}
table.mkt td { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 14px; }
table.mkt th.sortable { cursor: pointer; transition: color 0.2s; }
table.mkt th.sortable:hover { color: var(--accent); }
table.mkt th[aria-sort] { color: var(--accent); }
table.mkt th:first-child, table.mkt td:first-child { text-align: left; }
table.mkt tbody tr {
  cursor: pointer;
  transition: background 0.2s var(--ease), box-shadow 0.2s;
}
table.mkt tbody tr:hover { background: var(--accent-soft); }
table.mkt tbody tr:last-child td { border-bottom: 0; }

/* Liseré coloré à gauche de la ligne survolée */
table.mkt tbody tr td:first-child { position: relative; }
table.mkt tbody tr td:first-child::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad); transform: scaleY(0); transform-origin: center;
  transition: transform 0.3s var(--spring);
}
table.mkt tbody tr:hover td:first-child::before { transform: scaleY(1); }

.asset { display: flex; align-items: center; gap: 13px; }
.asset-logo {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--paper-2); border: 1px solid var(--line);
  font-family: var(--sans); font-size: 11.5px; font-weight: 700;
  letter-spacing: -0.03em; color: var(--ink-2);
  overflow: hidden;
  transition: transform 0.4s var(--spring);
}
tr:hover .asset-logo { transform: scale(1.1) rotate(-4deg); }
.asset-logo img { width: 100%; height: 100%; object-fit: cover; }
.asset-name { display: flex; flex-direction: column; line-height: 1.35; }
.asset-name b { font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: -0.02em; }
.asset-name span { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }

.chg { font-weight: 620; font-size: 14px; }
.spark { width: 110px; height: 32px; display: inline-block; vertical-align: middle; }

/* Clignotement de cotation */
@keyframes flash-up { 0% { background-color: var(--up-soft); } 100% { background-color: transparent; } }
@keyframes flash-down { 0% { background-color: var(--down-soft); } 100% { background-color: transparent; } }
.flash-up { animation: flash-up 1.2s var(--ease-out); }
.flash-down { animation: flash-down 1.2s var(--ease-out); }

/* ---------------------------------------------------------------- tabs -- */

.tabs {
  display: flex; gap: 4px; max-width: 100%; padding: 5px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 999px;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 95%, transparent);
  mask-image: linear-gradient(90deg, #000 95%, transparent);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  padding: 9px 18px; border: 0; border-radius: 999px; background: none; flex: none;
  font-size: 13.5px; font-weight: 560; color: var(--ink-2);
  cursor: pointer; scroll-snap-align: start;
  transition: color 0.25s, background 0.3s var(--ease), box-shadow 0.3s;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] {
  background: var(--surface); color: var(--ink);
  box-shadow: var(--sh-1); font-weight: 620;
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 24px; }
.toolbar .grow { flex: 1 1 240px; }

.field { position: relative; display: flex; align-items: center; }
.field svg { position: absolute; left: 16px; width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
input[type="search"], input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 13px 18px;
  font-size: 15px;
  box-shadow: var(--sh-1);
  transition: border-color 0.25s, box-shadow 0.25s;
  appearance: none;
}
textarea { border-radius: var(--r); font-family: var(--mono); font-size: 12px; }
.field input { padding-left: 44px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
input::placeholder { color: var(--ink-3); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%238A92A2' stroke-width='1.8'%3E%3Cpath d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; background-size: 11px;
  padding-right: 42px; cursor: pointer;
}

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; padding: 0; border: 0; box-shadow: none;
  background: var(--paper-2); border-radius: 999px; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad); border: 3px solid var(--surface);
  box-shadow: var(--sh-2);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #4F3DF5; border: 3px solid var(--surface); box-shadow: var(--sh-2);
}

/* ------------------------------------------------- choix d'un actif --- */

.picker { position: relative; }
.picker-kinds { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.picker-kinds button { padding: 10px 6px; }

.picker-results {
  position: absolute; z-index: 40; inset: auto 0 auto 0;
  margin-top: 8px; max-height: 340px; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-3);
  animation: pop-in 0.28s var(--spring);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
.picker-note {
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3);
}
.picker-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 16px; background: none; border: 0; border-bottom: 1px solid var(--line);
  text-align: left; cursor: pointer; color: inherit;
  transition: background 0.2s, padding-left 0.25s var(--ease);
}
.picker-row:last-child { border-bottom: 0; }
.picker-row:hover, .picker-row:focus-visible { background: var(--accent-soft); padding-left: 22px; }
.picker-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.picker-name b { font-size: 14.5px; font-weight: 580; letter-spacing: -0.018em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-name span { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.picked {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px; margin-top: 14px;
  border: 1px solid var(--accent-line); border-radius: var(--r);
  background: var(--accent-soft);
  animation: pop-in 0.35s var(--spring);
}
.picked .picked-txt { flex: 1; min-width: 0; }
.picked b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.picked span { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.picked .picked-px { font-family: var(--mono); font-size: 15px; font-weight: 600; text-align: right; }

/* -------------------------------------------------------- suggestions -- */

.search-shell { position: relative; }
.search-panel {
  position: absolute; z-index: 30; inset: calc(100% + 8px) 0 auto 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--sh-3); overflow: hidden;
}
.search-hit { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px; font-size: 14.5px; border-bottom: 1px solid var(--line); }
.search-hit:last-child { border-bottom: 0; }
.search-hit:hover { background: var(--accent-soft); }
.search-hit span { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

/* ------------------------------------------------------------ squelette -- */

.skel {
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--surface) 37%, var(--paper-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-xs); color: transparent !important;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.empty { padding: 54px 24px; text-align: center; color: var(--ink-3); font-size: 14.5px; }

/* ---------------------------------------------------------- statistiques */

.stat { display: flex; flex-direction: column; gap: 8px; }
.stat dt { font-size: 12.5px; font-weight: 560; letter-spacing: 0.02em; color: var(--ink-3); }
.stat dd {
  margin: 0; font-family: var(--mono);
  font-size: clamp(1.35rem, 2.3vw, 1.85rem); font-weight: 600; letter-spacing: -0.035em;
}

.kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden;
}
.kpi {
  padding: 22px 24px; position: relative;
  border-right: 1px solid var(--line);
  transition: background 0.3s;
}
.kpi:last-child { border-right: 0; }
.kpi:hover { background: var(--accent-soft); }
@media (max-width: 720px) {
  .kpi { border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi:last-child { border-bottom: 0; }
}

/* -------------------------------------------------------------- articles */

.article-list {
  display: grid; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); overflow: hidden;
}
.article {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; gap: 8px 24px;
  padding: 22px 26px; border-bottom: 1px solid var(--line);
  transition: background 0.25s, padding-left 0.3s var(--ease);
}
.article:last-child { border-bottom: 0; }
.article:hover { background: var(--accent-soft); padding-left: 34px; }
.article-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; grid-column: 1 / -1; }
.article h3 { font-size: 17px; font-weight: 580; line-height: 1.42; letter-spacing: -0.024em; }
.article p { color: var(--ink-2); font-size: 14.5px; margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-meta {
  display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; margin-top: 10px;
  font-size: 12.5px; font-weight: 560; color: var(--accent-ink);
}
[data-theme="dark"] .article-meta { color: var(--accent-2); }
.article-meta svg { transition: transform 0.3s var(--spring); }
.article:hover .article-meta svg { transform: translate(3px, -3px); }
.article-cat { font-size: 12.5px; color: var(--ink-3); }
.article-cat::before { content: "· "; }

/* ---------------------------------------------------------------- divers */

.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 4.5vw, 68px); align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.feature { display: flex; flex-direction: column; gap: 14px; }
.feature-icon {
  width: 48px; height: 48px; border-radius: var(--r);
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
  box-shadow: var(--sh-accent);
}
.feature h3 { font-size: 18px; }
.feature p { color: var(--ink-2); font-size: 15px; }

.steps {
  counter-reset: s; display: grid;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden;
}
.step {
  padding: 28px; display: flex; gap: 20px;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s;
}
.step:last-child { border-bottom: 0; }
.step:hover { background: var(--accent-soft); }
.step::before {
  counter-increment: s; content: "0" counter(s);
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: transparent; background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  padding-top: 3px; flex: none;
}

details.faq {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); margin-bottom: 10px;
  box-shadow: var(--sh-1);
  transition: box-shadow 0.3s, border-color 0.3s;
}
details.faq[open] { box-shadow: var(--sh-2); border-color: var(--accent-line); }
details.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 22px 24px; cursor: pointer; list-style: none;
  font-size: 17px; font-weight: 580; letter-spacing: -0.024em;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: ""; width: 12px; height: 12px; flex: none;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.4s var(--spring), border-color 0.3s;
}
details.faq[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); border-color: var(--accent); }
details.faq p { padding: 0 24px 24px; color: var(--ink-2); max-width: 74ch; font-size: 15.5px; }

.disclaimer {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 20px; border-radius: var(--r);
  background: var(--warn-soft); border: 1px solid rgba(245, 165, 36, 0.24);
  color: var(--ink); font-size: 14px; line-height: 1.58;
}
.disclaimer svg { flex: none; margin-top: 2px; color: var(--warn); }

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

.footer {
  border-top: 1px solid var(--line); background: var(--surface);
  padding-block: clamp(52px, 6vw, 84px) 32px;
}
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 44px 28px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h4 { font-size: 12.5px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 16px; }
.footer li + li { margin-top: 11px; }
.footer a { color: var(--ink-2); font-size: 14.5px; transition: color 0.25s, padding-left 0.25s; }
.footer a:hover { color: var(--accent); padding-left: 4px; }
.footer-bottom {
  margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  font-size: 13px; color: var(--ink-3);
}

/* ------------------------------------------------------------ révélation */

.reveal { opacity: 0; transform: translateY(24px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 0.75s var(--ease-out), transform 0.85s var(--ease-out);
  transition-delay: var(--d, 0ms);
}

/* ------------------------------------------------- transition de page --
   Un voile qui se lève à l'arrivée et retombe au départ : sans lui, chaque
   navigation montre un éclair blanc. */

.page-veil {
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
  background: var(--paper);
  opacity: 1; transition: opacity 0.32s var(--ease);
}
.page-veil.is-gone { opacity: 0; }

/* Reflet suivant la main sur les cartes inclinables */
.card-hover { position: relative; }
.card-hover::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%),
              var(--accent-soft), transparent 65%);
  opacity: 0; transition: opacity 0.4s var(--ease); pointer-events: none;
}
.card-hover:hover::after { opacity: 1; }

/* --------------------------------------------------------------- toasts */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 12px; justify-items: end; }
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 20px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--sh-3);
  font-size: 14.5px; max-width: min(92vw, 400px);
  animation: toast-in 0.5s var(--spring);
  border-left: 4px solid var(--accent);
}
.toast.ok { border-left-color: var(--up); }
.toast.err { border-left-color: var(--down); }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(0.94); } }

/* ------------------------------------------------------------ simulateur */

.sim-layout { display: grid; grid-template-columns: minmax(0, 1fr) 366px; gap: 26px; align-items: start; }
.sim-layout > *, .sim-layout > * > * { min-width: 0; }
@media (max-width: 1060px) { .sim-layout { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: calc(var(--nav-h) + 20px); }

.order-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.order-row:last-of-type { border-bottom: 0; }
.order-row span:first-child { color: var(--ink-2); font-size: 13.5px; }
.order-row b { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }

.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px;
}
.seg button {
  padding: 11px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font-size: 14.5px; font-weight: 580; color: var(--ink-2);
  transition: all 0.3s var(--ease);
}
.seg button.buy[aria-pressed="true"] { background: var(--grad-up); color: #fff; box-shadow: 0 4px 12px rgba(0,161,106,.3); }
.seg button.sell[aria-pressed="true"] { background: var(--grad-down); color: #fff; box-shadow: 0 4px 12px rgba(224,54,74,.3); }

.alloc-legend li { display: flex; align-items: center; gap: 11px; padding: 10px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.alloc-legend li:last-child { border-bottom: 0; }
.alloc-legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.alloc-legend .val { margin-left: auto; font-family: var(--mono); font-size: 13px; color: var(--ink-2); }

/* --------------------------------------------------- analyse de pratique */

.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 2px; }
.an-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px; border-radius: var(--r-sm);
  transition: background 0.3s;
}
.an-item:hover { background: var(--accent-soft); }
.an-lbl { font-size: 12.5px; color: var(--ink-3); }
.an-item b { font-size: 19px; font-weight: 620; letter-spacing: -0.03em; }

/* ------------------------------------------------------------ graphiques */

.chart-box { position: relative; width: 100%; height: clamp(260px, 38vh, 400px); }
.chart-box canvas { width: 100%; height: 100%; }
.chart-tip {
  position: absolute; z-index: 3; pointer-events: none; opacity: 0;
  transform: translate(-50%, -140%);
  padding: 9px 13px; border-radius: var(--r-sm);
  background: var(--ink); color: var(--paper);
  box-shadow: var(--sh-2); font-family: var(--mono); font-size: 12.5px; white-space: nowrap;
  transition: opacity 0.2s;
}
.range-tabs {
  display: inline-flex; gap: 3px; padding: 4px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px;
}
.range-tabs button {
  padding: 7px 14px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 12px; font-weight: 560; color: var(--ink-3);
  transition: all 0.25s;
}
.range-tabs button:hover { color: var(--ink); }
.range-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* --------------------------------------------------------------- guides */

.guide { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.guide-num {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: transparent; background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
}
.guide h3 { font-size: 19px; }
.guide p { color: var(--ink-2); font-size: 15px; }

ul.ticks { display: grid; gap: 10px; margin-top: 4px; }
ul.ticks li { position: relative; padding-left: 28px; font-size: 15px; color: var(--ink-2); }
ul.ticks li::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--up-soft);
}
ul.ticks li::after {
  content: ""; position: absolute; left: 5px; top: 11px;
  width: 7px; height: 4px;
  border-left: 2px solid var(--up); border-bottom: 2px solid var(--up);
  transform: rotate(-45deg);
}

.prose { max-width: 72ch; }
.prose h2 { margin-top: 48px; margin-bottom: 14px; }
.prose h3 { margin-top: 32px; margin-bottom: 10px; }
.prose p, .prose li { color: var(--ink-2); font-size: 16px; }
.prose p + p { margin-top: 16px; }
.prose ul { margin: 16px 0; display: grid; gap: 10px; padding-left: 22px; list-style: disc; }
.prose strong { color: var(--ink); font-weight: 620; }

@keyframes draw-x { to { transform: scaleX(1); } }
@keyframes draw-y { to { transform: scaleY(1); } }
@keyframes rise { from { transform: translateY(30px); opacity: 0.2; } to { transform: none; opacity: 1; } }
@keyframes settle { from { transform: translateY(18px); opacity: 0.3; } to { transform: none; opacity: 1; } }

/* =========================================== animations liées au défilement */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .runhead::after {
      content: ""; position: absolute; left: 0; bottom: -1px;
      width: 100%; height: 2px; background: var(--grad);
      transform: scaleX(0); transform-origin: left;
      animation: draw-x linear both;
      animation-timeline: view(); animation-range: entry 25% cover 42%;
    }
    hr.rule {
      transform: scaleX(0); transform-origin: left;
      animation: draw-x linear both;
      animation-timeline: view(); animation-range: entry 0% entry 90%;
    }
    .head .h1, .head .h2, .prose h1 {
      animation: rise linear both;
      animation-timeline: view(); animation-range: entry 0% cover 34%;
    }
    .step, .kpi, .article, .guide {
      animation: settle linear both;
      animation-timeline: view(); animation-range: entry 5% cover 30%;
    }
  }
}

/* -------------------------------------------------------- accessibilité */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .aurora span, .grain { animation: none; }
  .spot { display: none; }
}
