/* ============================================================
   EXTRATIME — Base : reset, typographie, primitives de mise en page
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* décalage d'ancre sous le header collant */
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--et-ink);
  color: var(--et-on-ink);
  font-family: var(--et-font-text);
  font-size: var(--et-t2);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* garde-fou : rien ne doit déborder horizontalement */
  overflow-x: hidden;
}

h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

/* L'attribut `hidden` doit gagner contre tout `display` d'auteur :
   sans cela, un .empty en `display:grid` reste visible une fois masqué. */
[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; }

/* Un seul anneau de focus pour tout le site, visible sur noir ET sur papier. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--et-accent);
  outline-offset: 3px;
  border-radius: 1px;
}

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

/* ---------- Typographie ---------- */

.display {
  font-family: var(--et-font-display);
  font-weight: 800;
  letter-spacing: var(--et-track-display);
  line-height: 0.92;
  text-transform: uppercase;
  text-wrap: balance;
  /* Un nom très long sans espace se coupe plutôt que de sortir de l'écran.
     break-word ne change pas la taille intrinsèque : aucune colonne existante ne bouge. */
  overflow-wrap: break-word;
}
.d1 { font-size: var(--et-d1); letter-spacing: var(--et-track-display-tight); }
.d2 { font-size: var(--et-d2); letter-spacing: var(--et-track-display-tight); }
.d3 { font-size: var(--et-d3); }
.d4 { font-size: var(--et-d4); line-height: 1.02; }

.editorial {
  font-family: var(--et-font-editorial);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.lead-ed { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem); line-height: 1.4; color: var(--on-surface, var(--et-on-ink)); max-width: 40ch; }

.lead {
  font-size: var(--et-t1);
  line-height: 1.5;
  color: var(--on-surface-soft, var(--et-on-ink-soft));
  max-width: var(--et-measure);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--et-2);
  font-family: var(--et-font-mono);
  font-size: var(--et-label);
  letter-spacing: var(--et-track-label);
  text-transform: uppercase;
  color: var(--on-surface-soft, var(--et-on-ink-soft));
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--et-accent);
  flex: none;
}
.eyebrow.bare::before { display: none; }

.meta {
  font-family: var(--et-font-mono);
  font-size: var(--et-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-surface-soft, var(--et-on-ink-soft));
}

.prose p { max-width: var(--et-measure); }
.prose p + p { margin-top: 1em; }

/* ---------- Primitives de mise en page ---------- */

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

.section { padding-block: var(--et-section-y); }
.section-sm { padding-block: clamp(36px, 4.5vw, 64px); }

/* Tout enfant de grille peut rétrécir : empêche les débordements. */
.grid > *, .flex > * { min-width: 0; }

.rule {
  height: var(--et-hairline);
  background: var(--surface-line, var(--et-ink-line));
  border: 0;
  margin: 0;
}

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

.skip-link {
  position: fixed;
  top: var(--et-3);
  left: var(--et-3);
  z-index: var(--z-skip);
  padding: var(--et-3) var(--et-4);
  background: var(--et-accent);
  color: var(--et-accent-ink);
  font-family: var(--et-font-mono);
  font-size: var(--et-label-lg);
  letter-spacing: var(--et-track-label);
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform var(--et-fast) var(--et-ease);
}
.skip-link:focus-visible { transform: translateY(0); }

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

@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;
  }
}
