/* ==========================================================================
   SANSIL 3D — base.css
   Reset, typographie, mise en page, accessibilité, utilitaires.
   Mobile-first : les media queries ne font qu'élargir.
   ========================================================================== */

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

* { margin: 0; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  min-height: 100svh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: var(--t-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

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

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

/* --- Titres --------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: var(--w-bold);
  line-height: var(--lh-title);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

h1 { font-size: var(--t-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); font-weight: var(--w-semibold); }

p { text-wrap: pretty; }
p + p { margin-top: var(--s-4); }

.lead {
  font-size: var(--t-lead);
  color: var(--c-muted);
  max-width: var(--w-prose);
}

.muted { color: var(--c-muted); }
.mono { font-family: var(--f-mono); font-size: 0.94em; }

/* Surtitre : sert à situer la section, pas à décorer */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  font-weight: var(--w-medium);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--c-cyan);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
}

/* Texte en dégradé — réservé à un seul mot-clé par page */
.accent-text {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Liens ---------------------------------------------------------------- */

a {
  color: var(--c-cyan);
  text-decoration-color: var(--c-cyan-40);
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease),
              text-decoration-color var(--dur) var(--ease);
}

a:hover { filter: var(--hover-lift); text-decoration-color: currentColor; }

/* --- Listes --------------------------------------------------------------- */

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

ul.checks {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--s-3);
}

ul.checks li {
  position: relative;
  padding-left: var(--s-6);
  color: var(--c-muted);
}

ul.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--c-cyan);
}

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

:focus-visible {
  outline: 2px solid var(--c-cyan);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  z-index: var(--z-toast);
  transform: translateY(-200%);
  padding: var(--s-3) var(--s-5);
  background: var(--c-cyan);
  color: var(--c-on-accent);
  font-weight: var(--w-semibold);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible { transform: translateY(0); }

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

/* --- Mise en page --------------------------------------------------------- */

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

.container--wide { max-width: var(--w-wide); }
.container--prose { max-width: var(--w-prose); }

.section { padding-block: var(--s-section); }
.section--tight { padding-block: calc(var(--s-section) * 0.6); }

/* Fond alterné pour séparer visuellement deux sections successives */
.section--panel {
  background: var(--c-surface);
  border-block: 1px solid var(--c-border);
}

.section__head {
  display: grid;
  gap: var(--s-4);
  margin-bottom: var(--s-7);
  max-width: var(--w-prose);
}

/* Grille fluide : min 260px par colonne, sans media query */
.grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid--wide { gap: var(--s-6); }

.stack { display: grid; gap: var(--s-4); }
.stack--lg { gap: var(--s-6); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}

/* Séparateur signature : strates d'impression FDM */
.layer-rule {
  height: 18px;
  background: var(--layer-lines);
  border: 0;
  opacity: 0.9;
  mask-image: linear-gradient(90deg, transparent, rgb(var(--shadow-rgb)) 15%, rgb(var(--shadow-rgb)) 85%, transparent);
}

/* --- Révélation au défilement (JS ajoute .is-visible) --------------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
}

.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* --- Utilitaires ---------------------------------------------------------- */

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.mt-7 { margin-top: var(--s-7); }
.full-bleed { width: 100%; }
.hide { display: none !important; }

@media (min-width: 48rem) {
  .md-hide { display: none !important; }
}

@media (max-width: 47.99rem) {
  .sm-hide { display: none !important; }
}

@media (min-width: 48rem) {
  .sm-only { display: none !important; }
}
