/* ---------- БАЗОВЫЕ ПЕРЕМЕННЫЕ (НОЧНАЯ ТЕМА) ---------- */
:root {
    --bg-body: #0B0E17;
    --bg-surface: #0F172A;
    --bg-card: #111827CC;
    --border-color: #2D3A5E;
    --text-primary: #EFF3FC;
    --text-secondary: #94A3B8;
    --text-muted: #7E8AA2;
    --accent: #3b82f6;
    --accent-grad: linear-gradient(95deg, #2563EB, #7C3AED);
    --header-bg: transparent;
    --footer-bg: #060914;
    --glow-1: radial-gradient(circle at 20% 30%, rgba(59,130,246,0.12) 0%, rgba(15,23,42,0) 65%);
    --glow-2: radial-gradient(circle at 85% 70%, rgba(139,92,246,0.1) 0%, rgba(10,14,23,0) 60%);
}
body.light {
    --bg-body: #F1F5F9;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFFCC;
    --border-color: #CBD5E1;
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #475569;
    --accent: #2563eb;
    --accent-grad: linear-gradient(95deg, #3b82f6, #8b5cf6);
    --header-bg: rgba(255,255,255,0.8);
    --footer-bg: #E2E8F0;
    --glow-1: radial-gradient(circle at 20% 30%, rgba(59,130,246,0.05) 0%, rgba(226,232,240,0) 65%);
    --glow-2: radial-gradient(circle at 85% 70%, rgba(139,92,246,0.04) 0%, rgba(241,245,249,0) 60%);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.2s ease;
}
.bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: var(--glow-1), var(--glow-2);
    transition: background 0.3s;
}
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}
.container { max-width: 1280px; margin: 0 auto; padding: 0 28px; }
/* navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    flex-wrap: wrap;
    gap: 20px;
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    border-radius: 60px;
    margin-top: 12px;
    padding-left: 24px;
    padding-right: 24px;
    position: relative;
    z-index: 1000; /* высокий z-index, чтобы мега-меню было над контентом */
}
.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFFFFF, #94A3F8);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    cursor: pointer;
}
body.light .logo { background: linear-gradient(135deg, #1E293B, #3b82f6); background-clip: text; }
.nav-links { display: flex; gap: 2rem; align-items: center; list-style: none; margin: 0 auto; }
.nav-links li { position: relative; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-weight: 500; transition: 0.2s; cursor: pointer; }
.nav-links a:hover, .nav-links a.active-page { color: var(--accent); }
/* mega menu */
.mega-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 880px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border-radius: 32px;
    border: 1px solid var(--border-color);
    padding: 28px 24px;
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    z-index: 1001; /* выше navbar */
    box-shadow: 0 30px 40px -15px rgba(0,0,0,0.3);
}
.mega-trigger:hover .mega-menu { display: grid; }
.mega-trigger::after { content: ''; position: absolute; bottom: -12px; left: 0; width: 100%; height: 20px; background: transparent; }
.mega-category h4 { color: var(--accent); margin-bottom: 16px; border-left: 3px solid var(--accent); padding-left: 12px; }
.mega-category a { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--text-secondary); font-size: 0.9rem; cursor: pointer; text-decoration: none; }
.mega-category a i { width: 24px; color: var(--accent); }
.mega-category a:hover { color: var(--text-primary); transform: translateX(4px); }
.btn-outline-light { border: 1.5px solid var(--accent); background: transparent; padding: 8px 20px; border-radius: 40px; color: var(--text-primary); font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--accent-grad); border: none; padding: 12px 28px; border-radius: 40px; font-weight: 600; color: white; cursor: pointer; transition: 0.2s; box-shadow: 0 8px 20px -8px var(--accent); }
.btn-secondary { background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); padding: 12px 28px; border-radius: 40px; color: var(--text-secondary); cursor: pointer; }
body.light .btn-secondary { background: rgba(0,0,0,0.03); }
.theme-toggle { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 40px; padding: 6px 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 1.2rem; }
.go-top { position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; visibility: hidden; transition: 0.3s; z-index: 1002; color: white; font-size: 1.5rem; }
.go-top.show { opacity: 1; visibility: visible; }
.cookie-banner { position: fixed; bottom: 20px; left: 20px; right: 20px; max-width: 460px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 28px; padding: 20px 24px; backdrop-filter: blur(12px); z-index: 1002; display: flex; flex-direction: column; gap: 16px; }
.cookie-banner .btn-cookie { background: var(--accent); border: none; padding: 8px 20px; border-radius: 40px; color: white; cursor: pointer; align-self: flex-start; }
.page { animation: fade 0.35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.section-title { font-size: 2.2rem; font-weight: 700; margin: 30px 0 16px; background: linear-gradient(120deg, var(--text-primary), var(--accent)); background-clip: text; -webkit-background-clip: text; color: transparent; }
.section-sub { color: var(--text-muted); margin-bottom: 40px; }
.service-detail { background: var(--bg-card); backdrop-filter: blur(8px); border-radius: 36px; padding: 40px; margin: 30px 0; border: 1px solid var(--border-color); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 24px; margin: 32px 0; }
.feature-item { background: var(--bg-surface); border-radius: 24px; padding: 20px; }
.footer { background: var(--footer-bg); margin-top: 80px; border-top: 1px solid var(--border-color); padding: 60px 0 30px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: var(--text-primary); margin-bottom: 20px; }
.footer-col a, .footer-col p { color: var(--text-muted); text-decoration: none; display: block; margin-bottom: 12px; cursor: pointer; }
.footer-col a:hover { color: var(--accent); }
.newsletter-form { display: flex; gap: 8px; margin-top: 12px; }
.newsletter-form input { background: var(--bg-body); border: 1px solid var(--border-color); padding: 10px 16px; border-radius: 40px; flex:1; color: var(--text-primary); }
.newsletter-form button { background: var(--accent); border: none; border-radius: 40px; padding: 0 20px; cursor: pointer; color: white; }
.social-icons i { font-size: 1.6rem; margin-right: 20px; color: var(--text-muted); cursor: pointer; }
.social-icons i:hover { color: var(--accent); }
.copyright { border-top: 1px solid var(--border-color); padding-top: 30px; text-align: center; color: var(--text-muted); }
.mobile-menu-icon { display: none; font-size: 1.8rem; cursor: pointer; }
@media (max-width: 950px) { .mega-menu { width: 700px; left: 50%; transform: translateX(-50%); } }
@media (max-width: 850px) {
    .navbar { flex-wrap: wrap; }
    .nav-links { display: none; flex-direction: column; width: 100%; background: var(--bg-surface); border-radius: 28px; padding: 20px; order: 3; margin-top: 16px; }
    .nav-links.active { display: flex; }
    .mobile-menu-icon { display: block; order: 2; }
    .demo-btn { order: 1; }
    .logo { order: 0; }
    .theme-toggle { order: 1; margin-left: auto; margin-right: 12px; }
    .mega-menu { position: static; width: 100%; transform: none; display: none; grid-template-columns: 1fr; }
    .mega-trigger:hover .mega-menu { display: none; }
    .mega-trigger.active-mobile .mega-menu { display: grid; }
    .mega-trigger::after { display: none; }
}