:root {
    --primary: #FFC400;
    --bg-light: #f4f4f5;
    --bg-dark: #09090b;
    --text-main: #18181b;
    --card-bg: #ffffff;
    --border-color: rgba(0,0,0,0.1);
    --transition: 0.4s ease;
}

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

::selection { background: #ffffff; color: #000; mix-blend-mode: difference; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: var(--text-main);
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
    width: 100%;
    cursor: default;
}

body.no-scroll { overflow: hidden; }
::-webkit-scrollbar { display: none; }

/* --- THÈME SOMBRE --- */
body.inverted {
    background: var(--bg-dark);
    color: #fafafa;
    --text-main: #fafafa;
    --card-bg: #18181b;
    --border-color: rgba(255,255,255,0.1);
}

/* --- UI ELEMENTS --- */
#cursor {
    width: 20px; height: 20px;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    background: #fff;
    mix-blend-mode: difference;
    transition: width 0.3s, height 0.3s, transform 0.2s;
    transform: translate(-50%, -50%);
}
#cursor.hovered { width: 60px; height: 60px; }
body.no-blend #cursor { mix-blend-mode: normal; background: var(--primary); opacity: 0.9; transform: translate(-50%, -50%) scale(0.8); }

.grid-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: 
        linear-gradient(to right, rgba(0,0,0, 0.05) 1px, transparent 1px), 
        linear-gradient(to bottom, rgba(0,0,0, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
}
body.inverted .grid-bg {
    background-image: 
        linear-gradient(to right, rgba(255,255,255, 0.05) 1px, transparent 1px), 
        linear-gradient(to bottom, rgba(255,255,255, 0.05) 1px, transparent 1px) !important;
}

/* --- NAVIGATION --- */
nav {
    position: fixed; top: 0; width: 100%; padding: 2rem 4rem; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    transition: all var(--transition);
    color: #fff;
}
nav.nav-dark { color: #18181b; }

nav a { text-decoration: none; color: inherit; font-weight: 700; font-size: 0.9rem; letter-spacing: 1px; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 3rem; }

.btn-cv {
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--btn-border);
    --btn-border: currentColor;
    border-radius: 50px;
    display: flex; align-items: center; gap: 8px;
}
body.inverted .btn-cv {
    --btn-border: #fafafa;
}
.btn-cv svg { width: 16px; height: 16px; fill: currentColor; }
.btn-cv:hover { background-color: #fff; color: #000; border-color: #fff; }
nav.nav-dark .btn-cv:hover { background-color: #000; color: #fff !important; border-color: #000; }

.btn-contact { padding: 0.8rem 2rem; background: #fff; color: #000; border-radius: 4px; transition: var(--transition); }
nav.nav-dark .btn-contact { background: #000; color: #fff; }


.lang-btn {
    background: none;
    border: 1px solid currentColor;
    color: inherit;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.8rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
}

.lang-btn:hover {
    background: #fff;
    color: #000;
}

nav.nav-dark .lang-btn:hover {
    background: #000;
    color: #fff;
}


/* --- HERO --- */
.hero {
    height: 100vh; width: 100vw;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    padding-bottom: 5rem;
    z-index: 1;
}
.hero-bg {
    position: absolute; inset: 0; z-index: 0;
    background: 
        linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)), 
        url('images/Background.png') center/cover no-repeat;
}
.stack-container { position: relative; width: fit-content; text-align: center; }

.hero-intro {
    position: absolute; top: -100px; left: 0;
    font-family: 'Inter', sans-serif; color: white;
    text-align: left; pointer-events: none; z-index: 10;
}
.hero-title { font-size: 2.5rem; font-weight: 600; }
.hero-subtitle { font-size: 1.2rem; text-decoration: underline; text-decoration-thickness: 2px; opacity: 0.9; }

.highlight {
    font-family: 'Oswald', sans-serif; font-weight: 300;
    font-size: clamp(4rem, 15vw, 15rem); line-height: 0.75;
    margin: 0; pointer-events: none; user-select: none;
}
.highlight.fill { color: white; position: relative; z-index: 1; }
.highlight.stroke {
    position: absolute; top: 0; left: 0; width: 100%;
    color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,0.9);
    z-index: 3;
}
.flower-overlay {
    position: absolute; top: 72%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw; height: 100vh;
    pointer-events: none; z-index: 2;
    opacity: 75%;
}
.flower-overlay img { width: 100%; height: 100%; object-fit: cover; }

/* --- ABOUT --- */
.about-section {
    padding: 14rem 10% 8rem;
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 4rem;
    background-color: var(--bg-light);
    
    background-image: 
        linear-gradient(to right, rgba(0,0,0, 0.05) 1px, transparent 1px), 
        linear-gradient(to bottom, rgba(0,0,0, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    border-top-left-radius: 50% 120px;
    border-top-right-radius: 50% 120px;
    margin-top: -120px;
    position: relative; 
    z-index: 20;
    transition: background var(--transition);
    overflow: hidden;
}
body.inverted .about-section {
    background-color: var(--bg-dark);
    background-image: 
        linear-gradient(to right, rgba(255,255,255, 0.05) 1px, transparent 1px), 
        linear-gradient(to bottom, rgba(255,255,255, 0.05) 1px, transparent 1px);
}

.about-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.fade-separator {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #18181b;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 2px;
    animation: bounce 2s infinite;
    cursor: pointer;
    z-index: 2;
}

body.inverted .fade-separator {
    color: #fafafa;
}

.fade-separator svg {
    width: 20px;
    height: 20px;
    margin-top: 5px;
    fill: currentColor;
}
@keyframes bounce { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 10px); } }

.about-card {
    background: var(--card-bg); padding: 4rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    border-radius: 4px;
    position: relative; z-index: 1; overflow: hidden;
}
.card-decoration {
    position: absolute; inset: 0; opacity: 0.05;
    background-image: radial-gradient(var(--text-main) 1px, transparent 1px);
    background-size: 20px 20px; pointer-events: none;
}
.section-index { font-family: 'Space Mono'; color: var(--primary); margin-bottom: 1rem; }
.about-info h2 { font-family: 'Space Mono'; font-size: 2.5rem; color: var(--primary); margin-bottom: 2rem; text-transform: uppercase; }
.about-info p { font-size: 1.4rem; line-height: 1.5; margin-bottom: 3rem; }
.signature { font-family: 'Mrs Saint Delafield', cursive; font-size: 2.5rem; opacity: 0.6; transform: rotate(-5deg); }
.ascii-art-image { max-width: 100%; opacity: 0.8; margin: 0 auto; display: block; }

/* --- DIVIDER --- */
.section-divider-container { padding: 6rem 5%; display: flex; align-items: center; gap: 2rem; }
.divider-line { flex-grow: 1; height: 1px; background: linear-gradient(to right, currentColor 50%, transparent 50%); background-size: 10px 100%; opacity: 0.3; }
.divider-badge {
    border: 1px solid currentColor; padding: 0.6rem 1.5rem; border-radius: 50px;
    font-family: 'Space Mono'; font-size: 0.8rem; text-transform: uppercase;
    display: flex; align-items: center;
}
.divider-badge::before { content: ''; width: 8px; height: 8px; background: var(--primary); border-radius: 50%; margin-right: 10px; animation: blink 2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* --- SKILLS --- */
.skills-section { padding: 4rem 10% 8rem; }
.skills-section h2 { font-family: 'Space Mono'; font-size: 3rem; text-align: center; margin-bottom: 4rem; text-transform: uppercase; }
.skills-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; max-width: 1200px; margin: 0 auto; }
.skill-card {
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 16px; padding: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}
.skill-card h3 { font-family: 'Oswald'; font-size: 3rem; border-bottom: 4px solid var(--primary); display: inline-block; margin-bottom: 1.5rem; }
.skill-card ul { list-style: none; display: flex; flex-direction: column; gap: 0.8rem; }
.skill-card li { font-size: 1.1rem; font-weight: 500; display: flex; align-items: center; }
.skill-card li::before { content: "•"; color: var(--text-main); margin-right: 15px; font-size: 1.5rem; line-height: 0; }

/* --- WORK --- */
.work-section { padding: 5rem 10% 8rem; }
.work-header { display: flex; align-items: baseline; gap: 2rem; margin-bottom: 3rem; }
.work-header .section-index { font-size: 3rem; margin: 0; }
.work-header h2 { font-family: 'Space Mono'; font-size: 3rem; text-transform: uppercase; }
.bento-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 2rem; }
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    height: 450px; 
    padding: 2.5rem;
    display: flex; 
    flex-direction: column; 
    justify-content: flex-end;
    text-decoration: none; 
    color: inherit; 
    border-radius: 12px;
    transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
    position: relative; 
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.project-card .project-icon {
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 1rem;
    border-radius: 8px;
}

.project-card.highlight-card { 
    background: var(--primary); 
    color: #000; 
}
.project-card h4 { 
    font-family: 'Oswald'; 
    font-size: 2rem; 
    line-height: 1; 
    z-index: 3; 
}
.project-card span { 
    font-weight: 700; 
    font-size: 0.8rem; 
    opacity: 0.7; 
    z-index: 3; 
    margin-bottom: 0.5rem; 
}
.project-card:hover { 
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* --- MODAL --- */
.project-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(12px);
    z-index: 1000; display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.project-modal.active { opacity: 1; pointer-events: all; }

.modal-project-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; 
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    z-index: 0;
    border-radius: 8px;
}

.modal-content {
    position: relative;
    width: 50%; max-width: 800px;
    background: rgba(9,9,11,0.9);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 4rem;
    transform: scale(0.9);
    transition: transform 0.4s ease;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.modal-content * { position: relative; z-index: 1; }
.project-modal.active .modal-content { transform: scale(1); }
.modal-close { position: absolute; top: 2rem; right: 2rem; background: none; border: none; font-size: 1.5rem; color: #fff; cursor: pointer; }
.modal-close:hover { color: var(--primary); }
.modal-meta { font-family: 'Space Mono'; color: var(--primary); font-size: 0.9rem; margin-bottom: 1rem; }
.modal-title { font-family: 'Oswald'; font-size: 4rem; line-height: 1; margin-bottom: 2rem; text-transform: uppercase; }
.modal-desc { font-size: 1.2rem; opacity: 0.8; margin-bottom: 2rem; color: #ccc; }
.modal-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-tag { border: 1px solid rgba(255,255,255,0.2); padding: 5px 15px; border-radius: 50px; font-size: 0.8rem; font-family: 'Space Mono'; text-transform: uppercase; }

/* --- CONTACT --- */
.contact-section {
    padding: 8rem 5%; min-height: 60vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    position: relative; z-index: 50;
}
.contact-index {
    font-family: 'Space Mono'; color: var(--primary); font-size: 0.9rem;
    margin-bottom: 1.5rem; border: 1px solid rgba(255,255,255,0.2);
    padding: 5px 12px; border-radius: 50px;
}
.contact-title { font-family: 'Oswald'; font-weight: 300; font-size: 2.5rem; margin-bottom: 2rem; color: #fff; text-transform: uppercase; letter-spacing: 2px; }
.email-wrapper { margin-bottom: 3rem; position: relative; }
.minimal-email {
    font-family: 'Inter'; font-size: 1.5rem; font-weight: 300; color: #fff;
    text-decoration: none; display: flex; align-items: center; gap: 10px;
    padding-bottom: 5px; position: relative; transition: color 0.3s;
}
.minimal-email::after { content: ''; position: absolute; left: 0; bottom: 0; width: 0%; height: 1px; background: var(--primary); transition: width 0.3s; }
.minimal-email:hover { color: var(--primary); }
.minimal-email:hover::after { width: 100%; }
.arrow-icon { width: 18px; height: 18px; fill: currentColor; transition: transform 0.3s; }
.minimal-email:hover .arrow-icon { transform: translate(5px, -5px); }
.contact-socials { display: flex; gap: 1.5rem; opacity: 0.7; transition: opacity 0.3s; }
.contact-socials:hover { opacity: 1; }
.contact-socials svg { width: 20px; height: 20px; fill: #fff; transition: transform 0.3s; }
.contact-socials a:hover svg { transform: translateY(-3px); fill: var(--primary); }

/* --- FOOTER --- */
footer {
    padding: 3rem 10%; background: #09090b; color: #fff;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-between; align-items: center;
}
.footer-logo { font-family: 'Oswald'; font-size: 2rem; line-height: 1; }
.footer-right { display: flex; align-items: center; gap: 2rem; }
.copyright { color: #555; font-size: 0.8rem; }
.back-to-top {
    width: 50px; height: 50px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2); color: #fff; text-decoration: none;
    display: flex; justify-content: center; align-items: center; transition: 0.3s;
}
.back-to-top:hover { background: var(--primary); border-color: var(--primary); color: #000; }

@media (max-width: 1024px) {
    nav { padding: 1.5rem 2rem; }
    .hero-title { font-size: 2rem; }
    .about-section, .skills-section, .work-section { padding-left: 5%; padding-right: 5%; }
    .bento-grid { gap: 1rem; }
}

@media (max-width: 900px) {
    .hero { padding: 0; }
    .about-section { 
        border-radius: 40px 40px 0 0; 
        margin-top: -60px; 
        padding-top: 8rem;
        padding-bottom: 4rem;
        grid-template-columns: 1fr;
    }

    .nav-links { 
        display: none;
    }
    nav { justify-content: center; } 
    nav > a { font-size: 1.2rem; }

    .hero-intro {
        position: relative;
        top: 0; left: 0;
        text-align: center;
        margin-bottom: 1rem;
        width: 100%;
    }
    .stack-container { width: 100%; padding: 0 1rem; }
    .highlight { font-size: 18vw; }
    
    /* About */
    .about-card { padding: 2rem; }
    .ascii-art-image { width: 60%; margin-top: 2rem; }
    .about-footer { flex-direction: column; gap: 1.5rem; align-items: center; text-align: center; }

    /* Skills */
    .skills-wrapper { grid-template-columns: 1fr; }
    .skill-card { padding: 2rem; }

    /* Work / Projets */
    .work-header { flex-direction: column; text-align: center; align-items: center; gap: 0.5rem; }
    .project-card { height: auto; min-height: 400px; } /* Hauteur flexible */

    /* Modal (Très important) */
    .modal-content { 
        width: 90%; 
        max-height: 85vh; 
        overflow-y: auto;
        padding: 2rem;
    }
    .modal-title { font-size: 2.5rem; }
    
    /* Contact & Footer */
    .contact-title { font-size: 1.8rem; }
    .minimal-email { font-size: 1rem; flex-direction: column; gap: 0.5rem; }
    footer { flex-direction: column; gap: 2rem; text-align: center; }
}   