/* ==========================================================================
   BASE — reset + éléments natifs (repris du reset de la référence)
   ========================================================================== */

*,
*::before,
*::after {
  background-repeat: no-repeat;
  box-sizing: border-box;
  font-family: inherit;
  line-height: inherit;
  min-height: 0;
  min-width: 0;
  text-decoration: inherit;
  vertical-align: inherit;
}

img,
iframe {
  border-style: none;
}

svg {
  fill: currentcolor;
  overflow: visible;
}

img,
svg,
iframe {
  height: auto;
  max-width: 100%;
}

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

blockquote,
hr,
p,
pre {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  text-rendering: optimizelegibility;
}

dd,
dl,
dt,
li,
ol,
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

a,
area,
button,
input,
label,
select,
summary,
textarea,
[tabindex] {
  touch-action: manipulation;
}

fieldset,
form {
  margin: 0;
  border: 0;
  padding: 0;
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

input,
select,
textarea {
  height: auto;
  max-width: 100%;
}

textarea {
  margin: 0;
  overflow: auto;
  resize: vertical;
}

[type="checkbox"],
[type="radio"] {
  padding: 0;
}

[aria-busy="true"] {
  cursor: progress;
}

[aria-controls] {
  cursor: pointer;
}

[aria-disabled="true"],
[disabled] {
  cursor: not-allowed;
}

/* display:flex ne doit jamais écraser hidden */
[hidden] {
  display: none !important;
}

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

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

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-locked {
  overflow: hidden;
}

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

a:hover {
  text-decoration: none;
}

button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

/* Anneau de focus exact de la référence */
:focus-visible {
  box-shadow: 0 0 0 0.25rem var(--on-blue);
  outline: 0.25rem solid transparent;
  outline-offset: 0;
  border-radius: var(--radius-xs);
}

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

/* --- Titres --------------------------------------------------------------- */
.h1,
.h2,
.h3,
.h4,
.h5 {
  font-family: var(--font-sans);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
}

.h1 {
  font-size: var(--fs-4xl);
}
.h2 {
  font-size: var(--fs-2xl);
}
.h3 {
  font-size: var(--fs-xl);
}
.h4 {
  font-size: var(--fs-lg);
  line-height: var(--lh-heading);
}
.h5 {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  letter-spacing: normal;
  line-height: var(--lh-heading);
}

.text-mono {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
}

.text-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  line-height: 1.125rem;
  text-transform: uppercase;
}

.text-sm {
  font-size: var(--fs-sm);
}
.text-xs {
  font-size: var(--fs-xs);
}
.text-md {
  font-size: var(--fs-md);
}

/* --- Utilitaires ---------------------------------------------------------- */
.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skip-link {
  background: var(--on-black);
  color: var(--on-white);
  font-size: var(--fs-sm);
  left: 0.5rem;
  padding: 0.75rem 1.25rem;
  position: fixed;
  top: -6rem;
  transition: top var(--dur-fast) var(--ease-out);
  z-index: var(--z-toast);
}

.skip-link:focus {
  top: 0.5rem;
}

.container {
  margin-inline: auto;
  max-width: var(--page-max);
  padding-inline: var(--gutter);
  width: 100%;
}

.container--narrow {
  max-width: 48rem;
}

.container--reading {
  max-width: 62rem;
}

.stack > * + * {
  margin-top: var(--sp-md);
}

.section {
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.section--tight {
  padding-block: clamp(1.5rem, 4vw, 3rem);
}

hr.rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}
