/* ==========================================================================
   MGP MOTO — « NOUVELLE GARDE » · BASE
   Reset, typographie, grille, sections, utilitaires.
   Propriétaire : agent SOCLE. Les pages ajoutent leur feuille dans
   static/ng/css/pages/<page>.css ; elles ne redéfinissent pas ce fichier.
   ========================================================================== */

/* --- Reset ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: dark;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}
html:not(.lenis) { scroll-behavior: smooth; }
html.no-motion { scroll-behavior: auto; }
body {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--ink-950);
  color: var(--paper);
  font-family: var(--font-body);
  font-stretch: var(--wdth-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  overflow-x: clip;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
h1, h2, h3, h4, h5, h6 { font-weight: inherit; font-size: inherit; line-height: inherit; }
ul[role="list"], ol[role="list"], .list-reset { list-style: none; padding: 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
::selection { background: var(--ember); color: var(--ink-950); }
dialog { color: inherit; }

/* Focus : visible au clavier, invisible à la souris. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Lien d'évitement */
.skip-link {
  position: fixed; top: .75rem; left: .75rem; z-index: calc(var(--z-loader) + 1);
  padding: .7rem 1.1rem; border-radius: var(--radius-pill);
  background: var(--paper); color: var(--ink-950);
  font: 600 var(--fs-small)/1 var(--font-body);
  transform: translateY(-200%);
  transition: transform var(--dur-2) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

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

/* --- Typographie : les trois voix ----------------------------------------- */
/* 1. Archivo étiré — titres */
.display, .h1, .h2, .h3, .h4, .mega {
  font-family: var(--font-display);
  font-stretch: var(--wdth-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--track-display);
  line-height: var(--lh-tight);
  text-wrap: balance;
}
.mega    { font-size: var(--fs-mega); font-weight: 900; letter-spacing: -0.035em; line-height: .86; }
.display { font-size: var(--fs-display); font-weight: 900; letter-spacing: -0.03em; line-height: .88; }
.h1      { font-size: var(--fs-h1); font-weight: 900; }
.h2      { font-size: var(--fs-h2); }
.h3      { font-size: var(--fs-h3); line-height: 1; }
.h4      { font-size: var(--fs-h4); line-height: 1.08; font-weight: 700; letter-spacing: -0.01em; }

/* 2. Instrument Serif italique — LE mot d'émotion (un seul groupe par titre) */
.serif, em.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: normal;
  text-transform: none;
  letter-spacing: -0.01em;
  /* L'œil du serif est plus petit que celui d'Archivo étiré : on compense. */
  font-size: 1.08em;
  line-height: 1;
  padding-right: .04em; /* l'italique déborde à droite */
}
.display .serif, .mega .serif, .h1 .serif { font-size: 1.1em; }
.text-ember { color: var(--ember); }
.section--paper .text-ember { color: var(--ember-deep); }

/* 3. Archivo texte */
.lead {
  font-size: var(--fs-lead);
  line-height: 1.45;
  font-weight: 400;
  color: var(--paper-dim);
  max-width: 38em;
  text-wrap: pretty;
}
.lead strong { color: var(--paper); font-weight: 600; }
.body-text { max-width: var(--container-text); text-wrap: pretty; }
.body-text > * + * { margin-top: 1em; }
.small { font-size: var(--fs-small); }
.muted { color: var(--mute); }
.dim { color: var(--paper-dim); }

/* 4. JetBrains Mono — données, repères, étiquettes */
.label, .mono {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.mono { text-transform: none; letter-spacing: .02em; font-size: var(--fs-small); }
.label--dim { color: var(--mute); }
.label--ember { color: var(--ember); }

/* Index de section « 01 — LA SÉLECTION » */
.index {
  display: inline-flex; align-items: center; gap: .9em;
  font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--paper-dim);
}
.index__num { color: var(--ember); font-variant-numeric: tabular-nums; }
.index__num::after { content: " —"; color: var(--mute); }
.section--paper .index { color: var(--mute-on-paper); }
.section--paper .index__num { color: var(--ember-deep); }

/* Texte riche (articles, descriptions) */
.prose { max-width: var(--container-text); font-size: 1.075rem; line-height: 1.7; text-wrap: pretty; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font: 800 var(--fs-h4)/1.1 var(--font-display); font-stretch: var(--wdth-display); text-transform: uppercase; margin-top: 2.2em; }
.prose h3 { font-weight: 700; font-size: 1.15rem; margin-top: 1.8em; }
.prose a { text-decoration: underline; text-decoration-color: var(--ember); text-underline-offset: .2em; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--ember); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--ember); }
.prose blockquote {
  font-family: var(--font-serif); font-style: italic; font-size: var(--fs-h3); line-height: 1.15;
  border-left: 2px solid var(--ember); padding-left: 1em; margin-block: 1.6em;
}
.section--paper .prose a:hover { color: var(--ember-deep); }

/* --- Mise en page ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--text { max-width: calc(var(--container-text) + 2 * var(--gutter)); }
.container--bleed { max-width: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gap);
}
.grid > * { grid-column: 1 / -1; }
/* Colonnes : .col-<n> (toujours pleine largeur sous 760 px), .md\:col-<n> dès 760 px, .lg\:col-<n> dès 1100 px */
@media (min-width: 760px) {
  .md\:col-3 { grid-column: span 3; } .md\:col-4 { grid-column: span 4; } .md\:col-5 { grid-column: span 5; }
  .md\:col-6 { grid-column: span 6; } .md\:col-7 { grid-column: span 7; } .md\:col-8 { grid-column: span 8; }
  .md\:col-12 { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .lg\:col-1 { grid-column: span 1; } .lg\:col-2 { grid-column: span 2; } .lg\:col-3 { grid-column: span 3; } .lg\:col-4 { grid-column: span 4; }
  .lg\:col-5 { grid-column: span 5; } .lg\:col-6 { grid-column: span 6; } .lg\:col-7 { grid-column: span 7; }
  .lg\:col-8 { grid-column: span 8; } .lg\:col-9 { grid-column: span 9; } .lg\:col-12 { grid-column: 1 / -1; }
  .lg\:start-2 { grid-column-start: 2; } .lg\:start-7 { grid-column-start: 7; } .lg\:start-8 { grid-column-start: 8; }
}

/* Grille de cartes auto-adaptative */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min, 19rem)), 1fr));
  gap: clamp(1.25rem, .8rem + 1.6vw, 2.5rem) var(--grid-gap);
}
.cards--wide { --card-min: 24rem; }
.cards--narrow { --card-min: 15rem; }

.stack > * + * { margin-top: var(--stack, var(--sp-5)); }
.stack--s { --stack: var(--sp-3); }
.stack--l { --stack: var(--sp-7); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster, var(--sp-3)); }
.split { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--sp-5); }

/* --- Sections : la scène sombre et le papier ivoire ------------------------ */
.section { position: relative; padding-block: var(--section-y); isolation: isolate; }
.section--tight { padding-block: calc(var(--section-y) * .55); }
.section--flush-top { padding-top: 0; }
.section--alt { background: var(--ink-900); }
.section--raised { background: var(--ink-850); }
.section--paper {
  --line: var(--line-on-paper);
  --line-strong: rgba(17, 17, 20, 0.24);
  background: var(--paper);
  color: var(--ink-on-paper);
  color-scheme: light;
}
.section--paper-2 { background: var(--paper-2); }
.section--paper .lead { color: var(--mute-on-paper); }
.section--paper .lead strong { color: var(--ink-on-paper); }
.section--paper .muted, .section--paper .label--dim { color: var(--mute-on-paper); }
.section--paper .dim { color: var(--mute-on-paper); }
.section--paper ::selection { background: var(--ink-on-paper); color: var(--paper); }

/* Grain de pellicule : posé par .grain (sections sombres) ; très léger. */
.grain { position: relative; }
.grain::after {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  background-image: url("../img/grain.svg");
  background-size: 180px 180px;
  opacity: .07;
  mix-blend-mode: overlay;
}
.grain > * { position: relative; z-index: 1; }

/* Filets */
.rule { height: 1px; border: 0; background: var(--line); }
.rule--strong { background: var(--line-strong); }
.rule--ember { background: var(--ember); height: 2px; width: 3rem; }

/* --- Utilitaires (volontairement minimalistes) ----------------------------- */
.mt-0 { margin-top: 0 !important; } .mt-s { margin-top: var(--sp-3); } .mt-m { margin-top: var(--sp-5); }
.mt-l { margin-top: var(--sp-7); } .mt-xl { margin-top: var(--sp-9); }
.mb-s { margin-bottom: var(--sp-3); } .mb-m { margin-bottom: var(--sp-5); } .mb-l { margin-bottom: var(--sp-7); }
.text-center { text-align: center; } .text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.w-full { width: 100%; }
.relative { position: relative; }
.hide-mobile { } .only-mobile { display: none; }
@media (max-width: 759px) { .hide-mobile { display: none !important; } .only-mobile { display: revert; } }

/* Image cadrée : fond ink-850, coins --radius-m, dégradé de pied. */
.frame {
  position: relative; overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--ink-850);
  aspect-ratio: var(--ratio, 4 / 5);
}
.frame > img, .frame > picture > img, .frame > picture {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.frame--shade::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(7,7,9,.72) 100%);
}
.frame--16x9 { --ratio: 16 / 9; } .frame--4x3 { --ratio: 4 / 3; } .frame--1x1 { --ratio: 1; } .frame--3x4 { --ratio: 3 / 4; }

/* Barre de défilement discrète */
@supports (scrollbar-color: auto) {
  html { scrollbar-color: var(--ink-600) var(--ink-950); scrollbar-width: thin; }
}
