/* ============================================================
   EQOS FORECAST — Template unifié des 12 études macro
   Cadrage C validé par EQOS le 28/05/2026 (U=1.587, φ=1.478)
   Vanilla scroll-driven · Charte or-sur-noir · Hero's Journey
   ============================================================ */

/* — 1. PALETTE CANONIQUE (override des variantes par page) — */
html, :root, body {
  --bg:       #08080d;
  --bg2:      #0e0e16;
  --bg3:      #15151f;
  --text:     #ededeb;
  --text-dim: #9494a0;
  --text-mid: #b5b5c0;
  --gold:       #c8a84e;
  --gold-light: #e8d496;
  --gold-dim:   rgba(200,168,78,.15);
  --gold-soft:  rgba(200,168,78,.06);
  --accent:     #c8a84e;   /* ⚑ unifié sur or — fini violet/rouge/vert disparates */
  --accent-soft: rgba(200,168,78,.10);
  --danger:   #e84a4a;
  --success:  #4ae87a;
  --warn:     #e8a84a;
  --crisis:   #e84a4a;     /* alias pour crise-2008 */
  --line:       rgba(200,168,78,.12);
  --line-soft:  rgba(200,168,78,.06);
}

/* Re-tinte les éléments dont l'accent était violet/rouge/vert vers or */
.section-label, .section-label::before { color: var(--gold) !important; background-color: transparent; }
.section-label::before { background: var(--gold) !important; }
.eq-block { border-color: var(--line) !important; background: var(--gold-soft) !important; }
.eq-block .eq-label { background: var(--gold) !important; color: var(--bg) !important; }
.eq-block.crisis { border-color: rgba(232,74,74,.22) !important; background: rgba(232,74,74,.04) !important; }
.eq-block.crisis .eq-label { background: var(--danger) !important; color: #fff !important; }
.eq-block .eq-explain { border-top-color: var(--line-soft) !important; }
.topbar { border-bottom-color: var(--line-soft) !important; }
.nav-links a:hover { color: var(--gold) !important; background: var(--gold-soft) !important; }
summary { color: var(--gold) !important; background: var(--gold-soft) !important; }
summary:hover { background: var(--accent-soft) !important; }
details[open] { border-color: var(--line) !important; }

/* — 2. VIEW TRANSITIONS (navigation fluide entre études) — */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: cs-fade-out .25s ease-out both; }
::view-transition-new(root) { animation: cs-fade-in  .35s ease-out both; }
@keyframes cs-fade-out { to { opacity: 0; } }
@keyframes cs-fade-in  { from { opacity: 0; transform: translateY(8px); } }

/* — 3. SCROLL-DRIVEN REVEALS (vanilla, Tier 0) — */
/* Cible les .reveal existants (déjà gérés par IntersectionObserver dans chaque page)
   et ajoute un fallback CSS scroll-timeline pour les navigateurs modernes */
@supports (animation-timeline: view()) {
  .reveal {
    opacity: 1; transform: none;          /* neutralise l'état JS initial */
    animation: cs-rise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }
  @keyframes cs-rise {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* — 4. BLOC CTA-CONVERSION (acte 7 du Hero's Journey) — */
.cs-cta-block {
  background: linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 4.5rem 1.5rem;
  text-align: center;
  position: relative;
}
.cs-cta-block::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(560px, 80%); height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.cs-cta-block .cs-cta-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .8rem;
}
.cs-cta-block h3 {
  font-size: clamp(1.4rem, 3.2vw, 2rem); font-weight: 800; color: var(--text);
  letter-spacing: -.01em; line-height: 1.2; margin: 0 0 .6rem;
}
.cs-cta-block h3 em { color: var(--gold); font-style: italic; font-weight: 700; }
.cs-cta-block > p {
  font-size: 15px; color: var(--text-mid); max-width: 580px;
  margin: 0 auto 2rem; line-height: 1.65;
}
.cs-cta-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  max-width: 820px; margin: 0 auto;
}
@media (max-width: 720px) { .cs-cta-grid { grid-template-columns: 1fr; } }
.cs-cta-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 1.4rem 1.2rem; text-align: left;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none; color: var(--text);
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
  view-transition-name: cs-cta;          /* transition fluide vers contact/simulateur */
}
.cs-cta-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  background: var(--gold-soft);
}
.cs-cta-card .cs-cta-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: .14em; color: var(--gold);
}
.cs-cta-card strong {
  font-size: 15px; font-weight: 700; color: var(--text);
}
.cs-cta-card span {
  font-size: 13px; color: var(--text-dim); line-height: 1.5;
}
.cs-cta-card .cs-cta-arrow {
  margin-top: .4rem; color: var(--gold); font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
}

/* — 5. STICKY CTA (apparaît à >30% scroll, dismissible) — */
.cs-sticky-cta {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(120%);
  z-index: 90; max-width: min(580px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: rgba(14,14,22,.94); backdrop-filter: blur(14px);
  border: 1px solid var(--gold);
  border-radius: 100px;
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.6), 0 0 0 1px rgba(200,168,78,.08);
  transition: transform .45s cubic-bezier(.16,1,.3,1), opacity .3s;
  opacity: 0; pointer-events: none;
  font-family: 'Inter', -apple-system, sans-serif;
}
.cs-sticky-cta.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1; pointer-events: auto;
}
.cs-sticky-cta .cs-sticky-msg {
  font-size: 13px; color: var(--text-mid); line-height: 1.3;
  flex: 1; min-width: 0;
}
.cs-sticky-cta .cs-sticky-msg strong { color: var(--text); }
.cs-sticky-cta a {
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--bg); background: var(--gold); padding: 8px 14px;
  border-radius: 100px; text-decoration: none; white-space: nowrap;
  transition: background .2s, transform .2s;
}
.cs-sticky-cta a:hover { background: var(--gold-light); transform: translateY(-1px); }
.cs-sticky-cta button.cs-sticky-close {
  background: transparent; border: 0; color: var(--text-dim);
  font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1;
}
.cs-sticky-cta button.cs-sticky-close:hover { color: var(--text); }
@media (max-width: 540px) {
  .cs-sticky-cta { border-radius: 14px; padding: 12px; }
  .cs-sticky-cta .cs-sticky-msg { font-size: 12px; }
}

/* — 6. LIEN FUNNEL INLINE (acte 4 : après le verdict) — */
.cs-funnel-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 1rem; padding: .55rem 1rem;
  background: var(--gold-soft); border: 1px solid var(--gold);
  border-radius: 100px;
  color: var(--gold); text-decoration: none;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  transition: background .2s, transform .2s;
}
.cs-funnel-link:hover { background: var(--gold-dim); transform: translateY(-1px); }
.cs-funnel-link::after { content: '→'; transition: transform .2s; }
.cs-funnel-link:hover::after { transform: translateX(3px); }

/* — 7. RESPECT DES PRÉFÉRENCES MOTION — */
@media (prefers-reduced-motion: reduce) {
  .reveal, ::view-transition-old(root), ::view-transition-new(root),
  .cs-cta-card, .cs-sticky-cta { animation: none !important; transition: none !important; }
}

/* — 8. MINI-TICKER CHIFFRES-CLÉS (bas de page, marquee infini) — */
.cs-ticker {
  position: relative; width: 100%; overflow: hidden;
  background: linear-gradient(180deg, rgba(8,8,13,0), rgba(200,168,78,.025) 30%, rgba(8,8,13,0));
  border-top: 1px solid rgba(200,168,78,.10);
  border-bottom: 1px solid rgba(200,168,78,.10);
  padding: 18px 0; margin-top: 60px;
}
.cs-ticker::before, .cs-ticker::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 80px; z-index: 2;
  pointer-events: none;
}
.cs-ticker::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.cs-ticker::after  { right: 0; background: linear-gradient(-90deg, var(--bg), transparent); }
.cs-ticker-track {
  display: inline-flex; gap: 44px; align-items: center;
  animation: cs-ticker-scroll 55s linear infinite;
  white-space: nowrap;
  will-change: transform;
}
.cs-ticker:hover .cs-ticker-track { animation-play-state: paused; }
.cs-ticker-item {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px; letter-spacing: .03em;
  color: var(--text-dim); white-space: nowrap;
}
.cs-ticker-item .lbl { color: var(--text-mid); }
.cs-ticker-item .val { color: var(--gold); font-weight: 600; }
.cs-ticker-item .val.danger { color: var(--danger); }
.cs-ticker-item .val.warn { color: var(--warn); }
.cs-ticker-item .val.ok { color: var(--success); }
.cs-ticker-item .sep {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(200,168,78,.35); flex-shrink: 0;
}
@keyframes cs-ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .cs-ticker-track { animation: none; }
  .cs-ticker { overflow-x: auto; }
}
