/* ==========================================================================
   base.css — Reset, éléments natifs, typographie, accessibilité
   ========================================================================== */

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

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

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
  color: var(--text-strong);
  margin: 0 0 var(--sp-3);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-3xl);
}
h2 {
  font-size: var(--fs-2xl);
}
h3 {
  font-size: var(--fs-xl);
}
h4 {
  font-size: var(--fs-lg);
}

p {
  margin: 0 0 var(--sp-4);
  max-width: 76ch;
}

a {
  color: var(--accent-text);
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

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

li {
  margin-bottom: var(--sp-2);
  max-width: 74ch;
}

strong {
  color: var(--text-strong);
  font-weight: 600;
}

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

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

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

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

hr {
  border: 0;
  border-top: var(--border) solid var(--line);
  margin: var(--sp-6) 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute !important;
  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;
  top: -200px;
  left: var(--sp-4);
  z-index: var(--z-modal);
  background: var(--accent);
  color: #001322;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--sp-2);
}

::selection {
  background: var(--accent-soft);
  color: var(--text-strong);
}

/* Barres de défilement discrètes, cohérentes avec le thème */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 6px;
  border: 3px solid var(--bg);
}

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

@media print {
  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}
