
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header simple */

        .header-floating {
            position: fixed;
            top: 1rem;
            left: 50%;
            transform: translateX(-50%);
            width: fit-content;
            background: rgba(15, 15, 15, 0.5);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 50px;
            padding: 0.75rem 2rem;
            z-index: 1000;
            display: flex;
            align-items: center;
            gap: 2rem;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            margin-bottom: 3rem;
        }

        /* Logo SVG */
        .logo-circle {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: linear-gradient(45deg, #6366f1, #8b5cf6);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            flex-shrink: 0; /* Empêche le logo de se compresser */
        }

        /* Header Floating avec animations */
        .header-floating {
            position: fixed;
            top: 1rem;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(15, 15, 15, 0.5);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 50px;
            padding: 0.75rem 2rem;
            z-index: 1000;
            display: flex;
            align-items: center;
            gap: 2rem;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
            width: auto;
            max-width: 90vw;
            overflow: hidden;
        }

        /* État normal - expanded */
        .header-floating.expanded {
            left: 50%;
            transform: translateX(-50%);
            padding: 0.75rem 2rem;
            width: auto;
        }

        /* État scrollé - compact sur la gauche */
        .header-floating.compact {
            left: 2rem;
            transform: translateX(0);
            padding: 0.6rem;
            width: 52px; /* Juste la taille pour le logo + padding */
            height: 52px; /* Même hauteur que largeur pour un cercle parfait */
            gap: 0;
            border-radius: 50%; /* Force un cercle parfait */
            justify-content: center; /* Centre le logo parfaitement */
        }

        /* Navigation */
        .nav-floating {
            display: flex;
            gap: 1.5rem;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            opacity: 1;
            transform: translateX(0);
        }

        /* Cache la nav en mode compact */
        .header-floating.compact .nav-floating {
            opacity: 0;
            transform: translateX(-20px);
            pointer-events: none;
            width: 0;
            gap: 0;
            overflow: hidden;
        }

        /* Montre la nav au hover du mode compact */
        .header-floating.compact:hover {
            width: auto;
            height: auto; /* Retourne à la hauteur automatique */
            padding: 0.75rem 2rem;
            gap: 2rem;
            border-radius: 50px; /* Retourne au border-radius normal */
            justify-content: space-between; /* Retourne à la justification normale */
        }

        .header-floating.compact:hover .nav-floating {
            opacity: 1;
            transform: translateX(0);
            pointer-events: auto;
            width: auto;
            gap: 1.5rem;
        }

        /* Bouton home */
        .home-btn-floating {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: #999;
            text-decoration: none;
            font-size: 0.9rem;
            padding: 0.5rem;
            border-radius: 25px;
            transition: all 0.3s ease;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .home-btn-floating:hover {
            background: rgba(99, 102, 241, 0.1);
            color: white;
        }

        /* Texte du bouton home */
        .home-text {
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            opacity: 1;
            width: auto;
            overflow: hidden;
        }

        /* Cache le texte en mode compact */
        .header-floating.compact .home-text {
            opacity: 0;
            width: 0;
            margin: 0;
            display: none;
        }

        /* Montre le texte au hover du mode compact */
        .header-floating.compact:hover .home-text {
            opacity: 1;
            width: auto;
            display: block;
        }

        /* Links navigation */
        .nav-floating a {
            color: #777;
            text-decoration: none;
            font-size: 0.85rem;
            padding: 0.5rem 1rem;
            border-radius: 20px;
            transition: all 0.3s ease;
            white-space: nowrap;
        }

        .nav-floating a:hover {
            background: rgba(255, 255, 255, 0.05);
            color: #ccc;
        }

        /* Animation du logo au hover */
        .home-btn-floating:hover .logo-circle {
            transform: scale(1.1) rotate(10deg);
        }
        .logo-circle .img-logo{
            display: block;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .header-floating {
                left: 1rem !important;
                transform: translateX(0) !important;
                max-width: calc(100vw - 2rem);
            }
            
            /* Sur mobile, le header reste toujours en mode "expanded" */
            .header-floating.expanded {
                left: 1rem;
                transform: translateX(0);
                width: auto;
                height: auto;
                padding: 0.75rem 1.5rem;
                gap: 1.5rem;
                border-radius: 50px;
                justify-content: space-between;
            }

            /* Sur mobile, même en mode "compact", on garde la nav visible */
            .header-floating.compact {
                left: 1rem;
                transform: translateX(0);
                width: auto !important; /* Force l'expansion */
                height: auto !important;
                padding: 0.75rem 1.5rem !important;
                gap: 1.5rem !important;
                border-radius: 50px !important;
                justify-content: space-between !important;
            }

            .header-floating.compact .nav-floating {
                opacity: 1 !important; /* Force la visibilité de la nav */
                transform: translateX(0) !important;
                pointer-events: auto !important;
                width: auto !important;
                gap: 1rem !important;
            }

            .header-floating.compact .home-text {
                display: block;
                opacity: 1 !important; /* Force la visibilité du texte */
                width: auto !important;
            }

            .nav-floating {
                gap: 1rem;
                display: none;
            }

            .nav-floating a {
                font-size: 0.8rem;
                padding: 0.4rem 0.8rem;
            }
        }
        /* Présentation */
        .presentation{
            margin: 0px auto;
            margin-top: 150px;
            text-align: center;
            max-width: 1200px;
        }
        .presentation p{
            padding: 25px;
        }

        .about{
            max-width: 1200px;
            margin: 20px auto;
            padding: 3rem 2rem;
            background-color: #2a2a2a;
            border-radius: 20px;
            box-shadow: 0 8px 25px rgba(0,0,0,0.4);
        }
        .about h2{
            text-decoration: underline;
            padding: 25px;
            padding-top: 10px;
        }
        .about li{
            padding: 20px 10px;
            color: #bababa;
        }

        /* Section compétences */
.skills {
    max-width: 1200px;
    margin: 50px auto;
    padding: 3rem 2rem;
    border-radius: 20px;
    border: 1px solid #2a2a2a;
    text-align: center;
}

.skills h2 {
    text-decoration: underline;
    margin-bottom: 2rem;
    padding: 25px;
    padding-top: 10px;
    text-align: start;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

/* Cartes de compétence */
.skill-card {
    background: #2a2a2a;
    border-radius: 15px;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.skill-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.skill-card img {
    width: 70px;
    margin-bottom: 1rem;
}

.skill-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.skill-card p {
    font-size: 0.9rem;
    color: #bababa;
    line-height: 1.4;
}

/* --- Cube Contact - style assorti à ton thème --- */
.contact-cube-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 2.5rem;
  background-color: #2a2a2a;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  text-align: center;
  color: #fff;
}

.contact-cube-section h2 {
    text-decoration: underline;
    margin-bottom: 2rem;
    padding: 25px;
    padding-top: 10px;
    text-align: start;
}

.contact-cube-section .muted {
  color: #bfbfbf;
  margin-bottom: 1rem;
  padding-bottom:25px ;
}

/* cube wrap */
.cube-wrap {
  perspective: 1100px;
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

/* main cube */
.cube {
  position: relative;
  width: 220px;
  height: 220px;
  transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(.2,.9,.2,1);
  transform-origin: center center;
}

/* single face base style */
.face {
  position: absolute;
  width: 200px;
  height: 200px;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
  transform-origin: center center;
  margin-left: -100px;
  margin-top: -100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-direction: column;
  background: linear-gradient(180deg, #232323, #1a1a1a);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  color: #fff;
  text-decoration: none;
  transition: transform 500ms ease, box-shadow 300ms ease, background 300ms ease;
  backface-visibility: hidden;
}

/* icons */
.face .icon {
  width: 56px;
  height: 56px;
  opacity: 0.95;
  fill: white;
    stroke-width: 0.3px;
  transition: 1s;
}

/* face labels */
.face span {
  font-size: 0.95rem;
  color: #cfcfcf;
}

/* positionnement des 3 faces (front / right / top) */
.face-front {
  transform: translateZ(110px);
}
.face-right {
  transform: rotateY(90deg) translateZ(110px);
}
.face-left{
  transform: rotateY(-90deg) translateZ(110px);
}

/* hover léger */
.face:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.7);
}
.face:hover .icon{
    fill: rgba(0, 0, 0, 0.2);
    stroke: white;
}

/* controls */
.cube-controls {
  display:flex;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1rem;
}
.cube-controls button {
  background: #171717;
  border: 1px solid rgba(255,255,255,0.06);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .15s, background .15s;
}
.cube-controls button:hover { transform: translateY(-3px); background:#222; }

/* rotation states (JS toggles classes) */
.cube.rotate-left { transform: rotateY(-60deg) rotateX(10deg); }
.cube.rotate-right { transform: rotateY(60deg) rotateX(10deg); }
.cube.rotate-center { transform: rotateY(0deg) rotateX(8deg); }

/* unfold animation: each face s'écarte */
.cube.unfold .face-front  { transform: translateZ(110px) scale(1.1); }
.cube.unfold .face-right  { transform: translateZ(110px) rotateY(0) translateX(120%)  translateY(0) rotateX(0) scale(1.1); }
.cube.unfold .face-left    { transform: translateZ(110px) rotateY(0) translateX(-120%)  translateY(0) rotateX(0) scale(1.1); }

/* responsive */
@media (max-width:520px){
    .contact-cube-section{
        overflow: hidden;
    }
  .cube { width:160px; height:160px; }
  .face { width:140px; height:140px; margin-left:-70px; margin-top:-70px; }
  .face .icon { width:44px; height:44px; }
  .cube-controls{
    margin-top: 100px;
  }
}


/* Container principal */
.container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 3rem 2rem;
    border-radius: 20px;
    border: 1px solid #2a2a2a;
}
.container h2{
    text-decoration: underline;
    padding: 25px;
}

/* Barre de filtres */
.filters-container {
    margin-bottom: 3rem;
}

.filters-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-label {
    color: #aaa;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    background: #3a3a3a;
    color: #ccc;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid #4a4a4a;
    transition: all 0.3s ease;
    user-select: none;
}

.tag:hover {
    background: #4a4a4a;
    border-color: #666;
}

.tag.active {
    background: #fff;
    color: #1a1a1a;
    border-color: #fff;
}

.tag.software {
    background: #2d4a3e;
    border-color: #3d5a4e;
}

.tag.software:hover {
    background: #3d5a4e;
    border-color: #4d6a5e;
}

.tag.software.active {
    background: #5cb85c;
    color: #fff;
    border-color: #5cb85c;
}

/* Compteur de résultats */
.results-count {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Grille des créations */
.creations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Cartes des projets */
.project-card {
    background: #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #3a3a3a;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    border-color: #555;
}

/* Zone d'aperçu 3D */
.preview-container {
    width: 100%;
    height: 200px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #3a3a3a;
    position: relative;
}

.preview-placeholder {
    color: #666;
    font-size: 1rem;
    text-align: center;
}


/* Overlay de hover */
.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    overflow: hidden;
}
.preview-overlay .black-overlay{
    position: absolute;
    background: rgba(0,0,0,0.5);
    width: 100%;
    height: 100%;
    opacity: 0;
}
.preview-overlay .preview-thumbnail{
    width: auto;
    height: 50%;
    opacity: 1;
    transition: 1s;
}
.span-thumbnail{
    color: #aaa;
    font-size: 20px;
}


.play-icon {
    position: absolute;
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #1a1a1a;
    opacity: 0.5;
}
.project-card:hover .preview-overlay .preview-thumbnail{
    height: 100%;
}
.project-card:hover .preview-overlay .black-overlay {
    transition: 0.5s;
    opacity: 1;
}
.project-card:hover .play-icon{
    transition: 0.5s;
    opacity: 1;
}

/* Info des projets */
.project-info {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.project-software {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 0.8rem;
}

.project-description {
    font-size: 0.95rem;
    color: #ccc;
    line-height: 1.4;
    margin-bottom: 1rem;
}

/* Tags sur les cartes */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tag {
    background: rgba(255,255,255,0.1);
    color: #ccc;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Animation pour les cartes filtrées */
.project-card.hidden {
    display: none;
}

.project-card.show {
    animation: fadeInUp 0.5s ease forwards;
}

/* Modal/Popup */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #2a2a2a;
    border-radius: 15px;
    max-width: 90vw;
    max-height: 90vh;
    width: 1000px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    overflow: hidden;
    position: relative;
    animation: slideIn 0.3s ease;
}

/* Zone Three.js dans le modal */
.modal-3d-container {
    background: #1a1a1a;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #3a3a3a;
}

/* Panel d'informations */
.modal-info {
    padding: 2rem;
    overflow-y: auto;
}

.modal-title {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 1rem;
}

.info-section {
    margin-bottom: 1.5rem;
}

.info-label {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.info-value {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.modal-description {
    color: #ccc;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Bouton de fermeture */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
}

.close-btn:hover {
    color: #fff;
}

/* Contrôles 3D (optionnels) */
.modal-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
}

.control-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: scale(0.9) translateY(-20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        max-height: 95vh;
    }
    
    .modal-3d-container {
        border-right: none;
        border-bottom: 1px solid #3a3a3a;
        min-height: 300px;
    }
    
    .creations-grid {
        grid-template-columns: 1fr;
    }
}