/* =====================================================================
   ATELIER 360 — BASE (reset, typographie, layout, accessibilité)
   ===================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--text-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Halo aurora discret en fond de page (CSS pur, pas de WebGL) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--grad-aurora);
  pointer-events: none;
  z-index: 0;
}

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

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

ul, ol { list-style: none; padding: 0; }

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

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

::selection { background: rgba(99, 102, 241, .35); color: #fff; }

/* ---- Titres ---- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -.02em;
  color: var(--text);
  text-wrap: balance;
}
h2 { font-size: var(--fs-h2); letter-spacing: -.025em; }
h3 { font-size: var(--fs-h3); }

p { text-wrap: pretty; }

/* ---- Primitives de layout ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { position: relative; z-index: 1; padding-block: var(--section-y); }
.section--soft { background: var(--bg-soft); }

/* Bandeau « œil » de section : surtitre + titre + chapô */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--indigo-bright);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--indigo-bright);
  opacity: .7;
}

.section-head { max-width: 720px; margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head .lead { font-size: var(--fs-lead); color: var(--text-muted); margin-top: 1.1rem; }

/* Texte en dégradé de marque */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Utilitaires ---- */
.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: absolute; left: 1rem; top: -100px;
  background: var(--indigo); color: #fff;
  padding: .7rem 1.1rem; border-radius: var(--r-sm);
  z-index: var(--z-modal); transition: top var(--t-fast);
}
.skip-link:focus { top: 1rem; }

/* Indicateur de focus visible au clavier (WCAG 2.2 — 2.4.7 / 2.4.11).
   :focus-visible = anneau uniquement à la navigation clavier, jamais au clic souris. */
:focus-visible {
  outline: 2px solid var(--indigo-bright);
  outline-offset: 2px;
  border-radius: 3px;
}
/* Le skip-link garde son placement dédié (géré ci-dessus), on ne le double pas. */
.skip-link:focus-visible { outline: none; }

.text-muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }

/* ---- Animations d'apparition (révélées par IntersectionObserver, repli si JS off) ---- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
/* Repli : sans JS, .no-js neutralise l'état caché pour ne jamais masquer le contenu */
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
