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

:root {
    --primary-color: #a67c5a; /* Brun doux/taupe */
    --secondary-color: #d4c4a8; /* Beige chaud */
    --accent-color: #8b9a5b; /* Vert olive doux */
    --warm-grey: #b5a394; /* Gris chaud */
    --sage: #9caf88; /* Vert sauge */
    --cream: #f5f2e8; /* Crème naturelle */
    --soft-brown: #8d6e52; /* Brun tendre */
    --pale-olive: #a8b68a; /* Olive pâle */
    --warm-white: #faf8f3; /* Blanc chaud */
    --dark: #4a3f36; /* Brun foncé doux */
    --shadow: 0 8px 25px rgba(74, 63, 54, 0.12);
    --shadow-hover: 0 15px 35px rgba(74, 63, 54, 0.18);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #d4c4a8 0%, #b5a394 25%, #a67c5a 50%, #8b9a5b 75%, #9caf88 100%);
    background-size: 400% 400%;
    animation: soft-gradient-flow 12s ease-in-out infinite;
    min-height: 100vh;
    color: var(--dark);
    position: relative;
}

/* Personnalisation de la barre de scroll */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(135deg, var(--cream) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    border: 2px solid var(--warm-white);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--soft-brown) 50%, var(--warm-grey) 100%);
    border-radius: 10px;
    border: 2px solid var(--warm-white);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--soft-brown) 0%, var(--primary-color) 50%, var(--accent-color) 100%);
    box-shadow: 0 2px 8px rgba(166, 124, 90, 0.3);
    transform: scale(1.05);
}

::-webkit-scrollbar-corner {
    background: var(--cream);
}

@keyframes soft-gradient-flow {
    0%, 100% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 100% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(166, 124, 90, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 154, 91, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(212, 196, 168, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header et nom d'artiste */
.header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 2rem 0;
}

.artist-name {
    font-family: 'Playfair Display', 'Merriweather', Georgia, serif;
    font-size: 6rem;
    font-weight: 800;
    color: #3b3c3d; /* Gris graphite pâle */
    margin-bottom: 0.5rem;
    letter-spacing: 0.15em;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(.4,2,.3,1);
    /* Effet de lumière douce */
    text-shadow:
        0 0 32px #fff8e1,
        0 0 16px #d4c4a8,
        0 2px 8px #b5a394,
        0 8px 32px #fff8e1,
        0 0 0 #fff8e1;
    filter: brightness(1.1) drop-shadow(0 0 24px #fff8e1aa);
    z-index: 2;
}

.artist-name:hover {
    transform: scale(1.15) rotate(-1deg);
    filter: brightness(1.2) drop-shadow(0 0 40px #fff8e1cc);
}

.artist-name::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 8px;
    background: radial-gradient(ellipse at center, #fff8e1 0%, transparent 80%);
    border-radius: 4px;
    opacity: 0.7;
    filter: blur(2px);
    z-index: 1;
    animation: light-move 3.5s ease-in-out infinite alternate;
}

@keyframes light-move {
    0% {
        left: 48%;
        opacity: 0.6;
        width: 58%;
        filter: blur(2.5px);
    }
    30% {
        left: 52%;
        opacity: 0.8;
        width: 62%;
        filter: blur(3.5px);
    }
    60% {
        left: 49%;
        opacity: 0.7;
        width: 65%;
        filter: blur(2.2px);
    }
    100% {
        left: 51%;
        opacity: 0.9;
        width: 60%;
        filter: blur(3px);
    }
}

.tagline {
    font-size: 1.2rem;
    color: #fff;
    font-weight: 300;
    opacity: 0.95;
    font-style: italic;
}

/* Section projets */
.projects-section {
    background: linear-gradient(135deg, var(--warm-white) 0%, var(--cream) 100%);
    border-radius: 25px;
    padding: 3rem;
    box-shadow: var(--shadow);
    border: 3px solid var(--primary-color);
    position: relative;
}

.projects-section::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid var(--accent-color);
    border-radius: 20px;
    opacity: 0.3;
    pointer-events: none;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--dark);
    position: relative;
}

.section-title::after {
    content: "(organisés par ordre d'importance décroissante)";
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--dark);
    opacity: 0.6;
    font-style: italic;
    white-space: nowrap;
}

/* Grille des projets */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Cartes de projets */
.project-card {
    background: linear-gradient(145deg, var(--warm-white) 0%, var(--cream) 100%);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 3px solid var(--secondary-color);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color), var(--warm-grey));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid var(--sage);
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-card:hover::before {
    transform: scaleX(1);
}

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

.project-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.project-card:nth-child(1) { border-left: 6px solid var(--primary-color); }
.project-card:nth-child(2) { border-left: 6px solid var(--accent-color); }
.project-card:nth-child(3) { border-left: 6px solid var(--warm-grey); }
.project-card:nth-child(4) { border-left: 6px solid var(--sage); }
.project-card:nth-child(5) { border-left: 6px solid var(--soft-brown); }
.project-card:nth-child(6) { border-left: 6px solid var(--pale-olive); }

.project-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    filter: sepia(20%) saturate(150%) hue-rotate(15deg);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.project-description {
    font-size: 0.95rem;
    color: var(--dark);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: linear-gradient(135deg, var(--primary-color), var(--warm-grey));
    color: var(--warm-white);
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 2px solid var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(166, 124, 90, 0.2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(74, 63, 54, 0.6);
    backdrop-filter: blur(8px) sepia(5%);
}

.modal-content {
    background: linear-gradient(135deg, var(--warm-white) 0%, var(--cream) 100%);
    margin: 5% auto;
    padding: 3rem 2.5rem 3rem 3rem; /* Padding réduit à droite pour la barre de scroll */
    padding-top: 4.5rem;
    border-radius: 25px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    animation: gentle-modalSlideIn 0.5s ease;
    box-shadow: 
        0 20px 60px rgba(166, 124, 90, 0.3),
        0 8px 25px rgba(74, 63, 54, 0.15);
    /* Améliore le scrolling sur mobile */
    -webkit-overflow-scrolling: touch;
}

/* Barre de scroll personnalisée pour les modales */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: linear-gradient(135deg, rgba(245, 242, 232, 0.8) 0%, rgba(212, 196, 168, 0.6) 100%);
    border-radius: 8px;
    margin: 15px 5px 15px 0; /* Marge pour placer la barre dans le body */
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 50%, var(--sage) 100%);
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-right: 5px; /* Décale la barre vers l'intérieur */
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 50%, var(--soft-brown) 100%);
    box-shadow: 0 2px 8px rgba(166, 124, 90, 0.4);
    transform: scaleX(1.2);
}

@keyframes gentle-modalSlideIn {
    from {
        transform: translateY(-80px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.close {
    color: var(--warm-white);
    float: right;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    transition: all 0.3s ease;
    background: var(--soft-brown);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid var(--secondary-color);
}

.close:hover {
    background: var(--primary-color);
    transform: rotate(90deg) scale(1.1);
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--soft-brown) 30%, var(--accent-color) 70%, var(--sage) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--dark); /* Fallback pour les navigateurs non compatibles */
    position: relative;
    padding-bottom: 0.8rem;
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(166, 124, 90, 0.1);
    animation: subtle-glow 3s ease-in-out infinite alternate;
}

.modal-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--sage));
    border-radius: 2px;
    opacity: 0.8;
    animation: line-expand 2s ease-in-out infinite alternate;
}

@keyframes subtle-glow {
    0% {
        filter: brightness(1) drop-shadow(0 0 8px rgba(166, 124, 90, 0.2));
    }
    100% {
        filter: brightness(1.1) drop-shadow(0 0 12px rgba(166, 124, 90, 0.3));
    }
}

@keyframes line-expand {
    0% {
        width: 40px;
        opacity: 0.6;
    }
    100% {
        width: 80px;
        opacity: 1;
    }
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 2rem;
    white-space: pre-wrap; /* Préserve les retours à la ligne */
}

.modal-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1rem 0;
    box-shadow: var(--shadow);
    object-fit: contain;
    max-height: 60vh;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header {
        margin-bottom: 2rem; /* Réduit l'espace entre YANK et Mes Projets */
    }
    
    .artist-name {
        font-size: 4rem;
    }
    
    .projects-section {
        padding: 2rem;
    }
    
    /* Désactive l'animation de fond sur mobile pour les performances */
    body {
        background: linear-gradient(135deg, #d4c4a8 0%, #b5a394 50%, #a67c5a 100%);
        background-size: 100% 100%;
        animation: none;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .modal {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .modal-content {
        margin: 5% auto;
        padding: 1.5rem;
        padding-top: 3.5rem;
        padding-bottom: 2.5rem;
        width: 95%;
        border-radius: 15px;
        word-break: break-word;
        position: relative;
        background: linear-gradient(135deg, var(--warm-white) 0%, var(--cream) 100%);
        box-shadow: 
            0 20px 60px rgba(166, 124, 90, 0.3),
            0 8px 25px rgba(74, 63, 54, 0.15);
    }
    
    .modal-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        margin-top: 0.5rem; /* Petit espace supplémentaire en haut */
        padding-bottom: 0.6rem;
        letter-spacing: 0.3px;
        /* Centrage parfait en tenant compte du bouton X */
        margin-left: 1rem;
        margin-right: 1rem;
        text-align: center;
    }
    
    .modal-title::after {
        width: 40px;
        height: 2px;
    }
    
    .modal-description {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
        white-space: pre-wrap; /* Préserve les retours à la ligne */
    }
    
    .modal-image {
        max-width: 100%;
        max-height: 50vh;
        margin: 0.8rem auto;
    }
    
    .close {
        top: 0.5rem;
        right: 1rem;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
        z-index: 10; /* S'assurer que le bouton est au-dessus */
    }
    
    .section-title::after {
        display: none; /* Cache le texte humoristique sur mobile */
    }
}

@media (max-width: 480px) {
    .header {
        margin-bottom: 1.5rem; /* Distance encore plus réduite sur très petits écrans */
    }
    
    .artist-name {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Fond statique simplifié pour les très petits écrans */
    body {
        background: linear-gradient(135deg, #d4c4a8 0%, #a67c5a 100%);
        background-size: 100% 100%;
        animation: none;
    }
    
    .modal {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .modal-content {
        margin: 2% auto;
        padding: 1rem;
        padding-top: 3rem;
        padding-bottom: 2rem;
        width: 98%;
        border-radius: 10px;
        word-break: break-word;
        position: relative;
        background: linear-gradient(135deg, var(--warm-white) 0%, var(--cream) 100%);
        box-shadow: 
            0 20px 60px rgba(166, 124, 90, 0.3),
            0 8px 25px rgba(74, 63, 54, 0.15);
    }
    
    .modal-title {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
        margin-top: 0.3rem; /* Petit espace supplémentaire */
        padding-bottom: 0.5rem;
        letter-spacing: 0.2px;
        /* Centrage parfait en compensant l'espace du bouton X */
        margin-left: 1.25rem;
        margin-right: 1.25rem;
        text-align: center;
    }
    
    .modal-title::after {
        width: 30px;
        height: 2px;
    }
    
    .modal-description {
        font-size: 0.95rem;
        margin-bottom: 1rem;
        white-space: pre-wrap; /* Préserve les retours à la ligne */
    }
    
    .modal-image {
        max-height: 45vh;
        margin: 0.5rem auto;
        border-radius: 8px;
    }
    
    .close {
        top: 0.3rem;
        right: 0.8rem;
        width: 30px;
        height: 30px;
        font-size: 1rem;
        z-index: 10; /* S'assurer que le bouton est au-dessus */
    }
    
    .project-card {
        padding: 1rem;
    }
    
    .project-title {
        font-size: 1.2rem;
    }
    
    .project-description {
        font-size: 0.9rem;
    }
    
    .tag {
        padding: 0.3rem 0.8rem;
        font-size: 0.7rem;
        border-radius: 20px;
    }
    
    .project-tags {
        gap: 0.3rem;
    }
}

/* Styles pour les Easter Eggs */
.modal-footer {
    border-top: 1px solid var(--accent-color);
    padding-top: 1rem;
    margin-top: 2rem !important;
    background: linear-gradient(135deg, transparent, rgba(255, 140, 66, 0.05));
    border-radius: 10px;
    padding: 1rem;
}
