:root {
    --bg-dark: #0F172A;
    --card-bg: #1E293B;
    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
    --accent: #818CF8;
    --accent-hover: #A5B4FC;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Activation des View Transitions natives pour une navigation fluide entre pages */
@view-transition {
    navigation: auto;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    /* Dégradé radial moderne et élégant pour le fond */
    background: radial-gradient(circle at top right, #1e1b4b, var(--bg-dark) 40%);
    background-attachment: fixed;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1000px;
    margin: auto;
}

/* Animation dynamique d'apparition plus ample (zoom + fade) */
main {
    animation: scaleFadeIn 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 0;
    transform-origin: top center;
}

@keyframes scaleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

header {
    background: transparent;
    padding: 60px 0 30px;
    text-align: center;
}

header h1 {
    font-size: 3em;
    color: var(--text-main);
    text-shadow: 0 0 20px rgba(129, 140, 248, 0.3);
    letter-spacing: -1px;
}

header p {
    color: var(--text-muted);
    font-size: 1.2em;
    margin-top: 10px;
    font-weight: 300;
}

nav {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50px;
    margin: 0 auto 40px;
    width: fit-content;
    padding: 5px 20px;
    border: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 20px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 10px;
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    display: inline-block;
    border-radius: 30px;
    transition: var(--transition);
}

nav a:hover {
    background: var(--accent);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.4);
    transform: scale(1.05);
}

.intro, .category, article {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 40px;
    border-radius: 24px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.intro:hover, .category:hover, article:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: rgba(129, 140, 248, 0.3);
}

.intro h2 {
    font-size: 2em;
    margin-bottom: 15px;
    color: var(--text-main);
}

.category h2 {
    color: var(--accent);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1.8em;
}

.category ul {
    list-style: none;
}

.category ul li {
    margin-bottom: 15px;
}

.category ul li a {
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: var(--transition);
    font-size: 1.1em;
    padding: 12px 15px;
    border-radius: 12px;
}

.category ul li a::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 15px;
    transition: var(--transition);
}

.category ul li a:hover {
    color: var(--accent-hover);
    background: rgba(255,255,255,0.05);
    transform: translateX(10px);
}

.category ul li a:hover::before {
    transform: scale(1.5);
    box-shadow: 0 0 12px var(--accent);
}

/* Styles pour les pages d'articles */
article h1 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 2.2em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

article h2 {
    color: var(--accent-hover);
    margin-top: 30px;
    margin-bottom: 15px;
}

article h3 {
    color: var(--text-main);
    margin-top: 20px;
    margin-bottom: 10px;
}

article p {
    margin-bottom: 15px;
    font-size: 1.1em;
}

article ul, article ol {
    margin-bottom: 20px;
    margin-left: 30px;
}

article li {
    margin-bottom: 10px;
}

/* Liens hypertextes dans le texte des articles */
article a:not(.btn-back) {
    color: var(--accent-hover);
    text-decoration: none;
    border-bottom: 1px solid rgba(165, 180, 252, 0.3);
    transition: var(--transition);
    padding-bottom: 1px;
}

article a:not(.btn-back):hover {
    color: #ffffff;
    border-bottom-color: var(--accent-hover);
    text-shadow: 0 0 8px rgba(165, 180, 252, 0.5);
}

/* Bouton retour */
.btn-back {
    display: inline-block;
    background: rgba(30, 41, 59, 0.8);
    color: var(--accent);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 30px;
    margin-bottom: 20px;
    border: 1px solid rgba(129, 140, 248, 0.3);
    transition: var(--transition);
}

.btn-back:hover {
    background: var(--accent);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.5);
    transform: scale(1.05);
}

footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 50px;
    font-size: 0.9em;
}

/* ==========================================================================
   Media Queries : Optimisation maximale pour Mobile
   ========================================================================== */

@media (max-width: 768px) {
    /* Le container prend presque toute la largeur */
    .container {
        width: 95%;
    }

    header {
        padding: 40px 0 20px;
    }

    header h1 {
        font-size: 2.2em;
    }

    /* Navigation mobile : compacte et qui ne cache pas le contenu */
    nav {
        width: 95%;
        border-radius: 15px;
        top: 10px;
        padding: 5px;
    }

    nav ul {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }

    nav a {
        padding: 8px 10px;
        font-size: 0.95em;
    }

    /* Réduction des paddings internes pour gagner de l'espace texte */
    .intro, .category, article {
        padding: 25px 20px;
        border-radius: 16px;
    }

    .category ul li a:hover {
        transform: translateX(5px);
    }
}

/* Ajustements pour les très petits écrans (Smartphones en mode portrait) */
@media (max-width: 480px) {
    .container {
        width: 98%;
    }

    header h1 {
        font-size: 1.8em;
    }

    header p {
        font-size: 1em;
    }

    .intro, .category, article {
        padding: 20px 15px;
        border-radius: 12px;
    }

    article h1 {
        font-size: 1.6em;
    }

    article h2 {
        font-size: 1.3em;
    }

    article p, .category ul li a {
        font-size: 1em;
    }
}
