/* ======  CSS-переменные  ====== */
:root {
    --primary-purple: #8b5cf6;
    --primary-pink:   #ec4899;
    --dark-purple:    #6d28d9;
    --light-purple:   #a78bfa;
    --bg-primary:     #0f0f15;
    --bg-secondary:   #1a1a24;
    --bg-card:        #252530;
    --bg-card-hover:  #2a2a3a;
    --text-primary:   #e2e8f0;
    --text-secondary: #94a3b8;
    --border-color:   #334155;
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --header-height:  80px;
    --header-height-scrolled: 70px;
}

/* ======  базовые стили  ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    padding-top: var(--header-height);
    transition: padding-top .3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ======  язык: НЕ display:none, а clip  ====== */
.lang-ru [lang="en"],
.lang-en [lang="ru"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.lang-ru [lang="ru"],
.lang-en [lang="en"] {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    border: none;
}

/* ======  шапка  ====== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(26, 26, 36, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    height: var(--header-height);
    transition: all .3s ease;
}
.header.scrolled {
    height: var(--header-height-scrolled);
    background: rgba(15, 15, 21, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.logo-icon {
    width: 45px;
    height: 45px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transition: all .3s ease;
}
.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all .3s ease;
}
.logo-img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transition: all .3s ease;
}
.header.scrolled .logo-img {
    width: 38px;
    height: 38px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}
.nav-link {
    position: relative;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    transition: all .3s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width .3s ease;
}
.nav-link:hover {
    color: var(--light-purple);
}
.nav-link:hover::after {
    width: 100%;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.lang-switcher {
    display: flex;
    gap: 3px;
    background: rgba(37, 37, 48, 0.6);
    backdrop-filter: blur(10px);
    padding: 3px;
    border-radius: 18px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    transition: all .3s ease;
}
.lang-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 14px;
    cursor: pointer;
    transition: all .3s ease;
    font-size: 0.85rem;
}
.lang-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all .3s ease;
}
.mobile-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all .3s ease;
}
.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}
.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: rgba(15, 15, 21, 0.98);
    backdrop-filter: blur(20px);
    z-index: 999;
    transition: right .4s cubic-bezier(.23, 1, .32, 1);
    border-left: 1px solid rgba(139, 92, 246, 0.2);
}
.mobile-nav-overlay.active {
    right: 0;
}
.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
}
.mobile-nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    transition: all .3s ease;
}
.mobile-nav-link:hover {
    color: var(--light-purple);
    padding-left: 10px;
}

/* ======  hero / sections / footer  ====== */
.hero {
    padding: 6rem 0 4rem 0;
    background: var(--bg-secondary);
    text-align: center;
    min-height: 70vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
}
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}
.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    animation: fadeInUp 1s ease-out;
}
.hero-description {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    animation: fadeInUp 1s ease-out 0.2s both;
}
.section {
    padding: 5rem 0;
}
.section-dark {
    background: var(--bg-secondary);
}
.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.content-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: all .3s ease;
}
.content-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-medium);
    border-color: rgba(139, 92, 246, 0.4);
}
.infrastructure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
.infra-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all .3s ease;
}
.infra-card:hover {
    transform: translateY(-10px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-medium);
    border-color: rgba(139, 92, 246, 0.4);
}
.infra-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(139, 92, 246, 0.3));
}
.contact-card {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    max-width: 500px;
    margin: 0 auto;
    transition: all .3s ease;
}
.contact-email {
    display: inline-block;
    margin-top: 1rem;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all .3s ease;
}
.contact-email:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}
.footer {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======  адаптив  ====== */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    .mobile-toggle {
        display: flex;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-description {
        font-size: 1.1rem;
    }
    .section {
        padding: 3rem 0;
    }
}
@media (max-width: 480px) {
    .logo-text {
        font-size: 1.2rem;
    }
    .hero-title {
        font-size: 2rem;
    }
    .mobile-nav-overlay {
        max-width: 280px;
    }
}

/* ======  скролл-бар и выделение  ====== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 4px;
}
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
}