:root {
    --bg-color: #070709;
    --surface-color: #121216;
    --primary-blue: #2563eb;
    --blue-gradient: linear-gradient(90deg, #3b82f6, #60a5fa);
    --primary-blue-glow: rgba(37, 99, 235, 0.4);
    --text-main: #f8fafc;
    /* Relevé de #94a3b8 → #a8b8cc : ratio WCAG AA ≥ 4.5:1 sur fond #121216 */
    --text-muted: #a8b8cc;
    --border: rgba(255, 255, 255, 0.05);
    /* Hauteur de la navbar fixe – utilisée pour le décalage des ancres */
    --nav-height: 72px;
}

/* =============================================
   RESET & BASE
   ============================================= */*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    /* Compense la navbar fixe sur tous les liens d'ancre */
    scroll-padding-top: var(--nav-height);
}

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


/* =============================================
   NAVIGATION
   ============================================= */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 8%;
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(7, 7, 9, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.nav-logo {
    height: 38px;
    width: auto;
}

.logo span {
    color: var(--primary-blue);
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 2.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--primary-blue);
    outline: none;
}

/* =============================================
   LANGUAGE SWITCHER
   ============================================= */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 2.5rem;
    flex-shrink: 0;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    padding: 4px 2px;
    text-transform: uppercase;
    transition: color 0.25s ease;
    font-family: 'Inter', sans-serif;
}

.lang-btn:hover,
.lang-btn:focus-visible {
    color: var(--text-main);
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
    border-radius: 2px;
}

.lang-btn.active {
    color: var(--primary-blue);
}

.lang-sep {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.75rem;
    user-select: none;
}

/* =============================================
   HERO
   ============================================= */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 5%;
    background: radial-gradient(circle at center, #111827 0%, var(--bg-color) 100%);
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -3px;
}

.accent {
    background: var(--blue-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typewriter::after {
    content: '|';
    color: var(--primary-blue);
    -webkit-text-fill-color: var(--primary-blue);
    animation: blink 0.7s step-end infinite;
    margin-left: 5px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 3rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    padding: 1rem 2.5rem;
    background-color: var(--primary-blue);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
}

.btn-outline:hover,
.btn-outline:focus-visible {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.5);
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--primary-blue-glow);
    outline: none;
}

.btn:active {
    transform: translateY(-1px);
}

/* Loader dans le bouton submit */
.main-btn {
    width: 100%;
    position: relative;
}

.btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

.btn.loading .btn-text {
    opacity: 0.7;
}

.btn.loading .btn-loader {
    display: block;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* =============================================
   SECTIONS COMMUNES
   ============================================= */
section {
    padding: 120px 8%;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    font-weight: 800;
    letter-spacing: -1px;
}

/* =============================================
   SCROLL REVEAL
   ============================================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* =============================================
   NAV SCROLLED
   ============================================= */
nav.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* =============================================
   SERVICES
   ============================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.service-card {
    height: 100%;
    background: var(--surface-color);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.service-card:hover {
    border-color: var(--primary-blue);
    background: #16161c;
    transform: translateY(-4px);
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* =============================================
   PORTFOLIO
   ============================================= */
.featured-project {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.project-image {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    /* Réserve l'espace avant le chargement de l'image (évite le CLS) */
    aspect-ratio: 8 / 5;
}

.project-img {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform 0.5s ease;
    object-fit: cover;
}

.featured-project:hover .project-img {
    transform: scale(1.05);
}

.project-info h3 {
    font-size: 2rem;
    margin: 1rem 0;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.tag {
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.view-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    margin-top: 1.5rem;
    display: inline-block;
    transition: color 0.3s;
}

.view-link:hover,
.view-link:focus-visible {
    color: var(--primary-blue);
    outline: none;
}

.testimonial-single {
    margin-top: 4rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.quote {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.author {
    color: var(--primary-blue);
    font-weight: 600;
}

/* =============================================
   CONTACT
   ============================================= */
.contact-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Wrapper pour chaque champ + son message d'erreur */
.field-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-error {
    font-size: 0.78rem;
    color: #f87171;
    min-height: 1em;
    display: block;
}

input, textarea {
    width: 100%;
    padding: 1.2rem;
    background: var(--surface-color);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

input:focus, textarea:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--primary-blue-glow);
}

/* Feedback visuel sur champ invalide après tentative de soumission */
input.invalid, textarea.invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25);
}

textarea {
    min-height: 150px;
    margin-bottom: 0.5rem;
    resize: vertical;
}

.field-wrapper + .btn,
.field-wrapper ~ .btn {
    margin-top: 1.5rem;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
    padding: 4rem 8%;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-content p {
    color: var(--text-muted);
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* =============================================
   MOBILE MENU TOGGLE (desktop: caché)
   ============================================= */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    z-index: 1100;
}

.menu-toggle .bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* =============================================
   MODAL
   ============================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    background-color: var(--surface-color);
    margin: 10% auto;
    padding: 40px 30px;
    border: 1px solid var(--border);
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--primary-blue-glow);
    animation: modalSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-icon {
    width: 60px;
    height: 60px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-icon svg {
    width: 30px;
    height: 30px;
}

.modal-content h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.close-modal {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    background: none;
    border: none;
    line-height: 1;
    padding: 4px;
    font-family: 'Inter', sans-serif;
}

.close-modal:hover,
.close-modal:focus-visible {
    color: var(--text-main);
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* =============================================
   RESPONSIVE MOBILE (≤ 768px)
   ============================================= */
@media (max-width: 768px) {

    :root {
        --nav-height: 64px;
    }

    nav {
        padding: 1.2rem 6%;
    }

    .lang-switcher {
        margin-left: 0;
        order: 3;
    }

    .menu-toggle {
        display: flex;
        order: 2;
    }

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

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

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

    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0;
        background: rgba(7, 7, 9, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        width: 100%;
        height: 100dvh;
        text-align: center;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-12px);
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
        z-index: 1000;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: all;
    }

    .nav-links a {
        margin: 0;
        padding: 1.1rem 2rem;
        font-size: 1.15rem;
        letter-spacing: 2px;
        width: 100%;
        border-bottom: 1px solid var(--border);
        transition: color 0.2s, background 0.2s;
    }

    .nav-links a:first-child {
        border-top: 1px solid var(--border);
    }

    .nav-links a:hover,
    .nav-links a:active {
        color: var(--primary-blue);
        background: rgba(37, 99, 235, 0.06);
    }

    section {
        padding: 80px 5%;
    }

    .section-title {
        font-size: 1.9rem;
        margin-bottom: 2.5rem;
        letter-spacing: -0.5px;
    }

    .hero {
        padding: 0 6%;
        min-height: 100dvh;
    }

    .hero h1 {
        font-size: clamp(2rem, 9vw, 2.8rem);
        line-height: 1.15;
        letter-spacing: -1.5px;
        margin-bottom: 1.2rem;
    }

    .hero p {
        font-size: 0.95rem;
        max-width: 100%;
        margin-bottom: 2.5rem;
        padding: 0;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        gap: 0.75rem;
    }

    .btn {
        padding: 0.95rem 2rem;
        font-size: 0.9rem;
        text-align: center;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .service-card {
        padding: 2rem;
    }

    .featured-project {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }

    .project-info h3 {
        font-size: 1.5rem;
    }

    .testimonial-single {
        margin-top: 2.5rem;
    }

    .quote {
        font-size: 1.15rem;
    }

    .form-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    input, textarea {
        padding: 1rem;
        font-size: 0.95rem;
    }

    textarea {
        margin-bottom: 0.5rem;
    }

    footer {
        padding: 2.5rem 6%;
    }
}

/* =============================================
   FOCUS VISIBLE (accessibilité clavier)
   ============================================= */
:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 3px;
    border-radius: 4px;
}

/* On retire le focus natif uniquement si focus-visible est géré */
:focus:not(:focus-visible) {
    outline: none;
}

/* =============================================
   FOOTER (Ajouts)
   ============================================= */
.footer-email {
    display: inline-block;
    margin-top: 1.2rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-email:hover,
.footer-email:focus-visible {
    color: var(--primary-blue);
}