/* Réglo — reset + fondations */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  transition: background-color var(--duration), color var(--duration);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

/* Les GRANDS titres passent en Fraunces : c'est la voix éditoriale du site.
   Une serif se règle autrement qu'une grotesque — l'interlignage descend
   (les empattements densifient la ligne) et l'approche négative se réduit
   (les serifs se touchent vite). h3/h4 restent en Space Grotesk : à taille
   d'interface, la serif ferait « journal », pas « produit ». */
h1, h2 {
  font-family: var(--font-serif);
  font-variation-settings: 'opsz' 72;
  line-height: 1.04;
  letter-spacing: -0.012em;
}

h1 { font-size: var(--text-hero); font-weight: 640; }
h2 { font-size: var(--text-2xl);  font-weight: 640; }
h3 { font-size: var(--text-xl);   font-weight: 600; }
h4 { font-size: var(--text-lg);   font-weight: 600; }

/* Les chiffres alignés en colonne (tarifs, économies) ne doivent jamais
   danser : chasse fixe dans les tableaux, partout. */
table { font-variant-numeric: tabular-nums; }

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-deep); }

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

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

button { cursor: pointer; }

ul, ol { padding-left: 1.2em; }

::selection { background: var(--sun-400); color: var(--cta-ink); }

/* Ascenseur discret, teinté du thème (WebKit + spec) */
html {
  scrollbar-width: thin;
  scrollbar-color: rgb(18 35 26 / 0.28) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgb(18 35 26 / 0.22);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgb(18 35 26 / 0.36); }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible {
  outline: 3px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.section { padding-block: var(--space-section); }
.section--tight { padding-block: var(--space-7); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-text);
  margin-bottom: var(--space-4);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-text), transparent);
}

.lead {
  font-size: var(--text-lg);
  color: var(--ink-soft);
  max-width: 56ch;
}

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

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

.skip-link {
  position: absolute;
  top: -48px; left: var(--space-4);
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top var(--duration-fast);
}
.skip-link:focus { top: 0; }

/* Révélation au scroll (transform/opacity uniquement) */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 90ms; }
.reveal[data-delay="2"] { transition-delay: 180ms; }
.reveal[data-delay="3"] { transition-delay: 270ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ══ Ambiance TSG ══
   Aurora fixe (halos bleu/jaune) derrière toute la page + grille
   discrète estompée vers le bas — sur les deux thèmes. */
body { position: relative; z-index: 0; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: var(--aurora), var(--bg);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 40%, transparent 100%);
}
