@import url('https://fonts.googleapis.com/css2?family=Science+Gothic:wdth,wght@50..200,100..900&display=swap');

:root {
    --bg-dark: #05050a;
    --bg-card: #0d0d18;
    --primary-blue: #1a1aff;
    --electric-violet: #4d0099;
    --text-white: #ffffff;
    --text-gray: #a0a0b0;
    --accent-cyan: #00d2ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.logo,
.hero-content h1,
.section-title,
.skill-category h3,
.project-info h3,
#modal-body h2 {
    font-family: 'Science Gothic', 'Segoe UI', sans-serif;
    font-style: normal;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 5, 10, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-weight: 800;
    font-variation-settings: "wdth" 120; /* Force l'aspect large et technologique */
    letter-spacing: 2px;
    font-size: 1.2rem;
    background: linear-gradient(45deg, #fff, var(--text-gray));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav a {
    color: var(--text-gray);
    text-decoration: none;
    margin-left: 25px;
    transition: color 0.3s;
    font-size: 0.95rem;
}

nav a:hover {
    color: var(--accent-cyan);
}

.hero {
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 900;
    font-variation-settings: "wdth" 140; /* Titre principal ultra large */
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-gray);
    font-size: 1.2rem;
    letter-spacing: 1px;
}

/* --- LOGO 42 RESPONSIVE --- */
.hero-logo-container {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- HERO LOGOS & GITHUB BUTTON --- */
.hero-logos-wrapper {
    margin-top: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px; /* Space between 42 logo and GitHub button */
    flex-wrap: wrap; /* Allows wrapping on very small screens */
}

.hero-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.responsive-logo {
    width: auto;
    height: 38px; /* Fixed height for consistency with the button */
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.responsive-logo:hover {
    opacity: 1;
}

.github-btn {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between icon and text */
    padding: 8px 18px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    height: 38px; /* Matching height with 42 logo */
}

.github-btn svg {
    transition: transform 0.3s ease;
}

.github-btn:hover {
    background-color: rgba(0, 210, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
}

.github-btn:hover svg {
    transform: scale(1.1);
}

/* --- MOBILE RESPONSIVE TUNING (Update existing media query) --- */
@media screen and (max-width: 600px) {
    /* ... your existing mobile rules ... */

    .hero-logos-wrapper {
        margin-top: 25px;
        gap: 15px; /* Sightly tighter gap on mobile */
    }

    .github-btn {
        padding: 6px 14px;
        font-size: 0.85rem;
    }
}

.responsive-logo {
    width: 100%;
    max-width: 80px;
    min-width: 50px;
    height: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.responsive-logo:hover {
    opacity: 1;
}

.glow {
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(26,26,255,0.25) 0%, rgba(0,0,0,0) 70%);
    filter: blur(30px);
    pointer-events: none;
}

.glow2 {
    position: absolute;
    bottom: -40%;
    right: -500px;
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle, rgba(26,26,255,0.25) 0%, rgba(0,0,0,0) 70%);
    filter: blur(30px);
    pointer-events: none;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    font-variation-settings: "wdth" 120;
    margin-bottom: 40px;
    position: relative;
    letter-spacing: 1px;
}

.skills-container, .projects-container {
    padding: 80px 5%;
}

/* --- PANNEAUX DE COMPÉTENCES (SKILLS) --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 30px;
    transition: transform 0.3s, border 0.3s;
}

.skill-category:hover {
    transform: translateY(-5px);
}

.card-advanced { border-left: 4px solid var(--accent-cyan); }
.card-medium { border-left: 4px solid var(--electric-violet); }
.card-beginner { border-left: 4px solid var(--text-gray); }

.skill-category h3 {
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 600;
    font-variation-settings: "wdth" 110;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.skill-category li span {
    color: var(--text-gray);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 12px;
}

/* --- GRILLE DE PROJETS --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--bg-card);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
}

.project-card:hover {
    box-shadow: 0 10px 20px rgba(26, 26, 255, 0.15);
    border-color: var(--primary-blue);
}

.project-img-wrapper {
    height: 180px;
    width: 100%;
    overflow: hidden;
    background: #0d0d18;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.project-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img-wrapper img {
    transform: scale(1.08);
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.project-info p {
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* --- MODALE --- */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 5, 10, 0.9);
    backdrop-filter: blur(8px);
    overflow-y: auto;
    padding: 20px 0;
}

.modal-content {
    background-color: var(--bg-card);
    margin: 40px auto;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--text-gray);
    font-size: 30px;
    cursor: pointer;
}

.close-btn:hover {
    color: #fff;
}

#modal-body h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--accent-cyan);
}

#modal-body p {
    color: var(--text-gray);
    line-height: 1.7;
    margin-bottom: 15px;
}

#modal-body img {
    width: 100%;
    max-height: 50vh;
    object-fit: contain;
    background: #05050a;
    border-radius: 6px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
}

/* --- BOUTON DE LIEN DANS LA MODALE --- */
.modal-link-btn {
    display: inline-block;
    margin: 15px 0 5px 0;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.modal-link-btn:hover {
    background-color: rgba(0, 210, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 40px;
    color: var(--text-gray);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- RESPONSIVE MOBILE --- */
@media screen and (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 2%;
        position: static;
    }

    nav {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        gap: 20px;
    }

    nav a {
        margin-left: 0;
        font-size: 0.9rem;
        padding: 5px 10px;
    }

    .hero {
        height: auto;
        padding: 100px 20px 60px 20px;
    }

    .hero-content h1 {
        font-size: 2.3rem;
        font-variation-settings: "wdth" 90; /* Ajuste la largeur automatique sur mobile */
    }

    .modal-content {
        padding: 20px;
        margin: 20px auto;
    }

    #modal-body h2 {
        font-size: 1.8rem;
    }
}



/* --- PAGE 404 DESIGN --- */
.error-page {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    background-color: var(--bg-dark);
}

.error-container {
    z-index: 10;
    padding: 0 20px;
    max-width: 500px;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    font-variation-settings: "wdth" 140;
    line-height: 1;
    background: linear-gradient(180deg, var(--accent-cyan), var(--primary-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    letter-spacing: -2px;
}

.error-title {
    font-size: 1.8rem;
    font-weight: 700;
    font-variation-settings: "wdth" 120;
    color: var(--text-white);
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.error-message {
    color: var(--text-gray);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 35px;
    font-family: 'Segoe UI', sans-serif;
}

/* Bouton de retour avec rotation de l'icône au survol */
.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-white);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
}

.back-home-btn svg {
    transform: rotate(-90deg); /* Oriente la flèche vers la gauche */
    transition: transform 0.3s ease;
}

.back-home-btn:hover {
    background-color: rgba(0, 210, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.25);
}

.back-home-btn:hover svg {
    transform: rotate(-90deg) translateX(-3px); /* Petit effet de poussée vers la gauche */
}

/* Ajustement Mobile pour la 404 */
@media screen and (max-width: 600px) {
    .error-code {
        font-size: 6rem;
    }
    .error-title {
        font-size: 1.4rem;
    }
}