/* assetsblox — base : polices auto-hébergées, remise à zéro, typographie, focus. */

/* Polices sous licence SIL Open Font License 1.1 (fichiers LICENSE-*.txt dans fonts/). */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-body-size);
  line-height: var(--text-body-line);
  font-weight: var(--text-body-weight);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img,
video {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--accent-text);
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--link-hover);
}

::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

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

/* Focus clavier toujours visible (charte : anneau --focus de 2 px, décalé de 2 px). */
:focus-visible {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--focus-offset);
}

/* Styles de texte de la charte */
.text-display {
  font-family: var(--font-display);
  font-size: var(--text-display-size);
  line-height: var(--text-display-line);
  font-weight: var(--text-display-weight);
  letter-spacing: var(--text-display-tracking);
}

.text-h1 {
  font-family: var(--font-display);
  font-size: var(--text-h1-size);
  line-height: var(--text-h1-line);
  font-weight: var(--text-h1-weight);
  letter-spacing: var(--text-h1-tracking);
}

.text-h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2-size);
  line-height: var(--text-h2-line);
  font-weight: var(--text-h2-weight);
  letter-spacing: var(--text-h2-tracking);
}

.text-h3 {
  font-family: var(--font-display);
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-line);
  font-weight: var(--text-h3-weight);
  letter-spacing: var(--text-h3-tracking);
}

.text-body-lg {
  font-size: var(--text-body-lg-size);
  line-height: var(--text-body-lg-line);
}

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

.text-label {
  font-family: var(--font-mono);
  font-size: var(--text-label-size);
  line-height: var(--text-label-line);
  font-weight: var(--text-label-weight);
  letter-spacing: var(--text-label-tracking);
  text-transform: uppercase;
}

.text-code,
code,
kbd {
  font-family: var(--font-mono);
  font-size: var(--text-code-size);
  line-height: var(--text-code-line);
}

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

/* L'attribut hidden l'emporte toujours sur le display d'un composant (.badge, .btn…). */
[hidden] {
  display: none !important;
}

/* Masqué à l'écran, lu par les lecteurs d'écran. */
.visually-hidden {
  position: absolute !important;
  width: var(--border-width);
  height: var(--border-width);
  padding: 0;
  margin: calc(-1 * var(--border-width));
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text);
  transform: translateY(-200%);
}

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

/* Variantes réservées à l'ordinateur ou au mobile (texte différent selon la maquette). */
@media (max-width: 640px) {
  .only-desktop {
    display: none !important;
  }
}

@media (min-width: 641px) {
  .only-mobile {
    display: none !important;
  }
}

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