/* ==========================================================================
   ONFLOWX · Base (couche 2) : reset moderne, typographie, focus
   ========================================================================== */

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

* { margin: 0; }

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

/* Très grands écrans (TV, 2K, 4K) : tout le site grandit proportionnellement (texte, espaces, images),
   la mise en page reste celle d'un ordinateur. Navigateur sans « zoom » : affichage normal. */
@media (min-width: 1800px) { html { zoom: 1.15; } }
@media (min-width: 2400px) { html { zoom: 1.4; } }
@media (min-width: 3200px) { html { zoom: 1.8; } }

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

[data-theme] { color: var(--text); }

[hidden] { display: none !important; }

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

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

button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

table { border-collapse: collapse; border-spacing: 0; }

hr { border: 0; border-top: 1px solid var(--border); }

/* ---------- Typographie ---------- */

h1, h2, h3, h4, .display, .h1, .h2, .h3 {
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-snug);
  text-wrap: balance;
}

.display {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: var(--lh-tight);
}

h1, .h1 { font-size: var(--fs-h1); font-weight: 700; line-height: var(--lh-tight); }
h2, .h2 { font-size: var(--fs-h2); font-weight: 600; line-height: 1.15; }
h3, .h3 { font-size: var(--fs-h3); font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

p { text-wrap: pretty; }

.lead { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); font-weight: 300; color: var(--text-soft); }

small, .small { font-size: var(--fs-small); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary-soft-text);
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-hover) var(--ease-flow);
}
a:hover { color: var(--text); }

/* Liens écrits dans une phrase ou une liste (texte, fenêtres) : de petits boutons, jamais un simple texte souligné
   (porteur, 27/10/2026). Les titres, cartes, menus et liens d'image gardent leur propre présentation. */
:is(main, dialog) :is(p, li, dd, td, label, small, figcaption, blockquote, span, div) > a:not([class]):not(:has(img, picture, video, svg)) {
  display: inline-block;
  max-width: 100%;
  margin-block: 1px;
  padding: .05em .55em;
  line-height: 1.45;
  overflow-wrap: anywhere;
  vertical-align: baseline;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-soft-text);
  font-weight: 500;
  text-decoration: none;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-color var(--dur-hover) var(--ease-flow), color var(--dur-hover) var(--ease-flow), border-color var(--dur-hover) var(--ease-flow);
}
:is(main, dialog) :is(p, li, dd, td, label, small, figcaption, blockquote, span, div) > a:not([class]):not(:has(img, picture, video, svg)):hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
:is(main, dialog) nav :is(p, li, dd, td, span) > a:not([class]) { padding: 0; border: 0; background: none; color: inherit; font-weight: inherit; }
/* Tout autre lien du contenu : jamais souligné. */
:is(main, dialog) a:not([class]) { text-decoration: none; }
/* Lien qui porte un titre ou une carte : pas de soulignement non plus, la couleur du titre, survol en violet. */
:is(main, dialog) :is(h1, h2, h3, h4, h5, h6) a:not([class]) { color: inherit; text-decoration: none; }
:is(main, dialog) :is(h1, h2, h3, h4, h5, h6) a:not([class]):hover { color: var(--link); }
:is(main, dialog) a:not([class]):focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { :is(main, dialog) a:not([class]) { transition: none; } }

strong, b { font-weight: 600; }

code, kbd, pre, samp { font-family: var(--font-mono); font-size: .875em; }

kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  font-size: var(--fs-xs);
}

.tabular, data, time { font-variant-numeric: tabular-nums; }

::selection { background: var(--violet-200); color: var(--ink-900); }

/* ---------- Focus visible : anneau violet 3 px ---------- */

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

/* ---------- Lien d'évitement ---------- */

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-field);
  background: var(--primary-solid);
  color: var(--on-primary);
  font-weight: 500;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; color: var(--on-primary); }

/* ---------- Mouvement réduit : tout s'arrête ---------- */

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