:root {
    --brand-blue: #297BF2;
    --brand-purple: #7D42E6;
    --brand-accent: #C2EF39;
    --bg-dark: #050810;
    --text-white: #ffffff;
    --text-gray: #94a3b8;
    --gradient-main: linear-gradient(135deg, var(--brand-blue), var(--brand-purple));
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-white);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Космический фон */
.cosmos-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
}
.stars {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 130px 80px, #fff, rgba(0,0,0,0));
    background-repeat: repeat; background-size: 200px 200px;
    animation: moveStars 100s linear infinite; opacity: 0.6;
}
@keyframes moveStars { from { transform: translateY(0); } to { transform: translateY(-1000px); } }

.glow-orb {
    position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
    width: 800px; height: 800px; background: var(--brand-purple);
    filter: blur(180px); opacity: 0.15; border-radius: 50%; pointer-events: none;
}

/* Header */
header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 5%; position: fixed; width: 100%; top: 0; z-index: 100;
    backdrop-filter: blur(12px); background: rgba(5, 8, 16, 0.7);
    border-bottom: 1px solid var(--glass-border);
}
.logo {
    font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 12px;
    letter-spacing: -0.5px; text-decoration: none; color: white;
    flex-shrink: 0;
}
.logo img {
    width: 48px;
}

nav {
    display: flex;
    align-items: center;
}

nav ul {
    display: flex; list-style: none; gap: 2rem; align-items: center;
    margin: 0; padding: 0;
}
nav a {
    color: var(--text-gray); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.3s;
}
nav a:hover, nav a.active { color: var(--text-white); }

.lang-switcher { display: flex; gap: 10px; margin-left: 20px; }
.lang-link { 
    color: var(--text-gray); text-decoration: none; font-size: 0.85rem; font-weight: 600; 
    padding: 4px 8px; border-radius: 6px; transition: all 0.3s;
}
.lang-link.active { background: rgba(255,255,255,0.1); color: white; }

/* Гамбургер - прижат к правому краю */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    z-index: 101;
    margin-left: auto;
    flex-shrink: 0;
}
.mobile-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}
.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Hero */
.hero {
    min-height: 90vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 8rem 1rem 4rem; position: relative;
}
.hero img {
    width: 120px;
    margin-bottom: 1.5rem;
}
.hero h1 {
    font-size: clamp(3rem, 6vw, 5rem); font-weight: 800; margin-bottom: 1rem; letter-spacing: -2px;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: fadeInUp 0.8s ease-out;
}
.hero p.tagline {
    font-size: clamp(1.1rem, 2vw, 1.5rem); color: var(--text-gray); margin-bottom: 3rem;
    max-width: 600px; animation: fadeInUp 0.8s ease-out 0.2s backwards;
}
.cta-group { display: flex; gap: 1rem; justify-content: center; animation: fadeInUp 0.8s ease-out 0.4s backwards; flex-wrap: wrap; }
.btn {
    padding: 1rem 2.5rem; border-radius: 50px; font-weight: 600; text-decoration: none; transition: all 0.3s; font-size: 1rem;
}
.btn-primary { background: var(--gradient-main); color: white; border: none; box-shadow: 0 0 20px rgba(125, 66, 230, 0.4); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(125, 66, 230, 0.6); }
.btn-secondary { background: rgba(255,255,255,0.05); color: white; border: 1px solid var(--glass-border); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }

/* Projects Grid */
.projects-section { padding: 2rem 5% 6rem; max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.section-header p { color: var(--brand-purple); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; font-size: 0.9rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.card {
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 24px;
    padding: 2.5rem 2rem; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}
.card:hover { transform: translateY(-8px); background: rgba(255, 255, 255, 0.06); border-color: rgba(125, 66, 230, 0.4); }

.card-icon {
    width: 56px; height: 56px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem; font-size: 1.8rem;
    transition: transform 0.3s;
}
.card-icon img {
    width: 56px; height: 56px; 
    display: flex; align-items: center; justify-content: center; 
    transition: transform 0.3s;
}
.card:hover .card-icon { transform: scale(1.1); }
.card h3 { font-size: 1.4rem; margin-bottom: 0.8rem; font-weight: 600; }
.card p { color: var(--text-gray); font-size: 0.95rem; margin-bottom: 2rem; flex-grow: 1; line-height: 1.6; }
.card-link {
    color: var(--brand-blue); text-decoration: none; font-weight: 600; font-size: 0.9rem;
    display: inline-flex; align-items: center; gap: 6px; transition: gap 0.3s;
}
.card:hover .card-link { gap: 10px; color: var(--brand-purple); }

footer {
    border-top: 1px solid var(--glass-border); padding: 3rem 5%; text-align: center;
    color: var(--text-gray); font-size: 0.9rem; background: rgba(5, 8, 16, 0.9);
}

@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* Адаптив */
@media (max-width: 768px) {
    header {
        padding: 0.8rem 5%;
    }

    .mobile-toggle {
        display: flex;
        margin-left: auto;
    }

    nav {
        order: 2;
    }

    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        width: 80%;
        max-width: 320px;
        background: var(--bg-dark);
        flex-direction: column;
        padding: 2rem 1.5rem;
        gap: 1.5rem;
        text-align: center;
        border-bottom: 1px solid var(--glass-border);
        border-left: 1px solid var(--glass-border);
        border-radius: 0 0 0 20px;
        backdrop-filter: blur(12px);
        background: rgba(5, 8, 16, 0.95);
        box-shadow: -10px 20px 40px rgba(0,0,0,0.5);
    }
    nav ul.active {
        display: flex;
    }

    nav ul li {
        width: 100%;
    }

    nav ul li a {
        display: block;
        padding: 0.5rem 0;
        font-size: 1.1rem;
    }

    .lang-switcher {
        margin: 0.5rem 0 0 0;
        justify-content: center;
    }

    .lang-switcher a {
        padding: 0.5rem 1.5rem;
    }

    .hero {
        padding-top: 7rem;
        min-height: auto;
        padding-bottom: 3rem;
    }
    .hero img {
        width: 80px;
    }
    .cta-group {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
    }
    .btn {
        width: 100%;
        text-align: center;
    }
    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    nav ul {
        width: 90%;
        max-width: none;
        right: 0;
        border-radius: 0 0 0 16px;
    }
}