/* =========================================================
    ELITESTREAM — BASE STYLES
    base.css
   ========================================================= */


/* =========================================================
    1. FONTS
   ========================================================= */

/* ---------- SORA ---------- */

@font-face {
    font-family: "Sora";
    src: url("../fonts/sora/Sora-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Sora";
    src: url("../fonts/sora/Sora-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Sora";
    src: url("../fonts/sora/Sora-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Sora";
    src: url("../fonts/sora/Sora-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Sora";
    src: url("../fonts/sora/Sora-ExtraBold.ttf") format("truetype");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}


/* ---------- INTER ---------- */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter/Inter_18pt-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter/Inter_18pt-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter/Inter_18pt-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter/Inter_18pt-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* =========================================================
    2. RESET / BOX SIZING
   ========================================================= */

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

html,
body {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--es-header-height);
}


/* =========================================================
    3. BODY
   ========================================================= */

body {
    min-height: 100vh;

    margin: 0;

    font-family: var(--es-font-body);
    font-size: var(--es-fs-base);
    font-weight: var(--es-fw-regular);
    line-height: var(--es-lh-body);

    background-color: var(--es-bg);
    color: var(--es-text);

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    overflow-x: hidden;

    transition:
        background-color var(--es-transition-base),
        color var(--es-transition-base);
}


/* =========================================================
    4. TYPOGRAPHY
   ========================================================= */

h1,h2,h3,h4,h5,h6,p {
    margin-top: 0;
}

h1,h2,h3,h4,h5,h6 {
    font-family: var(--es-font-heading);
    font-weight: var(--es-fw-bold);
    line-height: var(--es-lh-heading);
    color: var(--es-text);
}

p {
    color: var(--es-text-secondary);
}

strong,b {
    font-weight: var(--es-fw-bold);
}


/* =========================================================
    5. LINKS
   ========================================================= */

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: inherit;
}


/* =========================================================
    6. MEDIA
   ========================================================= */

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

img {
    height: auto;
}


/* =========================================================
    7. FORMS & BUTTONS
   ========================================================= */

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

button {
    border: 0;
    cursor: pointer;
}

button,a {
    -webkit-tap-highlight-color: transparent;
}


/* =========================================================
    8. LISTS
   ========================================================= */

ul,ol {
    margin-top: 0;
}


/* =========================================================
    9. ACCESSIBILITY
   ========================================================= */

:focus-visible {
    outline: 2px solid var(--es-primary);
    outline-offset: 3px;
}


/* =========================================================
    10. TEXT SELECTION
   ========================================================= */

::selection {
    background-color: var(--es-primary);
    color: #ffffff;
}


/* =========================================================
    11. REDUCED MOTION
   ========================================================= */

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

/* =========================================================
    12. SCROLL REVEAL
   ========================================================= */

/*
 * Les éléments ne sont masqués que lorsque JavaScript
 * est réellement disponible.
 */

.js [data-reveal] {
    opacity: 0;
    transition:
        opacity 600ms ease,
        transform 600ms ease;
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}


/* ---------------------------------------------------------
    Reveal Up — animation principale
   --------------------------------------------------------- */

.js [data-reveal="up"] {
    transform: translateY(30px);
}


/* ---------------------------------------------------------
    Reveal Left
   --------------------------------------------------------- */

.js [data-reveal="left"] {
    transform: translateX(-30px);
}


/* ---------------------------------------------------------
    Reveal Right
   --------------------------------------------------------- */

.js [data-reveal="right"] {
    transform: translateX(30px);
}


/* ---------------------------------------------------------
    Reveal Scale — à utiliser très rarement
   --------------------------------------------------------- */

.js [data-reveal="scale"] {
    transform: scale(0.97);
}


/* ---------------------------------------------------------
    État visible
   --------------------------------------------------------- */

.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* =========================================================
    13. ANCHOR SCROLL OFFSET
    =========================================================
 *
 * Évite que le header sticky recouvre le titre d'une section
 * lorsqu'on navigue avec les ancres #.
 */

section[id] {
    scroll-margin-top: calc(
        var(--es-header-height) + var(--es-space-4)
    );
}

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

@media (prefers-reduced-motion: reduce) {

    .js [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }

}

/* =========================================================
    GLOBAL — CTA NAVIGATION LOADING
   ========================================================= */

/* Les CTA concernés doivent pouvoir accueillir le spinner. */
[data-loading-link] {
    position: relative;
}

/* Pendant le chargement, on bloque les clics supplémentaires. */
[data-loading-link].is-loading {
    pointer-events: none;
    cursor: wait;
    opacity: 0.88;
}

/* Spinner ajouté sans modifier le HTML interne du bouton. */
[data-loading-link].is-loading::after {
    content: "";
    width: 15px;
    height: 15px;
    margin-left: var(--es-space-2);
    display: inline-block;
    flex: 0 0 15px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: middle;
    animation: es-button-spinner 650ms linear infinite;
}

/* Légère pression du bouton au clic. */
[data-loading-link]:active {
    transform: scale(0.98);
}

/* Rotation continue du loader. */
@keyframes es-button-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibilité : suppression des animations si demandée. */
@media (prefers-reduced-motion: reduce) {
    [data-loading-link].is-loading::after {
        animation: none;
    }

    [data-loading-link]:active {
        transform: none;
    }
}