/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* FONTS */
@font-face {
    font-family: "Space Grotesk";
    src: url('assets/fonts/SpaceGrotesk-Bold.ttf') format('truetype');
    font-weight: bold;
}

@font-face {
    font-family: "Inter";
    src: url('assets/fonts/Inter_18pt-Light.ttf') format('truetype');
    font-weight: 300;
}
/* -------------------------------- */

html {
    scroll-behavior: smooth;
}

body {
    background: #111111;
    color: #f5f5f5;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    position: relative;
    cursor: none !important; /* Fusion des déclarations cursor */
}

/* BACKGROUND GLOWS */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    z-index: -2;
    pointer-events: none;
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: #ff6b35;
    top: 10%;
    left: -100px;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: #8b5cf6;
    top: 50%;
    right: -150px;
}

.glow-3 {
    width: 350px;
    height: 350px;
    background: #ffffff;
    bottom: -100px;
    left: 30%;
}

.hero {
    min-height: 75vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 8rem 5%;
}

.hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.hero-image img {
    display: block;
    margin: 0 auto;
    max-width: 1100px;
    width: 80%;
    height: auto;
}

section {
    padding-top: 6rem;
    padding-bottom: 6rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem; /* Fusion avec l'autre déclaration section-header */
}

.section-header h1, .section-header h2 {
	font-family: Space Grotesk;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-top: 1rem;
}

.section-title {
    margin-bottom: 1rem;
}

/* CUSTOM CURSOR */
.custom-cursor {
    width: 30px;
    height: 30px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background 0.3s ease, transform 0.08s linear;
    z-index: 20000;
}

/* Hover effect */
.custom-cursor.active {
    width: 70px;
    height: 70px;
    background: rgba(255, 107, 53, 0.15);
}

img {
    width: 100%;
    display: block;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* HIDE DEFAULT CURSOR */
*,
*::before,
*::after {
    cursor: none !important;
}

/* VARIABLES */
:root {
    --accent: #ff6b35;
    --light: #f5f5f5;
    --dark: #111111;
    --gray: #999999;
}

/* NAVBAR */
.navbar {
    width: 100%;
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--accent);
}

/* HERO TEXT & BTNS */
.small-text {
    color: var(--accent);
    margin-bottom: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(4rem, 10vw, 9rem);
    line-height: 0.9;
    margin-bottom: 2rem;
}

.hero-description {
    max-width: 500px;
    color: var(--gray);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--accent);
    color: white;
    border-radius: 100px;
    transition: 0.3s;
}

.btn:hover {
    transform: translateY(-3px);
}

.hero-shape {
    width: 350px;
    height: 350px;
    background: var(--accent);
    border-radius: 48% 52% 70% 30% / 30% 30% 70% 70%;
    filter: blur(40px);
    opacity: 0.2;
    position: absolute;
    right: 10%;
    top: 20%;
}

/* SECTIONS */
.skills span {
    border: 1px solid #333;
    padding: 0.8rem 1.2rem;
    border-radius: 100px;
}

/* FILTERS */
.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 4rem;
    width: 100%;
    overflow-x: hidden;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    border: 1px solid #333;
    background: transparent;
    color: white;
    border-radius: 100px;
    cursor: pointer;
    transition: 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

/* PROJECT GRID */
.project-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    max-width: 1800px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.project-card {
    grid-column: span 4;
    height: 400px;
    position: relative;
    border-radius: 25px;
    overflow: hidden;
    cursor: pointer;
    background: #1a1a1a;
    transition: 0.5s ease;
}

.project-card.large {
    grid-column: span 8;
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.project-card:hover img {
    transform: scale(1.05);
}

/* OVERLAY */
.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.1));
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.project-overlay p {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.project-overlay h2, .project-overlay h3 {
	font-family: Space Grotesk;
    font-size: 2rem;
}

/* --- CORRECTION MODAL --- */
.project-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden; /* <-- Ajout important pour cacher complètement au chargement */
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 9999;
}

.project-modal.active {
    opacity: 1;
    visibility: visible; /* <-- Réapparition quand actif */
    pointer-events: auto;
}
/* ------------------------ */

.project-modal.active ~ .custom-cursor {
    opacity: 1;
}

.modal-box {
    width: 90%;
    max-width: 900px;
    background: #181818;
    border-radius: 30px;
    padding: 4rem;
    position: relative;
    animation: modalOpen 0.4s ease;
}

@keyframes modalOpen {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.modal-content h1, .modal-content h3 {
    font-size: 3rem;
    margin-bottom: 2rem;
    font-family: 'Space Grotesk', sans-serif;
}

.modal-content p {
    line-height: 1.8;
    margin-bottom: 2rem;
    color: #ccc;
}

.modal-content ul {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-content li {
    border: 1px solid #333;
    padding: 0.7rem 1rem;
    border-radius: 100px;
}

/* CONTACT */
.contact {
    text-align: center;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* FOOTER */
footer {
    padding: 3rem 5%;
    border-top: 1px solid #222;
    text-align: center;
    color: var(--gray);
}

/* MODAL GALLERY */
.modal-gallery {
    margin-top: 3rem;
    display: flex;
    overflow: hidden;
    padding-bottom: 1rem;
    user-select: none;
    cursor: grab;
    gap: 0;
}

.modal-gallery img {
    width: 100%;
    min-width: 100%;
    flex-shrink: 0;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 20px;
}

.modal-gallery.dragging {
    cursor: grabbing;
}

/* GALLERY WRAPPER */
.gallery-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* BUTTONS */
.gallery-btn {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    color: white;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.gallery-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: scale(1.08);
}

/* CURSOR STATES */
.custom-cursor.gallery-active {
    width: 90px;
    height: 90px;
    background: rgba(255, 107, 53, 0.12);
    border: 1px solid var(--accent);
}

.custom-cursor.dragging {
    width: 110px;
    height: 110px;
    background: rgba(255, 107, 53, 0.25);
    transform: translate(-50%, -50%) scale(0.9);
}

/* GRAIN EFFECT */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("https://www.transparenttextures.com/patterns/asfalt-dark.png");
    opacity: 0.12;
    pointer-events: none;
    z-index: -1;
}

/* SPOTLIGHT */
.spotlight {
    position: fixed;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.12) 0%, rgba(255, 107, 53, 0.05) 25%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, background 0.4s ease;
    mix-blend-mode: screen;
    filter: blur(30px);
}

/* SPOTLIGHT ACTIVE */
.spotlight.active {
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.18) 0%, rgba(255, 107, 53, 0.08) 30%, transparent 70%);
}

/* ABOUT */
.about {
    padding: 8rem 10%;
}

.about-container {
    display: grid;
    grid-template-columns: 1fr 500px;
    align-items: center;
    gap: 4rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 30px;
    padding: 4rem;
    position: relative;
    overflow: visible;
}

.section-tag {
    color: var(--accent);
    letter-spacing: 4px;
    font-size: .9rem;
}

.about-content h1, .about-content h2 {
	font-family: Space Grotesk;
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin: 1rem 0 2rem;
    line-height: 1.1;
}

.about-content h1 span, .about-content h2 span {
    color: var(--accent);
}

.about-content p {
    color: #bdbdbd;
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.skills span {
    padding: .8rem 1.2rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    transition: .3s;
}

.about-portrait {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 100%;
}

.about-portrait img {
    width: 200%;
    max-width: none;
    position: relative;
    top: -10px;
}

.contact-container {
    max-width: 650px;
    margin: 0 auto;
    padding: 4rem 3rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.contact-container p {
    font-size: 1rem;
    line-height: 1.8;
    max-width: 500px;
    color: #bdbdbd;
}

.contact-container h1, .contact-container h2 {
	font-family: Space Grotesk;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin: 0.5rem 0 1rem;
    font-family: 'Space Grotesk', sans-serif;
}

.contact-container .about-content {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    width: 100%;
}

.contact-container .section-tag {
    color: var(--accent);
    letter-spacing: 4px;
    font-size: .9rem;
}

/* RESPONSIVE */
@media screen and (max-width: 1300px) {
    .about-container {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 3rem;
        gap: 3rem;
    }

    .about-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        order: 2;
    }

    .about-content p {
        max-width: 700px;
    }
    
    .about-portrait {
        order: 1;
        justify-content: center;
        align-items: center;
    }

    .skills {
        justify-content: center;
    }

    .about-portrait img {
        width: 120%;
        max-width: 400px;
        top: 0;
    }
}

@media screen and (max-width: 900px) {
    .project-card,
    .project-card.large {
        grid-column: span 12;
    }

    .modal-box {
        padding: 2rem;
    }

    .modal-content h1, .modal-content h3 {
        font-size: 2rem;
    }

    .modal-gallery {
        scroll-snap-type: x mandatory;
    }
}

@media screen and (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .hero {
        padding-top: 12rem;
    }

    .hero h1 {
        font-size: 4rem;
    }

    .section-title h1, .section-title h2 {
        font-size: 2.2rem;
    }

    .about-content p {
        font-size: 1.1rem;
    }
    
    .custom-cursor {
        display: none;
    }

    body {
        cursor: auto;
    }

    .modal-gallery img {
        min-width: 85vw;
        height: 220px;
    }
    
    .gallery-btn {
        display: none;
    }
}

@media screen and (max-width: 400px) {
    .projects {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .project-grid {
        padding: 0;
    }

    .contact {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}