@font-face {
    font-family: 'Oswald-Medium';
    src: url('FONTS/Oswald-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Oswald-Light';
    src: url('FONTS/Oswald-Light.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* === CONFIGURATION DES VARIABLES === */
:root {
    --bg-rgb: 255, 255, 255; /* Blanc en RGB */
    --bg-color: rgb(var(--bg-rgb));
    --bg-footer: #ecebeb; 
    --text-dark: #111111;
    --nav: #f5f5f594;
    --text-light: #b0b0b0;
    --text-gray: #666666;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --shadow-hover: rgba(0, 0, 0, 0.12);
    --btn-bg: #f2f2f2;
    --btn-hover: #e5e5e5;
    --toggle-bg: #111111;
    --toggle-icon: #ffffff;
    --anim-speed: 0.6s;
    --blob-curve: cubic-bezier(0.34, 1.56, 0.64, 1); 
}

[data-theme="dark"] {
    --bg-rgb: 16, 16, 16; /* Noir en RGB */
    --bg-color: rgb(var(--bg-rgb));
    --bg-footer: #121212;
    --text-dark: #ffffff;
    --nav: #00000025;
    --text-light: #2c2c2c;
    --text-gray: #999999;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --shadow-hover: rgba(0, 0, 0, 0.6);
    --btn-bg: #1a1a1a;
    --btn-hover: #262626;
    --toggle-bg: #ffffff;
    --toggle-icon: #0c0c0c;
}

/* === RESET ET SCROLLBARS MASQUÉES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Cache la scrollbar sur Firefox */
    scrollbar-width: none; 
}

/* Cache la scrollbar sur Chrome, Safari et Edge */
*::-webkit-scrollbar {
    display: none;
}

html, body {
    width: 100%;
    min-height: 100vh; /* S'assure que le fond prend au moins tout l'écran */
}

/* Correction de l'animation pour ne pas casser la position "fixed" du bouton */
@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    font-family: 'Oswald-Medium', sans-serif;
    text-align: center;
    overflow-x: hidden;
    position: relative; /* Indispensable pour que la texture absolue se cale sur la page */
    
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Garantit que la page prend tout l'espace même si peu de contenu */
    
    transition: background-color 0.4s ease, color 0.4s ease;
    animation: pageFadeIn 0.8s ease forwards;
}

/* === CALQUE DE TEXTURE GLOBAL === */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('cardboard-texture.png');
    background-size: cover;
    background-position: center;
    background-repeat: repeat-y;
    
    /* Texture plus subtile */
    opacity: 0.15; 
    mix-blend-mode: multiply; 
    z-index: 9999; 
    pointer-events: none; 
}

/* === LOGO EN FILIGRANE (DÉFILE AVEC LA PAGE ET PLUS GRAND) === */
body::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;

    background-image: url('LOGO GAETAN.svg');
    background-repeat: no-repeat;
    background-position: center 10vh;
    background-attachment: scroll;
    background-size: 80vw;
    
    /* Logo rendu beaucoup plus léger */
    opacity: 0.05;
    
    pointer-events: none; 
    transition: opacity 0.4s ease, filter 0.4s ease;
}

[data-theme="dark"] body::after {
    filter: invert(1);
    opacity: 0.05 /* Légèrement plus visible en sombre si besoin */
}

/* === NAVIGATION ET LOGO === */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 4vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    background-color: var(--nav);
}

.logo-container {
    display: flex;
    align-items: center;
}

.nav-logo-img {
    height: clamp(32px, 4vw, 42px);
    width: auto;
    display: block;
    transition: transform 0.3s var(--blob-curve), filter 0.4s ease;
}

[data-theme="dark"] .nav-logo-img {
    filter: invert(1) brightness(2);
}

[data-theme="dark"] body::before {
    filter: invert(1) contrast(1.2); 
    opacity: 0.08; /* Très discret */
    mix-blend-mode: overlay; 
}

.logo-container:hover .nav-logo-img {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 35px;
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.85rem;
    font-family: 'Oswald-Light', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.4;
    position: relative;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s ease;
}

.nav-links a:hover, .nav-links a.active {
    opacity: 1;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 1.5px;
    background-color: var(--text-dark);
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav-links a.active::after, .nav-links a:hover::after {
    width: 100%;
}

/* === TYPOGRAPHIE ACCUEIL === */
.top-banner {
    padding: 150px 10px 0px;
}

.location {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-gray);
    margin-bottom: 4px;
    font-family: 'Oswald-Light';
}

.location, h1, h2 {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.location.jouer, h1.jouer, h2.jouer {
    opacity: 1;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 6.5rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -2px;
    line-height: 0.9;
    margin-bottom: 20px;
    margin-top: 8vh;
}

h2 {
    font-size: clamp(1.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--text-light);
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: -1px;
}

.minimal-separator {
    border: 0;
    border-top: 1px solid var(--text-light);
    opacity: 0.15;
    width: 60px;
    margin: 8vh auto;
}

/* === ANIMATIONS STRUCTURELLES === */
.anim-texte-blob .mot {
    display: inline-block;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.6s var(--blob-curve);
    white-space: pre;
}
        
.anim-texte-blob.jouer .mot {
    transform: scaleY(1);
}

.anim-texte-fondu {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
.anim-texte-fondu.jouer {
    opacity: 1;
    transform: translateY(0);
}

.anim-vignette {
    transform: scale(0.85); 
    opacity: 0;
    transition: transform var(--anim-speed) var(--blob-curve), opacity var(--anim-speed) ease-out;
}

.anim-vignette.visible {
    transform: scale(1);
    opacity: 1;
}

.delay-hero { transition-delay: 0.15s; }

/* === GRILLE DE PROJETS - FLEX POUR CENTRER SUR L'ÉCRAN === */
.more-work {
    display: flex;
    flex-direction: column;
    align-items: center;     /* Centre les blocs (div, grid, etc) */
    justify-content: center; /* Centre verticalement */
    text-align: center;      /* Centre le texte */
    width: 100%;
}

/* On force le centrage de TOUS les éléments à l'intérieur */
.more-work * {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* On s'assure que la grille n'est pas forcée à gauche par une largeur 100% */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 420px));
    gap: 50px;
    justify-content: center; /* Centre la grille dans son conteneur */
    width: 100%;
    max-width: 1200px;       /* Évite que la grille ne s'étire trop sur grands écrans */
}

/* Si tu as des titres ou descriptions, on les recentre manuellement */
.more-work {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centre verticalement les éléments */
    align-items: center;     /* Centre horizontalement les éléments */
    width: 100%;
    padding: 20px 4vw 12vh;
}

/* On retire le !important, c'est ce qui crée le bug */
.more-work h2, 
.more-work p {
    text-align: center;
    width: 100%;
}

/* Une seule définition propre pour la grille */
.work-grid {
    display: grid;
    /* Crée des colonnes automatiques */
    grid-template-columns: repeat(auto-fit, minmax(300px, 420px));
    gap: 70px;
    
    /* Centre la grille et ses items */
    justify-content: center; 
    align-content: center;
    
    width: 100%;
    max-width: 1400px; /* Limite la largeur pour garder le centrage visuel */
    margin: 0 auto;
}

.project-link {
    text-decoration: none;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.grid-media {
    width: 100%;
    height: 100%;
    border-radius: 16px; 
    object-fit: cover;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: transform 0.35s var(--blob-curve), box-shadow 0.35s ease;
}

.project-link:hover .grid-media {
    transform: scale(1.025);
    box-shadow: 0 25px 45px var(--shadow-hover);
}

/* === LECTEUR MODALE === */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45); 
    backdrop-filter: blur(10px);
    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: auto;
}

.modal-wrapper {
    background-color: var(--bg-color);
    width: 94%;
    max-width: 1000px;
    max-height: 85vh;
    border-radius: 28px;
    padding: 50px;
    position: relative;
    overflow-y: auto;
    transform: scale(0.92);
    opacity: 0;
    transition: transform 0.4s var(--blob-curve), opacity 0.4s ease;
    
    /* AJOUTS POUR CENTRER LE CONTENU */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project-modal.active .modal-wrapper {
    transform: scale(1);
    opacity: 1;
}

.modal-header-sticky {
    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 50;
}

.modal-close-btn {
    background: var(--btn-bg);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: background 0.2s, transform 0.2s;
}

.modal-close-btn:hover {
    background: var(--btn-hover);
    transform: scale(1.05);
}

.modal-title {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: -1px;
    text-align: center; /* Modifié de left vers center */
}

.modal-desc {
    font-size: 1rem;
    color: var(--text-gray);
    max-width: 750px;
    margin-bottom: 40px;
    line-height: 1.6;
    font-family: 'Oswald-Light';
    text-align: center; /* Modifié de left vers center */
}

.modal-media-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.modal-media-item {
    width: 100%;
    max-height: 65vh;
    border-radius: 16px;
    object-fit: contain;
    background-color: rgba(0,0,0,0.02);
}

.modal-media-caption {
    font-family: 'Oswald-Light', sans-serif;
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 10px;
    text-align: center; /* Modifié de left vers center */
    letter-spacing: 0.5px;
}

/* === DESIGN PAGE À PROPOS === */
.about-section {
    padding: 20px 4vw 10vh;
    flex-grow: 1; /* Permet aussi de pousser le footer si la page est courte */
}

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
    text-align: left;
}

.about-bio {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    line-height: 1.5;
    margin-bottom: 25px;
    color: var(--text-dark);
    font-family: 'Oswald-Light', sans-serif;
}

.about-sub-bio {
    font-family: 'Oswald-Light', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-gray);
    margin-bottom: 35px;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.skills-list span {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: var(--btn-bg);
    padding: 8px 16px;
    border-radius: 30px;
    color: var(--text-dark);
    font-family: 'Oswald-Light', sans-serif;
}

.about-profile-media {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 15px 35px var(--shadow-color);
}

/* === FOOTER COLLÉ EN BAS === */
.massive-footer {
    width: 100%;
    padding: 12vh 4vw;
    background-color: var(--bg-footer);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.4s ease;
    
    /* C'est ce qui force le footer tout en bas sans espace en dessous */
    margin-top: auto; 
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.footer-content .svg-text {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text-dark);
    line-height: 0.9;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-family: 'Oswald-Light';
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--text-dark);
}

.copyright-text {
    font-size: 0.6rem;
    color: var(--text-light);
    letter-spacing: 2px;
}

/* === COMMUTATEUR DE THÈME TOUJOURS VISIBLE === */
.theme-toggle-btn {
    position: fixed; /* Il doit rester fixed pour ne pas bouger avec le scroll */
    bottom: 25px;
    right: 25px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: var(--toggle-bg);
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 10000; /* Z-index très haut pour être au-dessus de la texture */
    display: flex;
    justify-content: center;
    align-items: center;
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--toggle-icon);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    position: absolute;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.icon-sun { opacity: 0; transform: rotate(-90deg); }
.icon-moon { opacity: 1; transform: rotate(0deg); }

[data-theme="dark"] .icon-sun { opacity: 1; transform: rotate(0deg); }
[data-theme="dark"] .icon-moon { opacity: 0; transform: rotate(90deg); }

/* === RESPONSIVE SMARTPHONES & TABLETTES === */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .about-profile-media {
        aspect-ratio: 1 / 1;
    }
}

@media (max-width: 768px) {
    .main-nav { 
        padding: 20px 5vw; 
        align-items: center;
    }
    .nav-links { 
        gap: 15px;
        font-size: 0.75rem;
    }
    .work-grid { 
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
        gap: 30px; 
    }
    .modal-wrapper { 
        padding: 30px 20px; 
        width: 92%;
    }
    .modal-title {
        font-size: 2rem;
        margin-top: 15px; 
    }
    .theme-toggle-btn { 
        bottom: 15px; 
        right: 15px; 
    }
}