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

html {
  font-size: 15px;
  /* Couleur de fond pendant l'init du thème (évite le flash blanc en sombre). */
  color-scheme: dark light;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  /* 100dvh : prend en compte la barre d'adresse mobile iOS (sinon trous en bas). */
  min-height: 100dvh;
  min-height: 100vh; /* fallback navigateurs sans support dvh */
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Skip-to-content : caché sauf au focus clavier. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 1000;
  background: var(--primary);
  color: var(--primary-on);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  margin: var(--space-2);
  transition: top 0.15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  text-decoration: none;
  color: var(--primary-on);
}

/* Focus visible global pour les éléments interactifs (a11y clavier).
   N'apparaît qu'au focus clavier, pas au clic souris (focus-visible). */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
/* On garde le comportement personnalisé pour certains composants qui
   gèrent leur propre style (boutons cerise, .topbar a, etc.) */
.btn:focus-visible,
.btn--primary:focus-visible,
.btn--ghost:focus-visible {
  outline-offset: 3px;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

p {
  color: var(--text);
}

small,
.muted {
  color: var(--text-muted);
  font-size: 0.9em;
}

a {
  color: var(--cherry-200);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover,
a:focus {
  color: var(--cherry-50);
  text-decoration: underline;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

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

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: var(--space-3);
}

@media (min-width: 720px) {
  .container {
    padding: var(--space-4);
  }
  h1 {
    font-size: 1.6rem;
  }
}

.stack > * + * {
  margin-top: var(--space-3);
}

.stack-lg > * + * {
  margin-top: var(--space-4);
}

.center-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

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