/* ==========================================================================
   HexaDEV — style.css
   Palette : fond #070b12, panneau #10151f, cyan #2de1c2, magenta #ff4d8d,
             violet #7c5cff, texte #e8edf2, texte atténué #8ea0b5
   Typo     : Space Grotesk (titres), Inter (texte), JetBrains Mono (terminal)
   ========================================================================== */

:root {
    --bg: #070b12;
    --bg-alt: #0a0e17;
    --panel: #10151f;
    --panel-alt: #131a26;
    --line: #1b2b40;
    --cyan: #2de1c2;
    --magenta: #ff4d8d;
    --violet: #7c5cff;
    --text: #e8edf2;
    --muted: #8ea0b5;
    --radius: 14px;
    --font-display: "Space Grotesk", "Inter", sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", monospace;
    --header-h: 76px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

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

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

section { padding: 110px 8vw; position: relative; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }

.highlight-text {
    background: linear-gradient(90deg, var(--cyan), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Accessibility: visible focus states */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
    html { scroll-behavior: auto; }
}

/* ---------- Fade up (scroll reveal, already wired via IntersectionObserver) ---------- */
.fade-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ---------- Header ---------- */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6vw;
    background: rgba(7, 11, 18, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    z-index: 1000;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.logo span { color: var(--cyan); }

nav { display: flex; align-items: center; gap: 2.4rem; }

nav a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    position: relative;
    padding: 6px 0;
    transition: color 0.25s ease;
}
nav a::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 0; height: 2px;
    background: var(--cyan);
    transition: width 0.25s ease;
}
nav a:hover, nav a.active { color: var(--text); }
nav a:hover::after, nav a.active::after { width: 100%; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
    padding: 8px;
}
.nav-toggle span {
    width: 24px; height: 2px;
    background: var(--text);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn, .btn-outline, .btn-small {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    padding: 14px 28px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn {
    background: linear-gradient(90deg, var(--cyan), var(--violet));
    color: #06110f;
    font-weight: 600;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(45, 225, 194, 0.5); }

.btn-outline {
    border-color: var(--line);
    color: var(--text);
    background: transparent;
}
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }

.btn-small {
    background: var(--panel-alt);
    border-color: var(--line);
    color: var(--text);
    font-size: 0.8rem;
    padding: 10px 22px;
}
.btn-small:hover { border-color: var(--magenta); color: var(--magenta); }

.pulse-glow { animation: pulseGlow 2.6s ease-in-out infinite; }
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(45, 225, 194, 0.45); }
    50% { box-shadow: 0 0 0 12px rgba(45, 225, 194, 0); }
}

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: calc(var(--header-h) + 60px);
    padding-bottom: 70px;
    background:
        radial-gradient(circle at 20% 20%, rgba(124, 92, 255, 0.16), transparent 45%),
        radial-gradient(circle at 80% 30%, rgba(45, 225, 194, 0.14), transparent 45%),
        var(--bg);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(30deg, var(--line) 1px, transparent 1px),
        linear-gradient(150deg, var(--line) 1px, transparent 1px),
        linear-gradient(270deg, var(--line) 1px, transparent 1px);
    background-size: 84px 146px;
    opacity: 0.35;
    mask-image: radial-gradient(circle at center, black 0%, transparent 75%);
    animation: hexDrift 40s linear infinite;
}
@keyframes hexDrift {
    from { background-position: 0 0, 0 0, 0 0; }
    to { background-position: 400px 0, -400px 0, 0 700px; }
}
.hero-content { max-width: 780px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); line-height: 1.1; margin-bottom: 1.4rem; }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 560px; margin: 0 auto 2.4rem; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Composant "fenêtre navigateur" (points rouge/jaune/vert) ----------
   Signature visuelle réutilisée pour : le mockup vidéo du hero, les cartes du
   portfolio, et la modale de lecture vidéo. */
.browser-frame {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 30px 80px -30px rgba(45, 225, 194, 0.25);
}
.browser-frame-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    background: var(--panel-alt);
    border-bottom: 1px solid var(--line);
}
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.browser-frame-url {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0 auto 0 14px;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 3px 12px;
}

/* ---------- Mockup vidéo dans le hero ---------- */
.video-mockup {
    display: block;
    width: min(880px, 100%);
    margin: 3.4rem auto 0;
    position: relative;
    z-index: 1;
    cursor: pointer;
    padding: 0;
    border-color: var(--line);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.video-mockup:hover, .video-mockup:focus-visible {
    transform: translateY(-4px);
    border-color: var(--cyan);
    box-shadow: 0 40px 90px -30px rgba(45, 225, 194, 0.4);
}
.video-mockup-media {
    display: block;
    position: relative;
    aspect-ratio: 1500 / 720;
    background: #000;
}
.video-mockup-media img { width: 100%; height: 100%; object-fit: cover; }
.play-button {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 74px; height: 74px;
    border-radius: 50%;
    background: rgba(7, 11, 18, 0.65);
    border: 1px solid rgba(45, 225, 194, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, background 0.25s ease;
}
.play-button svg { width: 28px; height: 28px; color: var(--cyan); margin-left: 4px; }
.video-mockup:hover .play-button { transform: translate(-50%, -50%) scale(1.1); background: rgba(45, 225, 194, 0.18); }

/* ---------- Modale vidéo ---------- */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5vh 4vw;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.video-modal.open { opacity: 1; pointer-events: auto; }
.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 10, 0.85);
    backdrop-filter: blur(6px);
}
.video-modal-panel {
    position: relative;
    width: min(920px, 100%);
    transform: scale(0.94);
    transition: transform 0.3s ease;
}
.video-modal.open .video-modal-panel { transform: scale(1); }
.video-modal-panel video { width: 100%; display: block; background: #000; max-height: 78vh; }
.video-modal-panel .dot-red { cursor: pointer; }
.video-modal-close {
    margin-left: 10px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}
.video-modal-close:hover { color: var(--magenta); background: var(--bg-alt); }

/* ---------- Features ---------- */
.features { text-align: center; }
.features h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 3rem; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.8rem;
}
.feature-box {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.4rem 1.8rem;
    text-align: left;
    transition: border-color 0.25s ease, transform 0.25s ease;
}
.feature-box:hover { border-color: var(--cyan); transform: translateY(-4px); }
.modern-icon {
    width: 42px; height: 42px;
    color: var(--cyan);
    margin-bottom: 1.2rem;
    padding: 10px;
    background: rgba(45, 225, 194, 0.08);
    border-radius: 10px;
}
.feature-box h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.feature-box p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Portfolio ---------- */
.portfolio { text-align: center; background: var(--bg-alt); }
.portfolio h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.portfolio .subtitle { color: var(--muted); margin: 0.6rem 0 3rem; }
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.6rem;
}
.portfolio-item {
    text-align: left;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.portfolio-item:hover { transform: translateY(-4px); border-color: var(--cyan); }
.portfolio-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 2;
}
.portfolio-media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.portfolio-item:hover .portfolio-media img { transform: scale(1.08); }
.portfolio-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: left;
    padding: 1.4rem;
    background: linear-gradient(180deg, transparent 40%, rgba(7, 11, 18, 0.95) 100%);
}
.portfolio-overlay h3 { font-size: 1.05rem; margin-bottom: 0.2rem; }
.portfolio-overlay p { color: var(--muted); font-size: 0.85rem; }

/* ---------- Pricing ---------- */
.pricing { text-align: center; }
.pricing h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 3rem; }
.cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.8rem;
    align-items: center;
}
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.6rem 1.8rem;
    text-align: left;
    position: relative;
    transition: transform 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--violet); }
.card.highlight {
    border-color: var(--cyan);
    background: linear-gradient(180deg, rgba(45, 225, 194, 0.08), var(--panel) 40%);
    transform: scale(1.04);
}
.pulse-border { animation: pulseBorder 2.8s ease-in-out infinite; }
@keyframes pulseBorder {
    0%, 100% { box-shadow: 0 0 0 0 rgba(45, 225, 194, 0.35); }
    50% { box-shadow: 0 0 0 10px rgba(45, 225, 194, 0); }
}
.badge {
    position: absolute;
    top: -14px; left: 50%;
    transform: translateX(-50%);
    background: var(--cyan);
    color: #06110f;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    white-space: nowrap;
}
.card h3 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.card .price { font-family: var(--font-display); font-size: 2rem; margin-bottom: 1.4rem; }
.card .price span { font-family: var(--font-mono); font-size: 0.9rem; color: var(--muted); font-weight: 400; }
.card ul { list-style: none; margin-bottom: 1.8rem; }
.card ul li {
    font-size: 0.9rem;
    color: var(--text);
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--line);
}
.card ul li::before { content: "✓ "; color: var(--cyan); font-weight: 700; }
.card ul li.muted { color: var(--muted); }
.card ul li.muted::before { content: "— "; color: var(--muted); }
.card .btn, .card .btn-small { width: 100%; justify-content: center; }

/* ---------- Contact ---------- */
.contact-section { background: var(--bg-alt); }
.contact-container { text-align: center; }
.contact-container h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.contact-container > p { color: var(--muted); margin: 0.6rem auto 3rem; max-width: 520px; }
.contact-box {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2.4rem;
    text-align: left;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.6rem;
}
.contact-info h3 { font-size: 1.15rem; margin-bottom: 1rem; }
.contact-info p { color: var(--muted); margin-bottom: 1rem; font-size: 0.95rem; }
.mail-link { color: var(--cyan); }
.mail-link:hover { text-decoration: underline; }
.terminal-box {
    margin-top: 1.6rem;
    background: #05080d;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--cyan);
}
.terminal-box p { color: var(--cyan); margin-bottom: 0.3rem; font-size: 0.82rem; }
.terminal-box p:last-child { color: var(--muted); }

.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px 16px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--muted); }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
    border-color: var(--cyan);
}
.contact-form select { color: var(--muted); }
.contact-form select:valid { color: var(--text); }
.contact-form textarea { resize: vertical; min-height: 110px; }
.field-error {
    color: var(--magenta);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    margin-top: -0.6rem;
    display: none;
}
.field-error.show { display: block; }
.contact-form input.invalid, .contact-form select.invalid, .contact-form textarea.invalid {
    border-color: var(--magenta);
}

/* ---------- Footer ---------- */
footer {
    text-align: center;
    padding: 3.4rem 6vw 2.4rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
}
footer .logo { justify-content: center; margin-bottom: 0.6rem; }
footer p { font-size: 0.9rem; }
footer .copyright { margin-top: 1rem; font-family: var(--font-mono); font-size: 0.78rem; opacity: 0.7; }

/* ---------- Toast (retour formulaire) ---------- */
.toast {
    position: fixed;
    bottom: 28px; right: 28px;
    max-width: 340px;
    background: var(--panel);
    border: 1px solid var(--cyan);
    border-radius: 10px;
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text);
    box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.6);
    transform: translateY(30px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s ease, opacity 0.35s ease;
    z-index: 2000;
}
.toast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.toast.error { border-color: var(--magenta); }

/* ---------- Back to top ---------- */
.back-to-top {
    position: fixed;
    bottom: 28px; left: 28px;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    z-index: 900;
    font-size: 1.1rem;
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { border-color: var(--cyan); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .features-grid, .cards-container, .portfolio-grid { grid-template-columns: 1fr; }
    .card.highlight { transform: none; }
    .contact-box { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    section { padding: 80px 6vw; }
    nav {
        position: fixed;
        top: var(--header-h); right: 0;
        height: calc(100vh - var(--header-h));
        width: min(78vw, 320px);
        background: var(--bg-alt);
        border-left: 1px solid var(--line);
        flex-direction: column;
        align-items: flex-start;
        padding: 2.4rem;
        gap: 1.6rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    nav.open { transform: translateX(0); }
    nav a { font-size: 1rem; }
    .nav-toggle { display: flex; }
    .hero-buttons { flex-direction: column; align-items: stretch; }
    .back-to-top { left: 16px; bottom: 16px; }
    .toast { right: 16px; left: 16px; max-width: none; bottom: 16px; }
}
