/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background-color: #121212; color: #e0e0e0; line-height: 1.6; scroll-behavior: smooth; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* --- NAVIGATION --- */
nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 5%; background: #1a1a1a; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.logo { font-size: 1.5rem; font-weight: bold; }
.logo span { color: #64ffda; }
.nav-links { display: flex; gap: 20px; }
.nav-links a:hover { color: #64ffda; }

/* --- HERO SECTION --- */
.hero { 
    position: relative; /* Ajouté pour les logos */
    overflow: hidden;   /* Ajouté pour les logos */
    height: 80vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    padding: 0 20px; 
    background: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)), url('https://images.unsplash.com/photo-1550745165-9bc0b252726f?auto=format&fit=crop&w=1920&q=80') no-repeat center/cover; 
}

/* Ajouté pour garantir que le texte passe au-dessus des logos */
.hero-content {
    position: relative;
    z-index: 10;
}

.hero h1 { font-size: 3rem; margin-bottom: 10px; text-shadow: 0 0 10px rgba(0,0,0,0.8); }
.subtitle { font-size: 1.2rem; color: #64ffda; margin-bottom: 20px; font-family: monospace; }
.bio { max-width: 600px; margin: 0 auto 30px; color: #ccc; }

/* --- LOGOS COINS HERO --- */
.corner-logos-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Laisse passer les clics vers ton texte et tes boutons centraux */
    z-index: 1; 
}

.corner-logo {
    position: absolute;
    width: 100px; 
    height: 100px; 
    opacity: 0.9;
    pointer-events: auto; 
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.corner-logo:hover {
    transform: scale(1.1);
    opacity: 1;
}

.corner-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
}

.top-left { top: 30px; left: 30px; }
.top-right { top: 30px; right: 30px; }
.bottom-left { bottom: 30px; left: 30px; }
.bottom-right { bottom: 30px; right: 30px; }

/* --- BOUTONS --- */
.btn { padding: 10px 25px; border-radius: 5px; font-weight: bold; display: inline-block; margin: 5px; }
.btn.primary { background: #64ffda; color: #121212; }
.btn.primary:hover { background: #4cd6b3; }
.btn.secondary { border: 2px solid #64ffda; color: #64ffda; }
.btn.secondary:hover { background: rgba(100, 255, 218, 0.1); }
/* Bouton Itch.io Spécifique */
.btn.btn-itch { border: 2px solid #fa5c5c; color: #fa5c5c; }
.btn.btn-itch:hover { background: #fa5c5c; color: white; }

/* --- SECTIONS GÉNÉRALES --- */
section { padding: 80px 10%; }
h2 { font-size: 2rem; margin-bottom: 50px; text-align: center; position: relative; }
h2::after { content: ''; width: 60px; height: 3px; background: #64ffda; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); }

/* --- STACK TECHNIQUE (GRID 2x2) --- */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.skill-card {
    background: #1e1e1e;
    border-radius: 12px;
    border: 1px solid #333;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.skill-card:hover { border-color: #64ffda; transform: translateY(-5px); }

/* Header de la carte Skill */
.card-header {
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e1e1e;
    z-index: 2;
}
.header-title { display: flex; align-items: center; gap: 20px; }
.header-title h3 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.header-title i { font-size: 3rem; }
/* Forcer le blanc pour Unreal et Unity */
.icon-ue, .icon-unity { color: #ffffff !important; }
.arrow { font-size: 1.2rem; transition: transform 0.3s ease; color: #64ffda; }

/* Contenu caché Skill (Toujours en accordéon pour la stack technique) */
.card-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 40px;
    color: #ccc;
    font-size: 1rem;
    line-height: 1.6;
    background-color: #161616;
    transition: max-height 0.4s ease, padding 0.4s ease;
}
.skill-card.active { border-color: #64ffda; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.skill-card.active .arrow { transform: rotate(180deg); }
.skill-card.active .card-content { max-height: 600px; padding: 0 40px 30px 40px; }

/* --- FILTRES PROJETS --- */
.filter-container { display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; flex-wrap: wrap; }
.filter-btn {
    background: #1e1e1e; border: 1px solid #333; color: #ccc; padding: 10px 20px;
    border-radius: 30px; cursor: pointer; font-size: 1rem; transition: all 0.3s ease;
    display: flex; align-items: center; gap: 8px;
}
.filter-btn:hover { border-color: #64ffda; color: #fff; }
.filter-btn.active { background: #64ffda; color: #121212; border-color: #64ffda; font-weight: bold; }
.icon-ue-small, .icon-unity-small { color: inherit; }

/* --- PROJETS (NOUVEAU DESIGN FIXE) --- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 40px; }

.project-card {
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #333;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease;
}

.project-card:hover {
    border-color: #64ffda;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* --- GESTION DES IMAGES SURVOL (JPG -> GIF) --- */

/* --- GESTION VIDÉO AU SURVOL (AVEC RETOUR À L'IMAGE FIXE) --- */

/* --- GESTION VIDÉO HYBRIDE (Image fixe + Vidéo WebM) --- */

/* 1. Le cadre (contient l'image fixe en background) */
.project-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000000; /* Fond noir par sécurité */
    background-size: contain;  /* L'image s'affiche en entier */
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 2. La vidéo (par dessus l'image) */
.project-image video.hover-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    
    /* PAR DÉFAUT : La vidéo est INVISIBLE (on voit le background) */
    opacity: 0; 
    transition: opacity 0.4s ease; /* Apparition douce */
}

/* 3. QUAND LA VIDÉO JOUE (Classe ajoutée par le JS) */
.project-image video.hover-video.playing {
    opacity: 1; /* La vidéo devient visible */
}

/* 4. Pour les projets sans vidéo (Mario Fighter) */
.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
}


.project-info { padding: 20px; }

.project-info h3 { font-size: 1.4rem; color: #fff; margin-bottom: 10px; }

.short-desc { font-size: 0.95rem; color: #aaa; margin-bottom: 15px; }

/* Détails qui étaient cachés (maintenant visibles) */
.details-content {
    margin-top: 15px;
    font-size: 0.95rem;
}

/* Utilitaires Tags & Liens */
.tags { margin-top: 15px; display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.tag { font-size: 0.8rem; padding: 4px 8px; border-radius: 4px; font-weight: bold; }
.tag.ue { background: #0e1128; border: 1px solid #4682b4; color: #4682b4; }
.tag.unity { background: #222c37; border: 1px solid #a0a0a0; color: #fff; }
.tag.godot { background: #202531; border: 1px solid #478cbf; color: #478cbf; }
.tag.csharp { background: #151618; border: 1px solid #b3bac0; color: #ffffff; }
.tag.gdscript { background: #194566; border: 1px solid #b3bac0; color: rgb(120, 156, 189); }
.tag.cpp { background: #113550; border: 1px solid #b3bac0; color: rgb(116, 129, 165); }
.tag.html-css-js { background: #1e1e1e; border: 1px solid #e34c26; color: #e34c26; }
.tag.flutter { background: #065A9D; border: 1px solid #5EC8F8; color: #5EC8F8; 
}

.links { margin-top: 10px; display: flex; gap: 15px; flex-wrap: wrap; }
.links a:hover { color: #64ffda; }

/* Animation Filtre */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.project-card.hide { display: none; }

/* --- CONTACT & FOOTER --- */
#contact { text-align: center; background: #1a1a1a; }
.socials { margin-top: 30px; font-size: 2rem; display: flex; justify-content: center; gap: 30px; }
footer { text-align: center; padding: 20px; font-size: 0.9rem; color: #666; border-top: 1px solid #333; }

/* --- MOBILE --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .nav-links { display: none; } 
    .skills-grid { grid-template-columns: 1fr; }
    .card-header { padding: 20px; }

    /* Ajustement des logos coins sur mobile */
    .corner-logo {
        width: 50px;
        height: 50px;
    }
    .top-left { top: 15px; left: 15px; }
    .top-right { top: 15px; right: 15px; }
    .bottom-left { bottom: 15px; left: 15px; }
    .bottom-right { bottom: 15px; right: 15px; }
}

.project-card.no-gif:hover .img-static {
    opacity: 1 !important;
}


.project-card.no-gif:hover .img-gif {
    opacity: 0 !important;
}

/* --- CONTROLS (RECHERCHE + FILTRES) --- */
.controls-container {
    max-width: 1100px;
    margin: 0 auto 40px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Barre de Recherche */
.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64ffda;
}

#search-input {
    width: 100%;
    padding: 12px 20px 12px 45px; /* Espace pour l'icone */
    border-radius: 30px;
    border: 1px solid #333;
    background: #1e1e1e;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#search-input:focus {
    border-color: #64ffda;
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.2);
}

/* Animation de mise en avant (Highlight) quand on clique depuis le CV */
@keyframes highlightPulse {
    0% { border-color: #64ffda; box-shadow: 0 0 0px #64ffda; transform: scale(1); }
    50% { border-color: #fff; box-shadow: 0 0 30px #64ffda; transform: scale(1.02); }
    100% { border-color: #64ffda; box-shadow: 0 0 0px #64ffda; transform: scale(1); }
}

.project-card.highlight {
    animation: highlightPulse 2s ease-in-out infinite;
    border: 2px solid #64ffda;
}