@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;700&display=swap');

/*-------------------------------------------VANTA--------------------------------------------------------------------*/


#vanta-bg-fog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    transition: opacity 1s ease;
}

/*-------------------------------------------MAIN---------------------------------------------------------------------*/

:root {
    --bg: #E8DCCB;
    --text: #443c3c;
    --accent: #906e56;
    --brown: #695C5C;
    --modal-bg: white;
    --modal-text: #695C5C;
    --modal-badge: #f3eee7;
    --modal-overlay: rgba(232, 220, 203, 0.85);
    --modal-hover: #443c3c;
}


body {
    margin: 0;
    font-family: 'Raleway', sans-serif;
    color: var(--text);
    overflow-x: hidden;
}

/* HERO */

.hero {
    text-align: center;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.4rem;
    color: var(--accent);
}

/* LAYOUT EDITORIAL */

.project-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 4rem 8vw;
    gap: 2rem;
    flex-direction: row; /* par défaut : image à droite */
    transition: all 0.3s ease;
}

.project-section.image-left {
    flex-direction: row-reverse;
}

.project-section.hidden {
    display: none !important;
}

.project-image {
    flex: 1 1 45%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(105, 92, 92, 0.1);
}

.project-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
}

.project-image {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

/* === Animation image === */
.project-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
    transition: transform 0.5s ease, filter 0.4s ease;
    transform-origin: center center;
    will-change: transform, filter;
}

.project-image:hover img {
    transform: scale(1.04);
    filter: brightness(1.05) contrast(1.02);
}

/* === Overlay animé === */
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    color: #E8DCCB;
    font-size: 1rem;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.4s ease, opacity 0.3s ease;
    pointer-events: none;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

/* Active l'overlay */
.project-image:hover .image-overlay {
    transform: translateY(0);
    pointer-events: auto;
}

.project-info {
    flex: 1 1 45%;
}

.project-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.project-info p {
    font-size: 1.2rem;
    line-height: 1.6;
}

.project-info a {
    /* Retire ce bloc ou remplace-le comme ci-dessous */
    color: var(--accent);
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: bold;
}

.project-info .project-link {
    position: relative;
    display: inline-block;
    font-weight: bold;
    color: var(--accent);
    font-size: 1.4rem;
    text-decoration: none;
    transition: color 0.3s ease;
    padding-bottom: 2px;
}

.project-info .project-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0; /* <-- c'était -2px avant, mets 0 pour qu’il soit visible */
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.project-info .project-link:hover::after {
    width: 100%;
}


/* RESPONSIVE */

@media (max-width: 900px) {
    .project-section {
        flex-direction: column !important;
        text-align: center;
    }

    .project-image,
    .project-info {
        flex: 1 1 100%;
    }

    .project-info h2 {
        font-size: 1.6rem;
    }
}

.project-tag {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}


.filter-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 2rem;
    backdrop-filter: blur(6px); /* effet léger si tu veux */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* très léger */
    transform: translateX(1.8rem);
}

.filter-btn {
    background: none;
    border: 2px solid var(--text);
    color: var(--text);
    font-family: 'Raleway', sans-serif;
    padding: 0.5rem 1.2rem;
    font-size: 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--text);
    color: var(--bg);
}


.portfolio-footer {
    text-align: center;
    padding: 6vh 2rem 8vh;
    font-size: 1.1rem;
    color: var(--text);
}

.portfolio-footer a {
    font-weight: bold;
    color: var(--accent);
    transition: opacity 0.3s ease;
}

.portfolio-footer a:hover {
    opacity: 0.7;
}


/*--------------------------------------------MODAL-------------------------------------------------------------------*/


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--modal-overlay); /* beige semi-transparent */
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--modal-bg);
    color: var(--modal-text);
    padding: 2rem;
    border-radius: 20px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 12px 30px rgba(105, 92, 92, 0.2);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--modal-text);
    cursor: pointer;
}

.modal-close:hover {
    transform: scale(1.2);
    transition: transform 0.2s ease;
}


.modal-body h2 {
    margin-top: 0;
    font-size: 2rem;
}

.modal-body p {
    font-size: 1rem;
    line-height: 1.6;
}

.tech-stack {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.tech-stack li {
    background-color: var(--modal-badge);
    color: var(--modal-text);
    padding: 0.4em 0.8em;
    border-radius: 15px;
    font-weight: 500;
}


body.modal-open {
    overflow: hidden;
}


.highlight {
    background-image: linear-gradient(to right, #b17d6e, #c7a298);
    background-repeat: no-repeat;
    background-size: 0% 0.5em;
    background-position: 0 85%;
    transition: background-size 0.5s ease;

}


.animated-title {
    display: inline-block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--text);
    cursor: default;
}

.animated-title .char {
    display: inline-block;
    will-change: transform, color;
}

.modal-body a {
    color: var(--accent);
    text-decoration: underline;
    font-weight: 600;
}

.modal-body a:hover {
    opacity: 0.8;
}


.modal-content a.btn-link {
    display: inline-block;
    margin: 0.3em 0;
    padding: 0.4em 0.8em;
    background-color: var(--brown);
    color: #E8DCCB;
    text-decoration: none;
    border-radius: 12px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.modal-content a.btn-link:hover {
    background-color: var(--modal-hover);
}


/*--------------------------------------------CAROUSSEL---------------------------------------------------------------*/

:root[data-theme="light"] {
    --modal-bg: #ffffff;
    --dot-active: #333; /* foncé pour fond clair */
    --dot-inactive: rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] {
    --modal-bg: #333;
    --dot-active: rgba(255, 255, 255, 0.9);
    --dot-inactive: rgba(255, 255, 255, 0.3);
}

.carousel,
.carousel * {
    user-select: none;
    -webkit-user-drag: none;
    cursor: grab;
}

.carousel:active {
    cursor: grabbing;
}


.carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 20px;
    background-color: var(--modal-bg, #eee);

    display: flex;
    justify-content: center;
    align-items: center;
}


.carousel-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 20px;
    object-fit: contain;
    object-position: center;


    opacity: 0;
    transform: translateX(0);
    transition: transform 0.6s ease, opacity 0.6s ease;
    pointer-events: none;
    z-index: 0;
}

.carousel-img.active {
    opacity: 1;
    z-index: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.carousel-img.slide-left {
    transform: translateX(-20%);
    opacity: 0;
}

.carousel-img.slide-right {
    transform: translateX(20%);
    opacity: 0;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}


.carousel-dots {
    display: flex;
    justify-content: center;
    margin-top: 12px;
    gap: 8px;
    z-index: 3;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--dot-inactive);
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.dot.active {
    background-color: var(--dot-active);
    transform: scale(1.3);
}


@media (max-width: 600px) {
    .carousel-prev,
    .carousel-next {
        font-size: 1.5rem;
        padding: 0 8px;
    }

    .dot {
        width: 8px;
        height: 8px;
    }
}


.scroll-down-btn {

    font-size: 1.5rem;
    color: #695C5C;
    text-decoration: none;
    display: flex;
    border: 2px solid #695C5C;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    justify-content: center;
    transition: all 0.3s ease;

}


.scroll-down-btn:hover {
    transform: scale(1.3);
}


.scroll-down-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.scroll-down-button-visible {
    opacity: 1;
    pointer-events: auto;
}


.carousel a {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0;
    left: 0;
}

.carousel a:not(.active) {
    pointer-events: none;
    opacity: 0;
}

.fancybox__caption {
    display: none !important;
}


.fancybox__thumbs .carousel__slide .fancybox__thumb::after {
    border-color: var(--bg);
}

.fancybox__image {
    border-radius: 20px;
}

.carousel button,
.carousel {
    touch-action: manipulation; /* Désactive double-tap zoom, garde le pinch actif */
}

@media (max-width: 800px) {
    .scroll-down-btn {
        position: fixed;
        bottom: 2%;
        right: 5%;
        font-size: 2.1rem;
        width: 3rem;
        height: 3rem;
    }

    .animated-title .char {
        font-size: 13vw; /* 10% de la largeur de l'écran */
        text-align: center;
    }

    .filter-bar {
        transform: translateX(0rem);
    }

    .tech-stack{
        margin-bottom: 10vh;
    }

    .modal-close {
        position: sticky;
        bottom: 2rem;



        width: 3rem;
        height: 3rem;
        font-size: 1.5rem;
        color: var(--modal-text);
        cursor: pointer;
        z-index: 2000;

        display: none;
        margin-left: 79vw;
    }

    /* Visible uniquement quand la modale est ouverte */
    .modal-overlay.visible .modal-close {
        display: block;
    }




}