/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0891b2;
    --primary-dark: #0e7490;
    --secondary-color: #06b6d4;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    perspective: 2000px;
}

/* 3D Page Container */
.page-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    transform-style: preserve-3d;
    animation: pageFlip 20s ease-in-out infinite;
}

.page-front,
.page-back {
    position: absolute;
    width: 100%;
    min-height: 100vh;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.page-front {
    transform: rotateY(0deg);
    z-index: 2;
}

.page-back {
    transform: rotateY(180deg);
    z-index: 1;
}

@keyframes pageFlip {
    0%, 40% {
        transform: rotateY(0deg);
    }
    50%, 90% {
        transform: rotateY(180deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.3s ease;
}

.page-front .navbar {
    position: fixed;
    z-index: 1001;
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoMoveAndColor 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes logoMoveAndColor {
    0% {
        transform: translateY(0);
        background: linear-gradient(135deg, #0891b2, #06b6d4);
        -webkit-background-clip: text;
        background-clip: text;
    }
    25% {
        transform: translateY(-5px);
        background: linear-gradient(135deg, #06b6d4, #10b981);
        -webkit-background-clip: text;
        background-clip: text;
    }
    50% {
        transform: translateY(0);
        background: linear-gradient(135deg, #10b981, #f59e0b);
        -webkit-background-clip: text;
        background-clip: text;
    }
    75% {
        transform: translateY(5px);
        background: linear-gradient(135deg, #f59e0b, #ef4444);
        -webkit-background-clip: text;
        background-clip: text;
    }
    100% {
        transform: translateY(0);
        background: linear-gradient(135deg, #0891b2, #06b6d4);
        -webkit-background-clip: text;
        background-clip: text;
    }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #000000;
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #000000;
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 60px;
    /* Image dark en dessous */
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #2d2d2d 100%);
    background-size: 200% 200%;
    animation: gradientShiftDark 12s ease infinite;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

/* Image avec graduation de couleur */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    background-size: 200% 200%;
    /* Animation cycle (30s): 
       0-10s (0-33%): Teal Wave
       10-20s (33-66%): Dark Theme (Typewriter)
       20-30s (66-100%): Rabbit Scene
    */
    animation: heroCycle 30s ease-in-out infinite;
    z-index: 1;
    transform-origin: center center;
}

/* Pattern de grille sur l'image */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text {
    color: white;
}

.greeting {
    display: block;
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-title .name {
    display: block;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    opacity: 0;
    animation: fadeInUpScale 1s ease-out 0.6s both;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title .role {
    display: block;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUpRole 0.8s ease-out 1.2s both;
}

.hero-description {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    line-height: 1.8;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 1.6s both;
    min-height: 3.6em;
    /* Reserve space for 2 lines */
}

.typing-cursor::after {
    content: '|';
    animation: blinkCursor 0.75s step-end infinite;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 2s both;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: white;
    color: #000000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.btn-secondary:hover {
    background: white;
    color: #000000;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

.code-snippet {
    font-family: 'Courier New', monospace;
    color: white;
    font-size: 0.9rem;
    line-height: 1.8;
}

.code-line {
    margin-bottom: 0.5rem;
}

.indent {
    padding-left: 1.5rem;
}


.keyword {
    color: #fbbf24;
}

.variable {
    color: #60a5fa;
}

.string {
    color: #34d399;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid white;
    border-radius: 12px;
    position: relative;
}

section {
    padding: 160px 0;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: white;
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes crinkleAndFade {
    0% {
        transform: scale(1);
        filter: brightness(1) contrast(1) blur(0px);
        opacity: 1;
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
        box-shadow:
            inset 0 0 50px rgba(0, 0, 0, 0.3),
            inset 0 0 100px rgba(0, 0, 0, 0.2);
    }

    15% {
        transform: scale(1.05);
        filter: brightness(1.1) contrast(1.2) blur(0.5px);
        opacity: 1;
        clip-path: polygon(3% 2%, 8% 1%, 12% 3%, 15% 0%, 85% 0%, 88% 3%, 92% 1%, 97% 2%,
                98% 5%, 99% 12%, 98% 20%, 99% 35%, 98% 50%, 99% 65%, 98% 80%, 99% 88%, 98% 95%,
                97% 98%, 92% 99%, 88% 97%, 85% 100%, 15% 100%, 12% 97%, 8% 99%, 3% 98%, 2% 95%, 1% 88%, 2% 80%, 1% 65%, 2% 50%, 1% 35%, 2% 20%, 1% 12%, 2% 5%);
        box-shadow:
            inset 0 0 60px rgba(0, 0, 0, 0.4),
            inset 0 0 120px rgba(0, 0, 0, 0.3),
            0 10px 30px rgba(0, 0, 0, 0.2);
    }

    30% {
        transform: scale(0.95);
        filter: brightness(0.9) contrast(1.1) blur(1px);
        opacity: 0.95;
        clip-path: polygon(6% 4%, 12% 2%, 18% 5%, 22% 1%, 78% 1%, 82% 5%, 88% 2%, 94% 4%,
                95% 8%, 96% 15%, 95% 25%, 96% 40%, 95% 50%, 96% 60%, 95% 75%, 96% 85%, 95% 92%,
                94% 96%, 88% 98%, 82% 95%, 78% 99%, 22% 99%, 18% 95%, 12% 98%, 6% 96%, 5% 92%, 4% 85%, 5% 75%, 4% 60%, 5% 50%, 4% 40%, 5% 25%, 4% 15%, 5% 8%);
        box-shadow:
            inset 0 0 80px rgba(0, 0, 0, 0.5),
            inset 0 0 150px rgba(0, 0, 0, 0.4),
            0 15px 40px rgba(0, 0, 0, 0.3);
    }

    45% {
        transform: scale(0.85);
        filter: brightness(0.7) contrast(0.9) blur(2px);
        opacity: 0.85;
        clip-path: polygon(12% 8%, 20% 4%, 28% 10%, 32% 6%, 68% 6%, 72% 10%, 80% 4%, 88% 8%,
                90% 12%, 91% 20%, 90% 30%, 91% 45%, 90% 50%, 91% 55%, 90% 70%, 91% 80%, 90% 88%,
                88% 92%, 80% 96%, 72% 90%, 68% 94%, 32% 94%, 28% 90%, 20% 96%, 12% 92%, 10% 88%, 9% 80%, 10% 70%, 9% 55%, 10% 50%, 9% 45%, 10% 30%, 9% 20%, 10% 12%);
        box-shadow:
            inset 0 0 100px rgba(0, 0, 0, 0.6),
            inset 0 0 200px rgba(0, 0, 0, 0.5),
            0 20px 50px rgba(0, 0, 0, 0.4);
    }

    60% {
        transform: scale(0.7);
        filter: brightness(0.5) contrast(0.7) blur(3px);
        opacity: 0.7;
        clip-path: polygon(20% 15%, 30% 10%, 38% 18%, 42% 12%, 58% 12%, 62% 18%, 70% 10%, 80% 15%,
                83% 20%, 84% 28%, 83% 38%, 84% 50%, 83% 62%, 84% 72%, 83% 80%,
                80% 85%, 70% 90%, 62% 82%, 58% 88%, 42% 88%, 38% 82%, 30% 90%, 20% 85%, 17% 80%, 16% 72%, 17% 62%, 16% 50%, 17% 38%, 16% 28%, 17% 20%);
        box-shadow:
            inset 0 0 120px rgba(0, 0, 0, 0.7),
            inset 0 0 250px rgba(0, 0, 0, 0.6),
            0 25px 60px rgba(0, 0, 0, 0.5);
    }

    75% {
        transform: scale(0.5);
        filter: brightness(0.3) contrast(0.5) blur(5px);
        opacity: 0.5;
        clip-path: polygon(30% 25%, 40% 18%, 48% 28%, 50% 22%, 50% 22%, 52% 28%, 60% 18%, 70% 25%,
                75% 30%, 76% 38%, 75% 48%, 76% 52%, 75% 62%, 76% 70%,
                70% 75%, 60% 82%, 52% 72%, 50% 78%, 48% 72%, 40% 82%, 30% 75%, 25% 70%, 24% 62%, 25% 52%, 24% 48%, 25% 38%, 24% 30%);
        box-shadow:
            inset 0 0 150px rgba(0, 0, 0, 0.8),
            inset 0 0 300px rgba(0, 0, 0, 0.7),
            0 30px 70px rgba(0, 0, 0, 0.6);
    }

    90% {
        transform: scale(0.3);
        filter: brightness(0.2) contrast(0.3) blur(7px);
        opacity: 0.3;
        clip-path: polygon(40% 40%, 46% 35%, 48% 42%, 50% 38%, 50% 38%, 52% 42%, 54% 35%, 60% 40%,
                62% 45%, 63% 48%, 62% 52%, 63% 55%, 62% 60%,
                60% 62%, 54% 65%, 52% 58%, 50% 62%, 48% 58%, 46% 65%, 40% 62%, 38% 60%, 37% 55%, 38% 52%, 37% 48%, 38% 45%);
        box-shadow:
            inset 0 0 180px rgba(0, 0, 0, 0.9),
            inset 0 0 350px rgba(0, 0, 0, 0.8),
            0 35px 80px rgba(0, 0, 0, 0.7);
    }

    100% {
        transform: scale(0.1);
        filter: brightness(0.1) contrast(0.2) blur(10px);
        opacity: 0;
        clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
        box-shadow:
            inset 0 0 200px rgba(0, 0, 0, 1),
            inset 0 0 400px rgba(0, 0, 0, 0.9),
            0 40px 100px rgba(0, 0, 0, 0.8);
    }
}

@keyframes crinkleOverlay {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }

    33% {
        transform: translate(-10px, 15px) scale(1.05);
        opacity: 0.25;
    }

    66% {
        transform: translate(15px, -10px) scale(0.95);
        opacity: 0.35;
    }
}

@keyframes fadeOut {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.15;
    }

    100% {
        opacity: 0;
    }
}

@keyframes gradientShiftDark {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Animation optimisée pour mobile - froissement depuis les bords */
@keyframes crinkleAndFadeMobile {
    0% {
        transform: scale(1);
        filter: brightness(1) contrast(1) blur(0px);
        opacity: 1;
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
        box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.3);
    }

    15% {
        transform: scale(1.005);
        filter: brightness(1.01) contrast(1.02) blur(0.15px);
        opacity: 1;
        clip-path: polygon(4% 3%, 6% 1%, 94% 1%, 96% 3%, 97% 6%, 99% 94%, 96% 97%, 94% 99%, 6% 99%, 3% 97%, 1% 94%, 3% 6%);
        box-shadow: inset 0 0 38px rgba(0, 0, 0, 0.35);
    }

    35% {
        transform: scale(0.97);
        filter: brightness(0.92) contrast(0.98) blur(0.6px);
        opacity: 0.92;
        clip-path: polygon(8% 6%, 12% 2%, 16% 5%, 84% 2%, 88% 5%, 92% 6%, 94% 10%, 96% 14%, 98% 18%, 98% 82%, 96% 86%, 94% 90%, 92% 94%, 88% 97%, 84% 98%, 16% 98%, 12% 97%, 8% 94%, 6% 90%, 4% 86%, 2% 82%, 2% 18%, 4% 14%, 6% 10%);
        box-shadow: inset 0 0 48px rgba(0, 0, 0, 0.45), 0 3px 10px rgba(0, 0, 0, 0.2);
    }

    55% {
        transform: scale(0.88);
        filter: brightness(0.8) contrast(0.88) blur(1.2px);
        opacity: 0.8;
        clip-path: polygon(15% 12%, 20% 8%, 25% 11%, 30% 9%, 70% 8%, 75% 11%, 80% 12%, 85% 15%, 88% 20%, 90% 25%, 92% 30%, 92% 70%, 90% 75%, 88% 80%, 85% 85%, 80% 88%, 75% 91%, 70% 92%, 30% 92%, 25% 91%, 20% 88%, 15% 85%, 12% 80%, 10% 75%, 8% 70%, 8% 30%, 10% 25%, 12% 20%);
        box-shadow: inset 0 0 65px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.3);
    }

    75% {
        transform: scale(0.65);
        filter: brightness(0.5) contrast(0.65) blur(2.5px);
        opacity: 0.5;
        clip-path: polygon(25% 22%, 32% 18%, 38% 22%, 42% 20%, 58% 18%, 62% 22%, 68% 25%, 72% 28%, 75% 32%, 78% 38%, 80% 42%, 80% 58%, 78% 62%, 75% 68%, 72% 72%, 68% 75%, 62% 78%, 58% 80%, 42% 80%, 38% 78%, 32% 75%, 28% 72%, 25% 68%, 22% 62%, 20% 58%, 20% 42%, 22% 38%, 25% 32%, 28% 28%);
        box-shadow: inset 0 0 85px rgba(0, 0, 0, 0.75), 0 10px 25px rgba(0, 0, 0, 0.45);
    }

    100% {
        transform: scale(0.05);
        filter: brightness(0.1) contrast(0.2) blur(7px);
        opacity: 0;
        clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
        box-shadow: inset 0 0 110px rgba(0, 0, 0, 1), 0 16px 45px rgba(0, 0, 0, 0.65);
    }
}

@keyframes heroCycle {

    /* 0% - 33%: Teal Wave (Visible) */
    0% {
        background-position: 0% 50%;
        transform: perspective(1000px) rotateX(0deg) translateZ(0) scale(1);
        opacity: 1;
    }

    16% {
        background-position: 100% 50%;
    }

    30% {
        background-position: 0% 50%;
        transform: perspective(1000px) rotateX(0deg) translateZ(0) scale(1);
        opacity: 1;
    }

    /* 33% - 36%: Tilt and Recede (Transition to Dark) */
    36% {
        transform: perspective(1000px) rotateX(60deg) translateZ(-1500px) scale(0.2);
        opacity: 0;
    }

    /* 36% - 95%: Dark Theme & Rabbit Scene (Hidden Teal BG) */
    95% {
        transform: perspective(1000px) rotateX(0deg) translateZ(0) scale(1);
        opacity: 0;
    }

    /* 95% - 100%: Smooth Fade In */
    100% {
        transform: perspective(1000px) rotateX(0deg) translateZ(0) scale(1);
        opacity: 1;
    }
}

/* Rabbit Scene Styles */
.hero-rabbit-scene {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    /* Behind content but visible when purple BG is gone */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: rabbitSceneCycle 30s linear infinite;
    pointer-events: none;
}

.scene-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cogwheel {
    position: absolute;
    top: 50%;
    left: -100px;
    /* Start off-screen */
    width: 300px;
    height: 300px;
    transform: translateY(-50%);
    animation: spinCog 4s linear infinite;
    filter: brightness(0) invert(1);
}

.rabbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    transform: translate(-50%, -50%);
    animation: slideRabbit 0.5s ease-in-out infinite alternate;
    filter: brightness(0) invert(1);
}

@keyframes rabbitSceneCycle {

    /* 0-66%: Hidden (Teal BG then Dark Theme/Typewriter) */
    0%,
    60% {
        opacity: 0;
    }

    /* 66-95%: Visible (Rabbit Scene) */
    66% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    /* 95-100%: Fade Out */
    95%,
    100% {
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .hero-rabbit-scene {
        animation: rabbitVerticalLoop 8s linear infinite;
    }

    .hero-rabbit-scene {
        animation: rabbitVerticalLoop 8s linear infinite;
    }
}

@keyframes heroCycleMobileBG {

    0%,
    100% {
        opacity: 0;
    }
}

@keyframes rabbitVerticalLoop {
    0% {
        transform: translateY(-120%);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(120%);
        opacity: 0;
    }
}

@keyframes spinCog {
    from {
        transform: translateY(-50%) rotate(0deg);
        left: -150px;
    }

    to {
        transform: translateY(-50%) rotate(360deg);
        left: 110%;
    }

    /* Moves across screen */
}

@keyframes slideRabbit {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(5deg) scale(1.05);
    }

    /* Slight rotation and scale to simulate effort */
}

@keyframes blinkCursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

/* About Section */
.about {
    background: var(--bg-primary);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-intro {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: center;
}

.skills {
    margin-top: 2rem;
}

.skills h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-align: center;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: #000000;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Projects Section */
.projects {
    background: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.project-image {
    height: 200px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="dots" width="60" height="60" patternUnits="userSpaceOnUse"><circle cx="30" cy="30" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.project-icon {
    font-size: 4rem;
    z-index: 1;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    text-align: center;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
    text-align: center;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tag {
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Contact Section */
.contact {
    background: var(--bg-primary);
}

.contact-content {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    margin-top: 3rem;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-align: center;
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: flex-start;
    justify-content: center;
}

.contact-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.contact-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.contact-item p {
    color: var(--text-secondary);
}

.contact-note {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 2rem;
    text-align: center;
}

.contact-form {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    width: 100%;
    margin-top: 0.5rem;
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.form-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    display: block;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    display: block;
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }


    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title .name {
        font-size: 2.5rem;
    }

    .hero-title .role {
        font-size: 1.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    /* Optimisation du froissement sur mobile */
    .hero::before {
        animation:
            gradientShift 10s ease infinite,
            crinkleAndFadeMobile 18s ease-in-out infinite;
    }

    .section-title {
        font-size: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-content {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 100px 20px 40px;
    }

    .hero-title .name {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .contact-form {
        padding: 1.5rem;
    }
}

/* Matrix Scene Styles */
.matrix-scene {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #000000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Matrix Grid Background */
.matrix-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 0, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: matrixMove 20s linear infinite;
    opacity: 0.3;
}

@keyframes matrixMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* Geometric Shapes */
.geometric-shape {
    position: absolute;
    border: 2px solid rgba(0, 255, 0, 0.6);
    animation: floatShape 8s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    transform: rotate(45deg);
    animation-delay: 0s;
    border-radius: 20% 80% 20% 80%;
}

.shape-2 {
    width: 60px;
    height: 60px;
    top: 60%;
    right: 15%;
    transform: rotate(30deg);
    animation-delay: 2s;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.shape-3 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 20%;
    transform: rotate(60deg);
    animation-delay: 4s;
    border-radius: 50%;
}

.shape-4 {
    width: 70px;
    height: 70px;
    top: 40%;
    right: 30%;
    transform: rotate(90deg);
    animation-delay: 6s;
    clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
}

@keyframes floatShape {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.6;
    }
    25% {
        transform: translate(30px, -30px) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translate(-20px, 20px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translate(20px, 30px) rotate(270deg);
        opacity: 1;
    }
}

/* Web Sphere - True 3D with Visible Rotation */
.web-sphere {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform-style: preserve-3d;
    perspective: 1500px;
    transform: translate(-50%, -50%);
}

/* Sphere Container with 3D layers */
.sphere-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: sphereRotate3D 6s linear infinite;
    transform-origin: center center;
}

/* Base sphere with gradient */
.sphere-inner {
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 255, 0, 1), rgba(0, 200, 0, 0.9) 35%, rgba(0, 150, 0, 0.7) 50%, rgba(0, 100, 0, 0.5) 70%, rgba(0, 50, 0, 0.3) 90%);
    box-shadow: 
        inset -50px -50px 100px rgba(0, 0, 0, 0.9),
        inset 30px 30px 60px rgba(0, 255, 0, 0.4),
        0 0 120px rgba(0, 255, 0, 0.6);
    position: relative;
    overflow: visible;
}

/* 3D Circle Layers - Horizontal (equator) */
.sphere-inner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    border: 3px solid rgba(0, 255, 0, 0.9);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotateX(90deg);
    transform-style: preserve-3d;
    animation: rotateEquator 6s linear infinite;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
    pointer-events: none;
}

/* 3D Circle Layers - Vertical (meridian) */
.sphere-inner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    border: 3px solid rgba(0, 255, 0, 0.9);
    border-radius: 50%;
    transform: translate(-50%, -50%) rotateY(90deg);
    transform-style: preserve-3d;
    animation: rotateMeridian 6s linear infinite;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
    pointer-events: none;
}

/* Additional 3D layers - visible circles */
.sphere-layer-1,
.sphere-layer-2,
.sphere-layer-3 {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 2px solid rgba(0, 255, 0, 0.8);
    transform-style: preserve-3d;
    pointer-events: none;
}

.sphere-layer-1 {
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%) rotateX(0deg);
    animation: rotateLayer1 6s linear infinite;
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.6);
}

.sphere-layer-2 {
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%) rotateY(0deg);
    animation: rotateLayer2 6s linear infinite;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.sphere-layer-3 {
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%) rotateZ(0deg);
    animation: rotateLayer3 6s linear infinite;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

/* Sphere Shadow on Ground - Moves with rotation */
.sphere-shadow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 80px;
    background: radial-gradient(ellipse, rgba(0, 255, 0, 0.4) 0%, rgba(0, 255, 0, 0.2) 30%, rgba(0, 255, 0, 0.1) 50%, transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
    transform: translate(-50%, -50%) translateY(130px) rotateX(90deg);
    animation: shadowRotate3D 6s linear infinite;
    z-index: -1;
}

.sphere-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 0, 0.5), transparent 70%);
    animation: pulseGlow 3s ease-in-out infinite;
    pointer-events: none;
    z-index: -2;
}

/* 3D Rotation Animations */
@keyframes sphereRotate3D {
    0% {
        transform: rotateY(0deg) rotateX(20deg);
    }
    100% {
        transform: rotateY(360deg) rotateX(20deg);
    }
}

@keyframes rotateEquator {
    0% {
        transform: translate(-50%, -50%) rotateX(90deg) rotateZ(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotateX(90deg) rotateZ(360deg);
    }
}

@keyframes rotateMeridian {
    0% {
        transform: translate(-50%, -50%) rotateY(90deg) rotateZ(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotateY(90deg) rotateZ(360deg);
    }
}

@keyframes rotateLayer1 {
    0% {
        transform: translate(-50%, -50%) rotateX(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotateX(360deg);
    }
}

@keyframes rotateLayer2 {
    0% {
        transform: translate(-50%, -50%) rotateY(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotateY(360deg);
    }
}

@keyframes rotateLayer3 {
    0% {
        transform: translate(-50%, -50%) rotateZ(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotateZ(360deg);
    }
}

@keyframes shadowRotate3D {
    0% {
        transform: translate(-50%, -50%) translateY(130px) rotateX(90deg) rotateZ(0deg) scale(1);
        opacity: 0.7;
    }
    25% {
        transform: translate(-50%, -50%) translateY(130px) rotateX(90deg) rotateZ(90deg) scale(0.85);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) translateY(130px) rotateX(90deg) rotateZ(180deg) scale(1);
        opacity: 0.7;
    }
    75% {
        transform: translate(-50%, -50%) translateY(130px) rotateX(90deg) rotateZ(270deg) scale(0.85);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) translateY(130px) rotateX(90deg) rotateZ(360deg) scale(1);
        opacity: 0.7;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* Skills Text Floating */
.skill-text {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(0, 255, 0, 0.9);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    animation: emergeFromDepth 4s ease-out infinite;
    white-space: nowrap;
    opacity: 0;
}

.skill-1 {
    top: 15%;
    left: 5%;
    animation-delay: 0.5s;
}

.skill-2 {
    top: 25%;
    right: 10%;
    animation-delay: 1s;
}

.skill-3 {
    top: 45%;
    left: 8%;
    animation-delay: 1.5s;
}

.skill-4 {
    top: 55%;
    right: 12%;
    animation-delay: 2s;
}

.skill-5 {
    bottom: 30%;
    left: 15%;
    animation-delay: 2.5s;
}

.skill-6 {
    bottom: 20%;
    right: 8%;
    animation-delay: 3s;
}

.skill-7 {
    top: 70%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 3.5s;
}

.skill-8 {
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 4s;
}

@keyframes emergeFromDepth {
    0% {
        opacity: 0;
        transform: translateZ(-1000px) scale(0.5);
        filter: blur(20px);
    }
    20% {
        opacity: 0.3;
        transform: translateZ(-500px) scale(0.7);
        filter: blur(10px);
    }
    50% {
        opacity: 1;
        transform: translateZ(0px) scale(1);
        filter: blur(0px);
    }
    80% {
        opacity: 0.8;
        transform: translateZ(200px) scale(1.1);
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: translateZ(500px) scale(1.2);
        filter: blur(5px);
    }
}

/* Adjust navbar and hero for 3D container */
.page-front .navbar,
.page-front .hero {
    position: relative;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUpScale {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUpRole {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}