/* Couleurs Gengar / Y2K */
:root {
    --gengar-dark: #2d1a47;
    --gengar-purple: #512888;
    --gengar-neon: #a048ff;
    --gengar-eye: #ff3e3e;
    --text-color: #e0d0ff;
}

/* Base & Background */
body {
    background-color: #0d0118;
    /* Grille rétro Y2K */
    background-image: 
        linear-gradient(rgba(160, 72, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(160, 72, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    color: var(--text-color);
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    overflow-x: hidden;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    from { background-position: 0 0; }
    to { background-position: 0 1000px; }
}

/* Effet d'aura qui bouge en fond */
.ghost-blur {
    position: fixed;
    width: 40vw;
    height: 40vw;
    background: var(--gengar-purple);
    filter: blur(150px);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.2;
    pointer-events: none;
    animation: float 15s infinite alternate;
}

@keyframes float {
    0% { transform: translate(-10%, -10%); }
    100% { transform: translate(80vw, 80vh); }
}

/* Lignes CRT */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 10;
}

/* Header & Glitch */
header {
    padding: 3rem 2rem;
    text-align: center;
    border-bottom: 2px solid var(--gengar-purple);
}

.glitch {
    font-size: clamp(1.5rem, 8vw, 3.5rem);
    font-weight: bold;
    color: var(--gengar-neon);
    position: relative;
    text-shadow: 3px 3px var(--gengar-eye);
    text-transform: uppercase;
}

nav { margin-top: 20px; }
nav a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 15px;
    font-weight: bold;
    font-size: 0.9rem;
}

nav a:hover {
    color: var(--gengar-eye);
    text-shadow: 0 0 8px var(--gengar-eye);
}

/* Fenêtre Windows Vintage */
.window {
    border: 2px solid var(--gengar-purple);
    background: rgba(45, 26, 71, 0.9);
    margin: 3rem auto;
    max-width: 600px;
    box-shadow: 8px 8px 0px var(--gengar-neon);
}

/* Ajustement de la barre de titre */
.window-header {
    background: var(--gengar-purple);
    padding: 5px 15px;
    display: flex;
    justify-content: space-between; /* Espace le titre à gauche et les boutons à droite */
    align-items: center; /* Centre verticalement */
    height: 35px; /* Définit une hauteur fixe pour éviter les chevauchements */
}

/* On réduit un peu la taille du titre dans la barre pour qu'il tienne */
.window-header .glitch {
    font-size: 1.2rem; /* Taille plus petite que le titre principal */
    margin: 0;
    text-shadow: 1px 1px var(--gengar-eye); /* Ombre plus fine ici */
    white-space: nowrap; /* Empêche le texte de revenir à la ligne */
}

/* Style des boutons de contrôle */
.window-controls {
    font-family: monospace;
    letter-spacing: 5px;
    color: var(--text-color);
    cursor: default;
    user-select: none;
    flex-shrink: 0; /* Empêche les boutons de s'écraser */
}

.window-body { padding: 25px; }

/* Grille de projets améliorée */
.section-title {
    text-align: center;
    color: var(--gengar-eye);
    margin-top: 4rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: rgba(26, 10, 46, 0.8);
    border: 1px solid var(--gengar-neon);
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--gengar-eye);
    box-shadow: 0 0 20px rgba(160, 72, 255, 0.3);
}

.card-tag {
    position: absolute;
    top: 10px; right: 10px;
    background: var(--gengar-eye);
    color: white;
    font-size: 0.6rem;
    padding: 3px 7px;
    z-index: 2;
}

.card-img {
    height: 180px;              /* taille visuelle constante */
    width: 100%;
    overflow: hidden;          /* cache ce qui dépasse */
    position: relative;
    background: #11051a;
    border-bottom: 1px solid var(--gengar-purple);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;     /* MAGIC */
    object-position: center;
}


.card-content { padding: 20px; }
.card-content h3 { margin-top: 0; color: var(--gengar-neon); }
.card-tech {
    margin-top: 15px;
    font-size: 0.7rem;
    color: var(--gengar-neon);
    opacity: 0.8;
}

footer {
    text-align: center;
    padding: 4rem;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* --- Navigation Spécifique --- */

.nav-system {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(45, 26, 71, 0.5);
    border-bottom: 1px solid var(--gengar-neon);
    backdrop-filter: blur(5px);
}

.btn-back {
    color: var(--gengar-neon);
    text-decoration: none;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    padding: 5px 15px;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.btn-back:hover {
    background: var(--gengar-neon);
    color: var(--gengar-dark);
    box-shadow: 0 0 15px var(--gengar-neon);
    border-radius: 2px;
}

.nav-status {
    font-size: 0.8rem;
    color: var(--gengar-eye);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Ajustement pour que la fenêtre ne colle pas au bord haut */
main {
    padding-top: 20px;
}

/* --- Amélioration Contact --- */

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px dashed var(--gengar-purple);
}

.contact-label {
    font-size: 0.8rem;
    color: var(--gengar-neon);
    font-weight: bold;
}

.contact-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 5px 15px;
    border: 1px solid var(--gengar-purple);
    background: rgba(81, 40, 136, 0.2);
    transition: all 0.2s ease;
    min-width: 150px;
    text-align: center;
}

.contact-link:hover {
    background: var(--gengar-neon);
    color: var(--gengar-dark);
    box-shadow: 0 0 15px var(--gengar-neon);
    transform: skewX(-10deg); /* Effet Y2K dynamique */
}

.system-message {
    background: #000;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--gengar-eye);
    border-left: 3px solid var(--gengar-eye);
}

/* Animation de texte qui tape */
.typing-effect {
    overflow: hidden;
    border-right: .15em solid var(--gengar-eye);
    white-space: nowrap;
    margin: 0;
    letter-spacing: .15em;
    animation: 
      typing 3.5s steps(40, end),
      blink-caret .75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--gengar-eye); }
}

/* Taille des icônes dans les liens de contact */
.contact-link .icon img {
    width: 30px;       /* Ajuste la taille selon ton goût */
    height: 30px;
    object-fit: contain;
    vertical-align: middle; /* Aligne l'icône avec le texte */
    margin-right: 3px;      /* Espace entre l'image et le texte */
}

/* Optionnel : Si tu veux que le conteneur span soit bien centré */
.contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- Pages Projets Individuelles --- */

.project-detail {
    max-width: 900px;
    margin: 2rem auto;
}

.project-title {
    color: var(--gengar-eye);
    margin: 0 0 20px 0;
    text-align: left;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 15px;
}

.project-media {
    border: 1px solid var(--gengar-purple);
    background: #000;
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-text h3 {
    color: var(--gengar-neon);
    font-size: 0.9rem;
    margin-top: 20px;
    border-bottom: 1px solid rgba(160, 72, 255, 0.3);
}

.skill-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.skill-list li::before {
    content: "> ";
    color: var(--gengar-eye);
}

.project-footer {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px dashed var(--gengar-purple);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Adaptation Mobile */
@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    .project-footer {
        flex-direction: column;
        gap: 20px;
    }
}