@import url('https://fonts.googleapis.com/css2?family=Bowlby+One+SC&family=Lexend+Deca:wght@100..900&display=swap');

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

/* Variables CSS */
:root {
    --primary: #588157;
    --background: #333537;
    --text: #d8dce3;
}

/* Styles globaux */
body {
    font-family: "Lexend Deca", sans-serif;
    color: var(--text);
    background-color: var(--background);
    line-height: 1;
}

/* Smooth scroll pour toute la page */
html {
    scroll-behavior: auto; /* Désactivé pour utiliser le smooth scroll JS personnalisé */
    scroll-padding-top: 120px;
}

/* Header */
.header {
    text-align: center;
    padding: 2.5rem 0.5rem;
    background-color: var(--primary);
    color: rgb(34, 34, 34);
    position: relative;
    z-index: 999;
}

.header h1 {
    font-size: 3rem;
}

/* Navigation */
.nav {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.nav-toggle {
    background-color: var(--primary);
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
    width: 48px;
    height: 48px;
}

.nav-toggle:hover {
    background-color: #6a9b68;
}

.nav-toggle img {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.nav.open .nav-toggle {
    transform: rotate(90deg);
}

.nav ul {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    padding: 0;
    background-color: rgb(34, 34, 34);
    border-radius: 8px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 160px;
}

.nav.open ul {
    max-height: 300px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.nav ul li {
    width: 100%;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav.open ul li {
    opacity: 1;
    transform: translateX(0);
}

.nav a {
    display: block;
    text-decoration: none;
    color: var(--text);
    font-weight: bold;
    padding: 12px 20px;
    transition: background-color 0.2s ease;
}

.nav a:hover {
    background-color: var(--primary);
    color: rgb(34, 34, 34);
}

/* Sections */
.section { 
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.section h2 {
    margin-bottom: 1rem;
    color: var(--primary);
    text-align: center;
    font-size: 2rem;
}

/* Projets */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.player:nth-child(2) .video {
    object-fit: contain;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    margin-top: 2rem;
}

@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 2rem;
    }
    .header h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        padding: 0 1.5rem;
    }
    .header h1 {
        font-size: 2rem;
    }
    .nav {
        top: 15px;
        right: 15px;
    }
    
    /* Désactive les effets de scale sur mobile */
    .player.is-active {
        transform: scale(1);
        margin: 0;
    }
    
    .player.is-inactive {
        transform: scale(1);
        opacity: 0.35;
        filter: grayscale(0.5);
    }
}

.hover-target {
    color: white;
    font-size: 1.2rem;
    cursor: none;
}

.cursor-circle {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    background-color: rgba(34, 34, 34, 0.15);
    filter: blur(2px);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.05s linear;
    z-index: 1000;
}

.cursor-circle.active {
    transform: translate(-50%, -50%) scale(1.4);
}

.player {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background-color: #171717;
    cursor: pointer;
    transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Ajustements pour le fullscreen */
.player.is-fullscreen {
    border-radius: 0;
    background-color: #000;
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
}

.player.is-active {
    transform: scale(1.15);
    z-index: 10;
    margin: 0 2rem;
}

.player.is-inactive{
    transform: scale(0.85);
    opacity: 0.35;
    filter: grayscale(0.5);
}

/* Vidéo */
.player .video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ajustement de la vidéo en fullscreen */
.player.is-fullscreen .video {
    object-fit: contain;
    background-color: #000;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Overlay Play central */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    cursor: pointer;
    z-index: 3;
}

.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    z-index: 1;
}

.pause-overlay div {
    text-align: center;
    padding: 0 2rem;
}

.pause-overlay h3 {
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.pause-overlay p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}

/* Cache les textes sur le player actif */
.player.is-active .pause-overlay h3,
.player.is-active .pause-overlay p {
    opacity: 0;
    transform: translateY(-10px);
}

/* Cache l'overlay quand la vidéo joue */
.player.is-playing .pause-overlay {
    opacity: 0;
    pointer-events: none;
}

.player:not(.is-playing):not(.is-fullscreen) .controls {
    display: none;
}

/* Controls */
.controls {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10000;
}

/* Affiche les controls en fullscreen - ils couvrent toute la largeur de la vidéo */
.player.is-fullscreen .controls {
    display: flex;
    z-index: 10001;
}

/* Play */
.play-btn {
    width: 36px;
    height: 36px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    background-image: url("../icons/play.png");
}

.player.is-playing .play-btn {
    background-image: url("../icons/pause.png");
}

/* Volume */
.volume {
    display: flex;
    align-items: center;
    gap: 6px;
}

.volume-slider {
    width: 70px;
    height: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    outline: none;
}

/* Barre de progression (partie remplie) */
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Hover effect */
.volume-slider::-webkit-slider-thumb:hover {
    background: #6a9b68;
    transform: scale(1.2);
}

.volume:hover .volume-slider {
    opacity: 1;
}

.mute-btn {
    width: 36px;
    height: 36px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    background-image: url("../icons/volume.png");
}

.player.is-muted .mute-btn {
    background-image: url("../icons/mute.png");
}

/* Bouton Fullscreen */
.fullscreen-btn {
    width: 36px;
    height: 36px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    background-image: url("../icons/fullscreen.png");
    margin-left: auto;
}

.player.is-fullscreen .fullscreen-btn {
    background-image: url("../icons/fullscreen-exit.png");
}

#projects {
    max-width: 100%;
}

/* Contact */
#contact {
    text-align: center;
    margin-top: 4rem;
}