:root {
    --color-wood: #8B4513;
    --color-leather: #8B4513;
    --color-beige: #F5F5DC;
    --color-teal: #066e6e;
}

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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-beige);
    color: var(--color-wood);
    overflow-x: hidden;
}

/* Header Styles */
header {
    position: fixed;
    width: 100%;
    height: 100px;
    background-color: var(--color-wood);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 2rem;
    z-index: 1000;
}

/* Header Logo */
.logo {
    position: absolute;
    left: 15%;
    transform: translateX(-50%);
    width: 140px;
    opacity: 0;
    cursor: pointer;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 1.2s;
    pointer-events: none;
    margin-top: 10px;
}

.logo img {
    width: 100%;
    height: auto;
    transform: translateY(20px);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 1.2s;
}

/* Animation du logo quand une forme est cliquée */
.shape-clicked .logo {
    opacity: 1;
    transform: translateX(-50%);
    pointer-events: all;
}

.shape-clicked .logo img {
    transform: translateY(3px);
}

.shape-clicked .logo:hover {
    opacity: 0.9;
}

.logo.rotating img {
    transform: translateY(3px) rotate(60 deg);
}

.logo:hover {
    opacity: 0.9;
}


.bar {
    width: 100%;
    height: 3px;
    background-color: var(--color-beige);
    margin: 6px 0;
    transition: 0.4s;
}

/* Hero Section */
.hero {
    height: 100vh;
    background: url('assets/back.jpg') center/cover no-repeat;
    padding-top: 120px;
    position: relative;
    transition: background-color 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('assets/atelier.png') center/cover no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease;
    z-index: 1;
    animation: fadeInBg 1.5s ease forwards;
    animation-delay: 2s;
}

@keyframes fadeInBg {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(139, 69, 19, 0.4);
    z-index: 2;
    transition: opacity 1s ease;
}

.hero-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 120px);
    padding: 2rem;
}

.hero-logo {
    width: 600px;
    margin-bottom: 2rem;
    transition: all 0.6s ease;
    position: relative;
    z-index: 2;
}

.hero-logo img {
    width: 100%;
    height: auto;
    animation: fadeInDown 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    will-change: filter;
}

.cta-button {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    
    color: #ffffff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 1.8rem;
    margin: 2rem 0 4rem;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 0.5s;
    font-family: 'Special Elite', sans-serif;
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Interactive Shapes */
.shapes {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 2rem;
    position: relative;
    z-index: 3;
}

.shapes > div {
    width: 80px;
    height: 80px;
    cursor: pointer;
    position: relative;
    transform: scale(1) rotate(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shapes > div svg {
    width: 100%;
    height: 100%;
}

/* Effets de survol uniques pour chaque forme */
.shapes .circle:hover {
    transform: scale(1.1) rotate(8deg);
}

.shapes .square:hover {
    transform: scale(1.1) rotate(-5deg);
}

.shapes .triangle:hover {
    transform: scale(1.1) rotate(6deg);
}

/* Shape Colors avec texture */
.circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background-color: var(--color-teal);
    mix-blend-mode: overlay;
    opacity: 0.8;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.square::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background-color: #704d3e;
    mix-blend-mode: overlay;
    opacity: 0.8;
    border-radius: 8px;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.triangle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    background-color: #ffae00;
    mix-blend-mode: overlay;
    opacity: 0.8;
    clip-path: polygon(50% 20%, 85% 80%, 15% 80%);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.circle svg circle {
    fill: url(#leather-pattern);
    stroke: var(--color-teal);
    stroke-width: 1;
    filter: url(#inner-shadow);
    mix-blend-mode: multiply;
}

.square svg rect {
    fill: url(#leather-pattern);
    stroke: #704d3e;
    stroke-width: 1;
    filter: url(#inner-shadow);
    mix-blend-mode: multiply;
    rx: 8px;
}

.triangle svg path {
    fill: url(#leather-pattern);
    stroke: #ffae00;
    stroke-width: 1;
    filter: url(#inner-shadow);
    mix-blend-mode: multiply;
}

/* Ajout d'une ombre interne aux SVG */
.shapes > div svg path,
.shapes > div svg circle,
.shapes > div svg rect {
    filter: url(#inner-shadow);
}

/* SVG Filter pour l'ombre interne */
<filter id="inner-shadow" x="-50%" y="-50%" width="200%" height="200%">
    <feGaussianBlur in="SourceAlpha" stdDeviation="3" result="blur"/>
    <feOffset dx="0" dy="2"/>
    <feComposite in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1"/>
    <feColorMatrix type="matrix" values="0 0 0 0 0   0 0 0 0 0   0 0 0 0 0  0 0 0 0.3 0"/>
    <feMerge>
        <feMergeNode/>
        <feMergeNode in="SourceGraphic"/>
    </feMerge>
</filter>

/* Animations d'apparition */
@keyframes appearShape {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.circle {
    animation: appearShape 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.8s;
}

.square {
    animation: appearShape 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 1s;
}

.triangle {
    animation: appearShape 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 1.2s;
}

/* Animation au clic */
.circle.active, .square.active, .triangle.active {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.shape-clicked .shapes > * {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.shape-clicked .hero::after {
    opacity: 0;
    transition: opacity 1s ease;
}

.shape-clicked .hero-logo,
.shape-clicked .cta-button {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Projects Sections */
.projects-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
    z-index: 10;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.projects-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    transition: transform 1.5s cubic-bezier(0.645, 0.045, 0.355, 1);
    z-index: -1;
}

.projects-section.maroquinerie::before {
    background-color: var(--color-teal);
    background-image: url('assets/poile.jpg');
    background-repeat: repeat;
    background-size: cover;
    opacity: 1;
    mix-blend-mode: multiply;
}

.projects-section.surmesure::before {
    background-color: #492313;
    background-image: url('assets/leather.png');
    background-repeat: repeat;
    background-size: cover;
    opacity: 1;
    mix-blend-mode: soft-light;
}

.projects-section.collection::before {
    background-color: #e29b00;
    background-image: url('assets/jaune.jpg');
    background-repeat: repeat;
    background-size: cover;
    opacity: 1;
    mix-blend-mode: difference;
}

/* Ajout d'un overlay pour mélanger la texture et la couleur */
.projects-section.maroquinerie::after,
.projects-section.surmesure::after,
.projects-section.collection::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.8;
    transition: opacity 1.5s ease delay:1.5s;
}

.projects-section.maroquinerie::after {
    background-color: var(--color-teal);
}

.projects-section.surmesure::after {
    background-color: #3b250f;
}

.projects-section.collection::after {
    background-color: #e09200;
}

.projects-section.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.projects-section.active::before {
    transform: translateX(100%);
}

/* Ajustement des délais pour la séquence d'animation */
.projects-section.active .projects-grid {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.2s;
}

.projects-section.active .project-card:nth-child(1) { transition-delay: 0.3s; }
.projects-section.active .project-card:nth-child(2) { transition-delay: 0.4s; }

/* Ajustement de l'opacité des cartes selon la couleur de fond */
.projects-section.maroquinerie .project-card,
.projects-section.surmesure .project-card {
    background: rgba(255, 255, 255, 0.95);
}

.projects-section.collection .project-card {
    background: rgba(255, 255, 255, 0.98);
}

/* Projects Grid */
.projects-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem;
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 90px;
    min-height: 100%;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.project-card {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateX(-20px);
    will-change: transform, opacity;
}

.project-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

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

.project-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: var(--color-wood);
}

.project-card p {
    color: rgba(0, 0, 0, 0.7);
    line-height: 1.5;
}

.projects-section.active .projects-grid {
    opacity: 1;
    transform: translateX(0);
}

.projects-section.active .project-card {
    opacity: 1;
    transform: translateX(0);
}

.project-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Scrollbar styling */
.projects-grid::-webkit-scrollbar {
    width: 8px;
}

.projects-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.048);
    border-radius: 4px;
}

.projects-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 226, 206, 0.096);
    border-radius: 4px;
}

.projects-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(97, 75, 59, 0.212);
}

@media (max-height: 800px) {
    .projects-grid {
        gap: 1.5rem;
        padding: 1.5rem;
        padding-top: 100px;
    }

    .project-card {
        padding: 1.2rem;
    }

    .project-card img {
        height: 150px;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .projects-grid {
        width: 60%;
        right: 5%;
    }

    .circle.active, .square.active, .triangle.active {
        left: 15%;
    }
}

@media (max-width: 1024px) {
    .projects-grid {
        flex-direction: column;
        padding-top: 90px;
        gap: 1.5rem;
    }

    .project-card {
        width: 100%;
        max-width: none;
        margin-bottom: 1.5rem;
    }

    header {
        height: 80px;
    }

    .logo {
        width: 120px;
        margin-top: 5px;
    }
}

@media (max-width: 768px) {
    .projects-section {
        height: 100%;
        position: fixed;
        overflow-y: scroll;
    }

    .projects-grid {
        padding: 1rem;
        padding-top: 80px;
        gap: 1rem;
        width: 94%;
    }

    .project-card {
        margin-bottom: 1rem;
        padding: 1rem;
        transform: none;
        border-radius: 12px;
    }

    .project-card img {
        height: 200px;
        margin-bottom: 1rem;
    }

    /* Suppression du déplacement des formes sur mobile */
    .shapes > div:hover {
        transform: none;
    }

    .circle.active, .square.active, .triangle.active,
    .shape-clicked .shapes > * {
        transform: scale(0.9);
    }

    .logo {
        width: 100px;
        left: 12%;
    }
}

@media (max-width: 480px) {
    .projects-grid {
        width: 92%;
        padding: 0.8rem;
        padding-top: 75px;
        gap: 0.8rem;
    }

    .project-card {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }

    .project-card img {
        height: 180px;
        margin-bottom: 0.8rem;
    }

    .project-card h3 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .project-card p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .logo {
        width: 90px;
        left: 10%;
    }
}

/* Reset Transitions */
.hero {
    transition: background-color 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

body:not(.shape-clicked) .hero,
body:not(.shape-clicked) .hero-content,
body:not(.shape-clicked) .shapes > * {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

body.shape-clicked {
    overflow: hidden;
}

.distort-on-active {
    transition: filter 1s ease;
}

.hero-logo {
    width: 400px;
    margin-bottom: 3rem;
    transition: all 0.6s ease;
    position: relative;
    z-index: 2;
}

.hero-logo img {
    width: 100%;
    height: auto;
    animation: fadeInDown 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    will-change: filter;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes appearShape {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.circle {
    opacity: 0;
    animation: appearShape 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.8s;
}

.square {
    opacity: 0;
    animation: appearShape 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 1s;
}

.triangle {
    opacity: 0;
    animation: appearShape 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 1.2s;
}

/* Modifications pour le hover */
.circle:hover, .square:hover, .triangle:hover {
    transform: scale(1.1);
}

/* Ajustement de l'opacité des cartes pour une meilleure lisibilité sur les textures */
.projects-section .project-card {
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

/* Reset des transitions */
body:not(.shape-clicked) .logo {
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0s;
}

/* Ajustement de la rotation pour chaque forme */
.circle:hover {
    transform: scale(1.1) rotate(8deg);
}

.square:hover {
    transform: scale(1.1) rotate(-5deg);
}

.triangle:hover {
    transform: scale(1.1) rotate(6deg);
}