/* ============================================
   BASE.CSS - Variables & Reset
   ============================================ */

/* === Variables CSS === */
:root {
    color-scheme: light;
    /* Couleurs principales */
    --blue: #7fb893;
    --green: #5c936f;
    --peach: #f2e3d8;
    --pink: #c56a52;
    --purple: #f2c96b;

    /* Couleurs fonctionnelles */
    --twitch: #9146ff;
    --twitch-dark: #772ce8;
    --live-red: #ff0000;
    --live-red-pastel: #ff9b9b;
    --live-red-dark: #e66767;

    /* Background */
    --bg-primary: #f0ebe0;
    --bg-overlay: rgba(240, 235, 224, 0.90);
    --bg-blur: rgba(240, 235, 224, 0.78);

    /* Texte */
    --text-primary: #3f2f25;
    --text-secondary: rgba(63, 47, 37, 0.88);
    --text-tertiary: rgba(63, 47, 37, 0.72);
    --text-muted: rgba(63, 47, 37, 0.55);

    /* Spacing */
    --spacing-xs: 10px;
    --spacing-sm: 20px;
    --spacing-md: 40px;
    --spacing-lg: 60px;
    --spacing-xl: 80px;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 20px;
    --radius-lg: 30px;
    --radius-xl: 40px;
    --radius-full: 50px;

    /* Shadows */
    --shadow-sm: 0 6px 18px rgba(63, 47, 37, 0.10);
    --shadow-md: 0 14px 40px rgba(63, 47, 37, 0.14);
    --shadow-lg: 0 24px 70px rgba(63, 47, 37, 0.18);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.4s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index */
    --z-particles: -1;
    --z-content: 1;
    --z-nav: 1000;
    --z-modal: 9999;
    --z-toast: 10000;
}

/* === Reset CSS === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Baloo 2",
    ui-rounded,
    "Nunito",
    "Quicksand",
    "Rubik",
    "Segoe UI",
    system-ui,
    -apple-system,
    "Helvetica Neue",
    Arial,
    sans-serif;
    font-weight: 500;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Typography base === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

p {
    line-height: 1.8;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

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

/* === Selection === */
::selection {
    background: var(--blue);
    color: var(--bg-primary);
}

::-moz-selection {
    background: var(--blue);
    color: var(--bg-primary);
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--pink);
    border-radius: 6px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--green);
}

/* === Focus visible === */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline-color: var(--pink);
}

/* ============================================
   VIEW TRANSITIONS — Navigation entre pages
   ============================================ */

/* Active les transitions cross-document (Chrome 126+, Edge 126+) */
@view-transition {
    navigation: auto;
}

/* Slide doux : sortie vers le haut, entrée depuis le bas */
::view-transition-old(root) {
    animation: vt-out 0.22s ease-in both;
}

::view-transition-new(root) {
    animation: vt-in 0.22s ease-out both;
}

@keyframes vt-out {
    to { opacity: 0; transform: translateY(-8px); }
}

@keyframes vt-in {
    from { opacity: 0; transform: translateY(8px); }
}

/* La navbar reste fixe et ne participe pas à la transition de page */
#navbar {
    view-transition-name: navbar;
}

::view-transition-old(navbar),
::view-transition-new(navbar) {
    animation: none;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none;
    }
}

/* === Utilities === */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* === Container === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* === Section base === */
section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px var(--spacing-md);
    position: relative;
}

/* === Préchargement / Loading states === */
[data-loading="true"] {
    opacity: 0.7;
    pointer-events: none;
}


/* === Icônes SVG globales === */
.icon,
.logo img,
.menu-toggle img,
.gallery-icon img,
.social-icon img,
.lightbox__btn img,
.lightbox__close img,
.lightbox__play img,
.lightbox__zoom img {
    width: 1em;
    height: 1em;
    vertical-align: middle;
    display: inline-block;
}

/* Icônes plus grandes dans la galerie et les réseaux */
.gallery-icon img,
.social-icon img {
    width: 2.5em;
    height: 2.5em;
}

/* Icônes de la lightbox */
.lightbox__btn img,
.lightbox__close img,
.lightbox__play img,
.lightbox__zoom img {
    width: 24px;
    height: 24px;
}

/* Fluent Emoji Styles */
.fluent-emoji,
img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 0.05em 0 0.1em;
    vertical-align: -0.15em;
    display: inline-block;
}

/* Emojis plus grands dans certains contextes */
.social-icon .fluent-emoji,
.contact-icon .fluent-emoji {
    height: 1.2em;
    width: 1.2em;
}

/* === Animations globales === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === Scroll reveal === */
.scroll-reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.55s ease, transform 0.55s ease;
    transition-delay: var(--sr-delay, 0s);
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Reduced motion === */
@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;
    }
}

/* === Print === */
@media print {
    body {
        background: white;
        color: black;
    }

    nav,
    footer,
    .particles,
    .bg-container {
        display: none !important;
    }
}