/* AvoLex — tokens, reset, typographie (mobile-first) */

:root {
  /* Brand — encre / or cabinet */
  --color-ink-950: #061018;
  --color-ink-900: #0c1c2e;
  --color-ink-800: #143049;
  --color-ink-700: #1c4160;
  --color-ink-600: #2a5578;
  --color-brass-300: #e2c98a;
  --color-brass-400: #d4b46a;
  --color-brass-500: #c49a3c;
  --color-brass-600: #9a7528;
  --color-brass-700: #7a5c1c;

  /* Neutrals warm-cool */
  --color-paper: #f5f3ef;
  --color-paper-2: #ebe7df;
  --color-slate-50: #f7f8fa;
  --color-slate-100: #eef1f5;
  --color-slate-200: #dde3eb;
  --color-slate-300: #c3ccd8;
  --color-slate-500: #667483;
  --color-slate-700: #3a4554;
  --color-slate-900: #161c24;

  /* Semantic aliases (compat composants existants) */
  --color-navy-950: var(--color-ink-950);
  --color-navy-900: var(--color-ink-900);
  --color-navy-800: var(--color-ink-800);
  --color-navy-700: var(--color-ink-700);
  --color-gold-400: var(--color-brass-400);
  --color-gold-500: var(--color-brass-500);
  --color-gold-600: var(--color-brass-600);
  --color-gray-50: var(--color-slate-50);
  --color-gray-100: var(--color-slate-100);
  --color-gray-200: var(--color-slate-200);
  --color-gray-300: var(--color-slate-300);
  --color-gray-500: var(--color-slate-500);
  --color-gray-700: var(--color-slate-700);
  --color-gray-900: var(--color-slate-900);

  --color-bg: #faf9f7;
  --color-bg-elevated: #ffffff;
  --color-bg-muted: var(--color-paper);
  --color-text: var(--color-slate-900);
  --color-text-muted: var(--color-slate-500);
  --color-border: rgb(22 28 36 / 10%);
  --color-border-strong: rgb(22 28 36 / 16%);
  --color-focus: var(--color-ink-700);
  --color-danger: #b42318;
  --color-danger-bg: #fef3f2;
  --color-success: #067647;
  --color-success-bg: #ecfdf3;
  --color-warning: #b54708;
  --color-warning-bg: #fffaeb;
  --color-info: #175cd3;
  --color-info-bg: #eff8ff;

  --color-sidebar: var(--color-ink-900);
  --color-sidebar-text: #c9d4e0;
  --color-sidebar-active: var(--color-brass-400);
  --color-topbar: rgb(250 249 247 / 86%);

  --sidebar-width: 17rem;
  --topbar-height: 4rem;
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgb(12 28 46 / 5%);
  --shadow-md: 0 10px 30px rgb(12 28 46 / 8%), 0 2px 6px rgb(12 28 46 / 4%);
  --shadow-lg: 0 24px 48px rgb(12 28 46 / 12%);
  --shadow-glow: 0 0 0 1px rgb(196 154 60 / 22%), 0 12px 40px rgb(196 154 60 / 12%);

  --font-sans: "Source Sans 3", "Segoe UI", sans-serif;
  --font-display: "Source Serif 4", "Times New Roman", serif;
  --text-xs: 0.75rem;
  --text-sm: 0.9rem;
  --text-base: 1.025rem;
  --text-lg: 1.15rem;
  --text-xl: 1.35rem;
  --text-2xl: 1.7rem;
  --text-3xl: 2.35rem;
  --text-4xl: 3rem;
  --leading: 1.55;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --content-max: 72rem;
  --transition: 200ms cubic-bezier(0.22, 1, 0.36, 1);
  --z-dropdown: 40;
  --z-sticky: 50;
  --z-modal: 60;
  --z-toast: 70;
}

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

html {
  scroll-behavior: smooth;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--color-text);
  background:
    radial-gradient(900px 420px at 100% -10%, rgb(196 154 60 / 7%), transparent 55%),
    radial-gradient(700px 380px at 0% 0%, rgb(20 48 73 / 5%), transparent 50%),
    var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--color-ink-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-brass-600);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-ink-900);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 4.5vw, var(--text-3xl));
}

h2 {
  font-size: clamp(1.55rem, 3.2vw, var(--text-2xl));
}

h3 {
  font-size: var(--text-xl);
  font-family: var(--font-sans);
  font-weight: 650;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.25rem;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  background: var(--color-ink-900);
  color: #fff;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
}

.container {
  width: min(100% - 2rem, var(--content-max));
  margin-inline: auto;
}

.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;
}

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

.text-sm {
  font-size: var(--text-sm);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

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

.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
