/* ═══════════════════════════════════════════════════
   VARIABLES & BASE
═══════════════════════════════════════════════════ */
:root {
    --bg-color:   #050510;
    --neon-pink:  #ff00ff;
    --neon-blue:  #00ffff;
    --neon-green: #39ff14;
    --font-title: 'Press Start 2P', cursive;
    --font-body:  'VT323', monospace;
}

* { box-sizing: border-box; }

/* On crée une classe spécifique pour bloquer le scroll */
.lock-scroll {
    overflow: hidden !important;
    height: 100vh !important;
    width: 100vw !important;
    position: fixed; /* Sécurité maximale */
}

/* Une fois le boot fini, on redonnera le droit de scroller via JS */
body.boot-finished {
    height: auto;
    overflow: visible;
    overflow-x: hidden;
}


/* 4. Sécurité pour les mobiles */
@media (max-width: 480px) {
    body, * { cursor: auto !important; }
}

body {
    margin: 0;
    background-color: var(--bg-color);
    color: #e0e0e0;
    font-family: var(--font-body);
    font-size: 1.4rem;
    overflow-x: hidden;
    line-height: 1.4;
}

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb {
    background: var(--neon-pink);
    border: 3px solid #000;
    border-radius: 0;
}




/* ═══════════════════════════════════════════════════
   BOOT SCREEN
═══════════════════════════════════════════════════ */
#boot-screen {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100vw; 
    height: 100vh; /* Remplace inset: 0 */
    background: #000;
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-body);
}

.boot-content {
    width: 90%;
    max-width: 640px;
    color: var(--neon-green);
}
.boot-logo {
    font-family: var(--font-title);
    font-size: 1.4rem;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
    margin-bottom: 1rem;
    text-align: center;
}
.boot-divider {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    letter-spacing: 2px;
}
#boot-log {
    height: 180px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    line-height: 1.8;
}
.boot-line {
    animation: bootLineFade 0.2s ease forwards;
    text-shadow: 0 0 5px var(--neon-green);
}
@keyframes bootLineFade {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.boot-progress-label {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: #aaa;
}
.boot-bar-outer {
    width: 100%;
    height: 18px;
    border: 2px solid var(--neon-green);
    background: #000;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 8px var(--neon-green);
}
.boot-bar-inner {
    height: 100%;
    width: 0%;
    background: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
    transition: width 0.3s ease;
}
.boot-final {
    text-align: center;
    font-family: var(--font-title);
    font-size: 0.75rem;
    color: var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green);
    animation: blink 0.8s infinite;
    
}
@keyframes bootOut {
    0%   { opacity: 1; transform: scaleY(1); }
    60%  { opacity: 1; transform: scaleY(0.02); }
    100% { opacity: 0; transform: scaleY(0.02); }
}

/* ═══════════════════════════════════════════════════
   SCANLINES & CRT FLICKER
═══════════════════════════════════════════════════ */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    ), linear-gradient(
        90deg,
        rgba(255, 0, 0, 0.06),
        rgba(0, 255, 0, 0.02),
        rgba(0, 0, 255, 0.06)
    );
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.6;
}

/* Glitch CRT amélioré */
#crt-flicker {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    /* On utilise un bruit blanc (noise) au lieu de simples lignes bleues */
    background: url('https://grainy-gradients.vercel.app/noise.svg'), 
                rgba(255, 255, 255, 0.1); 
    mix-blend-mode: overlay;
    /* On retire la transition : un glitch doit être instantané (pas de fondu) */
    transition: none; 
}

/* La classe de "secousse" qu'on va activer en JS sur le body */
.glitch-shake {
    filter: brightness(1.5) contrast(1.2) hue-rotate(10deg) !important;
    transform: translateX(3px) skewX(1deg) !important;
}
/* ═══════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════ */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-bottom: 4px solid var(--neon-pink);
    box-shadow: 0 0 20px var(--neon-pink);
}
.background-video {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: brightness(0.5) contrast(1.2) hue-rotate(-10deg);
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}
.hero h1 {
    font-family: var(--font-title);
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 4px 4px var(--neon-pink);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}
.glitch:hover {
    animation: glitch-anim 0.3s cubic-bezier(.25,.46,.45,.94) both infinite;
    color: var(--neon-blue);
}
@keyframes glitch-anim {
    0%   { transform: translate(0); }
    20%  { transform: translate(-2px, 2px); }
    40%  { transform: translate(-2px, -2px); }
    60%  { transform: translate(2px, 2px); }
    80%  { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* ═══════════════════════════════════════════════════
   TERMINAL BOX / TYPEWRITER
═══════════════════════════════════════════════════ */
.terminal-box {
    background: rgba(0,0,0,0.8);
    border: 2px solid var(--neon-green);
    padding: 1rem 1.5rem;
    display: inline-block;
    box-shadow: 0 0 10px var(--neon-green);
    margin-bottom: 2rem;
}
#typewriter-multi {
    font-family: var(--font-body);
    font-size: 1.5rem;
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
    font-weight: bold;
}
.prefix { color: var(--neon-green); margin-right: 10px; }


/* ═══════════════════════════════════════════════════
   SOCIAL + CV
═══════════════════════════════════════════════════ */
.social-links { margin-top: 1rem; }
.linkedin-logo img {
    width: 60px; height: 60px;
    filter: drop-shadow(0 0 5px var(--neon-blue));
    transition: transform 0.3s;
}
.linkedin-logo img:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px var(--neon-blue));
}
.cv-btn {
    display: inline-block;
    margin-top: 2rem;
    padding: 10px 20px;
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
    text-decoration: none;
    font-family: var(--font-title);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: rgba(0,0,0,0.6);
    transition: all 0.3s ease;
    box-shadow: 0 0 5px var(--neon-green);
    animation: pulseBorder 3s infinite;
}
.cv-btn:hover {
    background-color: var(--neon-green);
    color: #000;
    box-shadow: 0 0 20px var(--neon-green);
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════
   PROJECTS
═══════════════════════════════════════════════════ */
.projects {
    padding: 5rem 2rem;
    background-color: #0a0a0a;
    background-image: radial-gradient(#222 15%, transparent 16%);
    background-size: 20px 20px;
}
h2.neon-title {
    font-family: var(--font-title);
    font-size: 2rem;
    text-align: center;
    color: #fff;
    text-shadow: 3px 3px 0 var(--neon-blue);
    margin-bottom: 4rem;
    text-transform: uppercase;
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Cartes : état de base (cachées, prêtes à apparaître) ── */
.project-card {
    background: #000;
    border: 3px solid var(--neon-pink);
    position: relative;
    
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 5px var(--neon-pink);
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;

    /* État initial pour l'animation d'entrée */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

/* ── Carte visible (déclenché par IntersectionObserver) ── */
.project-card.card-visible {
    animation: cardBoot 0.4s ease forwards;
}
@keyframes cardBoot {
    0%   { opacity: 0; transform: translateY(20px) scale(0.95); }
    60%  { opacity: 1; transform: translateY(-4px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Ligne de scan qui descend à l'apparition */
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 0, 255, 0.15) 50%,
        transparent 100%
    );
    transform: translateY(-100%);
    transition: none;
    pointer-events: none;
}
.project-card.card-visible::before {
    animation: scanDown 0.4s ease forwards;
}
@keyframes scanDown {
    from { transform: translateY(-100%); }
    to   { transform: translateY(100%); }
}

/* Numéro de fichier en coin */
.project-card::after {
    content: attr(data-project);
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: rgba(255,0,255,0.3);
    text-transform: uppercase;
    pointer-events: none;
}

.card-inner {
    text-align: center;
    width: 100%;
    padding: 0 10px;
}
.project-card h3 {
    font-family: var(--font-title);
    font-size: 1rem;
    color: var(--neon-pink);
    margin: 0;
    line-height: 1.5;
}
.project-card:hover {
    transform: translateY(-5px);
    background-color: var(--neon-pink);
    box-shadow: 0 0 25px var(--neon-pink), inset 0 0 15px rgba(255,0,255,0.2);
}
.project-card:hover h3 { color: #000; }

/* ═══════════════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════════════ */
.contact {
    padding: 5rem 2rem;
    background-color: #080808;
    background-image:
        linear-gradient(rgba(0,255,255,0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,255,255,0.07) 1px, transparent 1px);
    background-size: 40px 40px;
    border-top: 2px solid var(--neon-blue);
    position: relative;
}
.arcade-alert {
    border: 2px solid var(--neon-green);
    background: #000;
    color: var(--neon-green);
    padding: 1rem;
    margin: 0 auto 2rem auto;
    max-width: 600px;
    text-align: center;
    font-family: var(--font-body);
    box-shadow: 0 0 10px var(--neon-green);
}
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: #111;
    padding: 2rem;
    border: 4px double var(--neon-blue);
    box-shadow: 0 0 15px rgba(0,255,255,0.2);
}
.input-group { margin-bottom: 1.5rem; }
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background: #000;
    border: 1px solid #333;
    border-bottom: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    font-family: var(--font-body);
    font-size: 1.2rem;
    
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #444;
    text-transform: uppercase;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    background: #051010;
    box-shadow: 0 0 10px rgba(0,255,255,0.3);
}
.contact-form textarea { min-height: 150px; resize: vertical; }
.arcade-btn {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 3px solid var(--neon-green);
    color: var(--neon-green);
    font-family: var(--font-title);
    font-size: 1rem;
    
    text-transform: uppercase;
    transition: 0.2s;
    box-shadow: 0 0 5px var(--neon-green);
}
.arcade-btn:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 20px var(--neon-green);
}



/* ═══════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════ */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
.retro-window {
    background: #1a1a2e;
    border: 2px solid #c0c0c0;
    width: 90%; max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 15px 15px 0 #000;
    animation: modalOpen 0.2s ease forwards;
}
@keyframes modalOpen {
    from { transform: scale(0.92) translateY(10px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
.window-bar {
    background: linear-gradient(90deg, #000080, #1084d0);
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #c0c0c0;
}
.window-bar span {
    font-family: var(--font-title);
    font-size: 0.8rem;
    color: white;
}
.close-button {
    background: #c0c0c0;
    color: #000 !important;
    font-family: sans-serif !important;
    font-weight: bold;
    padding: 2px 8px;
    border: 2px outset #fff;
    
    font-size: 1rem;
}
.close-button:active { border-style: inset; }
.window-body {
    padding: 2rem;
    overflow-y: auto;
    color: #fff;
}
.modal-title {
    font-family: var(--font-title);
    color: var(--neon-blue);
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px dashed var(--neon-blue);
    padding-bottom: 1rem;
    line-height: 1.5;
    font-size: 1.5rem;
}
.project-link {
    display: block;
    text-align: center;
    color: var(--neon-pink);
    font-family: var(--font-title);
    font-size: 0.8rem;
    margin-bottom: 2rem;
    text-decoration: none;
    animation: blink 2s infinite;
}
.project-link:hover { text-decoration: underline; }
.modal-section { margin-bottom: 3rem; }
.img-border {
    border: 2px solid #fff;
    padding: 4px;
    margin-bottom: 1rem;
    background: #000;
}
.modal-image {
    display: block;
    width: 100%;
    height: auto;
}
.terminal-text {
    font-size: 1.3rem;
    line-height: 1.6;
    border-left: 4px solid var(--neon-green);
    padding-left: 1rem;
    background: rgba(0,255,0,0.05);
}

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
footer {
    background: #000;
    color: #666;
    padding: 2rem;
    text-align: center;
    font-family: var(--font-body);
    font-size: 1rem;
    border-top: 1px solid #333;
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS GLOBALES
═══════════════════════════════════════════════════ */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
@keyframes pulseBorder {
    0%   { box-shadow: 0 0 5px var(--neon-green); }
    50%  { box-shadow: 0 0 15px var(--neon-green), inset 0 0 5px var(--neon-green); }
    100% { box-shadow: 0 0 5px var(--neon-green); }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (min-width: 768px) {
    .hero h1 { font-size: 4rem; }
    #typewriter-multi { font-size: 2rem; }
}
@media (max-width: 480px) {
    .project-card { height: 120px; }
    .hero h1 { font-size: 2rem; }
    .neon-title { font-size: 1.5rem; }
    /* Curseur custom désactivé sur mobile (touch) */
    #custom-cursor { display: none; }
    body, * { cursor: auto !important; }
}

/* ═══════════════════════════════════════════════════
   CURSEUR IMAGE (LA VRAIE MÉTHODE SIMPLE)
═══════════════════════════════════════════════════ */

/* 1. On force ta flèche personnalisée absolument PARTOUT */
* {
    cursor: url('images/curseur.png'), auto !important;
}

/* 2. On met ta main personnalisée sur les éléments cliquables ET leurs enfants */
a, a *, button, button *, .project-card, .project-card *, .close-button, .cv-btn, input, textarea {
    cursor: url('images/curseur-main.png'), pointer !important;
}

/* 3. Le bouclier : on cache la souris uniquement quand elle survole l'écran de chargement */
#boot-screen, #boot-screen * {
    cursor: none !important;
}

/* 4. Sécurité pour les mobiles (où le tactile remplace la souris) */
@media (max-width: 480px) {
    * { cursor: auto !important; }
}