/*
╔══════════════════════════════════════════════════════════════╗
║  SOMMAIRE - GLOBAL.CSS                                       ║
╠══════════════════════════════════════════════════════════════╣
║  1. Variables CSS (couleurs, typographie, espacements)       ║
║  2. Reset et base                                            ║
║  3. Typographie                                              ║
║  4. Layout (container, grilles)                              ║
║  5. Header et navigation                                     ║
║  6. Boutons                                                  ║
║  7. Footer                                                   ║
║  8. Utilitaires (animations, reveal, transitions)            ║
║  9. Responsive                                               ║
╚══════════════════════════════════════════════════════════════╝
*/

/* ═══════════════════════════════════════════════════════════════
   1. VARIABLES CSS
   ═══════════════════════════════════════════════════════════════ */
:root {
    /* Palette principale - Mode sombre (défaut) */
    --color-bg-primary: #0B0B0D;
    --color-bg-secondary: #111217;
    --color-bg-tertiary: #1a1b21;
    --color-bg-card: #16171c;
    
    --color-text-primary: #EDEDED;
    --color-text-secondary: #BDBDBD;
    --color-text-muted: #6E6E6E;
    
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.15);
    
    /* Accents (dégradés gris subtils) */
    --color-accent: #EDEDED;
    --color-accent-secondary: #BDBDBD;
    --gradient-subtle: linear-gradient(135deg, #2a2b32 0%, #1a1b21 100%);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
    
    /* Ombres */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(237, 237, 237, 0.1);
    
    /* Typographie */
    --font-primary: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Share Tech Mono', 'Fira Code', monospace;
    
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.125rem;
    --fs-lg: 1.25rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 2rem;
    --fs-3xl: 2.5rem;
    --fs-4xl: 3rem;
    --fs-5xl: 4rem;
    
    --fw-light: 300;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    
    /* Espacements */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Rayons de bordure */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-smooth: 600ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index */
    --z-dropdown: 100;
    --z-header: 200;
    --z-modal: 300;
    --z-loader: 400;
    
    /* Tailles fixes */
    --header-height: 70px;
    --container-max: 1200px;
}

/* ═══════════════════════════════════════════════════════════════
   2. RESET ET BASE
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

body.loading {
    overflow: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-base);
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

::selection {
    background-color: var(--color-accent);
    color: var(--color-bg-primary);
}

/* ═══════════════════════════════════════════════════════════════
   3. TYPOGRAPHIE
   ═══════════════════════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--fw-semibold);
    line-height: 1.2;
    color: var(--color-text-primary);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

strong {
    font-weight: var(--fw-semibold);
    color: var(--color-text-primary);
}

.highlight {
    color: var(--color-accent);
    position: relative;
}

code, .mono {
    font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════════════════════
   4. LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.main {
    min-height: 100vh;
    padding-top: var(--header-height);
}

.section-page {
    padding: var(--space-4xl) 0;
    min-height: calc(100vh - var(--header-height));
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-title {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-md);
}

.section-subtitle {
    font-size: var(--fs-lg);
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════
   5. HEADER ET NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(11, 11, 13, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    z-index: var(--z-header);
    transition: transform var(--transition-base), background var(--transition-base);
}

.header.hidden {
    transform: translateY(-100%);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: var(--fw-semibold);
    transition: opacity var(--transition-base);
}

.header-logo:hover {
    opacity: 0.8;
}

.logo-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gradient-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
}

.logo-name {
    font-size: var(--fs-md);
    display: none;
}

.logo-highlight {
    color: var(--color-text-muted);
    font-weight: var(--fw-regular);
    margin-left: var(--space-xs);
}

.nav {
    display: none;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.nav-link i {
    font-size: var(--fs-base);
}

.nav-link span {
    display: none;
}

.nav-link:hover {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.hamburger {
    position: relative;
    width: 20px;
    height: 2px;
    background: var(--color-text-primary);
    border-radius: 2px;
    transition: all var(--transition-base);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-text-primary);
    border-radius: 2px;
    transition: all var(--transition-base);
}

.hamburger::before { top: -6px; }
.hamburger::after { bottom: -6px; }

.nav-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
    bottom: 0;
    transform: rotate(-45deg);
}

.scroll-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--color-accent);
    width: 0%;
    transition: width 50ms linear;
}

/* ═══════════════════════════════════════════════════════════════
   6. BOUTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-text-primary);
    color: var(--color-bg-primary);
    border: 1px solid transparent;
}

.btn-primary:hover {
    background: var(--color-text-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-border-hover);
    transform: translateY(-2px);
}

.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--fs-xs);
}

.btn i {
    font-size: 0.9em;
}

/* ═══════════════════════════════════════════════════════════════
   7. FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    padding: var(--space-xl) 0;
}

.footer-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    text-align: center;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
}

.footer-name {
    font-weight: var(--fw-medium);
    color: var(--color-text-primary);
}

.footer-separator {
    color: var(--color-text-muted);
}

.footer-social {
    display: flex;
    gap: var(--space-md);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    transition: all var(--transition-base);
}

.social-link:hover {
    color: var(--color-text-primary);
    border-color: var(--color-border-hover);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.footer-copyright {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   8. UTILITAIRES
   ═══════════════════════════════════════════════════════════════ */

/* Animation reveal au scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-smooth), transform var(--transition-smooth);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Délais d'animation */
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }

/* Tags / badges */
.tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
}

/* Coins décoratifs pour les cartes */
.card-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--color-border);
    border-style: solid;
    border-width: 0;
    pointer-events: none;
    transition: border-color var(--transition-base);
}

.card-corner.top-left {
    top: -1px;
    left: -1px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.card-corner.top-right {
    top: -1px;
    right: -1px;
    border-top-width: 2px;
    border-right-width: 2px;
}

.card-corner.bottom-left {
    bottom: -1px;
    left: -1px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.card-corner.bottom-right {
    bottom: -1px;
    right: -1px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

/* Modal global */
.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
    animation: modalEnter var(--transition-base) ease-out;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    font-size: var(--fs-xl);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* ═══════════════════════════════════════════════════════════════
   9. RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Tablette */
@media (min-width: 768px) {
    :root {
        --fs-3xl: 3rem;
        --fs-4xl: 3.5rem;
    }
    
    .logo-name {
        display: block;
    }
    
    .nav-toggle {
        display: none;
    }
    
    .nav {
        display: block;
    }
    
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    :root {
        --fs-4xl: 4rem;
        --fs-5xl: 5rem;
    }
    
    .nav-link span {
        display: inline;
    }
    
    .nav-link i {
        display: none;
    }
}

/* Grand écran */
@media (min-width: 1400px) {
    :root {
        --container-max: 1320px;
    }
}

/* Mobile menu overlay */
@media (max-width: 767px) {
    .nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-bg-primary);
        padding: var(--space-xl);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all var(--transition-base);
    }
    
    .nav.active {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-list {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .nav-link {
        width: 100%;
        padding: var(--space-md);
        font-size: var(--fs-md);
    }
    
    .nav-link span {
        display: inline;
    }
    
    .section-title {
        font-size: var(--fs-2xl);
    }
}

/* Réduction des animations si préférence utilisateur */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}