/* =========================================
   VARIABLES & DESIGN SYSTEM
   ========================================= */
:root {
    --bg-color: #ffffff;
    --text-main: #1d1d1f;
    --text-muted: #86868b;

    --accent-light: #ffedd5;
    --accent-main: #ffb480;
    --accent-dark: #f08a5d;

    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    --card-bg-dark: rgba(20, 20, 25, 0.85);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* =========================================
   RESET & BASE UTILS
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }
html {
    /* 1.5x Dezoom demandé (16px base -> 11px) */
    font-size: 11px; 
    scroll-behavior: smooth; overflow-x: hidden; 
}
body {
    background-color: var(--bg-color); color: var(--text-main); font-family: var(--font-body);
    line-height: 1.6; overflow-x: hidden; width: 100%; position: relative; -webkit-font-smoothing: antialiased;
}

/* Custom Cursor */
#cursor, #cursor-aura {
    position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;
    border-radius: 50%; transform: translate(-50%, -50%); transition: width 0.3s, height 0.3s, background-color 0.3s;
}
#cursor { width: 14px; height: 14px; background-color: var(--accent-dark); }
#cursor-aura { width: 60px; height: 60px; border: 2px solid var(--accent-main); transition: transform 0.1s ease-out, width 0.3s, height 0.3s, border-color 0.3s, background-color 0.3s; }
.hovering #cursor-aura { width: 80px; height: 80px; background-color: rgba(255, 180, 128, 0.3); border-color: transparent; }

/* Background Canvas */
#scroll-canvas {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; max-width: 800px; height: auto;
    z-index: -2; opacity: 0.12; pointer-events: none; mix-blend-mode: multiply;
}

.dots-pattern {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: -1;
    background-image: radial-gradient(var(--text-muted) 1px, transparent 1px); background-size: 40px 40px; opacity: 0.1; pointer-events: none;
}
.bg-gradient-spot { position: fixed; border-radius: 50%; filter: blur(80px); z-index: -3; animation: drift 20s infinite alternate linear; }
.spot-1 { width: 40vw; height: 40vw; background: var(--accent-light); top: 10%; left: 0%; }
.spot-2 { width: 60vw; height: 60vw; max-width: 600px; max-height: 600px; background: rgba(255, 180, 128, 0.4); bottom: -10%; right: -10%; animation-duration: 25s; }
.spot-3 { width: 300px; height: 300px; background: rgb(240, 138, 93, 0.2); top: 40%; left: 40%; animation-duration: 15s; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(5vw, 5vh) scale(1.2); } }

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, .logo-text { font-family: var(--font-heading); }
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 6rem 0; position: relative; width: 100%; }
.section-title { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; margin-bottom: 3rem; text-align: center; }
.text-light { color: #fff; }
.gradient-text { background: linear-gradient(135deg, var(--accent-dark), var(--accent-main)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.reveal-text { opacity: 0; transform: translateY(30px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-text.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.2s; } .delay-2 { transition-delay: 0.4s; } .delay-3 { transition-delay: 0.6s; }

/* =========================================
   COMPONENTS
   ========================================= */
.glass-card {
    background: var(--glass-bg); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border); border-radius: 24px; box-shadow: var(--glass-shadow); padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease; width: 100%;
}
.glass-card:hover { box-shadow: 0 15px 40px 0 rgba(31, 38, 135, 0.1); }
.bouncy-hover { transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease; }
.bouncy-hover:hover { transform: scale(1.05) translateY(-5px); box-shadow: 0 25px 50px -12px rgba(240, 138, 93, 0.3); z-index: 10; }

.btn-primary, .btn-secondary, .btn-small {
    display: inline-flex; align-items: center; justify-content: center; padding: 1.2rem 2.5rem; border-radius: 30px;
    font-weight: 600; text-decoration: none; transition: all 0.3s ease; border: none; text-align: center; font-size: 1.1rem;
}
.btn-primary { background: var(--text-main); color: #fff; }
.btn-primary:hover { background: var(--accent-main); color: var(--text-main); transform: scale(1.05); }
.btn-secondary { background: transparent; color: var(--text-main); border: 2px solid var(--text-main); }
.btn-secondary:hover { background: var(--text-main); color: #fff; transform: scale(1.05); }
.text-center { text-align: center; }

/* =========================================
   NAVBAR - FLOATING PILL
   ========================================= */
#navbar {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 1400px; height: 90px;
    background: rgba(255, 255, 255, 0.5); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    z-index: 1000; border-radius: 45px; border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 15px 40px rgba(0,0,0,0.08); 
}
#navbar.scrolled {
    top: 10px; height: 75px; width: 95%; background: rgba(255, 255, 255, 0.65); border-radius: 37px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.nav-container { width: 100%; height: 100%; padding: 0 2.5rem; display: flex; justify-content: space-between; align-items: center; }
.logo-container { display: flex; align-items: center; gap: 15px; text-decoration: none; color: var(--text-main); z-index: 1001; }
.nav-logo { height: 55px; width: 55px; border-radius: 18px; object-fit: cover; transition: 0.3s; }
#navbar.scrolled .nav-logo { height: 45px; width: 45px; border-radius: 14px; }
.logo-text { font-weight: 900; font-size: 1.5rem; letter-spacing: -0.5px; }

.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a.hover-link { text-decoration: none; color: var(--text-main); font-weight: 600; font-size: 1.1rem; position: relative; }
.nav-links a.hover-link::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: var(--text-main); transition: width 0.3s ease; }
.nav-links a.hover-link:hover::after { width: 100%; }
.nav-links a.active::after { width: 100%; background: var(--accent-main); }

/* Language Slider */
.lang-toggle {
    display: flex; align-items: center; background: rgba(0,0,0,0.08); border-radius: 20px;
    padding: 4px; cursor: pointer; position: relative; width: 90px; justify-content: space-between; margin-left: 20px;
}
.lang-toggle .lang-opt { width: 50%; text-align: center; font-size: 0.85rem; font-weight: 800; z-index: 2; transition: color 0.3s; color: var(--text-muted); }
.lang-toggle.en-active .lang-opt:nth-child(3) { color: var(--text-main); }
.lang-toggle:not(.en-active) .lang-opt:nth-child(2) { color: var(--text-main); }
.lang-toggle .slider-bg {
    position: absolute; top: 4px; left: 4px; width: 40px; height: 24px; background: #fff;
    border-radius: 16px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); z-index: 1;
}
.lang-toggle.en-active .slider-bg { transform: translateX(42px); }

/* =========================================
   HERO (HOME)
   ========================================= */
.hero { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 130px; text-align: center; }
.hero-content { max-width: 1000px; display: flex; flex-direction: column; align-items: center; }
.hero-title { font-size: clamp(4rem, 8vw, 7.5rem); line-height: 1.1; letter-spacing: -2px; margin-bottom: 2rem; font-weight: 900; }
.hero-subtitle { font-size: clamp(1.2rem, 2.5vw, 1.8rem); color: var(--text-main); font-weight: 500; margin-bottom: 3rem; max-width: 800px; }
.hero-actions { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }

.radar-wrapper { margin-top: 5rem; display: flex; justify-content: center; align-items: center; width: 100%; transition: all 0.3s; }
#skills-radar { max-width: 700px; width: 100%; height: auto; }

.personal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 4rem; width: 100%; }
.perso-card { text-align: left; }
.perso-card h3 { color: var(--accent-dark); margin-bottom: 0.5rem; font-size: 1.4rem; }

/* =========================================
   PAGES SPECIFICS
   ========================================= */
.page-header { padding-top: 160px; padding-bottom: 40px; text-align: center; }

/* Timeline Alternée (Arbre Central) */
.timeline-vertical {
    position: relative; margin: 5rem auto; max-width: 1000px; padding: 0;
}
.timeline-vertical::after {
    content: ''; position: absolute; width: 4px; background: rgba(255, 180, 128, 0.4);
    top: 0; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 1;
}
.timeline-step {
    position: relative; margin-bottom: 6rem; display: flex; justify-content: space-between; align-items: center; width: 100%;
}
.timeline-step:nth-child(even) { flex-direction: row-reverse; }
.timeline-content {
    width: 45%; position: relative; z-index: 3;
}
.timeline-marker {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 24px; height: 24px; border-radius: 50%; background: var(--accent-main);
    border: 4px solid var(--glass-bg); box-shadow: 0 0 0 4px rgba(255, 180, 128, 0.3); z-index: 2;
}
.timeline-content h2 { margin-bottom: 0.5rem; color: var(--accent-dark); font-size: 2rem; }
.timeline-content h3 { font-size: 1.4rem; color: var(--text-main); margin-bottom: 1rem; }
.timeline-content img { border-radius: 12px; margin-top: 1rem; max-width: 100%; height: auto; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

/* CONTACT Custom Grid 3/2 */
.contact-links-grid {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; max-width: 1000px; margin: 0 auto; margin-top: 4rem;
}
.contact-links-grid .social-btn {
    width: calc(33.333% - 2rem); min-width: 260px;
}
/* Forcer les derniers éléments au centre */
.social-btn { padding: 3rem 2rem; text-align: center; text-decoration: none; color: var(--text-main); display: flex; flex-direction: column; align-items: center; gap: 1rem; font-weight: 800; font-size: 1.5rem; border-radius: 40px; }

/* API Labs V2 */
.api-clean-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 2rem; }
.api-endpoint { background: #0c0c0c; color: #4ade80; font-family: monospace; padding: 2rem; border-radius: 16px; position: relative; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.3); text-align: left; }
.api-endpoint h3 { color: white; margin-bottom: 1rem; font-family: var(--font-heading); font-size: 1.5rem; }
.api-endpoint pre { font-size: 1.1rem; opacity: 0.8; margin-bottom: 1rem; }
.live-pulse { width: 12px; height: 12px; background: #ef4444; border-radius: 50%; display: inline-block; animation: pulseRed 1.5s infinite; margin-right: 10px; }
@keyframes pulseRed { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

/* COMPETENCES */
.comp-category h2 { font-size: 2.6rem; margin-bottom: 2rem; color: var(--text-main); border-bottom: 2px solid var(--accent-light); padding-bottom: 0.5rem; display: inline-block; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.5rem; }

/* PROJETS SaaS */
.project-showcase { display: flex; align-items: center; gap: 4rem; margin-bottom: 6rem; padding: 4rem 3rem; border-radius: 40px; }
.project-showcase.reverse { flex-direction: row-reverse; }
.project-info { flex: 1; }
.project-info h3 { font-size: 3.2rem; margin-bottom: 1rem; }
.project-desc { font-size: 1.3rem; margin-bottom: 1.5rem; color: var(--text-main); }
.tech-stack { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.badge { background: rgba(255, 180, 128, 0.3); color: var(--text-main); padding: 0.5rem 1.2rem; border-radius: 20px; font-size: 1.1rem; font-weight: 700; }
.project-visual { flex: 1; perspective: 1000px; width: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; border-radius: 20px; }
.mockup-img { width: 100%; height: auto; max-height: 350px; object-fit: cover; border-radius: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.15); transition: 0.5s ease; }

/* MEDIA QUERIES */
.hamburger { display: none; cursor: pointer; z-index: 1001; }
.hamburger span { display: block; width: 32px; height: 4px; background: var(--text-main); transition: 0.3s; margin-bottom: 6px; border-radius: 3px; }

@media (max-width: 1024px) {
    #navbar { width: 95%; }
    .project-showcase, .project-showcase.reverse { flex-direction: column; text-align: center; padding: 2rem; }
    .project-visual { margin-top: 2rem; }
    .mockup-img { max-height: 300px; }
    .timeline-vertical::after { left: 20px; }
    .timeline-step, .timeline-step:nth-child(even) { flex-direction: column; align-items: flex-start; padding-left: 60px; }
    .timeline-content { width: 100%; }
    .timeline-marker { left: 20px; }
}

@media (max-width: 768px) {
    .nav-container { padding: 0 1.5rem; }
    .nav-logo { height: 40px; width: 40px; }
    .hero { padding-top: 140px; }
    .hero-title { font-size: 4rem; }
    #navbar { top: 10px; border-radius: 20px; }
    
    .nav-links {
        display: none; position: absolute; top: 80px; left: 0; width: 100%;
        background: rgba(255, 255, 255, 0.98); flex-direction: column; padding: 2rem 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); border-radius: 20px;
    }
    .hamburger { display: block; }
    .nav-links.active { display: flex; }
    .contact-links-grid .social-btn { width: 100%; }
}