/* =========================================================================
   Kaï Consulting — Design System v2 — RESET
   Base : Andy Bell's modern reset (2024 revision) + ajouts perso
   ========================================================================= */

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

/* Suppression marges par défaut */
* {
    margin: 0;
}

/* Hauteur racine + scroll-padding pour les sticky headers */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--sp-11);  /* éviter passage sous header sticky */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Body — base typo + couleurs */
body {
    min-height: 100dvh;       /* dynamic viewport unit, 2026 standard */
    line-height: var(--leading-normal);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    color: var(--fg);
    background: var(--bg);
    font-feature-settings: 'cv11', 'ss01', 'ss03';
}

/* Médias responsive par défaut */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Form controls héritent de la typo */
input, button, textarea, select {
    font: inherit;
    color: inherit;
}

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

button:disabled, [aria-disabled="true"] {
    cursor: not-allowed;
}

/* Éviter overflow sur mots longs */
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    text-wrap: balance;        /* 2026 : balance pour les titres */
}

p {
    text-wrap: pretty;         /* évite les veuves/orphelines */
}

/* Listes sans style par défaut quand role="list" */
ul, ol {
    padding: 0;
}

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

/* Liens — héritent du brand */
a {
    color: var(--brand);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color var(--duration-snappy) var(--ease-out);
}

a:hover {
    color: var(--brand-hover);
}

/* Tableaux */
table {
    border-collapse: collapse;
    width: 100%;
}

/* Hr */
hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin-block: var(--sp-7);
}

/* Code blocks */
code, pre, kbd, samp {
    font-family: var(--font-mono);
    font-feature-settings: 'liga' 0, 'calt' 0;
}

/* Suppression styles natifs <details>/<summary> sur certains browsers */
details > summary {
    list-style: none;
    cursor: pointer;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::marker { content: ''; }

/* Pour les sections target avec ancre — offset du sticky header */
:target {
    scroll-margin-top: var(--sp-11);
}

/* Suppression de l'outline focus par défaut — on utilise :focus-visible */
:focus {
    outline: none;
}

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

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

/* Sélection texte — couleur brand */
::selection {
    background: color-mix(in oklch, var(--brand) 25%, transparent);
    color: var(--fg);
}
