/* =============================================================
   Socle · Base
   Reset minimal + défauts typographiques + focus global.
   Consomme uniquement la couche sémantique.
   ============================================================= */

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

* {
  margin: 0;
}

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

body {
  background: var(--color-bg-page);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-body-size);
  font-weight: var(--text-body-weight);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

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

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

p,
h1,
h2,
h3,
h4 {
  overflow-wrap: break-word;
}

h1 {
  font-family: var(--font-heading);
  font-size: var(--text-h1-size);
  font-weight: var(--text-h1-weight);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-family: var(--font-heading);
  font-size: var(--text-h2-size);
  font-weight: var(--text-h2-weight);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h3 {
  font-family: var(--font-heading);
  font-size: var(--text-h3-size);
  font-weight: var(--text-h3-weight);
  line-height: var(--leading-snug);
}

h4 {
  font-family: var(--font-heading);
  font-size: var(--text-h4-size);
  font-weight: var(--text-h4-weight);
  line-height: var(--leading-snug);
}

code,
pre,
kbd {
  font-family: var(--font-code);
  font-size: var(--text-code-size);
}

::selection {
  background: var(--color-accent-subtle-hover);
  color: var(--color-text);
}

/* Anneau de focus global : tous les composants en héritent. */
:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: var(--focus-ring-offset);
}

/* Petites utilitaires de texte */
.sc-text-secondary {
  color: var(--color-text-secondary);
}

.sc-text-muted {
  color: var(--color-text-muted);
}

.sc-caption {
  font-size: var(--text-caption-size);
  line-height: var(--leading-snug);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
