/* =====================================================================
   RC LENS · DESIGN SYSTEM
   Couleurs Sang et Or, typographie premium, glassmorphism, animations.
   ===================================================================== */

:root {
  /* --- Palette --- */
  --rc-red: #E30613;
  --rc-red-soft: #ff2d3c;
  --rc-gold: #FFCD00;
  --rc-gold-soft: #ffe066;
  --rc-black: #0A0A0A;
  --rc-ink: #0d0e12;

  /* --- Surfaces --- */
  --bg: #07070a;
  --surface-1: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* --- Texte --- */
  --text: #f4f5f7;
  --text-soft: #b9bcc6;
  --text-dim: #7c7f8c;

  /* --- Effets --- */
  --glass: rgba(18, 19, 26, 0.55);
  --glass-strong: rgba(15, 16, 22, 0.78);
  --blur: 18px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8);
  --shadow-red: 0 12px 40px -12px rgba(227, 6, 19, 0.55);
  --shadow-gold: 0 12px 40px -12px rgba(255, 205, 0, 0.45);

  /* --- Layout --- */
  --nav-h: 72px;
  --maxw: 1240px;

  /* --- Typo --- */
  --font-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* --- Easing --- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===================== RESET ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Texture / dégradé de fond global */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(227, 6, 19, 0.18), transparent 60%),
    radial-gradient(800px 600px at 90% 0%, rgba(255, 205, 0, 0.10), transparent 55%),
    linear-gradient(180deg, #08080b 0%, #050507 100%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
input, select, textarea { font-family: inherit; }

::selection { background: var(--rc-red); color: #fff; }

/* Scrollbar custom (fine, Sang et Or) */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: #0A0A0A; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(#E30613, #FFCD00);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(#ff2d3c, #ffe066); }
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: #E30613 #0A0A0A; }

/* ===================== PARTICULES & GLOW ===================== */
#particles {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ambient-glow {
  position: fixed;
  z-index: -2;
  width: 50vw;
  height: 50vw;
  max-width: 720px;
  max-height: 720px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  pointer-events: none;
  animation: floatGlow 18s var(--ease) infinite alternate;
}
.ambient-glow--red { top: -10%; left: -10%; background: radial-gradient(circle, rgba(227,6,19,0.55), transparent 70%); }
.ambient-glow--gold { bottom: -15%; right: -10%; background: radial-gradient(circle, rgba(255,205,0,0.4), transparent 70%); animation-delay: -6s; }

@keyframes floatGlow {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.15); }
}

/* ===================== TYPOGRAPHIE ===================== */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 0.95; letter-spacing: 0.5px; }

.display {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 7rem);
  line-height: 0.88;
  letter-spacing: 1px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.section-title::before {
  content: "";
  width: 6px;
  height: 0.85em;
  background: linear-gradient(var(--rc-red), var(--rc-gold));
  border-radius: 4px;
  box-shadow: var(--shadow-red);
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--rc-gold);
}

.text-grad {
  background: linear-gradient(100deg, var(--rc-gold) 0%, #fff 45%, var(--rc-red-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===================== LAYOUT UTILITAIRES ===================== */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }

.page { padding-top: calc(var(--nav-h) + 1.5rem); padding-bottom: 5rem; min-height: 100vh; }
.page--hero { padding-top: 0; }

.section { margin-top: clamp(3rem, 7vw, 6rem); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; flex-wrap: wrap; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ===================== GLASS CARD ===================== */
.glass {
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1));
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }

/* Liseré supérieur Sang et Or sur cartes clés */
.card--accent::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--rc-red), var(--rc-gold));
}

/* ===================== BOUTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* Reflet qui balaie le bouton au survol */
.btn--primary::after, .btn--gold::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-160%);
  transition: transform 0.7s var(--ease);
}
.btn--primary:hover::after, .btn--gold:hover::after { transform: translateX(160%); }
.btn:active { transform: scale(0.96); }
.btn--primary { background: linear-gradient(100deg, var(--rc-red), #b1040e); color: #fff; box-shadow: var(--shadow-red); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 44px -10px rgba(227,6,19,0.7); }
.btn--gold { background: linear-gradient(100deg, var(--rc-gold), #e0b400); color: #0a0a0a; box-shadow: var(--shadow-gold); }
.btn--gold:hover { transform: translateY(-2px); }
.btn--ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); }
.btn--ghost:hover { background: var(--surface-3); border-color: var(--rc-gold); }

/* ===================== BADGES ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.badge--live { background: rgba(227,6,19,0.16); color: #ff616d; border: 1px solid rgba(227,6,19,0.4); }
.badge--gold { background: rgba(255,205,0,0.14); color: var(--rc-gold); border: 1px solid rgba(255,205,0,0.35); }
.badge--soft { background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rc-red-soft);
  box-shadow: 0 0 0 0 rgba(255,45,60,0.7);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,45,60,0.6); }
  70% { box-shadow: 0 0 0 10px rgba(255,45,60,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,45,60,0); }
}

/* ===================== SKELETON LOADERS ===================== */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-line { height: 14px; margin: 8px 0; }
.sk-line.sm { width: 40%; }
.sk-line.md { width: 70%; }
.sk-block { height: 180px; }

/* ===================== ÉTATS (vide / erreur) ===================== */
.state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-soft);
  display: grid;
  place-items: center;
  gap: 0.75rem;
  max-width: 36ch;
  margin-inline: auto;
}
.state--wide { max-width: 48ch; }
.state--card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.8rem 2rem;
}
.state__art {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  margin-bottom: 0.25rem;
  filter: drop-shadow(0 8px 24px rgba(227, 6, 19, 0.2));
}
.state__art svg { width: 100%; height: 100%; display: block; }
.state__icon { font-size: 2.6rem; opacity: 0.7; }
.state__title { font-family: var(--font-display); font-size: 1.65rem; color: var(--text); letter-spacing: 1px; line-height: 1.1; }
.state__text { font-size: 0.92rem; line-height: 1.55; color: var(--text-soft); }
.state--error .state__title { color: #ff7079; }
.state__action { margin-top: 0.5rem; }

/* ===================== TRANSITIONS DE PAGE SPA ===================== */
#app.page-exit,
#app.page-enter,
#app.page-enter-active {
  transition:
    opacity 280ms var(--ease-out),
    transform 280ms var(--ease-out);
}

#app.page-exit {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

#app.page-enter {
  opacity: 0;
  transform: translateY(12px);
}

#app.page-enter-active {
  opacity: 1;
  transform: translateY(0);
}

/* ===================== ANIMATIONS D'ENTRÉE (contenu) ===================== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.reveal { opacity: 0; }
.reveal.in { animation: fadeUp 0.7s var(--ease-out) forwards; }

/* ===================== BARRE DE CHARGEMENT GLOBALE ===================== */
#loadbar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 200;
  background: linear-gradient(90deg, var(--rc-red), var(--rc-gold));
  box-shadow: 0 0 12px rgba(255, 205, 0, 0.6);
  opacity: 0;
  transition: width 0.4s var(--ease-out), opacity 0.3s;
}
#loadbar.active { opacity: 1; }

/* ===================== BARRE DE PROGRESSION DE DÉFILEMENT ===================== */
.scroll-progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--rc-red), var(--rc-gold));
  transition: width 0.1s linear;
  z-index: 101;
}

/* ===================== BOUTON TOP ===================== */
.to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(var(--rc-red), #9c040d);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-red);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 60;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { transform: translateY(-3px); }

/* ===================== ACCESSIBILITÉ ===================== */
:focus-visible { outline: 2px solid var(--rc-gold); outline-offset: 3px; border-radius: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@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;
  }
  /* Fond animé */
  #particles { display: none !important; }
  .ambient-glow { animation: none !important; opacity: 0.18; }
  /* Chargement & transitions */
  #loadbar { display: none !important; }
  #app.page-exit,
  #app.page-enter,
  #app.page-enter-active {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .reveal.in { animation: none !important; }
  /* Skeletons & effets décoratifs */
  .skeleton::after { display: none !important; }
  .live-dot { animation: none !important; box-shadow: none !important; }
  .player-card::after { display: none !important; }
  .btn--primary::after, .btn--gold::after { display: none !important; }
  .brand:hover .brand__logo { transform: none !important; }
  .leader__bar i { transition: none !important; width: var(--w, 100%) !important; }
}

/* Classe JS (même logique que la media query système) */
html.reduce-motion #particles { display: none !important; }
html.reduce-motion .ambient-glow { animation: none !important; opacity: 0.18; }
html.reduce-motion #loadbar { display: none !important; }
html.reduce-motion #app.page-exit,
html.reduce-motion #app.page-enter,
html.reduce-motion #app.page-enter-active {
  transition: none !important;
  opacity: 1 !important;
  transform: none !important;
}
html.reduce-motion .reveal,
html.reduce-motion .reveal.in { animation: none !important; opacity: 1 !important; transform: none !important; }
html.reduce-motion .skeleton::after { display: none !important; }
html.reduce-motion .live-dot { animation: none !important; box-shadow: none !important; }
html.reduce-motion .player-card::after,
html.reduce-motion .btn--primary::after,
html.reduce-motion .btn--gold::after { display: none !important; }

/* ===================== RESPONSIVE GLOBAL ===================== */
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  :root { --nav-h: 64px; }
}
