/* ===================== GLOBAL ===================== */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Focus */
input:focus,
textarea:focus,
button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Selection */
::selection {
    background-color: #4B5563;
    color: white;
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* ===================== HERO ===================== */
#accueil {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

/* Background gradient SUR UN LAYER DÉDIÉ */
#accueil::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom right,
        #bfdbfe,
        #e0e7ff,
        #ede9fe
    );
    z-index: 0;
}

/* Animation légère du fond */
@keyframes floatBackground {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#accueil::after {
    content: "";
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    animation: floatBackground 10s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* Contenu central */
.hero-center {
    position: relative;
    z-index: 2;
}

/* Animation texte Hero */
#accueil h1,
#accueil p,
#accueil a {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUpHero 1s forwards;
}

#accueil h1 { animation-delay: 0.2s; }
#accueil p:first-of-type { animation-delay: 0.4s; }
#accueil p:last-of-type { animation-delay: 0.6s; }
#accueil a { animation-delay: 0.8s; }

@keyframes fadeInUpHero {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================== LOGOS FLOTTANTS ===================== */
#floating-logos {
    position: absolute;
    inset: 0;
    z-index: 1; /* ENTRE le fond et le texte */
    pointer-events: none;
    overflow: hidden;
}

.floating-logo {
    position: absolute;
    color: rgba(37, 99, 235, 0.25);
    animation-name: floatUp;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    filter: blur(0.3px);
    transform-origin: center;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateY(-60vh) translateX(20px) rotate(180deg);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-120vh) translateX(-20px) rotate(360deg);
        opacity: 0;
    }
}

/* ===================== SKILLS ===================== */
.skill-card {
    transition: all 0.3s ease;
}
.skill-card:hover {
    transform: translateY(-5px);
}

/* ===================== PROJECTS ===================== */
.project-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
    transform: scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

/* ===================== LIGHTBOX ===================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox.hidden {
    display: none;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    animation: fadeIn 0.3s ease-out;
}

#lightbox-img {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    animation: zoomIn 0.35s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
