/* ═══════════════════════════════════════════════════════
   NeuralGate — Design System
   ═══════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dark: #4f46e5;
    --accent-glow: rgba(99,102,241,0.3);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --bg: #0b1120;
    --bg-surface: #131a2e;
    --bg-elevated: #1e293b;
    --border: #1e293b;
    --border-light: #334155;

    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    --max-width: 1100px;
    --radius: 12px;
    --radius-sm: 8px;
    --section-py: 80px;
    --transition: 0.2s ease;
}

@font-face {
    font-family: 'Inter';
    src: url('https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfAZ9hiA.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.15rem; }

img { max-width: 100%; height: auto; }

/* ── Layout ── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 32px; }
.section { padding: var(--section-py) 0; }
.section-dark { background: var(--bg-surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: 13px; font-weight: 600; color: var(--accent-light); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.section-sub { color: var(--text-secondary); font-size: 16px; max-width: 600px; margin-bottom: 40px; }

/* ── Navigation ── */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(11,17,32,0.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px; height: 64px;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); }
.nav-brand span { background: linear-gradient(135deg, var(--accent), var(--accent-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: color var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-login { color: var(--text-secondary); font-size: 14px; }
.nav-cta { background: var(--accent); color: #fff; padding: 8px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; transition: background var(--transition); }
.nav-cta:hover { background: var(--accent-dark); color: #fff; }
.nav-hamburger { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }
.nav-mobile { display: none; }

/* ── Hero ── */
.hero {
    min-height: 90vh; display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 120px 32px 80px;
    background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.08) 0%, transparent 60%);
}
.hero-inner { max-width: 800px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2);
    padding: 6px 16px; border-radius: 24px; font-size: 13px; color: var(--accent-light);
    margin-bottom: 24px;
}
.hero-badge span { opacity: 0.4; }
.hero h1 { margin-bottom: 16px; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--accent-light), var(--success)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { font-size: 18px; color: var(--text-secondary); max-width: 600px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; cursor: pointer; transition: all var(--transition); border: none; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; box-shadow: 0 0 24px var(--accent-glow); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-light); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-light); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ── Code Block ── */
.code-block {
    background: #0a0f1a; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 24px; font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
    color: #e2e8f0; overflow-x: auto; text-align: left; margin: 24px 0;
    -webkit-overflow-scrolling: touch;
}
.code-block .comment { color: #64748b; }
.code-block .string { color: #86efac; }
.code-block .keyword { color: #c084fc; }
.code-block .flag { color: #60a5fa; }

/* ── Product Cards ── */
.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 40px 0; }
.product-card {
    background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px 24px; text-align: center; transition: all var(--transition);
}
.product-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.product-icon { font-size: 40px; margin-bottom: 16px; }
.product-card h3 { margin-bottom: 8px; }
.product-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }

/* ── Stats Row ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 48px 0; text-align: center; }
.stat-value { font-size: 2.5rem; font-weight: 800; background: linear-gradient(135deg, var(--accent-light), var(--success)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* ── Provider Logos ── */
.providers { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; padding: 32px 0; opacity: 0.7; }
.providers img { height: 32px; filter: brightness(0) invert(1); opacity: 0.5; transition: opacity var(--transition); }
.providers img:hover { opacity: 1; }
.providers .more { color: var(--text-muted); font-size: 14px; display: flex; align-items: center; }

/* ── Feature Grid ── */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.feature-card {
    background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; transition: border-color var(--transition);
}
.feature-card:hover { border-color: var(--accent); }
.feature-icon { font-size: 28px; margin-bottom: 12px; }
.feature-card h3 { margin-bottom: 6px; font-size: 15px; }
.feature-card p { color: var(--text-secondary); font-size: 13px; line-height: 1.5; }

/* ── Pricing Cards ── */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.pricing-card {
    background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px; position: relative;
}
.pricing-card.featured { border-color: var(--accent); box-shadow: 0 0 40px rgba(99,102,241,0.1); }
.pricing-card.featured::before { content: 'Популярный'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 4px 16px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.pricing-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.pricing-price { font-size: 2rem; font-weight: 800; margin: 12px 0; }
.pricing-price small { font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.pricing-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }
.pricing-features { list-style: none; margin-bottom: 24px; }
.pricing-features li { padding: 6px 0; font-size: 14px; color: var(--text-secondary); }
.pricing-features li::before { content: '✓ '; color: var(--success); font-weight: 700; }

/* ── CTA Section ── */
.cta-section {
    text-align: center; padding: var(--section-py) 32px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(16,185,129,0.05));
}
.cta-section h2 { margin-bottom: 12px; }
.cta-section p { color: var(--text-secondary); margin-bottom: 28px; font-size: 16px; }

/* ── Lead Form ── */
.lead-form { max-width: 500px; margin: 0 auto; }
.lead-form input, .lead-form textarea {
    width: 100%; padding: 12px 16px; margin-bottom: 12px;
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-family: var(--font-body); font-size: 14px;
    transition: border-color var(--transition);
}
.lead-form input:focus, .lead-form textarea:focus { border-color: var(--accent); outline: none; }
.lead-form textarea { min-height: 100px; resize: vertical; }
.lead-form .privacy-notice { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; text-align: left; line-height: 1.5; }
.lead-form .privacy-notice input[type="checkbox"] { width: auto; min-width: 18px; height: 18px; margin: 0; flex-shrink: 0; cursor: pointer; accent-color: var(--accent); }
.lead-form .privacy-notice label { cursor: pointer; }
.lead-form button { width: 100%; }
.lead-form .form-success { display: none; text-align: center; padding: 32px; color: var(--success); }

/* ── Footer ── */
.footer { border-top: 1px solid var(--border); padding: 48px 32px 32px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; max-width: var(--max-width); margin: 0 auto 32px; }
.footer-col h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; color: var(--text); }
.footer-col a { display: block; color: var(--text-muted); font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { text-align: center; color: var(--text-muted); font-size: 13px; padding-top: 24px; border-top: 1px solid var(--border); max-width: var(--max-width); margin: 0 auto; }

/* ── Cookie Banner ── */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: var(--bg-elevated); border-top: 1px solid var(--border);
    padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.cookie-banner p { font-size: 13px; color: var(--text-secondary); flex: 1; }
.cookie-banner .cookie-actions { display: flex; gap: 8px; }

/* ── Comparison Table ── */
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-table th { padding: 12px 16px; text-align: left; background: var(--bg-surface); border-bottom: 2px solid var(--border); font-weight: 600; }
.compare-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.compare-table tr:hover td { background: rgba(99,102,241,0.04); }

/* ── Scroll Animations ── */
.anim-up { opacity: 0; transform: translateY(24px); transition: opacity 0.6s, transform 0.6s; }
.anim-up.visible { opacity: 1; transform: translateY(0); }

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    .anim-up { opacity: 1; transform: none; transition: none; }
    * { transition-duration: 0.01ms !important; }
}

/* ═══ Responsive — Tablet (1024px) ═══ */
@media (max-width: 1024px) {
    .container { padding: 0 24px; }
    .nav { padding: 0 24px; }
    .nav-links { gap: 20px; }
    .nav-links a { font-size: 13px; }

    .products-grid { gap: 16px; }
    .product-card { padding: 24px 20px; }

    .stats-row { gap: 16px; }
    .stat-value { font-size: 2rem; }

    .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .pricing-grid { gap: 16px; }
}

/* ═══ Responsive — Mobile (768px) ═══ */
@media (max-width: 768px) {
    /* ── Navigation ── */
    .nav-links, .nav-actions { display: none; }
    .nav-hamburger { display: block; }
    .nav { padding: 0 16px; height: 56px; }
    .nav-brand { font-size: 16px; }

    .nav-mobile.open {
        display: flex; flex-direction: column;
        position: fixed; top: 56px; left: 0; right: 0; bottom: 0;
        background: var(--bg); padding: 24px 20px; gap: 4px; z-index: 99;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    .nav-mobile.open a {
        font-size: 17px; color: var(--text); padding: 12px 0;
        border-bottom: 1px solid var(--border);
    }
    .nav-mobile.open .nav-mobile-cta {
        margin-top: 16px; text-align: center;
    }
    .nav-mobile.open .btn { width: 100%; justify-content: center; }

    /* ── Hero ── */
    .hero { min-height: auto; padding: 80px 20px 48px; }
    .hero h1 { font-size: 1.6rem; line-height: 1.3; }
    .hero-sub { font-size: 14px; margin-bottom: 24px; }
    .hero-badge { font-size: 11px; padding: 5px 12px; flex-wrap: wrap; justify-content: center; }
    .hero-actions { flex-direction: column; align-items: stretch; gap: 10px; }
    .hero-actions .btn { justify-content: center; }

    /* ── Buttons ── */
    .btn { padding: 14px 20px; font-size: 15px; width: 100%; justify-content: center; }
    .btn-sm { padding: 10px 14px; font-size: 13px; width: auto; }

    /* ── Sections ── */
    .section { padding: 48px 0; }
    .container { padding: 0 16px; }
    .section-title { font-size: 12px; }
    .section-sub { font-size: 14px; }

    /* ── Product Cards ── */
    .products-grid { grid-template-columns: 1fr; gap: 12px; }
    .product-card { padding: 24px 20px; text-align: left; display: flex; gap: 16px; align-items: flex-start; }
    .product-icon { font-size: 32px; margin-bottom: 0; flex-shrink: 0; }
    .product-card h3 { margin-bottom: 4px; }
    .product-card p { font-size: 13px; margin-bottom: 12px; }
    .product-card .btn { width: auto; }

    /* ── Stats ── */
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 32px 0; }
    .stat-value { font-size: 1.8rem; }
    .stat-label { font-size: 12px; }

    /* ── Providers ── */
    .providers { gap: 12px; padding: 20px 0; }
    .providers img { height: 24px; }

    /* ── Features ── */
    .feature-grid { grid-template-columns: 1fr; gap: 12px; }
    .feature-card { padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
    .feature-icon { font-size: 24px; margin-bottom: 0; flex-shrink: 0; line-height: 1; }
    .feature-card > div { flex: 1; }
    .feature-card h3 { font-size: 14px; margin-bottom: 4px; }
    .feature-card p { font-size: 12px; }

    /* ── Code blocks ── */
    .code-block {
        font-size: 11px; padding: 14px 16px; border-radius: 8px;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        white-space: pre; word-break: normal;
    }
    /* Code tabs */
    .code-tabs { flex-wrap: wrap; gap: 4px; }
    .code-tabs button, .code-tabs .tab { font-size: 12px; padding: 6px 10px; }

    /* ── Pricing ── */
    .pricing-grid { grid-template-columns: 1fr; gap: 16px; }
    .pricing-card { padding: 24px 20px; }
    .pricing-card.featured::before { font-size: 11px; padding: 3px 12px; top: -10px; }
    .pricing-name { font-size: 16px; }
    .pricing-price { font-size: 1.6rem; }
    .pricing-features li { font-size: 13px; padding: 5px 0; }

    /* ── Comparison Table ── */
    .compare-table { font-size: 12px; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .compare-table th { padding: 8px 10px; font-size: 12px; white-space: nowrap; }
    .compare-table td { padding: 8px 10px; white-space: nowrap; }

    /* ── Lead Form ── */
    .lead-form { max-width: 100%; }
    .lead-form input, .lead-form textarea { padding: 14px 16px; font-size: 16px; /* prevent iOS zoom */ }
    .lead-form .privacy-notice { font-size: 11px; }

    /* ── CTA Section ── */
    .cta-section { padding: 48px 20px; }
    .cta-section h2 { font-size: 1.4rem; }
    .cta-section p { font-size: 14px; }

    /* ── Footer ── */
    .footer { padding: 32px 16px 24px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .footer-col h4 { font-size: 12px; margin-bottom: 8px; }
    .footer-col a { font-size: 13px; padding: 3px 0; }
    .footer-bottom { font-size: 12px; padding-top: 16px; }

    /* ── Cookie Banner ── */
    .cookie-banner {
        flex-direction: column; text-align: center; gap: 12px;
        padding: 16px 20px;
    }
    .cookie-banner p { font-size: 12px; }
    .cookie-banner .cookie-actions { width: 100%; }
    .cookie-banner .cookie-actions .btn { flex: 1; }

    /* ── Terminal (pilot page) ── */
    .terminal-window { border-radius: 8px; }
    .terminal-window pre { font-size: 11px; padding: 14px; overflow-x: auto; }
    .terminal-titlebar { padding: 8px 12px; font-size: 12px; }

    /* ── Personas grid ── */
    .personas-grid { grid-template-columns: 1fr; gap: 10px; }

    /* ── FAQ ── */
    .faq-item summary { font-size: 14px; padding: 14px 0; }
    .faq-item p { font-size: 13px; }

    /* ── Misc ── */
    .modes-grid { grid-template-columns: 1fr; gap: 12px; }
    .security-grid { grid-template-columns: 1fr; gap: 12px; }
    .solutions-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* ═══ Responsive — Small phones (480px) ═══ */
@media (max-width: 480px) {
    .hero h1 { font-size: 1.35rem; }
    .hero-badge { font-size: 10px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-value { font-size: 1.5rem; }

    .footer-grid { grid-template-columns: 1fr; gap: 20px; }

    .product-card { flex-direction: column; text-align: center; }
    .product-icon { margin-bottom: 8px; }

    .pricing-price { font-size: 1.4rem; }
    .pricing-card { padding: 20px 16px; }

    .compare-table th, .compare-table td { padding: 6px 8px; font-size: 11px; }
}

/* ═══ Touch enhancements ═══ */
@media (hover: none) {
    /* Remove hover effects on touch — prevent sticky hover states */
    .product-card:hover { transform: none; box-shadow: none; }
    .feature-card:hover { border-color: var(--border); }
    .btn-primary:hover { box-shadow: none; }

    /* Larger tap targets */
    .nav-mobile.open a { min-height: 44px; display: flex; align-items: center; }
    .faq-item summary { min-height: 44px; display: flex; align-items: center; }
    .pricing-features li { min-height: 36px; display: flex; align-items: center; }
}

/* ═══ Safe area (notch phones) ═══ */
@supports (padding: env(safe-area-inset-bottom)) {
    .nav { padding-top: env(safe-area-inset-top); }
    .cookie-banner { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
    .footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
