/* ===== VARIABLES CSS ULTRA-MODERNES ===== */
:root {
    /* Couleurs principales */
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* Couleurs de texte */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    
    /* Couleurs de fond */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-backdrop: blur(20px);
    
    /* Ombres modernes */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Espacements responsifs */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Polices */
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Bordures */
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --border-radius-2xl: 1.5rem;
    --border-radius-full: 9999px;
}

/* Mode sombre */
.dark {
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-tertiary: #cbd5e1;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --glass-bg: rgba(15, 23, 42, 0.25);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.4);
}

/* ===== RESET ET BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Sélection de texte personnalisée */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-color);
}

/* Scroll personnalisé */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
}

/* ===== BARRE DE PROGRESSION MODERNE ===== */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    z-index: 9999;
    transition: width var(--transition-fast);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* ===== NAVIGATION GLASSMORPHISM ===== */
.nav-modern {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border-bottom: 1px solid var(--glass-border);
    transition: all var(--transition-normal);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-modern.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-lg);
}

.dark .nav-modern.scrolled {
    background: rgba(15, 23, 42, 0.95);
}

.nav-link {
    position: relative;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

/* Toggle thème moderne */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-normal);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* ===== MENU MOBILE MODERNE ===== */
.burger-icon {
    display: flex;
    flex-direction: column;
    width: 24px;
    height: 18px;
    cursor: pointer;
}

.burger-icon span {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    margin: 2px 0;
    transition: all var(--transition-normal);
    border-radius: var(--border-radius-full);
}

.mobile-menu-toggle.active .burger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .burger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .burger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 6rem 2rem 2rem;
}

.mobile-menu-header {
    margin-bottom: 3rem;
    text-align: center;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--border-radius-xl);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-normal);
}

.mobile-nav-link:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateX(10px);
}

.mobile-nav-link i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

/* ===== SECTIONS MODERNES ===== */
.section-modern {
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.section-alt {
    background: var(--bg-secondary);
}

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

.section-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.section-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== HERO SECTION ULTRA-MODERNE ===== */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.1) 0%, 
        rgba(139, 92, 246, 0.1) 50%, 
        rgba(236, 72, 153, 0.1) 100%);
    animation: gradientShift 8s ease-in-out infinite;
}

.particles-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particles-container::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    animation: float 6s ease-in-out infinite;
}

.particles-container::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(30px);
    animation: float 8s ease-in-out infinite reverse;
}

.hero-content {
    position: relative;
    z-index: 10;
}

.hero-greeting {
    font-size: 1.125rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-name {
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: 1rem;
}

.typewriter-container {
    height: 3rem;
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.typewriter {
    font-weight: 700;
    border-right: 3px solid var(--primary-color);
    animation: blink 1s infinite;
    white-space: nowrap;
    overflow: hidden;
}

.hero-subtitle {
    margin-bottom: 2rem;
    max-width: 600px;
}

/* Statistiques hero */
.hero-stats {
    margin: 2rem 0;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    padding: 1rem;
    text-align: center;
    transition: all var(--transition-normal);
}

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

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: block;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Boutons modernes */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: var(--border-radius-xl);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-3px);
}

/* Image de profil moderne */
.profile-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}

.profile-frame {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--glass-border);
    box-shadow: var(--shadow-2xl);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.profile-frame:hover .profile-img {
    transform: scale(1.1);
}

.profile-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.2) 0%, 
        rgba(139, 92, 246, 0.2) 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.profile-frame:hover .profile-overlay {
    opacity: 1;
}

.profile-ring {
    position: absolute;
    inset: -10px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: rotate 10s linear infinite;
}

/* Badges flottants */
.floating-badges {
    position: absolute;
    inset: 0;
}

.floating-badge {
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: float 4s ease-in-out infinite;
}

.badge-ai {
    top: 10%;
    left: -20%;
    animation-delay: 0s;
}

.badge-ml {
    top: 50%;
    right: -30%;
    animation-delay: 1s;
}

.badge-neuro {
    bottom: 20%;
    left: -10%;
    animation-delay: 2s;
}

.floating-badge i {
    font-size: 1rem;
    color: var(--primary-color);
}

/* Indicateur de scroll moderne */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.scroll-wheel {
    width: 24px;
    height: 40px;
    border: 2px solid currentColor;
    border-radius: 12px;
    position: relative;
}

.scroll-dot {
    width: 4px;
    height: 8px;
    background: currentColor;
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollAnimation 2s infinite;
}

.scroll-text {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@keyframes scrollAnimation {
    0% { opacity: 1; top: 6px; }
    50% { opacity: 0.5; top: 16px; }
    100% { opacity: 0; top: 26px; }
}

/* ===== RESPONSIVE DESIGN ULTRA-MODERNE ===== */

/* Mobile small (320px - 374px) */
@media (max-width: 374px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-name {
        font-size: 2.5rem;
    }
    
    .profile-container {
        width: 200px;
        height: 200px;
    }
    
    .floating-badge {
        display: none;
    }
    
    .section-modern {
        padding: 4rem 0;
    }
}

/* Mobile medium (375px - 424px) */
@media (min-width: 375px) and (max-width: 424px) {
    .hero-name {
        font-size: 3rem;
    }
    
    .profile-container {
        width: 220px;
        height: 220px;
    }
    
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

/* Mobile large (425px - 767px) */
@media (min-width: 425px) and (max-width: 767px) {
    .hero-name {
        font-size: 3.5rem;
    }
    
    .profile-container {
        width: 250px;
        height: 250px;
    }
    
    .floating-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 0 2rem;
    }
    
    .hero-content {
        gap: 3rem;
    }
    
    .hero-name {
        font-size: 4rem;
    }
    
    .profile-container {
        width: 280px;
        height: 280px;
    }
}

/* Laptop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .container {
        max-width: 1024px;
        padding: 0 2rem;
    }
    
    .hero-name {
        font-size: 5rem;
    }
    
    .profile-container {
        width: 320px;
        height: 320px;
    }
}

/* Desktop large (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
        padding: 0 3rem;
    }
    
    .hero-name {
        font-size: 6rem;
    }
    
    .profile-container {
        width: 400px;
        height: 400px;
    }
    
    .section-modern {
        padding: 8rem 0;
    }
}

/* Orientations spécifiques */
@media (orientation: landscape) and (max-height: 600px) {
    .hero-section {
        min-height: auto;
        padding: 6rem 0 3rem;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .profile-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Préférences utilisateur */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .typewriter {
        animation: none;
        border-right: none;
    }
    
    .floating-badge {
        animation: none;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f8fafc;
        --text-secondary: #e2e8f0;
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
    }
}

/* ===== ANIMATIONS KEYFRAMES ===== */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(5px) rotate(-1deg); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes blink {
    0%, 50% { border-color: var(--primary-color); }
    51%, 100% { border-color: transparent; }
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible pour la navigation clavier */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

/* Amélioration des contrastes */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.9);
        --glass-border: rgba(0, 0, 0, 0.3);
    }
    
    .dark {
        --glass-bg: rgba(0, 0, 0, 0.9);
        --glass-border: rgba(255, 255, 255, 0.3);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .nav-modern,
    .mobile-menu,
    .scroll-indicator,
    .floating-badges,
    .particles-container {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .section-modern {
        padding: 2rem 0;
        break-inside: avoid;
    }
}
