/* =========================================================
   COACH NEIRAM — Reset, typographie de base, accessibilité
   ========================================================= */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

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

/* Lenis pilote le scroll : on neutralise le smooth natif quand il est actif
   pour éviter les deux systèmes qui se battent. */
html.lenis-active { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Garde-fou : aucune section ne doit provoquer de scroll latéral. */
  overflow-x: hidden;
  transition: background-color var(--dur-slow) var(--ease-out);
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button { background: none; border: none; cursor: pointer; }

/* Les paragraphes peuvent césurer un mot trop long ; les titres d'affichage
   ne le doivent jamais — on ajuste plutôt leur taille. */
p { overflow-wrap: break-word; }
h1, h2, h3, h4, h5, h6 { overflow-wrap: normal; }

ul, ol { list-style: none; padding: 0; }

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

/* ---------- Titres ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  text-wrap: balance;
}

h1 { font-size: var(--fs-mega); }
h2 { font-size: var(--fs-xxl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

/* ---------- Utilitaires typographiques ---------- */

.label {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
}

.label--accent { color: var(--accent); }

/* Sur petit écran, l'interlettrage large fait casser les libellés
   sur une deuxième ligne pour un ou deux mots. On le resserre. */
@media (max-width: 560px) {
  .label { letter-spacing: 0.1em; font-size: 0.7rem; }
}

.lead {
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
  color: var(--text-muted);
  max-width: var(--maxw-text);
}

.text-accent { color: var(--accent); }

/* Le trait jaune : signature graphique discrète, réutilisée partout. */
.rule {
  width: 40px;
  height: 2px;
  background: var(--accent);
  border: 0;
  margin: 0;
}

/* ---------- Accessibilité ---------- */

/* Le focus reste toujours visible : c'est non négociable, y compris en dark. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  z-index: var(--z-overlay);
  background: var(--accent);
  color: var(--on-accent);
  padding: var(--sp-3) var(--sp-5);
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus { top: var(--sp-4); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Mouvement réduit ----------
   Le site doit rester parfaitement utilisable sans animation.
   On neutralise le mouvement, jamais le contenu : tout est rendu
   dans son état final, visible et lisible. */

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

  [data-reveal],
  [data-reveal-lines] .line-mask > span,
  [data-reveal-media] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}

/* Même logique quand le JS décide que l'appareil est trop faible
   ou que l'utilisateur a désactivé le mouvement. */
.no-motion [data-reveal],
.no-motion [data-reveal-lines] .line-mask > span,
.no-motion [data-reveal-media] {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}
