/* ========================================
   BASE — Reset, typographie, body, utilitaires
   ======================================== */

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* clip (et non hidden) : empêche tout débordement horizontal sans
       créer de conteneur de défilement qui casserait position: fixed. */
    overflow-x: clip;
}

body {
    font-family: var(--font-body);
    background: var(--black);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--speed) var(--ease); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* Conteneur centré */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* Mot mis en avant (couleur bois) */
.accent {
    color: var(--wood-light);
    font-weight: inherit;
}

/* Accessibilité : lien d'évitement + contenu hors écran */
.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;
}

/* Focus visible global (accessibilité clavier) */
:focus-visible {
    outline: 2px solid var(--wood-light);
    outline-offset: 3px;
}

/* Sélection & scrollbar */
::selection {
    background: var(--wood-light);
    color: var(--black);
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--charcoal); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--wood-dark); }

/* ========================================
   LOADER
   ======================================== */
.loader {
    position: fixed;
    inset: 0;
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-logo {
    width: 140px;
    animation: pulse 1.4s ease-in-out infinite;
    filter: brightness(1.1);
}
@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* ========================================
   BARRE DE PROGRESSION DE SCROLL (accent bois)
   ======================================== */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 100%;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--wood-dark), var(--wood-light));
    z-index: 200;
    will-change: transform;
}
/* Variante moderne : scroll-driven animation si supportée */
@supports (animation-timeline: scroll()) {
    .scroll-progress {
        animation: progressGrow linear;
        animation-timeline: scroll(root);
    }
}
@keyframes progressGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}
