/* Réinitialisation légère + typographie de base */

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 1024px) {
  body {
    font-size: var(--text-md);
  }
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--color-ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-xl); font-weight: 700; }
h2 { font-size: var(--text-lg); font-weight: 600; }
h3 { font-size: var(--text-md); font-weight: 600; }

p { margin: 0; }

a {
  color: var(--color-brand-strong);
  text-underline-offset: 3px;
}

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

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

/* Chiffres alignés pour les montants et les dioptries */
.num,
td.num,
th.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

:focus-visible {
  outline: 3px solid var(--color-brand-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -4rem;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-ink);
  color: #fff;
  border-radius: var(--radius-pill);
  transition: top var(--dur) var(--ease);
}

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

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