/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Poppins:wght@600;700&display=swap');

:root {
    --bg-dark: #0a0a0a;
    --text-main: #E0E0E0;
    --text-bright: #FFFFFF;
    --accent-color: #6C63FF;
    --accent-soft: rgba(108, 99, 255, 0.2);
    --card-bg: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-forge: #00D1FF;
    --accent-forge-soft: rgba(0, 209, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden; /* Empêche le scroll horizontal parasite */
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--text-bright);
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

/* ==========================================================================
   2. HEADER (RESPONSIVE)
   ========================================================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 10%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.7);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a { color: rgba(255, 255, 255, 0.7); }
nav a:hover { color: var(--accent-color); }

/* --- RESPONSIVE HEADER --- */
@media (max-width: 768px) {
    header {
        padding: 1rem 5%;
        flex-direction: column; /* Logo au dessus du menu */
        gap: 1rem;
    }

    .logo { font-size: 1.3rem; }

    nav ul {
        gap: 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    nav ul {
        gap: 0.8rem; /* Encore plus serré pour les très petits écrans */
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   3. FOOTER (RESPONSIVE)
   ========================================================================== */
footer {
    text-align: center;
    padding: 3rem 10%;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #666;
    background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    footer {
        padding: 2rem 5%;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   4. SECTIONS & GRILLES
   ========================================================================== */
section {
    padding: 5rem 10%;
}

@media (max-width: 1024px) {
    section { padding: 4rem 5%; }
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

@media (max-width: 480px) {
    .grid { grid-template-columns: 1fr; }
}

.card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .card { padding: 1.5rem; }
}

/* ==========================================================================
   5. ÉLÉMENTS DE DESIGN & BACKGROUND
   ========================================================================== */
.background {
    position: fixed;
    width: 100vw; height: 100vh;
    top: 0; left: 0;
    margin: 0; padding: 0;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    overflow: hidden;
    z-index: -1;
}

/* On masque quelques particules sur mobile pour économiser la batterie/perf */
@media (max-width: 768px) {
    .background li:nth-child(n+10) { display: none; }
}

.background li {
    position: absolute;
    display: block;
    list-style: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: animate 25s linear infinite;
    bottom: -150px;
}

/* Keyframes Background */
@keyframes animate {
    0%{ transform: translateY(0) rotate(0deg); opacity: 1; border-radius: 0; }
    100%{ transform: translateY(-1200px) rotate(720deg); opacity: 0; border-radius: 50%; }
}

.background li:nth-child(1) { left: 25%; width: 80px; height: 80px; animation-delay: 0s; }
.background li:nth-child(2) { left: 10%; width: 20px; height: 20px; animation-delay: 2s; animation-duration: 12s; }
.background li:nth-child(3) { left: 70%; width: 20px; height: 20px; animation-delay: 4s; }
.background li:nth-child(4) { left: 40%; width: 60px; height: 60px; animation-delay: 0s; animation-duration: 18s; }
.background li:nth-child(5) { left: 65%; width: 20px; height: 20px; animation-delay: 0s; }
.background li:nth-child(6) { left: 75%; width: 110px; height: 110px; animation-delay: 3s; }
.background li:nth-child(7) { left: 35%; width: 150px; height: 150px; animation-delay: 7s; }
.background li:nth-child(8) { left: 50%; width: 25px; height: 25px; animation-delay: 15s; animation-duration: 45s; }
.background li:nth-child(9) { left: 20%; width: 15px; height: 15px; animation-delay: 2s; animation-duration: 35s; }
.background li:nth-child(10) { left: 85%; width: 150px; height: 150px; animation-delay: 0s; animation-duration: 11s; }
.background li:nth-child(11) { left: 60%; width: 25px; height: 25px; animation-delay: 4s; }
.background li:nth-child(12) { left: 30%; width: 15px; height: 15px; animation-delay: 7s; animation-duration: 17s; }
.background li:nth-child(13) { left: 45%; width: 90px; height: 90px; animation-delay: 5s; }
.background li:nth-child(14) { left: 80%; width: 150px; height: 150px; animation-delay: 3s; animation-duration: 25s; }
.background li:nth-child(15) { left: 55%; width: 20px; height: 20px; animation-delay: 6s; }
.background li:nth-child(16) { left: 15%; width: 25px; height: 25px; animation-delay: 8s; animation-duration: 30s; }
.background li:nth-child(17) { left: 90%; width: 60px; height: 60px; animation-delay: 2s; animation-duration: 20s; }
.background li:nth-child(18) { left: 50%; width: 110px; height: 110px; animation-delay: 4s; }
.background li:nth-child(19) { left: 25%; width: 30px; height: 30px; animation-delay: 1s; animation-duration: 15s; }
.background li:nth-child(20) { left: 70%; width: 80px; height: 80px; animation-delay: 3s; animation-duration: 22s; }

/* ==========================================================================
   6. BOUTONS & NAVIGATION
   ========================================================================== */
.btns {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap; /* Permet aux boutons de passer l'un sous l'autre sur mobile */
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
}

@media (max-width: 480px) {
    .btn { width: 100%; } /* Boutons pleine largeur sur mobile */
}

/* ==========================================================================
   7. PAGES SPÉCIFIQUES (NEXUS, STACK, LORE, CONTACT)
   ========================================================================== */

/* NEXUS ACCUEIL */
.split-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
}

@media (max-width: 768px) {
    .split-container {
        flex-direction: column;
        height: auto;
    }
    .side {
        width: 100%;
        min-height: 50vh;
        flex: none !important; /* Désactive l'agrandissement au hover */
    }
    .side h2 { font-size: 2.5rem !important; }
}

/* STACK PROJETS */
.stack-wrapper {
    display: grid;
    grid-template-columns: 550px 1fr;
    gap: 2rem 4rem;
    padding: 120px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1100px) {
    .stack-wrapper {
        grid-template-columns: 1fr;
        padding: 80px 5% 40px;
        text-align: center;
    }
    .stack-item img {
        width: 85vw !important;
        height: 85vw !important;
        max-width: 450px;
        max-height: 450px;
    }
    .stack-item h2 { font-size: 2.8rem !important; }
    .stack-nav { justify-content: center; width: 100%; }
}

/* MODALE */
.modal-content {
    width: 95%;
    max-height: 90vh;
    padding: 2rem;
}

@media (max-width: 768px) {
    .modal-grid { grid-template-columns: 1fr !important; }
    .modal-content { padding: 1.5rem; padding-top: 3.5rem; }
}

/* THEME FORGE BACKGROUND FIX */
.theme-forge .background {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #050a10;
    background-image: radial-gradient(circle at 50% 50%, rgba(0, 209, 255, 0.1) 0%, transparent 80%);
}

/* BACK BUTTON */
@media (max-width: 480px) {
    .back-btn { width: 100%; justify-content: center; }
}

