/* ==========================================================================
   1. RESET & PROTECTION GLOBALE (ANTI-COPIE)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #000;
    color: #fff;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

input, textarea {
    -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

img {
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
    display: block;
    max-width: 100%;
}

a, button, .method-item, .project-card, .slider-arrow, .cv-card {
    pointer-events: auto;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

/* ==========================================================================
   NOUVEAU : SYSTÈME D'ANIMATION DYNAMIQUE (VIVANT)
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 1.2s cubic-bezier(0.2, 1, 0.3, 1),
    transform 1.2s cubic-bezier(0.2, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   2. FOND ET STRUCTURE
   ========================================================================== */
.background-image {
    position: fixed;
    top: 0;
    right: 0;
    width: 40%;
    height: 100vh;
    background-image: url("img/Julian_pasquasy_img.png");
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.background-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.2), rgba(0,0,0,0.95));
}

.page-content {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   3. HEADER & NAVIGATION (DESKTOP & MOBILE)
   ========================================================================== */
.header {
    height: 80px;
    padding: 0 clamp(20px, 5vw, 60px);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    font-weight: 700;
}

.nav a {
    margin-left: 28px;
    font-size: 15px;
    opacity: 0.7;
    transition: 0.3s;
}

.nav a:hover { opacity: 1; }

.language-switcher {
    display: flex;
    gap: 8px;
    font-size: 14px;
    margin-right: 25px;
}

.language-switcher button {
    background: none;
    border: none;
    color: #fff;
    font-weight: 600;
    opacity: 0.5;
}

.language-switcher button.active { opacity: 1; text-decoration: underline; }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    width: 30px;
    z-index: 1100;
}

.hamburger span {
    height: 3px;
    width: 100%;
    background: #fff;
    border-radius: 10px;
    transition: 0.3s;
}

/* ==========================================================================
   4. SECTIONS HERO
   ========================================================================== */
.hero {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    padding: 0 10%;
}

.hero-left {
    width: 60%;
    /* Animation de fondu au chargement */
    animation: heroFadeIn 1.5s ease-out forwards;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-left h1 {
    font-size: clamp(35px, 8vw, 65px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 25px;
}

.hero-left p {
    font-size: clamp(16px, 2.5vw, 19px);
    opacity: 0.8;
    max-width: 550px;
}

.hero.hero-page {
    min-height: auto;
    padding-top: 60px;
    padding-bottom: 20px;
}

/* ==========================================================================
   5. PAGES DE CONTENU (BIO, CONTACT, LÉGAL)
   ========================================================================== */
.bio-container, .contact-container, .legal-container, .detail-container {
    padding: 40px 10% 100px 10%;
    max-width: 1400px;
    margin: 0 auto;
}

.bio-row {
    display: flex;
    align-items: center;
    gap: 60px;
    margin-bottom: 100px;
}
.bio-row.reverse { flex-direction: row-reverse; }

.bio-text { flex: 1.2; }
.bio-text h2 { font-size: 32px; margin-bottom: 20px; }
.bio-text p { font-size: 18px; opacity: 0.8; text-align: justify; white-space: pre-wrap; }

.bio-image { flex: 0.8; }
.bio-image img {
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    transition: transform 0.6s ease;
}

/* Animation au survol de la ligne bio */
.bio-row:hover .bio-image img {
    transform: scale(1.03);
}

/* Contact Page */
.contact-container {
    padding: 40px 10% 100px 10%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 5vw, 80px);
    align-items: start;
}

.contact-left h2 {
    font-size: 28px;
    margin-bottom: 40px;
    color: #fff;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.method-item {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    transition: transform 0.3s ease, opacity 0.3s;
}

.method-item:hover {
    transform: translateX(10px);
    opacity: 0.8;
}

.icon-circle {
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, border-color 0.3s;
}

.method-item:hover .icon-circle {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.icon-circle svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
}

.contact-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.form-group label {
    font-size: 14px;
    opacity: 0.8;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 14px;
    color: #fff;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    user-select: text;
}

.form-group input:focus,
.form-group textarea:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    outline: none;
}

#btn-submit {
    background: #fff;
    color: #000;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.3s, transform 0.3s;
}

#btn-submit:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

/* ==========================================================================
   6. SKILLS GRID (DYNAMIQUE)
   ========================================================================== */
.skills-grid-container {
    padding: 20px 10% 100px 10%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.skill-category-title {
    grid-column: 1 / -1;
    font-size: 26px;
    border-left: 4px solid #fff;
    padding-left: 15px;
    margin-top: 40px;
}

.skill-card-horizontal {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.4s, background 0.4s, border-color 0.4s;
}

.skill-logo { width: 50px; height: 50px; flex-shrink: 0; }
.skill-info h3 { font-size: 20px; margin-bottom: 5px; }
.skill-info p { font-size: 14px; opacity: 0.6; }

/* ==========================================================================
   7. SLIDER DE PROJETS & GALERIE DE DÉTAILS
   ========================================================================== */
.projects-slider-container {
    position: relative;
    width: 90%;
    margin: 40px auto;
    height: 60vh;
    display: flex;
    align-items: center;
}

.slider-track {
    display: flex;
    gap: 25px;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.slider-track::-webkit-scrollbar { display: none; }

.project-card {
    min-width: calc(33.33% - 17px);
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.project-card-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: 0.6s ease;
}

.project-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    transition: 0.4s;
    z-index: 1;
}

.project-card h3 {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-size: 26px;
    text-align: center;
}

.slider-arrow {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    padding: 20px 15px;
    z-index: 10;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}
.slider-arrow:hover { background: rgba(255,255,255,0.2); }
.slider-arrow.prev { left: -20px; }
.slider-arrow.next { right: -20px; }

/* --- STYLE MODERNE POUR LA GALERIE DE DÉTAILS --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.gallery-item {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

/* ==========================================================================
   8. RESPONSIVE & ADAPTATION TACTILE
   ========================================================================== */

@media (max-width: 1100px) {
    .background-image { width: 100%; opacity: 0.35; }
    .hero-left { width: 85%; }
    .project-card { min-width: calc(50% - 15px); }
    .contact-container { grid-template-columns: 1fr; gap: 50px; }
}

@media (max-width: 850px) {
    .hamburger { display: flex; }
    .nav {
        display: flex;
        position: fixed;
        top: 0; right: -100%;
        width: 100%; height: 100vh;
        background: #000;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
    }
    .nav.open { right: 0; }
    .nav a { margin: 20px 0; font-size: 24px; }
    .hero { text-align: center; justify-content: center; }
    .hero-left { width: 100%; }
    .bio-row, .bio-row.reverse { flex-direction: column; text-align: center; }
    .skills-grid-container { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .projects-slider-container { width: 100%; padding: 0 10px; }
    .project-card { min-width: 85%; }
    .slider-arrow { padding: 15px 10px; opacity: 0.8; }
    .slider-arrow.prev { left: 5px; }
    .slider-arrow.next { right: 5px; }
    @media (pointer: coarse) { .slider-arrow { display: none; } }
}

/* Optimisations Hover */
@media (hover: hover) {
    .project-card:hover .project-card-img { transform: scale(1.1); }
    .project-card:hover::after { background: rgba(0,0,0,0.3); }
    .project-card:hover h3 { opacity: 0; }
    .gallery-item:hover {
        transform: translateY(-10px);
        border-color: rgba(255, 255, 255, 0.4);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    }
    .gallery-item:hover img { transform: scale(1.05); }
    .skill-card-horizontal:hover {
        background: rgba(255,255,255,0.08);
        border-color: rgba(255,255,255,0.3);
        transform: translateY(-5px);
    }
}

/* ==========================================================================
   9. FOOTER & COOKIES
   ========================================================================== */
.footer {
    padding: 50px 20px;
    display: flex;
    justify-content: center;
    gap: 25px;
    opacity: 0.5;
    flex-wrap: wrap;
    font-size: 13px;
    margin-top: auto;
}

.cookie-banner {
    position: fixed;
    bottom: -150px; left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    width: 90%; max-width: 550px;
    z-index: 2000;
    transition: 0.6s cubic-bezier(0.2, 1, 0.3, 1);
}
.cookie-banner.show { bottom: 30px; }

.cookie-btns { display: flex; gap: 15px; margin-top: 15px; }
#cookie-accept { background: #fff; color: #000; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 700; flex: 1; }
#cookie-refuse { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.3); padding: 10px 20px; border-radius: 8px; flex: 1; }

.cv-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.cv-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.cv-header p {
    opacity: 0.7;
    margin-bottom: 40px;
}

.cv-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.cv-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px 40px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    width: 280px;
}

.cv-icon svg {
    width: 50px;
    height: 50px;
}

.cv-card span {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
}

.cv-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 600px) {
    .cv-card {
        width: 100%;
    }
}

/* Transition pour le changement de langue */
.page-content {
    transition: opacity 0.4s ease-in-out; /* Contrôle la vitesse du fondu */
    opacity: 1;
}

/* Classe appliquée pendant la mise à jour des textes */
.lang-changing {
    opacity: 0;
}