/* =========================================================
   BASE — reset, typographie, utilitaires
   ========================================================= */

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

* { margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
}

body.is-locked { overflow: hidden; }

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

a { color: inherit; text-decoration: none; }

button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

ul, ol { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; }

p { color: var(--text-2); }

strong { color: var(--text); font-weight: 700; }

::selection { background: var(--accent); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--surface-sunk); }
::-webkit-scrollbar-thumb {
  background: var(--sh-d);
  border-radius: var(--r-pill);
  border: 3px solid var(--surface-sunk);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Focus accessible */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* =========================================================
   LAYOUT UTILITAIRES
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: 900px; }

.section { padding-block: var(--section-y); position: relative; }
.section--sunk { background: var(--surface-sunk); }

.grid { display: grid; gap: clamp(1.1rem, 2.4vw, 2rem); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.flex { display: flex; }
.center { display: flex; align-items: center; justify-content: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.gap-sm { gap: .6rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.8rem; }

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.8rem; }
.mt-4 { margin-top: 2.6rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.8rem; }

.lead {
  font-size: clamp(1.02rem, 1.35vw, 1.18rem);
  color: var(--text-2);
  max-width: 62ch;
}

.gradient-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 999;
  background: var(--accent); color: #fff;
  padding: .8rem 1.4rem; border-radius: var(--r-sm);
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 1rem; }

/* Décor de fond : halos animés */
.aurora {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.aurora span {
  position: absolute;
  width: 46vmax; height: 46vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .30;
  will-change: transform;
}
[data-theme="dark"] .aurora span { opacity: .22; }
.aurora span:nth-child(1) { background: var(--accent);   top: -18vmax; left: -12vmax; animation: drift-a 26s var(--ease-io) infinite; }
.aurora span:nth-child(2) { background: var(--accent-2); bottom: -20vmax; right: -14vmax; animation: drift-b 32s var(--ease-io) infinite; }
.aurora span:nth-child(3) { background: var(--accent-3); top: 42%; left: 55%; opacity: .16; animation: drift-c 38s var(--ease-io) infinite; }

main { position: relative; z-index: 1; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 680px) {
  :root { --header-h: 70px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* =========================================================
   MOUVEMENT RÉDUIT
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .aurora { display: none; }
}
