/* ==========================================================================
   BASE - Reset, variables, typographie, polices
   ========================================================================== */

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  /* Palette principale - alignée avec l'app mobile */
  --red:          #FF3338;
  --red-dark:     #CC0000;
  --red-light:    #FF6668;
  --red-glow:     rgba(255, 51, 56, 0.18);
  --black:        #050505;
  --black-soft:   #0d1017;
  --black-card:   #0f1219;
  --white:        #FFFFFF;
  --white-dim:    rgba(255, 255, 255, 0.65);
  --white-faint:  rgba(255, 255, 255, 0.08);

  /* Surface dark (style app mobile) */
  --surface:      rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.08);

  /* Surfaces claires */
  --gray-50:      #F9F9F9;
  --gray-100:     #F2F2F2;
  --gray-200:     #E4E4E4;
  --gray-300:     #CACACA;
  --gray-400:     #9A9A9A;
  --gray-600:     #555555;
  --gray-800:     #1E1E1E;

  /* Gradients */
  --gradient-red:    linear-gradient(135deg, var(--red-dark) 0%, var(--red) 100%);
  --gradient-dark:   linear-gradient(160deg, #0a0c10 0%, #0d1017 100%);
  --gradient-hero:   linear-gradient(135deg, #050505 0%, #0d0507 60%, #100508 100%);
  --gradient-card:   linear-gradient(145deg, #0f1219 0%, #0a0c10 100%);

  /* Typographie */
  --font:         'Geist', 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'HKGroteskWide', 'Barlow Condensed', system-ui, sans-serif;

  --text-xs:      0.6875rem;  /* 11px */
  --text-sm:      0.8125rem;  /* 13px */
  --text-base:    0.9375rem;  /* 15px */
  --text-md:      1rem;       /* 16px */
  --text-lg:      1.125rem;   /* 18px */
  --text-xl:      1.25rem;    /* 20px */
  --text-2xl:     1.5rem;     /* 24px */
  --text-3xl:     1.875rem;   /* 30px */
  --text-4xl:     2.5rem;     /* 40px */
  --text-5xl:     3.25rem;    /* 52px */
  --text-6xl:     4.25rem;    /* 68px */
  --text-hero:    5.5rem;     /* 88px */

  /* Espacements */
  --s1:   0.25rem;
  --s2:   0.5rem;
  --s3:   0.75rem;
  --s4:   1rem;
  --s5:   1.25rem;
  --s6:   1.5rem;
  --s8:   2rem;
  --s10:  2.5rem;
  --s12:  3rem;
  --s16:  4rem;
  --s20:  5rem;
  --s24:  6rem;
  --s32:  8rem;
  --s40:  10rem;

  /* Rayons */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-2xl:  32px;
  --r-full: 9999px;

  /* Ombres */
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg:    0 12px 36px rgba(0,0,0,0.18);
  --shadow-xl:    0 24px 60px rgba(0,0,0,0.24);
  --shadow-red:   0 8px 32px rgba(255,51,56,0.28);
  --shadow-card:  0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08);

  /* Transitions */
  --ease:         cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --t-fast:       180ms var(--ease);
  --t-base:       280ms var(--ease);
  --t-slow:       480ms var(--ease);

  /* Layout */
  --max-w:        1200px;
  --header-h:     68px;

  /* Bordures subtiles */
  --border-light:  1px solid var(--gray-200);
  --border-dark:   1px solid var(--surface-border);
  --border-red:    1px solid rgba(255,51,56,0.3);

  /* Alias de rétro-compatibilité (anciens noms de variables) */
  --color-red:       var(--red);
  --color-white:     var(--white);
  --color-black:     var(--black);
  --color-gray-50:   var(--gray-50);
  --color-gray-100:  var(--gray-100);
  --color-gray-200:  var(--gray-200);
  --color-gray-300:  var(--gray-300);
  --color-gray-400:  var(--gray-400);
  --color-gray-600:  var(--gray-600);
  --color-gray-800:  var(--gray-800);

  --font-size-xs:    var(--text-xs);
  --font-size-sm:    var(--text-sm);
  --font-size-base:  var(--text-base);
  --font-size-md:    var(--text-md);
  --font-size-lg:    var(--text-lg);
  --font-size-xl:    var(--text-xl);
  --font-size-2xl:   var(--text-2xl);
  --font-size-3xl:   var(--text-3xl);
  --font-size-4xl:   var(--text-4xl);

  --space-1:   var(--s1);
  --space-2:   var(--s2);
  --space-3:   var(--s3);
  --space-4:   var(--s4);
  --space-5:   var(--s5);
  --space-6:   var(--s6);
  --space-8:   var(--s8);
  --space-10:  var(--s10);
  --space-12:  var(--s12);
  --space-16:  var(--s16);
  --space-20:  var(--s20);
  --space-24:  var(--s24);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--white);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
}

p { line-height: 1.75; }

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

img, svg, video { display: block; max-width: 100%; }
ul, ol { list-style: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ── Polices Geist ──────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/Geist-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/Geist-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/Geist-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ── Polices HK Grotesk Wide (titres display) ───────────────────────────── */
@font-face {
  font-family: 'HKGroteskWide';
  src: url('../assets/fonts/hkgroteskwide-regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'HKGroteskWide';
  src: url('../assets/fonts/hkgroteskwide-bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Dharma Gothic E ExBold ─────────────────────────────────────────────── */
@font-face {
  font-family: 'DharmaGothicE';
  src: url('../assets/fonts/Dharma Gothic E ExBold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ── Animations globales ────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes counterPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Classe gérée par IntersectionObserver dans main.js */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Délais de cascade pour les grilles */
.animate-on-scroll:nth-child(2) { transition-delay: 0.08s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.16s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.24s; }

/* ── Utilitaires ────────────────────────────────────────────────────────── */
.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;
}

.text-red    { color: var(--red); }
.text-white  { color: var(--white); }
.text-muted  { color: var(--gray-400); }
.text-center { text-align: center; }
.font-bold   { font-weight: 700; }
.uppercase   { text-transform: uppercase; }
.tracking    { letter-spacing: 0.1em; }

/* Surbrillance rouge inline */
.accent { color: var(--red); }
