:root {
    --bg: #080a0d;
    --bg2: #0f1117;
    --bg3: #161b24;
    --accent: #c8f04a;
    --white: #f0f2f5;
    --muted: rgba(240,242,245,0.45);
    --border: rgba(240,242,245,0.07);
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--white);
    font-family: var(--font-main);
    overflow-x: hidden;
}

#cursor-dot {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    position: fixed; top: 0; left: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 99999;
    transition: transform 0.1s;
}
#cursor-ring {
    width: 32px; height: 32px;
    border: 1px solid rgba(200,240,74,0.5);
    border-radius: 50%;
    position: fixed; top: 0; left: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 99998;
    transition: width 0.25s, height 0.25s, border-color 0.25s;
}
body.cursor-hover #cursor-ring { width: 50px; height: 50px; border-color: var(--accent); }
body.cursor-hover #cursor-dot { transform: translate(-50%, -50%) scale(0); }
@media (pointer: coarse) { * { cursor: auto !important; } #cursor-dot, #cursor-ring { display: none; } }

/* HEADER */
header {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 48px;
    border-bottom: 1px solid var(--border);
    background: rgba(8,10,13,0.9);
    backdrop-filter: blur(20px);
}
.logo {
    font-family: var(--font-mono);
    font-size: 17px; font-weight: 700; letter-spacing: 3px;
}
.logo span { color: var(--accent); }
nav { display: flex; gap: 32px; }
nav a {
    font-family: var(--font-main);
    font-size: 13px; color: var(--muted);
    text-decoration: none; letter-spacing: 1px; font-weight: 500;
    transition: color 0.2s;
}
nav a:hover { color: var(--accent); }

/* HERO */
.hero {
    min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
    padding: 140px 48px 80px;
    position: relative; overflow: hidden;
}
.hero-bg-text {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(100px, 18vw, 260px);
    font-weight: 900; color: transparent;
    -webkit-text-stroke: 1px rgba(240,242,245,0.035);
    white-space: nowrap; pointer-events: none; user-select: none;
    letter-spacing: -5px;
}
.hero-tag {
    font-family: var(--font-mono);
    font-size: 11px; color: var(--accent);
    letter-spacing: 3px; text-transform: uppercase;
    margin-bottom: 32px;
    display: flex; align-items: center; gap: 12px;
}
.hero-tag::before { content: ''; width: 28px; height: 1px; background: var(--accent); }
.hero-content { position: relative; z-index: 1; max-width: 900px; }

h1 {
    font-size: clamp(52px, 9vw, 118px);
    font-weight: 900; line-height: 0.93;
    letter-spacing: -4px; margin-bottom: 36px;
}
h1 .line { display: block; }
h1 .accent { color: var(--accent); }

.hero-desc {
    font-family: var(--font-main);
    font-size: 16px; color: var(--muted); font-weight: 400;
    max-width: 480px; line-height: 1.75; margin-bottom: 48px;
}
.btn-primary {
    display: inline-flex; align-items: center; gap: 12px;
    background: var(--accent); color: #080a0d;
    padding: 16px 32px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px; font-weight: 700; letter-spacing: 0.5px;
    text-decoration: none; border-radius: 2px;
    transition: all 0.25s;
    border: none; cursor: none;
}
.btn-primary:hover { background: var(--white); transform: translateY(-3px); }

.hero-scroll {
    position: absolute; bottom: 40px; right: 48px;
    font-family: var(--font-mono);
    font-size: 10px; color: var(--muted); letter-spacing: 3px;
    writing-mode: vertical-rl;
    animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
    0%,100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* SECTION TAG */
.section-tag {
    font-family: var(--font-mono);
    font-size: 11px; color: var(--accent);
    letter-spacing: 2px; display: block; margin-bottom: 20px;
}

/* ABOUT */
.about-section {
    padding: 120px 48px;
    border-top: 1px solid var(--border);
}
.about-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 80px;
    max-width: 1200px; margin: 0 auto;
}
.about-left h2 {
    font-size: clamp(26px, 4vw, 46px);
    font-weight: 800; line-height: 1.15; letter-spacing: -1px;
}
.about-right p {
    font-family: var(--font-main);
    font-size: 15px; color: var(--muted); font-weight: 400;
    line-height: 1.85; margin-bottom: 36px;
}
.skills-row { display: flex; flex-wrap: wrap; gap: 10px; }
.skills-row span {
    font-family: var(--font-main);
    font-size: 12px; font-weight: 500; letter-spacing: 0.5px;
    padding: 8px 18px;
    border: 1px solid var(--border);
    color: var(--muted); border-radius: 2px;
    transition: all 0.2s;
}
.skills-row span:hover { border-color: var(--accent); color: var(--accent); }

/* CLIENTS */
.clients-section {
    padding: 120px 48px;
    border-top: 1px solid var(--border);
    max-width: 1200px; margin: 0 auto;
}
.clients-header { margin-bottom: 60px; }
.clients-header h2 {
    font-size: clamp(30px, 5vw, 54px);
    font-weight: 800; letter-spacing: -2px;
}
.clients-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.client-card { text-decoration: none; color: var(--white); display: block; }
.client-card-inner {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 4px; padding: 40px;
    height: 100%; position: relative; overflow: hidden;
    transition: border-color 0.3s, transform 0.3s;
}
.client-card:not(.client-card--empty):hover .client-card-inner {
    border-color: var(--accent);
    transform: translateY(-6px);
}
.client-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 28px;
}
.client-logo {
    width: 52px; height: 52px; background: var(--bg3);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.client-arrow {
    font-size: 24px; color: var(--muted);
    transition: color 0.2s, transform 0.2s;
}
.client-card:hover .client-arrow { color: var(--accent); transform: translate(4px, -4px); }
.client-info h3 { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.client-info p {
    font-family: var(--font-main);
    font-size: 13px; font-weight: 400; color: var(--muted);
    line-height: 1.7; margin-bottom: 24px;
}
.client-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.client-tags span {
    font-family: var(--font-main);
    font-size: 11px; font-weight: 500; letter-spacing: 0.5px;
    padding: 5px 12px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 2px; color: var(--muted);
}
.client-hover-line {
    position: absolute; bottom: 0; left: 0;
    height: 2px; width: 0; background: var(--accent);
    transition: width 0.4s;
}
.client-card:hover .client-hover-line { width: 100%; }

.client-card--empty .client-card-inner {
    border-style: dashed;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 240px; gap: 16px;
}
.empty-icon { font-size: 40px; color: var(--border); font-weight: 300; }
.client-card--empty p {
    font-family: var(--font-main);
    font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0.5px;
}

/* CONTACT */
.contact-section {
    padding: 120px 48px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.contact-section h2 {
    font-size: clamp(38px, 7vw, 96px);
    font-weight: 800; letter-spacing: -3px; margin-bottom: 16px;
}
.contact-section > p {
    font-family: var(--font-main);
    font-size: 16px; font-weight: 400; color: var(--muted); margin-bottom: 56px;
}
.contact-links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.contact-link {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 36px;
    border: 1px solid var(--border);
    color: var(--white); text-decoration: none;
    font-family: var(--font-main);
    font-size: 14px; font-weight: 500; letter-spacing: 0.5px; border-radius: 2px;
    transition: all 0.25s;
}
.contact-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

/* FOOTER */
footer {
    padding: 24px 48px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--font-main);
    font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0.5px;
}

/* FLOATING CONTACT PANEL */
.contact-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 340px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 9999;
    transform: translate(-50%, -45%) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.contact-panel.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}
.contact-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}
.contact-panel-title {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 2px;
}
.contact-panel-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 14px;
    cursor: none;
    padding: 4px 8px;
    transition: color 0.2s;
    border-radius: 2px;
    font-family: var(--font-main);
}
.contact-panel-close:hover { color: var(--accent); }
.contact-panel-links { padding: 12px; }
.panel-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--white);
    transition: background 0.2s;
    border: 1px solid transparent;
}
.panel-link:hover {
    background: var(--bg3);
    border-color: var(--border);
}
.panel-link:hover .panel-link-arrow { color: var(--accent); transform: translate(3px, -3px); }
.panel-link-icon {
    width: 38px; height: 38px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    flex-shrink: 0;
    transition: border-color 0.2s, color 0.2s;
}
.panel-link:hover .panel-link-icon { border-color: var(--accent); color: var(--accent); }
.panel-link-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.panel-link-name {
    font-family: var(--font-main);
    font-size: 14px; font-weight: 600;
}
.panel-link-handle {
    font-family: var(--font-mono);
    font-size: 10px; color: var(--muted); letter-spacing: 0.5px;
}
.panel-link-arrow {
    color: var(--muted); font-size: 16px;
    transition: color 0.2s, transform 0.2s;
}
.contact-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
}
.contact-overlay.open { display: block; }

/* AI overlay — pas de blur */
#ai-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(0,0,0,0.2);
    z-index: 9989;
}

@media (max-width: 768px) {
    .contact-panel {
        width: calc(100% - 40px);
        border-radius: 12px;
    }
}

/* ANIMATIONS */
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* LOADER */
#loader {
    position: fixed; inset: 0; z-index: 99999;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { text-align: center; }
.loader-logo {
    font-family: var(--font-mono);
    font-size: 28px; font-weight: 700; letter-spacing: 6px;
    color: var(--white); margin-bottom: 32px;
}
.loader-logo span { color: var(--accent); }
.loader-bar {
    width: 200px; height: 2px;
    background: var(--border); border-radius: 2px;
    margin: 0 auto 16px; overflow: hidden;
}
.loader-progress {
    height: 100%; width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.05s linear;
    box-shadow: 0 0 10px var(--accent);
}
.loader-percent {
    font-family: var(--font-mono);
    font-size: 11px; color: var(--muted); letter-spacing: 2px;
}

/* PARTICLES */
#particles-canvas {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    opacity: 0.4;
}

/* TYPEWRITER */
.type-cursor {
    color: var(--accent);
    animation: blink 0.8s step-end infinite;
    font-weight: 300;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* CURSOR TRAIL */
.cursor-trail {
    position: fixed; pointer-events: none; z-index: 99997;
    border-radius: 50%;
    background: var(--accent);
    transform: translate(-50%, -50%);
    animation: trailFade 0.5s ease forwards;
}
@keyframes trailFade {
    0% { opacity: 0.4; width: 6px; height: 6px; }
    100% { opacity: 0; width: 2px; height: 2px; }
}

/* STATS ROW */
.stats-row {
    display: flex; gap: 36px; margin-top: 32px; flex-wrap: wrap;
}
.stat-item { display: flex; flex-direction: column; gap: 4px; }
.stat-number {
    font-family: var(--font-main);
    font-size: 42px; font-weight: 900;
    color: var(--accent); line-height: 1;
    letter-spacing: -2px;
}
.stat-plus { font-size: 28px; font-weight: 700; color: var(--accent); vertical-align: super; }
.stat-label {
    font-family: var(--font-mono);
    font-size: 10px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase;
}

/* LANGUAGE SELECTOR */
.lang-selector {
    position: relative;
}
.lang-btn {
    display: flex; align-items: center; gap: 7px;
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--white);
    font-family: var(--font-main);
    font-size: 12px; font-weight: 600;
    padding: 8px 14px; border-radius: 4px;
    cursor: none; transition: border-color 0.2s, background 0.2s;
    letter-spacing: 0.5px;
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent); }
.lang-arrow { font-size: 10px; color: var(--muted); transition: transform 0.2s; }
.lang-selector.open .lang-arrow { transform: rotate(180deg); }
.lang-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 6px; overflow: hidden;
    min-width: 160px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
    opacity: 0; pointer-events: none;
    transform: translateY(-8px) scale(0.97);
    transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
    z-index: 9999;
}
.lang-selector.open .lang-dropdown {
    opacity: 1; pointer-events: all;
    transform: translateY(0) scale(1);
}
.lang-dropdown button {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 11px 16px;
    background: none; border: none;
    color: var(--muted); font-family: var(--font-main);
    font-size: 13px; font-weight: 500;
    cursor: none; text-align: left;
    transition: background 0.15s, color 0.15s;
    border-bottom: 1px solid var(--border);
}
.lang-dropdown button:last-child { border-bottom: none; }
.lang-dropdown button:hover { background: var(--bg3); color: var(--white); }
.lang-dropdown button.active { color: var(--accent); }

/* RTL support for Arabic */
html[dir="rtl"] header { flex-direction: row-reverse; }
html[dir="rtl"] nav { flex-direction: row-reverse; }
html[dir="rtl"] h1 { text-align: right; }
html[dir="rtl"] .hero-desc { text-align: right; }
html[dir="rtl"] .hero-tag { flex-direction: row-reverse; }
html[dir="rtl"] .about-right p { text-align: right; }
html[dir="rtl"] .contact-section { text-align: right; }

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

    /* ── Global ── */
    body { overflow-x: hidden; }

    /* ── Header ── */
    header {
        padding: 14px 18px;
        gap: 10px;
    }
    nav { display: none; }
    .logo { font-size: 13px; letter-spacing: 2px; }
    .lang-btn { padding: 6px 10px; font-size: 11px; gap: 5px; }
    .lang-dropdown { min-width: 150px; right: 0; }

    /* ── Hero ── */
    .hero {
        padding: 90px 18px 60px;
        min-height: 100svh;
        justify-content: center;
    }
    .hero-bg-text {
        font-size: clamp(56px, 20vw, 90px);
        letter-spacing: -2px;
    }
    .hero-content { max-width: 100%; }
    .hero-tag {
        font-size: 9px;
        letter-spacing: 2px;
        margin-bottom: 18px;
    }
    h1 {
        font-size: clamp(40px, 12vw, 64px);
        letter-spacing: -2px;
        margin-bottom: 20px;
        line-height: 0.95;
    }
    .hero-desc {
        font-size: 14px;
        line-height: 1.7;
        margin-bottom: 32px;
        max-width: 100%;
    }
    .btn-primary {
        padding: 15px 24px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
    .hero-scroll { display: none; }

    /* ── About ── */
    .about-section { padding: 64px 18px; }
    .about-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .about-left h2 {
        font-size: clamp(22px, 6.5vw, 34px);
        letter-spacing: -0.5px;
        line-height: 1.2;
    }
    .about-right p {
        font-size: 14px;
        line-height: 1.8;
        margin-bottom: 24px;
    }
    .skills-row {
        gap: 8px;
    }
    .skills-row span {
        font-size: 11px;
        padding: 6px 12px;
    }
    .stats-row {
        gap: 20px;
        margin-top: 28px;
        justify-content: flex-start;
    }
    .stat-number { font-size: 34px; }
    .stat-plus { font-size: 20px; }
    .stat-label { font-size: 9px; }

    /* ── Clients ── */
    .clients-section {
        padding: 64px 18px;
        max-width: 100%;
    }
    .clients-header { margin-bottom: 32px; }
    .clients-header h2 {
        font-size: clamp(26px, 8vw, 40px);
        letter-spacing: -1px;
    }
    .clients-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .client-card-inner { padding: 26px 22px; }
    .client-info h3 { font-size: 19px; }
    .client-info p { font-size: 12px; line-height: 1.6; }
    .client-card--empty .client-card-inner { min-height: 140px; }

    /* ── Contact ── */
    .contact-section {
        padding: 64px 18px;
    }
    .contact-section h2 {
        font-size: clamp(30px, 10vw, 52px);
        letter-spacing: -2px;
    }
    .contact-section > p {
        font-size: 14px;
        margin-bottom: 32px;
    }
    .contact-links {
        flex-direction: column;
        align-items: stretch;
    }
    .contact-panel {
        width: calc(100% - 28px);
        border-radius: 12px;
        left: 50%;
        transform: translate(-50%, -45%) scale(0.95);
    }
    .contact-panel.open {
        transform: translate(-50%, -50%) scale(1);
    }

    /* ── Feedback ── */
    .feedback-section {
        padding: 64px 18px;
        max-width: 100%;
        box-sizing: border-box;
    }
    .feedback-section h2 {
        font-size: clamp(26px, 8vw, 42px);
        letter-spacing: -1px;
        margin-bottom: 10px;
    }
    .feedback-section > p {
        font-size: 13px;
        margin-bottom: 28px;
    }
    .feedback-card {
        padding: 24px 18px;
        gap: 18px;
        box-sizing: border-box;
        width: 100%;
    }
    .feedback-stars { gap: 6px; justify-content: center; }
    .star-btn { font-size: 32px; padding: 0 2px; }
    .feedback-card textarea {
        font-size: 14px;
        padding: 14px 16px;
        min-height: 90px;
        width: 100%;
        box-sizing: border-box;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    #feedbackSubmit {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }

    /* ── Footer ── */
    footer {
        padding: 20px 18px;
        flex-direction: column;
        gap: 6px;
        text-align: center;
        font-size: 11px;
    }
}

/* ── Très petits écrans (≤ 390px) ── */
@media (max-width: 390px) {
    header { padding: 12px 14px; }
    h1 { font-size: 36px; letter-spacing: -1.5px; }
    .hero-tag { display: none; }
    .hero { padding: 80px 14px 50px; }
    .about-section,
    .clients-section,
    .contact-section,
    .feedback-section { padding: 52px 14px; }
    .client-card-inner { padding: 20px 16px; }
    .feedback-card { padding: 20px 14px; }
    .star-btn { font-size: 28px; }
}
/* ── FEEDBACK SECTION ───────────────────────────────── */
.feedback-section {
    padding: 120px 48px;
    border-top: 1px solid var(--border);
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}
.feedback-section h2 {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 800; letter-spacing: -2px; margin-bottom: 12px;
}
.feedback-section > p {
    font-size: 15px; color: var(--muted); margin-bottom: 48px;
}
.feedback-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 40px;
    display: flex; flex-direction: column; gap: 24px;
    align-items: center;
}
.feedback-stars {
    display: flex; gap: 8px;
}
.star-btn {
    background: none; border: none;
    font-size: 36px; color: var(--border);
    cursor: none; transition: color 0.15s, transform 0.15s;
    line-height: 1; padding: 0 4px;
}
.star-btn.active, .star-btn.hovered { color: var(--accent); }
.star-btn:hover { transform: scale(1.2); }
.feedback-card textarea {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--white);
    font-family: var(--font-main);
    font-size: 14px; line-height: 1.7;
    padding: 16px 20px;
    resize: vertical; min-height: 100px;
    transition: border-color 0.2s;
    outline: none;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    box-sizing: border-box;
}
.feedback-card textarea:focus { border-color: var(--accent); }
.feedback-card textarea::placeholder { color: var(--muted); }
.feedback-success {
    display: flex; align-items: center; gap: 10px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 13px; letter-spacing: 1px;
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }