/* --- 1. VARIABLES & DESIGN SYSTEM --- */
/* Thème clair (défaut) et thème sombre partagent les mêmes noms de variables
   (contrainte : publier.js et blog/site-internet-artisan-ile-de-france.html
   les référencent directement) — seules les valeurs changent sous [data-theme="dark"]. */
:root {
    /* Couleurs Fond (thème clair — off-white, pas de blanc pur) */
    --bg-dark: #f5f7fa;       /* fond de page */
    --bg-card: #ffffff;       /* surface élevée : cartes, modales, panneaux */
    --bg-glass: rgba(255, 255, 255, 0.75);

    /* Couleurs Accent */
    --primary: #2563eb;       /* Bleu électrique — gardé */
    --primary-hover: #1d4ed8;
    --secondary: #1d4ed8;

    /* Typographie (noms historiques conservés pour ne pas casser publier.js / les articles) */
    --text-white: #0f172a;    /* titres (quasi-noir en light) */
    --text-muted: #52606d;
    --text-body: #334155;     /* texte de contenu (listes, paragraphes de cartes) */

    /* Effets */
    --glass-blur: blur(20px);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-light: 1px solid var(--border-color);
    --shadow-color: rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 50px rgba(37, 99, 235, 0.12);
    --radius: 16px;

    color-scheme: light;
}

[data-theme="dark"] {
    /* Fonds bleu nuit — pas de noir pur */
    --bg-dark: #0a0e1a;
    --bg-card: #0f1420;
    --bg-glass: rgba(15, 20, 32, 0.75);

    --primary: #3b82f6;       /* légèrement éclairci pour la lisibilité sur fond sombre */
    --primary-hover: #60a5fa;
    --secondary: #60a5fa;

    --text-white: #f1f5f9;
    --text-muted: #94a3b8;
    --text-body: #cbd5e1;

    --border-color: rgba(255, 255, 255, 0.09);
    --shadow-color: rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 50px rgba(59, 130, 246, 0.18);

    color-scheme: dark;
}

/* --- 2. RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Transition douce entre thèmes clair/sombre — ciblée, pas de transition:all
   qui casserait les micro-interactions hover des boutons/cards. */
body, header, footer,
.pricing-card, .project-card-thumb, .modal-content, .blog-card,
.detail-card, .faq-item, .contact-form, .info-box, .service-card,
.comparison-table, .comparison-table th, .comparison-table td {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
/* Désactivée le temps du tout premier rendu pour éviter un flash animé au chargement */
.no-theme-transition, .no-theme-transition * {
    transition: none !important;
}

h1, h2, h3 { font-weight: 800; letter-spacing: -0.03em; color: var(--text-white); }
h1 { font-weight: 900; letter-spacing: -0.04em; }
p { color: var(--text-muted); margin-bottom: 20px; font-size: 1.05rem; }

/* Invisible pour les visiteurs, lisible par Google et lecteurs d'écran */
.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;
}
a { text-decoration: none; transition: 0.3s; }
ul { list-style: none; }

section { padding: 120px 6%; position: relative; z-index: 1; }

/* --- 3. COMPONENTS --- */

/* Titres avec dégradé */
.text-gradient {
    background: linear-gradient(135deg, var(--text-white) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header { text-align: center; max-width: 800px; margin: 0 auto 80px; }
.section-header h2 { font-size: 3rem; margin-bottom: 20px; }
.accent-line {
    width: 60px; height: 4px; background: var(--primary);
    margin: 0 auto 20px auto; border-radius: 2px;
}

/* Badge pilule (utilisé par le hero portfolio + le CTA final portfolio) */
.hero-tag {
    display: inline-block; padding: 8px 16px; border-radius: 30px;
    background: rgba(37, 99, 235, 0.08); border: 1px solid rgba(37, 99, 235, 0.25);
    color: var(--primary); font-size: 0.85rem; font-weight: 600; margin-bottom: 30px;
}

/* Boutons "Next Gen" */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 32px; border-radius: 50px; font-weight: 600; cursor: pointer; border: none;
    transition: all 0.3s ease; font-size: 1rem; position: relative; overflow: hidden;
}
.btn-primary {
    background: var(--primary); color: white;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.5);
}
.btn-primary::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transform: translateX(-150%) skewX(-20deg);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.4), 0 15px 35px -5px rgba(37, 99, 235, 0.5);
    background: var(--primary-hover);
}
.btn-primary:hover::after { animation: shimmer 0.65s ease forwards; }
@keyframes shimmer { to { transform: translateX(200%) skewX(-20deg); } }
.btn-outline {
    background: transparent; border: 1px solid var(--border-color); color: var(--text-white);
    width: 100%; justify-content: center;
}
.btn-outline:hover { border-color: var(--primary); background: rgba(37,99,235,0.05); color: var(--primary); }

/* Classes utilitaires */
.btn-fullwidth { width: 100%; }
.contact-nav-btn { padding: 10px 24px; font-size: 0.9rem; }
.paper-plane-icon { margin-left: 10px; }

/* --- 4. NAVBAR PREMIUM --- */
header {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    padding: 20px 6%; display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur); /* Flou derrière la navbar */
    border-bottom: var(--border-light);
    transition: 0.3s;
}

.logo { display: flex; align-items: center; }
/* Le logo source est blanc (pensé pour fond sombre) : on l'assombrit en CSS pour le thème clair,
   et on retire le filtre en dark mode pour retrouver le blanc d'origine. */
.logo img { height: 40px; width: auto; filter: brightness(0); transition: filter 0.3s ease; }
[data-theme="dark"] .logo img { filter: none; }

nav ul { display: flex; gap: 35px; align-items: center; }
nav a { font-size: 0.95rem; font-weight: 500; color: var(--text-body); position: relative; }
nav a:hover { color: var(--text-white); }
nav a::after {
    content:''; position: absolute; width: 0; height: 2px; bottom: -5px; left: 0;
    background: var(--primary); transition: 0.3s;
}
nav a:hover::after { width: 100%; }

/* Hamburger toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-white);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

header.scrolled {
    background: var(--bg-glass);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    box-shadow: 0 1px 40px var(--shadow-color);
}

/* --- TOGGLE THÈME CLAIR / SOMBRE --- */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    position: relative;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--bg-card); border: 1px solid var(--border-color);
    color: var(--text-muted); cursor: pointer;
    margin-left: 18px; flex-shrink: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-2px); }
.theme-toggle i { font-size: 0.95rem; position: absolute; transition: opacity 0.25s ease, transform 0.35s ease; }
.theme-toggle .icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
.theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

/* --- FOOTER --- */
footer {
    border-top: var(--border-light); padding: 50px 6% 30px; background: var(--bg-card);
    text-align: center; color: var(--text-muted); font-size: 0.9rem;
}

/* Logo Footer Réduit */
.footer-logo {
    height: 70px; /* Petit et discret */
    width: auto; opacity: 0.8; margin-bottom: 20px;
    filter: brightness(0); /* logo source blanc, assombri pour le thème clair */
    transition: filter 0.3s ease;
}
[data-theme="dark"] .footer-logo { filter: none; }

.footer-links .footer-link { color: var(--text-muted); margin: 0 10px; }
.footer-villes {
    opacity: 0.2; font-size: 0.7rem; letter-spacing: 0.03em;
    margin-top: 14px; margin-bottom: 0; color: var(--text-muted); line-height: 2;
}

/* --- RESPONSIVE (navbar/menu partagés par toutes les pages) --- */
@media (max-width: 992px) {
    .menu-toggle { display: flex; }
    nav {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        -webkit-backdrop-filter: var(--glass-blur);
        backdrop-filter: var(--glass-blur);
        border-bottom: var(--border-light);
        padding: 10px 6% 24px;
        z-index: 999;
    }
    nav.nav-open { display: block; }
    nav ul { flex-direction: column; gap: 0; align-items: flex-start; }
    nav ul li { width: 100%; border-bottom: 1px solid var(--border-color); }
    nav ul li:last-child { border-bottom: none; }
    nav ul li a { display: block; padding: 16px 0; font-size: 1rem; }
    nav ul li a::after { display: none; }
    nav ul li:last-child a.btn { display: inline-block; margin-top: 16px; padding: 12px 28px; }
}

/* --- ACCESSIBILITÉ : respect de prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    [data-aos] {
        transform: none !important;
        clip-path: none !important;
        opacity: 1 !important;
    }
}
