/* ==========================================================================
   1. Reset & Base Styles
   ========================================================================== */

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

body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, figcaption, blockquote, dl, dd, header {
    list-style: none;
    cursor: none;
}

/* Base styles */
:root {
    --color-dark: #181818;
    --color-light: #FFF0DF;
    --transition-default: all 0.3s ease-in-out;
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-secondary: 'Consolas', Monaco, 'Lucida Console', monospace;
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/outfit/v11/QGYvz_MVcBeNP4NjuGObqx1XmO1I4TC0O40.woff2) format('woff2');
}

body {
    font-family: var(--font-primary), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-dark);
    color: var(--color-light);
    width: 100%;
    height: auto;
    transition: var(--transition-default);
    cursor: none;
}

/* ==========================================================================
   2. Typography
   ========================================================================== */

/* Headings */
h1, h2, h3 {
    font-family: var(--font-primary);
    font-weight: 800;
    line-height: 1.2;
}

h1 {
    text-align: left;
    font-size: clamp(2rem, 8vw, 8vw);
}

h2 {
    text-align: left;
    font-size: clamp(1.8rem, 6vw, 7vw);
    grid-column: span 5;
    grid-row: span 3/span 2;
}

h3 {
    font-weight: 900;
    font-size: clamp(1.5rem, 12vw, 12vw);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    grid-column: 8;
    grid-row: 1/span 8;
    margin: 0 -3rem 0 0;
}

/* Paragraphs */
p {
    font-family: var(--font-secondary);
    font-weight: 300;
    font-size: clamp(0.9rem, 1.80vw, 1.80vw);
    line-height: 1.6;
    display: block;
    transition: font-size 0.3s ease-in-out;
    max-width: 100%;
}

/* ==========================================================================
   3. Layout Components
   ========================================================================== */

/* Container */
.container {
    width: auto;
    height: auto;
}

/* Grid Layout Base */
.informations, .aboutme, .mywork, .photos, .contact {
    display: grid;
    padding: 0 5rem;
    grid-template: repeat(8, 1fr) / repeat(8, 1fr);
    gap: 20px;
    min-height: 100vh;
    align-items: center;
    border: solid 1px var(--color-dark);
    transition: var(--transition-default);
    width: 100%;
}

/* Header */
header {
    grid-column: 1 / span 5;
    grid-row: span 3 / span 3;
    width: fit-content;
    height: fit-content;
}

/* Footer */
footer {
    position: fixed;
    bottom: 10px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   4. Navigation & Menu
   ========================================================================== */

/* Main Navigation */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 5.5rem 0 4rem;
}

/* Menu Styles */
.menu {
    display: flex;
    font-family: var(--font-primary);
    color: var(--color-light);
    font-weight: 900;
    font-size: clamp(1em, 1.5vw, 1.5vw);
    transform: scale(1.1);
}

.menu li a {
    position: relative;
    margin: 0 0.5em;
    color: var(--color-dark);
    text-decoration: none;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-default);
}

.menu li a span {
    display: inline-block;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.menu li a:hover {
    transform: scale(1.08);
}

/* Social Icons */
.menu svg,
.reseaux svg {
    display: block;
    height: 3.5em;
    width: auto;
}

.reseaux li {
    display: flex;
    align-items: center;
}

/* ==========================================================================
   5. Gallery
   ========================================================================== */

.gallery {
    display: grid;
    grid-column: 2 / span 6;
    grid-row: 2 / span 6;
    grid-template: repeat(2, 1fr) / repeat(5, 1fr);
    gap: 20px;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Gallery Items */
.gallery > a {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: block;
    aspect-ratio: 1;
    transition: var(--transition-default);
}

.gallery > a:hover {
    transform: scale(1.05);
}

/* Gallery Images */
.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: var(--transition-default);
}

.gallery > a:hover img {
    transform: scale(1.1);
    cursor: none;
}

/* Gallery Animation */
.gallery a div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    background-color: transparent;
}

.gallery a div.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive gallery adjustments */
/* Très grand écran */
@media screen and (min-width: 1920px) {
    .gallery {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
}

/* Grand écran */
@media screen and (min-width: 1300px) and (max-width: 1919px) {
    .gallery {
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Écran moyen */
@media screen and (min-width: 770px) and (max-width: 1299px) {
    .gallery {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 16px;
    }
}

/* Tablette et Mobile */
@media screen and (max-width: 770px) {
    /* Layout ajustments */
    .informations, .aboutme, .mywork, .photos, .contact {
        padding: 0 1.5rem;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        min-height: 90vh;
    }

    /* Typography adjustments */
    h1 {
        font-size: clamp(3rem, 7vw, 8vw);
        grid-column: 1 / -1;
        margin-bottom: -1rem;
    }

    h2 {
        font-size: clamp(1.8rem, 6vw, 7vw);
        grid-column: 1 / -1;
        grid-row: 2 / span 2;
        text-align: center;
        margin-bottom: -1rem;
    }

    h3 {
        font-size: 10vw;
        grid-column: 1 / -1;
        grid-row: 1;
        margin: 0;
        padding: 0.5rem 0;
        writing-mode: horizontal-tb;
        transform: rotate(0deg);
        text-align: center;
        height: fit-content;
    }

    p {
        font-size: clamp(0.9rem, 1.75vw, 2vw);
    }

    /* Gallery adjustments */
    .gallery {
        grid-column: 1 / -1;
        grid-row: 2 / span 6;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 12px;
        padding: 1rem 0;
    }

    /* Chat sections adjustments */
    .chat {
        grid-column: 1 / -1;
        grid-row: span 2;
        width: 70%;
        margin: 0 auto;
    }

    .chat svg {
        width: 100%;
        height: auto;
    }

    .chat2 {
        grid-column: 1 / -1;
        grid-row: 4 / span 2;
        width: 50%;
        position: relative;
        transform: rotate(-15deg);
        translate: 0 2em;
        margin: 0 auto;
    }

    .chat2 svg {
        width: 100%;
        height: auto;
    }

    /* Social networks adjustments */
    .reseaux {
        grid-column: 1 / -1;
        grid-row: 4 / span 2;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .reseaux ul {
        gap: 3vw;
        width: fit-content;
        margin: 0 auto;
        padding: 1rem 0;
    }

    .reseaux svg {
        width: 7vw;
        min-width: 32px;
        max-width: 45px;
    }

    /* Paragraphs adjustments */
    .parag1, .parag2, .blabla, .blabla2 {
        grid-column: 1 / -1;
        padding: 0 1rem;
        max-width: 100%;
    }

    /* Container spacing */
    .container > div {
        margin-bottom: 2rem;
    }
}

/* Mobile specific adjustments */
@media screen and (max-width: 480px) {
    .informations, .aboutme, .mywork, .photos, .contact {
        padding: 0 1rem;
        min-height: 85vh;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0.5rem 0;
    }

    h1 {
        font-size: clamp(3rem, 7vw, 7vw);
        margin-bottom: 0;
    }

    h2 {
        font-size: clamp(1.6rem, 6vw, 6vw);
        margin-bottom: 0;
    }

    h3 {
        font-size: 22vw;
        margin: 0.3rem 0;
    }

    p {
        font-size: clamp(0.85rem, 1.6vw, 1.8vw);
        padding: 0 0.5rem;
    }

    /* Chat adjustments for smaller screens */
    .chat {
        width: 85%;
        margin: 0 auto;
    }

    .chat2 {
        width: 60%;
        transform: rotate(-10deg);
        translate: 0 1em;
        opacity: 0.9;
        display: block; /* Réactiver l'affichage */
    }

    /* Social networks for smaller screens */

    .reseaux svg {
        width: 9vw;
        min-width: 28px;
        max-width: 40px;
    }

    /* Container spacing */
    .container > div {
        margin-bottom: 1rem;
    }

    /* Navigation adjustments */
    .menu {
        gap: 0.8rem;
    }
}

/* ==========================================================================
    6. Section-Specific Styles
    ========================================================================== */

/* Color variations */
.contact, .mywork, .informations {
     background-color: orangered;
     color: #181818;
}

/* Chat sections */
.chat {
     grid-column: span 2/9;
     grid-row: span 4;
     position: relative;
}

.chat2 {
     grid-column: 1 / span 5;
     grid-row: 4 / span 4;
     position: absolute;
     transform: rotate(-25deg);
     translate: -1em 13em;
}


@keyframes float {
     0% {
          transform: translateY(0px);
     }
     50% {
          transform: translateY(-20px);
     }
     100% {
          transform: translateY(0px);
     }
}

.chat {
     animation: float 3s ease-in-out infinite;
}

.chat2 {
     animation: float 3s ease-in-out infinite;
}

/* Paragraphs */
.parag1 {
     grid-column: 1 / span 4;
     grid-row: 6;
}

.parag2 {
     grid-column: 1 / span 5;
     grid-row: 7;
}

.blabla {
     grid-column: 1 / span 4;
     grid-row: 4 / span 2;
}

.blabla2 {
     grid-column: 1 / span 4;
     grid-row: span 2;
}

/* Social networks */
.reseaux {
     grid-column: 1 / -1;
     grid-row: 4 / span 2;
     display: flex;
     justify-content: center;
     align-items: center;
}

.reseaux ul {
     display: flex;
     grid-template-columns: repeat(auto-fit, minmax(3rem, max-content));
     justify-content: center;
     align-items: center;
     gap: 6vw;
     z-index: 1000;
}

.reseaux li {
     list-style: none;
}

.reseaux svg {
    width: 3vw;
    min-width: 32px;
    max-width: 48px;
    height: auto;
    display: block;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 1;
}

.reseaux a:hover {
    cursor: none;
}

/* ==========================================================================
    7. Utilities & Optimizations
    ========================================================================== */

.copyright {
     color: #181818;
     margin: 0 0.5em;
     font-family: 'Outfit';
     font-weight: 900;
     font-size: clamp(1em, 1.5vw, 1.5vw);
}

@media (prefers-reduced-motion: reduce) {
     * {
          transition: none !important;
     }
}

/* Animation classes */
.hidden {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(100%);
    transition: all 1s ease;
}

.show {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Additional Media Queries for Mobile Menu */
@media screen and (max-width: 770px) {
    /* Menu adjustments */
footer {
        position: fixed;
        bottom: 0;
        left: 0;
        margin: 0;
        padding: 12px 15px;
        background: rgba(24, 24, 24, 0.98);
        backdrop-filter: blur(8px);
        box-sizing: border-box;
        -webkit-box-sizing: border-box;
        transform: translateX(0);
    }

    nav {
        width: 98%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .copyright {
        font-size: clamp(0.9em, 1.2vw, 1.2vw);
    }

    /* Additional spacing adjustments */
    .chat svg, 
    .chat2 svg {
        width: 100%;
        height: auto;
    }
}

@media screen and (max-width: 480px) {
    nav {
        flex-direction: column;
        gap: 10px;
    }

    .menu {
        order: -1;
        margin-bottom: 5px;
    }

    .copyright {
        font-size: 0.8rem;
    }

    footer {
        padding: 10px;
    }
}

#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    background: #FFF0DF; /* Couleur par défaut, changée dynamiquement */
    opacity: 0;
}

.menu li a:hover span,
.copyright:hover {
    cursor: none;
}

/* Image Popup Styles */
.image-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

.popup-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-popup:hover {
    transform: scale(1.2);
}

.image-popup.fade-in {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

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

/* Classe pour bloquer le scroll */
.no-scroll {
    overflow: hidden !important;
}
