/* ==========================================================================
   GJS · BASE
   Reset, typographie (échelle unique), accessibilité, animation d'apparition.
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light;
  background: var(--cream);
  scroll-padding-top: calc(var(--header-h) + 24px);
}

/* Sans JavaScript, l'en-tête n'est pas fixe (layout.css) : rien à laisser au-dessus des ancres */
html.no-js {
  scroll-padding-top: 24px;
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

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

img {
  height: auto;
}

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-weight: inherit;
  font-size: inherit;
  overflow-wrap: break-word;
}

p,
li,
dd,
summary {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
}

::selection {
  background: var(--lime);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

/* ---- Échelle typographique (H1, H2, H3, texte, petit texte) ------------ */

.t-h1,
.t-h2,
.t-h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: var(--lh-display);
  text-wrap: balance;
}

.t-h1 { font-size: var(--fs-h1); line-height: 0.88; }
.t-h2 { font-size: var(--fs-h2); }
.t-h3 { font-size: var(--fs-h3); line-height: 1; }

.t-body { font-size: var(--fs-body); }

.t-small {
  font-size: var(--fs-small);
  line-height: 1.5;
}

.t-muted { color: var(--fg-2); }

/* Paragraphe d'introduction : même taille que le texte, graisse 500 */
.t-intro {
  font-weight: 500;
  max-width: var(--measure);
}

.prose > * + * { margin-top: 1em; }
.prose p,
.prose li { max-width: var(--measure); }

/* Groupe de mots qui ne doit pas être coupé (ex. « projet ? ») */
.nowrap { white-space: nowrap; }

/* Coup de marqueur citron sous UN mot clé par titre important */
.hl {
  position: relative;
  z-index: 0;
  white-space: nowrap;
}

.hl::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.08em;
  right: -0.1em;
  bottom: 0.16em;
  height: 0.42em;
  background: var(--lime);
  border-radius: 0.06em 0.3em 0.1em 0.25em;
  transform: rotate(-1.5deg);
}

/* Sur fond noir, le texte passe en noir sur un aplat citron complet (lisible). */
.is-dark .hl {
  color: var(--ink);
  padding-inline: 0.12em;
}

.is-dark .hl::before {
  left: 0;
  right: 0;
  top: 0.04em;
  bottom: 0.08em;
  height: auto;
  border-radius: 0.04em 0.12em 0.06em 0.1em;
}

/* Marqueur de contenu à remplacer : volontairement visible */
.todo {
  display: inline-block;
  padding: 0 6px;
  border: 2px dashed currentColor;
  font-family: var(--font-text);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
  /* Un repère long revient à la ligne : il ne doit jamais élargir la page sur mobile */
  max-width: 100%;
  white-space: normal;
}

/* ---- Accessibilité ------------------------------------------------------ */

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: calc(var(--z-cookies) + 1);
  padding: 12px 18px;
  background: var(--lime);
  color: var(--ink);
  border: var(--border) solid var(--ink);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

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

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

/* ---- Mouvement réduit ---------------------------------------------------- */

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