/* base.css — remise à zéro, typographie de base, conteneurs et grille. Voir DESIGN.md § 3 et § 4. */

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 100%;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  overflow-x: hidden;
  /* L'en-tête est collant (components.css) : une ancre (#projets, #contact, le lien d'évitement)
     doit atterrir SOUS lui, pas dessous-dessus. */
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: var(--fs-body);
  font-weight: var(--fw-text);
  overflow-wrap: break-word;
  hyphens: manual;
}

main {
  flex: 1 0 auto;
}

/* Titres */
h1, h2, h3, h4 {
  margin: 0;
  font-weight: var(--fw-title);
  text-wrap: balance;
  color: var(--ink);
}

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  letter-spacing: -0.015em;
  font-weight: var(--fw-display);
}

h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
}

h4 {
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
}

p, ul, ol, dl, figure, blockquote {
  margin: 0;
}

p {
  text-wrap: pretty;
}

p + p {
  margin-top: var(--s-4);
}

/* Aucune italique : Hanken n'a pas de fichier italique (DESIGN.md § 3). */
em, i, cite, address {
  font-style: normal;
}

strong, b {
  font-weight: var(--fw-title);
}

small {
  font-size: var(--fs-small);
}

a {
  color: inherit;
}

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

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

button {
  cursor: pointer;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--s-7) 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-text);
}

pre {
  overflow-x: auto;
}

/* Focus commun à tout le site (DESIGN.md § 5) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

/* Texte : classes typographiques */
.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
  color: var(--ink-2);
  text-wrap: pretty;
}

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

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

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

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

.prose > * + * {
  margin-top: var(--s-4);
}

.prose h2 {
  margin-top: var(--s-8);
}

.prose h3 {
  margin-top: var(--s-6);
}

.prose ul, .prose ol {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: var(--s-2);
}

/* Conteneurs et grille */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter-x);
}

.container--wide {
  max-width: var(--container-wide);
}

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

.section--tight {
  padding-block: var(--s-8);
}

.section__head {
  margin-bottom: var(--s-7);
}

.section__head .lead {
  margin-top: var(--s-4);
  max-width: var(--measure);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

/* Par défaut (mobile, tablette) chaque enfant prend toute la largeur ; les .col-* n'agissent qu'à partir de 900 px.
   `auto / span n` : un .col-start-n peut alors fixer la colonne de départ sans perdre l'étendue. */
.grid > * {
  min-width: 0;
  grid-column: 1 / -1;
}

@media (min-width: 40rem) {
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 56.25rem) {
  .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .col-1 { grid-column: auto / span 1; }
  .col-2 { grid-column: auto / span 2; }
  .col-3 { grid-column: auto / span 3; }
  .col-4 { grid-column: auto / span 4; }
  .col-5 { grid-column: auto / span 5; }
  .col-6 { grid-column: auto / span 6; }
  .col-7 { grid-column: auto / span 7; }
  .col-8 { grid-column: auto / span 8; }
  .col-9 { grid-column: auto / span 9; }
  .col-10 { grid-column: auto / span 10; }
  .col-12 { grid-column: auto / span 12; }
  .col-start-2 { grid-column-start: 2; }
  .col-start-3 { grid-column-start: 3; }
  .col-start-4 { grid-column-start: 4; }
  .col-start-5 { grid-column-start: 5; }
  .col-start-6 { grid-column-start: 6; }
  .col-start-7 { grid-column-start: 7; }
  .col-start-8 { grid-column-start: 8; }
  .col-start-9 { grid-column-start: 9; }
}

.stack > * + * {
  margin-top: var(--s-5);
}

.stack--tight > * + * {
  margin-top: var(--s-3);
}

.stack--loose > * + * {
  margin-top: var(--s-8);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  align-items: center;
}

/* Accessibilité */
.visually-hidden {
  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: 0;
  left: 0;
  z-index: 100;
  padding: var(--s-3) var(--s-5);
  background: var(--ink);
  color: var(--paper);
  font-weight: var(--fw-ui);
  text-decoration: none;
  transform: translateY(-120%);
}

.skip-link:focus-visible {
  transform: none;
  outline-offset: -4px;
  outline-color: var(--paper);
}

/* Un attribut hidden l'emporte sur tout display posé par un composant. */
[hidden] {
  display: none !important;
}

/* Listes sans puce */
.list-plain {
  list-style: none;
  padding: 0;
}
