/* --- CONFIGURATION DES THÈMES --- */
:root {
    --brand-red: #A62D17;     /* Rouge constant */
}

/* On définit les variables par thèmes sur la balise HTML */
html[data-theme="dark"] {
    --bg-color: #013220;      /* Vert Sapin */
}

html[data-theme="light"] {
    --bg-color: #F5F5DC;      /* Beige */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    /* ÉTAPE CRUCIALE : On cache le body par défaut */
    opacity: 0; 
    background-color: var(--bg-color);
    color: var(--brand-red);
    font-family: 'Unbounded', sans-serif;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background-color 0.8s ease-in-out, opacity 0.3s ease;
}

/* Cette classe sera ajoutée par le JS après avoir appliqué le thème */
body.is-ready {
    opacity: 1;
}

/* ... (Le reste de ton CSS pour le bouton, le logo, etc. reste identique) ... */

/* --- BOUTON THEME --- */
#theme-toggle {
    position: fixed;
    top: 40px;
    right: 40px;
    z-index: 10002;
    background: none;
    border: 2px solid var(--brand-red);
    color: var(--brand-red);
    padding: 8px 15px;
    font-family: 'Unbounded', sans-serif;
    font-weight: 900;
    font-size: 0.7rem;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 50px;
    transition: all 0.3s;
}

#theme-toggle:hover {
    background-color: var(--brand-red);
    color: var(--bg-color);
}

/* --- LOGO COIN (Logo2) --- */
#master-icon {
    position: fixed; 
    top: 40px; 
    left: 40px; 
    width: 50px; 
    z-index: 10001;
    opacity: 0; 
    pointer-events: none; 
    will-change: transform, opacity;
    image-rendering: -webkit-optimize-contrast;
    transform: translateZ(0); /* Force l'accélération matérielle propre */
    will-change: transform;
}
#master-icon.final-state { opacity: 1; transform: translate(0, 0) scale(1); }

@keyframes fullIntro {
    0% { opacity: 0; transform: translate(calc(50vw - 40px - 50%), calc(50vh - 40px - 50%)) scale(600); }
    30% { opacity: 1; transform: translate(calc(50vw - 40px - 50%), calc(50vh - 40px - 50%)) scale(20); }
    55% { transform: translate(calc(50vw - 40px - 50%), calc(50vh - 40px - 50%)) scale(20); }
    100% { opacity: 1; transform: translate(0, 0) scale(1); }
}
.animate-all { animation: fullIntro 5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* --- ELEMENTS STATIQUES --- */
header, nav { z-index: 10000; opacity: 0; }
header { position: fixed; top: 55px; left: 40px; width: calc(100% - 80px); display: flex; align-items: center; }
.header-text { margin-left: 65px; font-weight: 900; text-transform: uppercase; font-size: 0.9rem; }
nav { position: fixed; bottom: 25px; left: 0; width: 100%; display: flex; justify-content: center; gap: 60px; }

.nav-link { 
    font-size: 1.3rem; font-weight: 900; text-transform: uppercase; cursor: pointer; 
    position: relative; color: var(--brand-red); text-decoration: none; 
}
.nav-link::after { content: ''; position: absolute; width: 0; height: 4px; bottom: -5px; left: 0; background-color: var(--brand-red); transition: width 0.3s ease; }
.nav-link:hover::after { width: 100%; }

.fade-active { 
    opacity: 1 !important; 
    transition: opacity 3.5s cubic-bezier(0.25, 0.1, 0.25, 1) !important; 
}

/* --- LOGO CENTRAL (Logo1) + TON NOM --- */
main { 
    flex: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
}

.brand-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* TON NOM : Réglage du décalage à gauche ici */
.user-name {
    font-weight: 900;
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--brand-red);
    
    margin-bottom: -130px; 
    
    /* MODIFICATION : On ajoute une marge à droite pour pousser le texte vers la gauche */
    /* Plus ce chiffre est grand, plus le texte part à gauche */
    margin-right: 900px; 
    
    line-height: 1;
    text-align: center;
    opacity: 0;
    z-index: 2;
}

#main-typo { 
    width: 95vw; 
    max-width: 1600px;
    height: auto; 
    flex-shrink: 0;
    z-index: 1;
}

.main-logo-text {
    opacity: 0;
    will-change: transform, opacity;
}

/* --- ANIMATIONS --- */
.one-flow-anim { animation: revealAndBreathe 8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; }

@keyframes revealAndBreathe {
    0% { opacity: 0; transform: translateY(20px) scale(1); }
    40% { opacity: 1; transform: translateY(0) scale(1); }
    70% { opacity: 1; transform: translateY(0) scale(1.1); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.loop-only { opacity: 1; animation: deepPulse 4s ease-in-out infinite; }

@keyframes deepPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
















@media (max-width: 1024px) {
    /* 1. STABILISATION DE L'ÉCRAN */
    html, body {
        position: fixed !important;
        overflow: hidden !important;
        height: 100% !important;
        width: 100% !important;
    }

    /* 2. LOGO COIN (Master Icon) */
    #master-icon { 
        top: 20px !important; 
        left: 20px !important; 
        width: 35px !important; 
        padding-bottom: 10px !important;
        overflow: visible !important;
    }
    
    header { top: 32px !important; left: 20px !important; }
    .header-text { margin-left: 48px !important; font-size: 0.6rem !important; }
    #theme-toggle { top: 20px !important; right: 20px !important; padding: 6px 12px !important; font-size: 0.55rem !important; }

    /* 3. LOGO CENTRAL (Le fix pour le "Breathe" coupé) */
    main {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 100% !important;
        /* Très important : on laisse le contenu déborder du main */
        overflow: visible !important; 
    }

    .brand-group { 
        gap: 20px; 
        overflow: visible !important;
        /* Aide le navigateur à gérer les échelles (scale) */
        perspective: 1000px; 
    }

   #main-typo {
        /* On passe de 85vw à 95vw pour qu'il prenne presque toute la largeur */
        width: 95vw !important; 
        /* On augmente le max-width pour les grands téléphones/tablettes */
        max-width: 450px !important; 
        height: auto !important;
        display: block !important;

        /* ZONE DE SÉCURITÉ (Indispensable pour le Breathe) */
        padding: 40px !important; 
        margin: -40px 0 !important; 
        
        /* RENDU GPU */
        overflow: visible !important;
        will-change: transform;
        -webkit-transform: translateZ(0); 
        transform: translateZ(0);
        
        /* Optionnel : si tu veux qu'il soit ENCORE plus gros, 
           tu peux ajouter un scale de base ici */
        /* transform: scale(1.2) translateZ(0) !important; */
    }

    .user-name {
        margin: 0 !important;
        font-size: 1rem !important;
        margin-right: 0 !important; /* Reset du décalage Desktop */
        width: 100% !important;
        text-align: center !important;
        opacity: 1;
        z-index: 10;
    }

    /* 4. NAVIGATION BASSE */
    nav { 
        bottom: 30px !important; 
        gap: 30px !important; 
        opacity: 1 !important; /* S'assure de la visibilité */
    }
    .nav-link { font-size: 0.85rem !important; }

    /* 5. ANIMATION INTRO (Ajustée pour Mobile) */
    @keyframes fullIntro {
        0% { 
            opacity: 0; 
            transform: translate(calc(50vw - 17.5px - 20px), calc(50vh - 17.5px - 20px)) scale(100); 
        }
        30% { 
            opacity: 1; 
            transform: translate(calc(50vw - 17.5px - 20px), calc(50vh - 17.5px - 20px)) scale(12); 
        }
        55% {
            transform: translate(calc(50vw - 17.5px - 20px), calc(50vh - 17.5px - 20px)) scale(12);
        }
        100% { 
            opacity: 1; 
            transform: translate(0, 0) scale(1); 
        }
    }
}






















