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

html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: #000;
  position: fixed;
  top: 0;
  left: 0;
}

.main-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #000;
  margin: 0;
  padding: 0;
}

.main-wrapper.scrolled {
  transform: translateY(-100%);
}

.home-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  margin: 0;
  padding: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.home-container.loaded {
  opacity: 1;
}

.video-section {
  width: 50%;
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #000;
  z-index: 1;
}

.video-section:hover {
  width: 65%;
}

.video-section:not(:hover) {
  width: 50%;
}

.video-section.expanding {
  width: 100% !important;
  z-index: 1000;
}

.video-section.shrinking {
  width: 0 !important;
  opacity: 0;
  visibility: hidden;
}

.video-section video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #000;
}

.video-section:hover video {
  transform: scale(1.1);
}

.video-section video.loaded {
  opacity: 1;
}

/* Suppression des bordures */
.left, .right {
  border: none;
}

/* Animation de transition pour les vidéos */
.video-section:hover video {
  transform: scale(1.1);
}

.container {
  display: flex;           /* Utiliser flexbox pour centrer */
  justify-content: center; /* Centrer horizontalement */
  align-items: center;     /* Centrer verticalement */
  height: 100vh;           /* La hauteur du conteneur sera 100% de la fenêtre */
  width: 100vw;            /* La largeur du conteneur sera 100% de la fenêtre */
}

.split {
  width: 50%;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

.split.left {
  background-color: #333;
}

.split.right {
  background-color: #555;
}

.bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.button {
  z-index: 2;
  display: block;
  color: white;
  font-family: "Fugaz One", cursive;
  text-transform: uppercase;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid white;
  cursor: pointer;
  transition: 0.3s;
}

.button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

@keyframes fadeIn {
  from {
    opacity: 0; /* Départ transparent */
  /*   transform: scale(0.9); /* Optionnel : léger déplacement */
  }
  to {
    opacity: 1; /* Complètement visible */
  /*   transform: scale(1); Retour à la position initiale */
  }
}

.portfolio-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  justify-content: center;
  align-items: center;
  z-index: 3;
  opacity: 0; /* Initialement invisible */
  animation: fadeIn 0.5s ease-in-out forwards;
}

.video-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Colonnes flexibles avec un minimum de 180px */
  gap: calc((100% - (180px * auto)) / (auto - 1));  /* Espacement constant entre les items */
  padding: 10px;
  width: 80%;
  height: auto;
  opacity: 0; /* Initialement invisible */
  animation: fadeIn 1s ease-in-out forwards;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1; /* Forcer un ratio carré */
  overflow: hidden; /* Empêcher les débordements */
  display: flex; /* Centrer les éléments enfants si nécessaire */
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.gallery-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0); /* Couverture noire invisible par défaut */
  transition: background 0.5s ease; /* Transition pour l'apparition de la couverture */
  z-index: 1; /* Au-dessus de l'image mais en dessous du titre */
  
}

.gallery-title {
  position: absolute;
  top: 50%;
  left: 50%;
  text-align: center;
  transform: translate(-50%, -50%) scale(0.8); /* Légèrement réduit par défaut */
  color: white;
  font-size: 13px;
  opacity: 0; /* Caché par défaut */
  transition: opacity 0.5s ease, transform 0.3s ease; /* Apparition et déplacement fluide */
  z-index: 2; /* Au-dessus de la couverture noire */
  
}

.gallery-item:hover img {
  transform: scale(1); /* Zoom sur l'image */
  filter: brightness(85%); /* Réduit la luminosité pour un effet d'assombrissement complémentaire */
}

.gallery-item:hover::before {
  background: rgba(0, 0, 0, 0.5); /* Apparition de la couverture noire */
}

.gallery-item:hover .gallery-title {
  opacity: 1; /* Titre devient visible */
  transform: translate(-50%, -50%) scale(1); /* Titre revient à sa taille normale */
}

.modal {
  display: none;
  position: fixed;
  z-index: 4;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  opacity: 0; /* Initialement invisible */
  animation: fadeIn 0.3s ease-in-out forwards;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  margin: 100px auto 0; /* Ajouter une marge en haut de 100px */
  padding: 40px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.close, .close-button {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 50px;
  cursor: pointer;
  color: white;
}

#video-frame {
  width: 100%;
  height: 450px;
}

#video-description {
  margin-top: 10px;
  color: #adadad;
  font-size: 16px;
}

.section-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 30px;
    font-size: 12px;
    font-family: "Fugaz One", cursive;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: transparent;
    border: 2px solid white;
    color: white;
    cursor: pointer;
    z-index: 10;
    transition: none;  /* Suppression de la transition par défaut */
    overflow: hidden;
    opacity: 1 !important;
    visibility: visible !important;
}

.anim-button, .rig-button {
    left: 50%;
    transform: translate(-50%, -50%);
}

.section-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.section-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* Animation d'apparition des boutons */
@keyframes buttonAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.section-button {
    animation: buttonAppear 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

/* Styles pour les modales */
.projects-modal,
.project-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.projects-modal.active,
.project-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    margin: 100px auto 0; /* Ajouter une marge en haut de 100px */
    padding: 40px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
}

.close-button:hover {
    transform: scale(1.1);
}

.modal-title {
    font-family: "Fugaz One", cursive;
    color: white;
    font-size: 24px;
    margin-bottom: 30px;
    text-align: center;
}

/* Grille de projets */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
    position: relative; /* Ajouter position relative */
    top: -100px; /* Déplacer vers le haut de 100px */
}

.project-card {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: scale(1.05);
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-card-overlay {
    opacity: 1;
}

.project-card-title {
    color: white;
    font-family: "Fugaz One", cursive;
    font-size: 16px;
    text-align: center;
    padding: 10px;
}

/* Vue détaillée du projet */
.project-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.project-video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: black;
}

.project-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.project-info {
    padding: 44px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.project-title {
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 1000;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.3;
    letter-spacing: 0.3px;
    padding-top: 20px;
    padding-left: 5px;
}

.project-details,
.project-description {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    padding-top: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: "Montserrat", sans-serif;
    font-size: 11px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    letter-spacing: 0.2px;
}

.project-details p {
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-details strong {
    font-weight: 900; /* Valeur maximale pour le gras */
    color: rgba(255, 255, 255, 1); /* Blanc pur pour plus de contraste */
}

.project-description {
    line-height: 1.5;
}

/* Ajustements pour les écrans mobiles */
@media (max-width: 1024px) {
    .project-info {
        padding: 36px 12px 16px;
    }

    .project-title {
        font-size: 12px;
        padding-top: 20px;
    }

    .project-details,
    .project-description {
        padding: 10px;
        padding-top: 30px;
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    .project-info {
        padding: 32px 12px 12px;
    }

    .project-title {
        font-size: 11px;
        padding-top: 20px;
    }

    .project-details,
    .project-description {
        padding: 8px;
        padding-top: 28px;
        font-size: 9px;
    }
}

/* Mobile layout adjustments for project panel */
@media (max-width: 768px) {
    .project-panel-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr; /* 50/50 height split */
        border: 0;
        border-radius: 0;
    }

    .project-media {
        width: 100%;
        height: 100%;
        background: black;
    }

    .videos-container {
        width: 100%;
        height: 100%;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .videos-container video,
    .videos-container iframe {
        width: 100%;
        height: 80%; /* reduce video height while keeping container size */
        object-fit: contain;
    }

    .project-info {
        display: none !important; /* Fully hidden on mobile */
        visibility: hidden !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        overflow: hidden !important;
    }

    .project-info-mobile {
        display: block;
        padding: 12px;
        background: rgba(255, 255, 255, 0.05);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        font-family: "Montserrat", sans-serif;
        font-size: 11px;
        color: rgba(255, 255, 255, 0.85);
        overflow-y: auto;
        position: relative;
    }

    .close-panel {
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        font-size: 20px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        z-index: 10;
    }

    .close-panel:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.1);
    }
}

/* Extra guard: hide project-info on tablets too and force single column */
@media (max-width: 1024px) {
    .project-info {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        max-width: 0 !important;
        flex: 0 0 0 !important;
        grid-column: 2 / 2 !important; /* neutralize if grid places it */
    }
    .project-panel-content {
        grid-template-columns: 1fr !important;
        grid-template-rows: 1fr 1fr !important; /* 50/50 height split */
    }
    .project-info-mobile { 
        display: block !important;
        position: relative;
    }

    .close-panel {
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        font-size: 20px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        z-index: 10;
    }

    .close-panel:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.1);
    }

    .videos-container {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .videos-container video,
    .videos-container iframe {
        width: 100%;
        height: 80%;
        object-fit: contain;
    }
}

/* Desktop default: hide mobile info */
.project-info-mobile { display: none; }

/* Desktop: keep original close button position */
@media (min-width: 1025px) {
    .close-panel {
        position: absolute;
        top: 20px;
        right: 20px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        font-size: 24px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        z-index: 10;
    }

    .close-panel:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.1);
    }
}

/* Styles pour l'overlay de transition */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 1001;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.transition-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.transition-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    position: relative;
}

.back-indicator {
    position: absolute;
    top: 40px;
    transform: none;
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    z-index: 1002;
    transition: opacity 0.5s ease;
}

.transition-overlay.active .back-indicator {
    opacity: 0;
    visibility: visible;
    animation: showTriangle 0.5s ease forwards;
    animation-delay: 0.6s;
}

@keyframes showTriangle {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Position par défaut (animation et rigging) */
.transition-overlay.animation-section .back-indicator,
.transition-overlay.rigging-section .back-indicator {
    right: 80px;
}

/* Masquer le triangle inapproprié */
.transition-overlay.animation-section .rigging-arrow,
.transition-overlay.rigging-section .animation-arrow {
    display: none;
}

/* Animation pour les deux sections */
.transition-overlay.animation-section .animation-arrow,
.transition-overlay.rigging-section .rigging-arrow {
    animation: bounceRight 2s infinite;
}

@keyframes bounceRight {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(0);
    }
    40% {
        transform: translateX(20px);
    }
    60% {
        transform: translateX(10px);
    }
}

/* Ajustement pour les écrans mobiles */
@media (max-width: 768px) {
    .back-indicator {
        top: 20px;
    }
    
    .transition-overlay.animation-section .back-indicator,
    .transition-overlay.rigging-section .back-indicator {
        right: 40px;
    }
}

.back-indicator .arrow {
    font-family: Arial, sans-serif;
    font-size: 32px;
    display: block;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Animation du bouton quand la section est active */
.video-section.expanding .section-button {
    animation: buttonSequence 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none;
}

/* Animation de retour du bouton */
.video-section:not(.expanding) .section-button {
    animation: buttonReset 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes buttonSequence {
    0% {
        top: 50%;
        transform: translate(-50%, -50%);
        opacity: 1;
    }
    30% {
        top: 50%;
        transform: translate(-50%, -50%);
        opacity: 1;
    }
    100% {
        top: 10%;
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

@keyframes buttonReset {
    0% {
        top: 10%;
        transform: translate(-50%, -50%);
        opacity: 1;
    }
    30% {
        top: 10%;
        transform: translate(-50%, -50%);
        opacity: 1;
    }
    100% {
        top: 50%;
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* Désactiver les transitions qui pourraient interférer */
.video-section.expanding .section-button,
.video-section.shrinking .section-button {
    transition: none !important;
}

/* Styles pour la grille d'images */
.image-grid {
    display: none;
    width: 100%;
    min-height: 100vh;
    background-color: white;
    padding: 40px;
    box-sizing: border-box;
    position: absolute;
    z-index: -1;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.grid-item {
    aspect-ratio: 1;
    background-color: white;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Ajustement pour les écrans plus petits */
@media (max-width: 768px) {
    .image-grid {
        padding: 20px;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }

    .back-indicator {
        top: 20px;
    }

    .transition-overlay.animation-section .back-indicator,
    .transition-overlay.rigging-section .back-indicator {
        right: 40px;
    }
}

/* Styles pour la grille de carrés */
.section-text {
    position: absolute;
    top: 0; /* Commencer depuis le haut */
    left: 50%;
    transform: translateX(-50%); /* Uniquement la translation horizontale */
    width: 90%;
    max-width: 1200px;
    height: 100vh; /* Prendre toute la hauteur de la fenêtre */
    padding: 20px;
    display: flex;
    flex-direction: column;
    padding-top: 120px; /* Espace pour le bouton en haut */
    box-sizing: border-box;
}

/* Masquer la barre de défilement pour tous les navigateurs */
.section-text {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Masquer la barre de défilement pour Chrome, Safari et Opera */
.section-text::-webkit-scrollbar {
    display: none;
}

/* Supprimer tous les styles précédents de la barre de défilement */
/* Style de la barre de défilement */
.section-text::-webkit-scrollbar-track,
.section-text::-webkit-scrollbar-thumb,
.section-text::-webkit-scrollbar-thumb:hover {
    display: none;
}

.transition-overlay.active .section-text {
    overflow-y: auto;
}

.animation-grid,
.rigging-grid {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* S'adapte automatiquement au nombre de colonnes */
    gap: 8px;
    opacity: 0;
    transform: translateY(0);
    width: 100%;
    margin: auto 0;
    align-self: center;
    max-width: 700px;
}

/* Ajustements responsifs pour différentes tailles d'écran */
@media (max-width: 700px) {
    .animation-grid,
    .rigging-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 6px;
    }
}

@media (max-width: 500px) {
    .animation-grid,
    .rigging-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 4px;
    }
}

/* Animation d'entrée */
@keyframes fadeInText {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation de sortie */
@keyframes fadeOutText {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.transition-overlay.active.animation-section .animation-grid,
.transition-overlay.active.rigging-section .rigging-grid {
    display: grid;
    animation: fadeInText 1s ease forwards;
    animation-delay: 1s;
}

.transition-overlay.exiting.animation-section .animation-grid,
.transition-overlay.exiting.rigging-section .rigging-grid {
    display: grid;
    animation: fadeOutText 0.5s ease forwards;
    overflow-y: hidden;
}

.grid-square {
    aspect-ratio: 1;
    width: 100%;
    height: 100%;
    border-radius: 3px; /* Légèrement réduire le border-radius pour les images plus petites */
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    transform-origin: center;
    will-change: transform, box-shadow;
    background-color: rgba(0, 0, 0, 0.1);
}

.grid-square::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.grid-square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    will-change: transform;
    opacity: 0; /* Commence invisible */
}

.grid-square img.loaded {
    opacity: 1; /* Devient visible une fois chargée */
}

.grid-square:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.grid-square:hover img {
    transform: scale(1.1);
}

.grid-square:hover::before {
    opacity: 1;
}

/* Animation de l'overlay au survol */
.grid-square::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.grid-square:hover::after {
    opacity: 1;
}

/* Animation du titre au survol */
.grid-square .grid-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px;
    color: white;
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0) 100%
    );
}

.grid-square:hover .grid-title {
    transform: translateY(0);
    opacity: 1;
}

/* Ajustements pour les écrans mobiles */
@media (max-width: 768px) {
    .grid-square:hover {
        transform: scale(1.03);
    }

    .grid-square:hover img {
        transform: scale(1.05);
    }

    .grid-square .grid-title {
        font-size: 11px;
        padding: 8px;
    }
}

/* Styles pour le panneau de projet */
.project-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.project-panel.active {
    opacity: 1;
    visibility: visible;
}

.project-panel-content {
    position: relative;
    width: 76%;
    max-width: 1440px;
    height: 72vh;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 0;
    overflow: hidden;
    transform-origin: center;
    transform: scaleY(0);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-panel.active .project-panel-content {
    transform: scaleY(1);
    opacity: 1;
}

.project-panel.closing .project-panel-content {
    transform: scaleY(0);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.close-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-panel:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.project-media {
    width: 100%;
    height: 100%;
    background: black;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.videos-container {
    width: 90%;
    height: 90%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.videos-container video,
.videos-container iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: black;
}

.videos-container iframe {
    border: none;
    position: relative;
    top: 0;
    left: 0;
    pointer-events: auto;
}

.video-selector {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 30px;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.video-button {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    line-height: 1.2;
}

.video-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.video-button.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Suppression des styles du bouton de lecture */
/* Style pour le bouton de lecture */
.play-button {
    display: none; /* Cache complètement le bouton de lecture */
}

/* Styles pour le logo email et le panneau de contact */
.contact-container {
    position: fixed;
    top: 40px;
    left: 40px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.email-logo {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    width: 44px; /* Largeur fixe */
    height: 44px; /* Hauteur fixe */
    display: flex; /* Utilisation de flexbox pour centrer */
    align-items: center; /* Centrage vertical */
    justify-content: center; /* Centrage horizontal */
}

.email-logo:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.email-icon {
    width: 24px;
    height: 24px;
    fill: white;
    transition: transform 0.3s ease;
    display: block; /* Assure que l'icône est un bloc */
    margin: 0; /* Supprime toute marge */
}

.email-logo:hover .email-icon {
    transform: translateY(-2px);
}

.contact-container .email-logo,
.contact-container .cv-logo {
    width: 44px;
    height: 44px;
    padding: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.cv-logo {
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.cv-logo:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.cv-icon {
    width: 24px;
    height: 24px;
    fill: white;
    transition: transform 0.3s ease;
    display: block; /* Assure que l'icône est un bloc */
    margin: 0; /* Supprime toute marge */
}

.cv-logo:hover .cv-icon {
    transform: translateY(-2px);
}

.contact-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.close-contact {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close-contact:hover {
    opacity: 1;
}

.contact-content h3 {
    color: white;
    font-family: "Montserrat", sans-serif;
    font-weight: 500;
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 0.5px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.contact-icon {
    width: 18px;
    height: 18px;
    fill: white;
    opacity: 0.8;
}

.contact-item a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
    font-weight: 400;
}

/* Style pour l'état de chargement */
.grid-square.loading {
    background: linear-gradient(90deg, 
        rgba(0, 0, 0, 0.1) 0%, 
        rgba(0, 0, 0, 0.2) 50%, 
        rgba(0, 0, 0, 0.1) 100%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}
