/* ============================================
   VARIABLES & RESET
   ============================================ */

:root {
    /* Couleurs */
    --primary: #2563eb;
    --secondary: #1e293b;
    --accent: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border: #334155;

    /* Espacements */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Typographie */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHIE
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: 1.25rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    margin: var(--spacing-sm) auto 0;
    border-radius: 2px;
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(37, 99, 235, 0.1);
}

.nav-link.active {
    color: var(--primary);
}

.nav-link.cta {
    background: var(--primary);
    color: white;
}

.nav-link.cta:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Burger menu pour mobile */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.btn-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ============================================
   BADGES / TAGS
   ============================================ */

.tag {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.tag.active {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(37, 99, 235, 0.2);
    background: var(--primary);
    color: white;
    cursor: pointer;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: var(--spacing-sm) 0;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: var(--spacing-md);
    border: 1px solid var(--border);
    transition: var(--transition);
    height: 100%;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 400px;
    width: 100%;
}

/* .card img {
    max-height: 180px;
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
} */

.card img {
    width: 100%;
    height: 200px;
    /* Force une hauteur fixe */
    object-fit: cover;
    /* Recadre l'image proprement sans l'écraser */
    border-radius: 8px;
    margin-bottom: 1rem;
}


.card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.2);
}

.card.hidden {
    display: none;
    opacity: 0;
}

.card ul {
    list-style-type: none;
    padding-left: 0;
}

.card ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.card ul li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* ============================================
   Photo
   ============================================ */

.photo-profile {
    width: 300px;
    height: 300px;
    background: var(--bg-card);
    object-fit: cover;
    border-radius: 20px;
    border: 2px solid var(--primary);
    display: flex;
}


/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    display: grid;
    gap: var(--spacing-md);
    justify-content: start;
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: var(--secondary);
    border-top: 1px solid var(--border);
    padding: var(--spacing-lg) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.footer-section h4 {
    margin-bottom: var(--spacing-sm);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.social-links {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.social-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    color: var(--primary);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* =============================================
   RESPONSIVE - TABLETTES ET MOBILES (< 768px)
   ============================================= */
@media (max-width: 768px) {

    /* 1. Ajustement du Header */
    .nav {
        flex-direction: column;
        /* Empile le logo et le menu verticalement */
        padding: 15px;
        height: auto;
        /* Permet au header de s'agrandir en hauteur */
    }

    .nav-menu {
        margin-top: 15px;
        gap: 10px;
        flex-wrap: wrap;
        /* Permet aux liens de passer à la ligne si besoin */
        justify-content: center;
    }

    .nav-link {
        font-size: 14px;
        /* Un peu plus petit pour que ça tienne */
        padding: 5px 8px;
    }

    /* 2. Ajustement de la grille projet (Template) */
    /* On cible la grille qui a 2 colonnes (description et sidebar) */
    .grid-2 {
        grid-template-columns: 1fr !important;
        /* Force une seule colonne */
        gap: 30px;
    }

    /* Optionnel : Ajuster les titres sur mobile pour qu'ils ne soient pas trop gros */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    /* On s'assure que les images de la galerie ne débordent pas */
    .grid-3 {
        grid-template-columns: 1fr !important;
    }
}