/* ============================================
   THE NERD COMPANY - PREMIUM STYLESHEET
   World-Class Design System
   ============================================ */

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

:root {
    /* Light Mode Colors */
    --background: hsl(0, 0%, 100%);
    --foreground: hsl(0, 0%, 0%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(0, 0%, 0%);
    --primary: hsl(0, 0%, 0%);
    --primary-foreground: hsl(0, 0%, 100%);
    --secondary: hsl(0, 0%, 96%);
    --secondary-foreground: hsl(0, 0%, 0%);
    --muted: hsl(0, 0%, 96%);
    --muted-foreground: hsl(0, 0%, 45%);
    --accent: hsl(0, 0%, 96%);
    --accent-foreground: hsl(0, 0%, 0%);
    --border: hsl(0, 0%, 92%);
    --input: hsl(0, 0%, 92%);
    --ring: hsl(0, 0%, 0%);
    --radius: 1rem;
    
    /* Design Tokens */
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --shadow-subtle: 0 2px 20px rgba(0, 0, 0, 0.08);
    --shadow-elevated: 0 4px 40px rgba(0, 0, 0, 0.12);
    --shadow-premium: 0 10px 60px rgba(0, 0, 0, 0.15);
}

/* Dark Mode - Palette bleu marine */
[data-theme="dark"] {
    --background: hsl(222, 47%, 11%);      /* #020617 */
    --foreground: hsl(210, 40%, 96%);      /* #e5e7eb */
    --card: hsl(222, 47%, 15%);            /* #0f172a */
    --card-foreground: hsl(210, 40%, 96%);
    --primary: hsl(199, 89%, 60%);         /* #38bdf8 */
    --primary-foreground: hsl(222, 47%, 11%);
    --secondary: hsl(222, 47%, 16%);
    --secondary-foreground: hsl(210, 40%, 96%);
    --muted: hsl(222, 47%, 16%);
    --muted-foreground: hsl(215, 20%, 75%);
    --accent: hsl(215, 25%, 27%);          /* #1e293b */
    --accent-foreground: hsl(210, 40%, 96%);
    --border: hsl(215, 25%, 40%);
    --input: hsl(215, 25%, 27%);
    --ring: hsl(199, 89%, 60%);
    --shadow-subtle: 0 2px 20px rgba(15, 23, 42, 0.6);
    --shadow-elevated: 0 4px 40px rgba(15, 23, 42, 0.8);
    --shadow-premium: 0 10px 60px rgba(8, 47, 73, 0.9);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, hsl(0, 0%, 98%) 100%);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
    cursor: none;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, hsl(0, 0%, 7%) 0%, hsl(0, 0%, 10%) 100%);
}

@media (max-width: 768px) {
    body { cursor: auto; }
}

/* Liquid Glass Cursor */
.cursor {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.3) 70%, transparent 100%);
    backdrop-filter: blur(8px) saturate(180%);
    -webkit-backdrop-filter: blur(8px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.6);
    will-change: transform;
}

[data-theme="dark"] .cursor {
    background: radial-gradient(circle, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.2) 70%, transparent 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1), inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.cursor.hover {
    transform: translate(-50%, -50%) scale(2);
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.4) 70%, transparent 100%);
}

@media (max-width: 768px) {
    .cursor, .cursor-follower { display: none; }
}

/* Dark Mode Toggle */
.theme-toggle {
    background: none;
    border: 2px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    z-index: 52;
}

.theme-toggle:hover {
    transform: rotate(180deg) scale(1.1);
    border-color: var(--foreground);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--foreground);
    transition: var(--transition-smooth);
    display: block;
}

#theme-toggle .icon-moon svg {
    transform: translateX(-0.5px);
}

/* Icônes soleil / lune synchronisées avec le thème */
#theme-toggle .icon-sun,
#theme-toggle .icon-moon {
    display: inline-flex;
}

[data-theme="light"] #theme-toggle .icon-moon { display: none; }
[data-theme="dark"] #theme-toggle .icon-sun { display: none; }

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 52;
    position: relative;
}

@media (min-width: 768px) {
    .mobile-menu-toggle { display: none; }
}

.mobile-menu-toggle span {
    width: 32px;
    height: 2px;
    background-color: var(--foreground);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* Mobile Menu Overlay avec Liquid Glass */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    z-index: 51;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

[data-theme="dark"] .mobile-menu {
    background: rgba(18, 18, 18, 0.95);
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-link {
    font-size: 2rem;
    font-weight: 600;
    color: var(--foreground);
    text-decoration: none;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease, color 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu.active .mobile-menu-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu-link:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu-link:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu-link:nth-child(4) { transition-delay: 0.4s; }

.mobile-menu-link:hover {
    color: var(--muted-foreground);
}

/* Navbar */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: var(--transition-smooth);
}

nav.scrolled {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 0.75rem 2rem;
}

[data-theme="dark"] nav.scrolled {
    background: rgba(18, 18, 18, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

nav:not(.scrolled) {
    background-color: transparent;
    padding: 1.25rem 2rem;
}

/* ... Reste du code ... */

.service-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-radius: 1.5rem;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .service-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ... Reste du code ... */

.portfolio-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 1rem;
    overflow: hidden;
    background-color: var(--muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

/* ... Reste du code ... */
.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.4), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: white;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.portfolio-item:hover .portfolio-content {
    transform: translateY(0);
}

/* Team Cards */
.team-card {
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-radius: 1.5rem;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: var(--transition-smooth);
}

[data-theme="dark"] .team-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.team-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .team-card:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.team-avatar {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    background-color: var(--foreground);
    color: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 auto 1rem;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.team-card:hover .team-avatar {
    transform: scale(1.1) rotate(5deg);
}

.team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.skill-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 9999px;
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    transition: var(--transition-smooth);
}

.team-card:hover .skill-badge {
    background-color: var(--foreground);
    color: var(--background);
}

/* Amélioration visibilité textes dark mode */
[data-theme="dark"] .service-title,
[data-theme="dark"] .team-name,
[data-theme="dark"] .portfolio-title,
[data-theme="dark"] .process-title,
[data-theme="dark"] .whyus-title,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
    color: hsl(0, 0%, 98%);
}

[data-theme="dark"] .service-desc,
[data-theme="dark"] .team-role,
[data-theme="dark"] .process-desc,
[data-theme="dark"] p {
    color: hsl(0, 0%, 75%);
}

[data-theme="dark"] .portfolio-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Boutons en mode sombre */
[data-theme="dark"] .btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

[data-theme="dark"] .btn-cta {
    background-color: var(--background);
    color: var(--foreground);
    border-color: var(--foreground);
}

[data-theme="dark"] .btn-outline {
    color: var(--foreground);
    border-color: var(--border);
}

/* Process numbers en mode sombre */
[data-theme="dark"] .process-number {
    background-color: var(--foreground);
    color: var(--background);
}

/* FAQ en mode sombre */
[data-theme="dark"] .faq-question {
    color: var(--foreground);
}

/* Footer en mode sombre */
[data-theme="dark"] .footer-text,
[data-theme="dark"] .footer-link {
    color: var(--muted-foreground);
}

/* Keyboard Navigation Focus */
body.keyboard-nav *:focus {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
