/* CBM — Variables globales, reset, typographie */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Palette CBM — extraite du logo officiel */
  --cbm-primary: #7E3443;
  --cbm-primary-dark: #5E2735;
  --cbm-primary-light: #9E4D5E;
  --cbm-secondary: #585858;
  --cbm-accent: #9E6772;
  --cbm-accent-bright: #C4848F;
  --cbm-text: #2C2C2A;
  --cbm-text-light: #6B6B69;
  --cbm-bg: #F7F7F5;
  --cbm-bg-alt: #EEEDEB;
  --cbm-white: #FFFFFF;
  --cbm-border: rgba(0, 0, 0, 0.08);

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #7E3443 0%, #4A1E2A 50%, #2D1219 100%);
  --gradient-cta: linear-gradient(135deg, #7E3443 0%, #5E2735 100%);
  --gradient-accent: linear-gradient(135deg, #9E6772 0%, #7E3443 100%);
  --gradient-subtle: linear-gradient(180deg, #F7F7F5 0%, #EEEDEB 100%);

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
  --shadow-nav: 0 2px 20px rgba(0, 0, 0, 0.06);

  /* Rayons */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 50px;

  /* Espacements */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;
  --space-3xl: 7rem;

  /* Typographie */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.8125rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.375rem;
  --font-size-2xl: 1.75rem;
  --font-size-3xl: 2.25rem;
  --font-size-4xl: 3rem;
  --font-size-5xl: 3.75rem;

  /* Transitions */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Largeur max */
  --max-width: 1200px;
  --max-width-narrow: 800px;
}

/* 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-family);
  font-size: var(--font-size-base);
  line-height: 1.7;
  color: var(--cbm-text);
  background-color: var(--cbm-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--cbm-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--cbm-primary-dark);
}

ul, ol {
  list-style: none;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.15;
  font-weight: 800;
  color: var(--cbm-text);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--font-size-5xl);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
}

p {
  color: var(--cbm-text-light);
  line-height: 1.75;
}

@media (max-width: 768px) {
  h1 { font-size: var(--font-size-3xl); }
  h2 { font-size: var(--font-size-2xl); }
  h3 { font-size: var(--font-size-lg); }
}

/* Utilitaires */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-xl);
  }
}

.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;
}

/* Section base */
section {
  padding: var(--space-3xl) 0;
}

@media (max-width: 768px) {
  section {
    padding: var(--space-2xl) 0;
  }
}

section h2 {
  text-align: center;
  margin-bottom: var(--space-sm);
}

section > .container > h2 + p {
  text-align: center;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-xl);
  font-size: var(--font-size-lg);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.animate-on-scroll.animate--left {
  transform: translateX(-30px);
}

.animate-on-scroll.animate--left.animated {
  transform: translateX(0);
}

.animate-on-scroll.animate--scale {
  transform: scale(0.9);
}

.animate-on-scroll.animate--scale.animated {
  transform: scale(1);
}

/* Stagger delays for children */
.animate-on-scroll.animate--delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.animate--delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.animate--delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.animate--delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.animate--delay-5 { transition-delay: 0.5s; }

/* Selection */
::selection {
  background-color: var(--cbm-primary);
  color: var(--cbm-white);
}
