/* ============================================================
   BASE — Reset, typographie, éléments globaux
   ============================================================ */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--text-secondary);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Typographie --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: var(--lh-tight);
  font-weight: 700;
}

h1 {
  font-size: var(--fs-hero);
  font-weight: 800;
  letter-spacing: var(--ls-tight);
}

h2 {
  font-size: var(--fs-h2);
  letter-spacing: var(--ls-normal);
}

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

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

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

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

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

ul, ol {
  list-style: none;
}

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

input,
textarea,
select {
  font-family: inherit;
  font-size: 16px; /* Empêche le zoom iOS */
  color: var(--text-primary);
  background: #FFFFFF;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.15);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

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

.section {
  padding: var(--space-section) 0;
  position: relative;
}

.section--alt {
  background-color: var(--bg-section);
}

/* --- Section sombre (anthracite profond — en rappel du fourgon) --- */
.section--dark {
  background: linear-gradient(135deg, #262A2F 0%, #343942 50%, #1F2327 100%);
  color: rgba(255, 255, 255, 0.85);
}

.section--dark .section__label {
  color: rgba(255, 255, 255, 0.5);
}

.section--dark .section__title {
  color: #FFFFFF;
}

.section--dark .gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section--dark .section__subtitle {
  color: rgba(255, 255, 255, 0.6);
}

/* --- Section header --- */
.section__label {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--brand-primary);
  margin-bottom: var(--space-md);
  display: block;
}

.section__title {
  margin-bottom: var(--space-lg);
}

.section__subtitle {
  color: var(--text-secondary);
  font-size: var(--fs-body);
  max-width: 600px;
  line-height: var(--lh-relaxed);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section__header .section__subtitle {
  margin: 0 auto;
}

/* --- Texte utilitaires --- */
.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center { text-align: center; }
.text-primary { color: var(--text-primary); }
.text-muted { color: var(--text-muted); }
.uppercase { text-transform: uppercase; }

/* --- Accessibilité --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--brand-primary);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-md);
}

/* --- Focus visible --- */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Selection --- */
::selection {
  background: rgba(var(--brand-primary-rgb), 0.3);
  color: var(--text-primary);
}
