/* =========================================
   IMPORT DES POLICES (Montserrat + Roboto)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Roboto:wght@300;400;500&display=swap');

/* =========================================
   1. CONFIGURATION GLOBALE & VARIABLES
   ========================================= */
:root {
    --bg-color: #0b0d15;       /* Noir profond teinté de bleu */
    --text-color: #e2e8f0;     /* Blanc cassé pour le texte */
    --primary-color: #38bdf8;  /* Cyan (Thème Réseau/Tech) */
    --accent-color: #facc15;   /* Jaune (Thème "Important") */
    --card-bg: rgba(30, 41, 59, 0.7); /* Fond des cartes semi-transparent */
    
    /* Variables de Polices */
    --font-title: 'Montserrat', sans-serif;
    --font-text: 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Police par défaut (Corps de texte) */
    font-family: var(--font-text);
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Application de la police "Titre" (Montserrat) aux éléments importants */
h1, h2, h3, h4, h5, h6, .logo, .btn-hire, nav a, .tag {
    font-family: var(--font-title);
    letter-spacing: 0.5px;
}

/* =========================================
   2. FOND ÉTOILÉ (ANIMATIONS)
   ========================================= */
#star-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #172033 0%, #000000 100%);
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: twinkle var(--duration) infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.shooting-star {
    position: absolute;
    background: linear-gradient(90deg, #fff, transparent);
    width: 100px;
    height: 2px;
    transform: rotate(-45deg);
    animation: shoot 2s linear;
    opacity: 0;
}

@keyframes shoot {
    0% { transform: translate(0, 0) rotate(-45deg); opacity: 1; }
    100% { transform: translate(-500px, 500px) rotate(-45deg); opacity: 0; }
}

/* =========================================
   3. NAVIGATION
   ========================================= */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 8%;
    position: absolute;
    width: 100%;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: 0.3s;
    text-transform: uppercase;
}

nav a:hover {
    color: var(--accent-color);
}

/* Bouton retour (pages internes) */
.nav-bar {
    padding: 30px 8%;
}

.btn-back {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 30px;
    background: rgba(0,0,0,0.3);
}

.btn-back:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateX(-5px);
}

/* =========================================
   4. ELEMENTS GLOBAUX
   ========================================= */
section {
    padding: 80px 8%;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: white;
}

.section-title span {
    color: var(--accent-color);
}

.btn-hire {
    padding: 12px 35px;
    background-color: var(--accent-color);
    color: #000;
    font-weight: 700;
    border-radius: 30px;
    text-decoration: none;
    display: inline-block;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(250, 204, 21, 0.3);
    margin-top: 20px;
}

.btn-hire:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(250, 204, 21, 0.5);
    background-color: #fff;
}

/* =========================================
   5. HERO SECTION (ACCUEIL)
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8%;
    padding-top: 80px;
}

.hero-text {
    flex: 1;
    max-width: 600px;
    z-index: 2;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    color: #fff;
    font-weight: 800;
}

.hero-desc {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 30px;
    line-height: 1.8;
    border-left: 3px solid var(--accent-color);
    padding-left: 20px;
}

.profile-pic {
    width: 450px;
    height: 450px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 50px rgba(56, 189, 248, 0.3);
    background-color: #1e293b;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* =========================================
   6. TIMELINE (PARCOURS)
   ========================================= */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

.container {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.container::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-color);
    border: 4px solid var(--accent-color);
    top: 20px;
    border-radius: 50%;
    z-index: 1;
}

.left { left: 0; }
.right { left: 50%; }

.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid white;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--card-bg);
}

.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid white;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--card-bg) transparent transparent;
}

.right::after { left: -10px; }

.content {
    padding: 25px 30px;
    background-color: var(--card-bg);
    position: relative;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
}

.content:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.content h3 { color: var(--accent-color); font-size: 1.2rem; margin-bottom: 5px; }
.content h4 { color: #fff; margin-bottom: 10px; font-weight: 600; }
.content h5 { color: #94a3b8; margin-bottom: 10px; font-size: 0.9rem; font-style: italic;}
.content p { font-size: 0.95rem; color: #cbd5e1; line-height: 1.5; }

.year {
    position: absolute;
    top: -30px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
    font-family: var(--font-title);
}
.left .year { right: 40px; }
.right .year { left: 40px; }

/* =========================================
   7. PROJETS (AVEC IMAGES & ZOOM)
   ========================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--card-bg);
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
    overflow: hidden;
    padding: 0;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.card-image-container {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .card-image-container img {
    transform: scale(1.1);
}

.card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-card h3 { color: #fff; margin-bottom: 10px; font-size: 1.4rem; }
.project-card p { color: #94a3b8; font-size: 0.9rem; line-height: 1.5; }

.tags {
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary-color);
    border-radius: 20px;
    font-weight: 600;
}

/* Classe pour cacher les projets (Load More) */
.hidden { display: none !important; }

/* Bouton Load More */
.load-more-container {
    width: 100%;
    text-align: center;
    margin-top: 40px;
    padding-bottom: 20px;
}

/* =========================================
   8. PAGE CONTACT
   ========================================= */
.contact-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    margin-bottom: 50px;
    animation: fadeIn 1s ease-out;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1000px;
    width: 100%;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    transition: 0.3s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.2);
}

.icon-box {
    width: 70px;
    height: 70px;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: var(--primary-color);
    transition: 0.3s;
}

.contact-card:hover .icon-box { background: var(--primary-color); color: #000; transform: scale(1.1); }

/* CV Card Style */
.cv-card:hover { border-color: var(--accent-color); box-shadow: 0 0 30px rgba(250, 204, 21, 0.2); }
.cv-card .icon-box { background: rgba(250, 204, 21, 0.1); color: var(--accent-color); }
.cv-card:hover .icon-box { background: var(--accent-color); color: #000; }

.card-title { font-size: 1.2rem; color: #fff; margin-bottom: 10px; font-weight: bold; }
.card-info { color: #94a3b8; font-size: 1rem; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   9. PAGE DÉTAIL PROJET (PDF)
   ========================================= */
.project-details-container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.subtitle { color: var(--accent-color); font-size: 1.2rem; margin-bottom: 40px; display: block; }

.project-details {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 50px;
}

.project-details h2 {
    color: var(--primary-color);
    border-left: 4px solid var(--accent-color);
    padding-left: 15px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.project-details p, .project-details ul { color: #cbd5e1; line-height: 1.8; }

.pdf-section { margin-top: 60px; text-align: center; }
.pdf-container { width: 100%; height: 800px; border: 2px solid var(--primary-color); border-radius: 10px; overflow: hidden; background: #fff; }

/* =========================================
   10. FOOTER
   ========================================= */
footer {
    text-align: center;
    padding: 40px;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: #64748b;
    margin-top: 50px;
}

/* =========================================
   11. RESPONSIVE (MOBILE & TABLETTE)
   ========================================= */
@media (max-width: 900px) {
    
    /* MENU RESPONSIVE (BANDEAU VISIBLE) */
    nav {
        display: flex;
        flex-direction: column;
        background: rgba(11, 13, 21, 0.95); /* Fond sombre */
        backdrop-filter: blur(10px);
        position: sticky;
        top: 0;
        padding: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        z-index: 1000;
        width: 100%;
        height: auto;
    }

    .logo { margin-bottom: 10px; font-size: 1.5rem; }

    nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        font-size: 0.85rem;
        padding: 5px 10px;
        background: rgba(255,255,255,0.05);
        border-radius: 15px;
    }

    /* HERO */
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 30px;
        height: auto;
        min-height: auto;
    }

    .hero-img-container { margin-bottom: 30px; justify-content: center; }
    .profile-pic { width: 200px; height: 200px; }
    .hero-text h1 { font-size: 2.2rem; }

    /* TIMELINE MOBILE */
    .timeline::after { left: 31px; }
    .container { width: 100%; padding-left: 70px; padding-right: 25px; }
    
    .container::before {
        left: 60px;
        border: medium solid white;
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--card-bg) transparent transparent;
    }
    
    .left::after, .right::after { left: 21px; }
    .right { left: 0%; }
    
    .year {
        position: relative;
        top: 0;
        left: 0 !important;
        right: auto !important;
        margin-bottom: 5px;
        display: block;
        text-align: left;
        margin-left: 70px;
    }
}