/* TDSL — styles de base : reset, typographie, mise en page, accessibilité.
   Toutes les valeurs passent par tokens.css et site-tokens.css. */

/* ---------- Reset léger ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

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

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

body {
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body-size);
  line-height: var(--text-body-lh);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- Typographie ---------- */
h1,
h2,
h3 {
  font-family: var(--font-sans);
  color: var(--ink);
  text-wrap: balance;
}

.text-display {
  font-size: var(--text-display-size);
  line-height: var(--text-display-lh);
  letter-spacing: var(--text-display-ls);
  font-weight: 800;
}

h1,
.text-h1 {
  font-size: var(--text-h1-size);
  line-height: var(--text-h1-lh);
  letter-spacing: var(--text-h1-ls);
  font-weight: 800;
}

h2,
.text-h2 {
  font-size: var(--text-h2-size);
  line-height: var(--text-h2-lh);
  font-weight: 800;
}

h3,
.text-h3 {
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-lh);
  font-weight: 600;
}

p {
  text-wrap: pretty;
}

.text-small {
  font-size: var(--text-small-size);
  line-height: var(--text-small-lh);
}

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

a {
  color: var(--teal);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

strong {
  font-weight: 600;
}

/* ---------- Mise en page ---------- */
.container {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose {
  max-width: var(--prose-max);
}

.section {
  padding-block: var(--section-gap);
}

.section--deep {
  background: var(--surface-deep);
  color: var(--ink-inverse);
}

.section--deep h1,
.section--deep h2,
.section--deep h3 {
  color: var(--ink-inverse);
}

/* Filet de séparation entre deux sections sur le même fond */
.section--line {
  border-top: 1px solid var(--line);
}

.section--soft {
  background: var(--teal-soft);
}

/* ---------- Accessibilité ---------- */
:focus-visible {
  outline: var(--focus-ring) solid var(--teal);
  outline-offset: 2px;
}

.section--deep :focus-visible {
  outline-color: var(--ink-inverse);
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--teal);
  color: var(--on-teal);
  border-radius: var(--radius-md);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

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