/* =====================================================================
   Base : reset, typographie, focus
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  zoom: var(--ui);
  background: var(--canvas);
  color: var(--label);
  -webkit-text-size-adjust: 100%;
  /* scrollIntoView() respecte ces marges : le focus ne colle jamais aux bords */
  scroll-padding-top: calc(var(--nav-h) + 48px);
  scroll-padding-bottom: 64px;
}

body {
  min-height: calc(100vh / var(--ui));
  font: 400 var(--fs-body)/1.45 var(--font);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
/* Message affiché sans JavaScript (index.html) */
.noscript { padding: 40px; font: 16px system-ui, sans-serif; }

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: rgba(255, 255, 255, .25); }

/* Effets légers (TV, appareils modestes ; voir core/device.js) : ni verre dépoli,
   ni fond flouté, transitions plus courtes. Les matériaux deviennent opaques. */
:root.lite {
  --material: rgba(30, 30, 34, .97);
  --material-thick: rgba(24, 24, 27, .98);
  --shadow-focus: 0 14px 28px -14px rgba(0, 0, 0, .8);
}
@media (prefers-reduced-motion: no-preference) {
  :root.lite { --t-med: 140ms; --t-slow: 220ms; }
}
.lite *, .lite *::before, .lite *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.lite .ambient__layer { display: none; }

/* Grands titres : chasse étroite, graisse forte, approche serrée */
.display {
  font-weight: 700;
  font-stretch: var(--stretch-display);
  letter-spacing: -.035em;
  line-height: .95;
  text-wrap: balance;
}

.ico { width: 24px; height: 24px; flex: none; }

/* ---------------------------------------------------------------------
   Focus
   La classe .is-kb est posée sur <html> par focus.js dès qu'on navigue
   au clavier ou à la manette (et retirée au premier clic). Les composants
   définissent leur propre état « levé » ; ceci est le filet de sécurité.
   --------------------------------------------------------------------- */
:focus { outline: none; }
.is-kb :focus { outline: 3px solid var(--focus); outline-offset: 3px; } /* l'outline suit l'arrondi de l'élément */
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

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

/* Barres de défilement discrètes */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}
