@import url('couleurs.css');
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

/* --- RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- BODY --- */
body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: 'Share Tech Mono', monospace;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Particules de fond animées */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(57, 255, 20, 0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 10%, rgba(57, 255, 20, 0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 80%, rgba(57, 255, 20, 0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 10% 60%, rgba(57, 255, 20, 0.2) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 70%, rgba(57, 255, 20, 0.3) 0%, transparent 100%),
        linear-gradient(rgba(57, 255, 20, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(57, 255, 20, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    pointer-events: none;
    z-index: 0;
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

/* Ligne de scan qui descend */
body::after {
    content: '';
    position: fixed;
    top: -10%;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
            transparent,
            rgba(57, 255, 20, 0.6),
            rgba(57, 255, 20, 0.9),
            rgba(57, 255, 20, 0.6),
            transparent);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.6), 0 0 40px rgba(57, 255, 20, 0.3);
    animation: scanDown 6s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes scanDown {
    from {
        top: -5%;
    }

    to {
        top: 110%;
    }
}

/* --- MAIN --- */
.content {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 110px 24px 80px;
}

/* --- HEADER --- */
.header-section {
    text-align: center;
    margin-bottom: 80px;
    position: relative;
}

.main-title {
    font-size: 4rem;
    letter-spacing: 12px;
    text-transform: uppercase;
    color: var(--color-neon);
    display: inline-block;
    position: relative;
    animation: titleBoot 1.2s steps(12) forwards;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--color-neon);
}

@keyframes titleBoot {
    from {
        width: 0;
    }

    to {
        width: 100%;
        border-right-color: transparent;
    }
}

/* Reflet sous le titre */
.main-title::after {
    content: attr(data-text);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    color: var(--color-neon);
    opacity: 0.15;
    transform: scaleY(-1);
    filter: blur(2px);
    mask-image: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.4));
    pointer-events: none;
}

.subtitle {
    margin-top: 24px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    letter-spacing: 3px;
    opacity: 0;
    animation: fadeUp 0.6s 1.2s ease forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

/* --- GALERIE --- */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* --- CARTE --- */
.project-card {
    position: relative;
    background: var(--color-card);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    animation: cardBlast 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}

.project-card:nth-child(1) {
    animation-delay: 1.3s;
}

.project-card:nth-child(2) {
    animation-delay: 1.5s;
}

.project-card:nth-child(3) {
    animation-delay: 1.7s;
}

.project-card:nth-child(4) {
    animation-delay: 1.9s;
}

@keyframes cardBlast {
    0% {
        opacity: 0;
        transform: scale(0.6) rotate(-4deg);
        filter: blur(8px) brightness(2);
    }

    60% {
        opacity: 1;
        filter: blur(0) brightness(1.2);
    }

    80% {
        transform: scale(1.03) rotate(0.5deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
        filter: blur(0) brightness(1);
    }
}

/* Bordures animées */
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    padding: 1px;
    background: linear-gradient(135deg,
            var(--color-neon),
            transparent 40%,
            transparent 60%,
            var(--color-neon));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.4;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
    animation: borderRotate 4s linear infinite;
    background-size: 200% 200%;
}

@keyframes borderRotate {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 200% 200%;
    }
}

.project-card:hover::before {
    opacity: 1;
}

/* Eclat lumineux au hover */
.project-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            transparent 0deg,
            rgba(57, 255, 20, 0.06) 60deg,
            transparent 120deg);
    animation: rotate 6s linear infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.project-card:hover::after {
    opacity: 1;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 60px rgba(57, 255, 20, 0.15),
        0 0 0 1px var(--color-neon),
        0 0 40px rgba(57, 255, 20, 0.1);
}

/* --- IMAGE --- */
.project-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    object-position: center;
    display: block;
    background: var(--color-card);
    filter: brightness(0.5) saturate(0.3) hue-rotate(80deg);
    transition: filter 0.5s ease, transform 0.5s ease;
    position: relative;
    z-index: 0;
}

.project-card:hover .project-img {
    filter: brightness(0.7) saturate(0.6) hue-rotate(80deg);
    transform: scale(1.05);
}

/* --- INFO --- */
.project-info {
    padding: 20px 22px;
    position: relative;
    z-index: 3;
}

.project-info h2 {
    color: var(--color-neon);
    font-size: 1rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--color-neon);
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
}

/* Soulignement qui s'anime */
.project-info h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    height: 1px;
    width: 0;
    background: var(--color-neon);
    box-shadow: 0 0 8px var(--color-neon);
    transition: width 0.4s ease;
}

.project-card:hover .project-info h2::after {
    width: 100%;
}

.project-info p {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    line-height: 1.65;
    letter-spacing: 0.5px;
}

/* Tag "ACCÉDER" */
.project-tag {
    display: inline-block;
    margin-top: 14px;
    padding: 4px 12px;
    border: 1px solid rgba(57, 255, 20, 0.4);
    border-radius: 2px;
    color: var(--color-text-muted);
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.project-card:hover .project-tag {
    border-color: var(--color-neon);
    color: var(--color-neon);
    text-shadow: 0 0 8px var(--color-neon);
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.2);
}

/* --- POPUP OVERLAY --- */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 5, 0.96);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}

.popup-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* --- POPUP CONTENU --- */
.popup-content {
    background: var(--color-card);
    border: 1px solid var(--color-neon);
    border-radius: 4px;
    padding: 44px;
    max-width: 720px;
    width: 100%;
    position: relative;
    box-shadow:
        0 0 0 1px rgba(57, 255, 20, 0.1),
        0 0 80px rgba(57, 255, 20, 0.2),
        inset 0 0 60px rgba(57, 255, 20, 0.02);
    transform: scale(0.85) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* Effet scan intérieur popup */
.popup-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-neon), transparent);
    animation: popupScan 3s linear infinite;
}

@keyframes popupScan {
    from {
        top: 0;
        opacity: 1;
    }

    to {
        top: 100%;
        opacity: 0.2;
    }
}

.popup-overlay.active .popup-content {
    transform: scale(1) translateY(0);
}

.popup-content h1 {
    color: var(--color-neon);
    font-size: 1.5rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    text-shadow: 0 0 16px var(--color-neon);
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(57, 255, 20, 0.2);
}

.popup-content p {
    color: var(--color-text);
    font-size: 0.87rem;
    line-height: 1.85;
    margin-bottom: 16px;
}

/* --- LIEN --- */
.project-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 28px;
    background: var(--color-neon);
    color: var(--color-bg);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.82rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 3px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
}

.project-link::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: rgba(255, 255, 255, 0.15);
    transform: skewX(-20deg);
    transition: left 0.4s ease;
}

.project-link:hover::after {
    left: 130%;
}

.project-link:hover {
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.7), 0 0 60px rgba(57, 255, 20, 0.3);
    transform: translateY(-2px);
}

/* --- BOUTON FERMER --- */
.close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: 1px solid var(--color-glitch);
    color: var(--color-glitch);
    font-size: 1.1rem;
    width: 30px;
    height: 30px;
    cursor: pointer;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-shadow: 0 0 8px var(--color-glitch);
    box-shadow: 0 0 8px rgba(255, 48, 48, 0.2);
}

.close-btn:hover {
    background: var(--color-glitch);
    color: var(--color-bg);
    box-shadow: 0 0 20px var(--color-glitch);
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-neon);
    border-radius: 2px;
    box-shadow: 0 0 6px var(--color-neon);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
        letter-spacing: 6px;
    }

    .project-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .popup-content {
        padding: 28px 20px;
    }

    .popup-content h1 {
        font-size: 1.1rem;
        letter-spacing: 3px;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 90px 14px 60px;
    }

    .main-title {
        font-size: 1.6rem;
        letter-spacing: 4px;
    }

    .project-img {
        height: 160px;
    }

    .popup-content {
        padding: 22px 14px;
    }
}