/* Базовые переменные по умолчанию (для подстраховки) */
:root {
    font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ЦВЕТА ДЛЯ СВЕТЛОЙ ТЕМЫ */
:root[data-theme="light"] {
    --bg-color: #FAFAFA;
    --surface: #FFFFFF;
    --text-main: #27272A;
    --text-muted: #71717A;
    --accent: #3B82F6;
    --border-color: rgba(39, 39, 42, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 1);
    --noise-opacity: 0.04;
    --aurora-opacity: 0.7;
    --aurora-color-1: #DBEAFE;
    --aurora-color-2: #CCFBF1;
    --grad-1: #27272A;
    --grad-2: #A1A1AA;
    --modal-bg: rgba(250, 250, 250, 0.85);
    --btn-bg: #27272A;
    --btn-text: #FFFFFF;
    --check-mark: #FFFFFF;
    --scroll-thumb: #D4D4D8;
    --scroll-hover: #A1A1AA;
    --mobile-hover-bg: rgba(39, 39, 42, 0.9);
}

/* ЦВЕТА ДЛЯ ТЕМНОЙ ТЕМЫ */
:root[data-theme="dark"] {
    --bg-color: #09090B;
    --surface: #18181B;
    --text-main: #FAFAFA;
    --text-muted: #A1A1AA;
    --accent: #6366F1;
    --border-color: rgba(250, 250, 250, 0.08);
    --glass-bg: rgba(24, 24, 27, 0.4);
    --glass-border: rgba(250, 250, 250, 0.05);
    --noise-opacity: 0.025;
    --aurora-opacity: 0.25;
    --aurora-color-1: #312E81;
    --aurora-color-2: #064E3B;
    --grad-1: #FFFFFF;
    --grad-2: #71717A;
    --modal-bg: rgba(9, 9, 11, 0.9);
    --btn-bg: #FFFFFF;
    --btn-text: #000000;
    --check-mark: #000000;
    --scroll-thumb: #27272A;
    --scroll-hover: #3F3F46;
    --mobile-hover-bg: rgba(250, 250, 250, 0.1);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

button, a, input, select, textarea {
    -webkit-tap-highlight-color: transparent;
}

.aurora-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; overflow: hidden; z-index: -1; pointer-events: none; }
@media (max-width: 768px) { .aurora-container { display: none; } }

.aurora-blob {
    position: absolute;
    filter: blur(150px);
    border-radius: 50%;
    opacity: var(--aurora-opacity);
    transition: opacity 0.6s ease, background-color 0.6s ease;
    animation: moveAurora 25s infinite alternate ease-in-out;
    will-change: transform;
}
.aurora-1 { width: 60vw; height: 60vw; max-width: 800px; max-height: 800px; background: var(--aurora-color-1); top: -20%; left: -10%; animation-duration: 25s; }
.aurora-2 { width: 50vw; height: 50vw; max-width: 600px; max-height: 600px; background: var(--aurora-color-2); bottom: -20%; right: -10%; animation-duration: 30s; animation-delay: -5s; }
@keyframes moveAurora { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(5%, 10%) scale(1.05); } 100% { transform: translate(-5%, -5%) scale(0.95); } }

.bg-noise {
    position: fixed; inset: 0; z-index: 9998; pointer-events: none; opacity: var(--noise-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    transition: opacity 0.6s ease;
}

.magnetic-btn, .magnetic-btn-text { display: inline-block; transition: transform 0.3s cubic-bezier(0.1, 0.7, 0.1, 1); }
.magnetic-btn-text { pointer-events: none; }

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: background-color 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

.glass-panel::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: linear-gradient(to bottom, var(--glass-border), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}

.text-gradient {
    background: linear-gradient(to right, var(--grad-1), var(--grad-2), var(--grad-1));
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

.tilt-card { transform-style: preserve-3d; transform: perspective(1000px); }
.tilt-card-content { transform: translateZ(30px); }
@media (max-width: 768px) {
    .mobile-show-hover { opacity: 1 !important; transform: scale(1) !important; background: var(--mobile-hover-bg) !important; color: var(--bg-color) !important; border: 1px solid var(--border-color); }
    .tilt-card-content { transform: translateZ(0); }
}

.liquid-container { filter: url('#liquid-filter'); position: relative; width: 44px; height: 44px; }
.liquid-base { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 26px; height: 26px; background: var(--text-main); border-radius: 50%; transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.6s ease; }
.liquid-eye { position: absolute; top: -8px; left: -8px; width: 16px; height: 16px; background: var(--text-main); border-radius: 50%; transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.6s ease; }
@media (pointer: fine) {
    .group:hover .liquid-base { width: 6px; height: 18px; border-radius: 3px; transform: translate(-50%, -4px); }
    .group:hover .liquid-eye { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); top: -16px; left: -3px; box-shadow: 0 0 15px var(--accent); }
}

.scramble-text { display: inline-block; min-width: 80px; }
.ai-stagger-item { opacity: 0; transform: translateY(10px); animation: aiFadeIn 0.5s forwards ease-out; }
@keyframes aiFadeIn { to { opacity: 1; transform: translateY(0); } }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; transition: background 0.3s; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); }

#mobile-menu { transition: opacity 0.3s ease, visibility 0.3s ease; z-index: 90; }

.custom-checkbox {
    appearance: none;
    background-color: transparent;
    border: 1.5px solid var(--text-muted);
    padding: 9px;
    border-radius: 6px;
    display: inline-block;
    position: relative;
    outline: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.custom-checkbox:focus-visible {
    box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--accent);
}

.custom-checkbox:checked { background-color: var(--text-main); border-color: var(--text-main); }
.custom-checkbox:checked::after { content: '\2714'; font-size: 14px; position: absolute; top: -1px; left: 3px; color: var(--bg-color); font-weight: bold; }

details > summary { list-style: none; } details > summary::-webkit-details-marker { display: none; }
details[open] summary ~ * { animation: sweep .4s ease-in-out forwards; }
@keyframes sweep { 0% { opacity: 0; transform: translateY(-10px); } 100% { opacity: 1; transform: translateY(0); } }

.modal-overlay { position: fixed; inset: 0; background: var(--modal-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.4s ease; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { transform: scale(0.95) translateY(20px); transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); max-height: 90vh; overflow-y: auto; }
.modal-overlay.active .modal-content { transform: scale(1) translateY(0); }

#burger-btn span { background-color: var(--text-main); transform-origin: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
#burger-btn.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#burger-btn.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
#burger-btn.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

#mobile-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 105;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#mobile-menu-wrapper.active #mobile-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lang-switcher-pill {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 2px;
    width: 100px;
    height: 36px;
    position: relative;
    transition: border-color 0.3s ease;
}

.lang-btn {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    background: transparent;
    border-radius: 9999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.lang-btn.active-lang {
    color: var(--bg-color) !important;
    background: var(--text-main) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (pointer: fine) {
    .lang-btn:not(.active-lang):hover {
        color: var(--text-main);
        background: rgba(0, 0, 0, 0.04);
    }
}

.premium-card {
    border: 1px solid var(--accent) !important;
    box-shadow: 0 25px 60px rgba(99, 102, 241, 0.25);
    transform: scale(1.03);
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.premium-card:hover {
    transform: scale(1.05) translateY(-4px);
    box-shadow: 0 30px 70px rgba(99, 102, 241, 0.35);
}

@media (max-width: 1024px) {
    .premium-card {
        transform: scale(1);
    }
    .premium-card:hover {
        transform: translateY(-4px);
    }
}