:root {
    --primary: #1e40af;
    --secondary: #3b82f6;
    --accent: #f97316;
    --dark: #0f172a;
    --light: #f8fafc;
    --white: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --gradient-1: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --gradient-2: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    
    /* Цвета серий */
    --tech-color: #3b82f6;
    --nature-color: #10b981;
    --edu-color: #8b5cf6;
    --hum-color: #d97706;
    --econ-color: #dc2626;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Top Bar */
.top-bar {
    background: var(--dark);
    color: var(--white);
    padding: 0.8rem 0;
    font-size: 0.85rem;
}

.top-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.top-bar-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.top-bar-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.top-bar-links a:hover {
    color: var(--secondary);
}

/* Top Bar Dropdown Styles */
.top-bar-links li {
    position: relative;
}

.top-bar-links .dropdown {
    position: relative;
}

.top-bar-links .dropdown > a {
    color: rgba(255,255,255,0.95) !important;
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
}

.top-bar-links .dropdown > a:hover {
    background: rgba(255,255,255,0.2);
    color: var(--white) !important;
}

.top-bar-links .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--white);
    min-width: 160px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 0.5rem 0;
    z-index: 10000;
    border: 1px solid rgba(0,0,0,0.1);
}

.top-bar-links .dropdown:hover .dropdown-menu {
    display: block;
    animation: dropdownSlide 0.3s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.top-bar-links .dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1.2rem;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
}

.top-bar-links .dropdown-menu a:hover {
    background: var(--primary);
    color: var(--white);
}

.top-bar-links .dropdown > a::after {
    content: ' ▾';
    margin-left: 0.3rem;
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Main Header */
.main-header {
    background: var(--white);
    padding: 2rem 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 80px;
    width: auto;
}

.logo-text h1 {
    font-family: 'Nunito', serif;
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--dark);
    letter-spacing: -0.5px;
    line-height: 1; /* можно чуть больше, если строки налезают */
}

.logo-text h1 span {
    display: block;   /* перенос на новую строку */
    margin-top: 0.2rem; /* расстояние между строками, подбирайте по вкусу */
}


.logo-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    justify-content: center;
}

.main-nav a {
    padding: 0.8rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.main-nav a:hover {
    background: var(--light);
    color: var(--primary);
}

.main-nav li {
    position: relative;
}

.main-nav .dropdown {
    position: relative;
}

.main-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 280px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    z-index: 1000;
}

.main-nav .dropdown:hover .dropdown-menu {
    display: block;
}

.main-nav .dropdown-menu a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    border-radius: 0;
}

.main-nav .dropdown-menu a:hover {
    background: var(--light);
    color: var(--primary);
}

.main-nav .dropdown > a::after {
    content: ' ▾';
    margin-left: 0.3rem;
    font-size: 0.8rem;
}

.header-cta {
    background: var(--gradient-2);
    color: var(--white);
    padding: 0.9rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.header-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(249, 115, 22, 0.4);
}

/* Footer */
footer {
    background: var(--dark);
    color: rgba(255,255,255,0.8);
    padding: 4rem 0 2rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand h3 {
    font-family: 'Nunito', serif;
    font-size: 1.8rem;
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-brand p {
    color: rgba(255,255,255,0.6);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.footer-section h4 {
    font-family: 'Nunito', serif;
    color: var(--white);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    color: rgba(255,255,255,0.5);
}

/* Responsive */
@media (max-width: 1200px) {
    .header-content {
        grid-template-columns: auto 1fr;
        gap: 2rem;
    }

    .header-cta {
        grid-column: 1 / -1;
        text-align: center;
    }

    .main-nav {
        grid-column: 1 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 968px) {
    .top-bar-content {
        padding: 0 1rem;
        font-size: 0.8rem;
    }

    .top-bar-links {
        gap: 1rem;
    }

    .header-content {
        padding: 0 1rem;
        gap: 1.5rem;
    }

    .logo img {
        height: 60px;
    }

    .logo-text h1 {
        font-size: 1.3rem;
    }

    .main-nav {
        gap: 0.3rem;
    }

    .main-nav a {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    /* Top Bar Mobile */
    .top-bar {
        display: none; /* Hide top bar on mobile */
    }

    /* Mobile Header */
    .main-header {
        padding: 1rem 0;
    }

    .header-content {
        grid-template-columns: 1fr auto;
        gap: 1rem;
        padding: 0 1rem;
    }

    .logo {
        gap: 0.8rem;
    }

    .logo img {
        height: 50px;
    }

    .logo-text h1 {
        font-size: 1.1rem;
    }

    .logo-text p {
        font-size: 0.65rem;
    }

    /* Mobile Navigation */
    .main-nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        overflow-y: auto;
        z-index: 9999;
        gap: 0;
        animation: slideInLeft 0.3s ease;
    }

    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translateX(-100%);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav li {
        width: 100%;
        border-bottom: 1px solid var(--light);
    }

    .main-nav a {
        display: block;
        width: 100%;
        padding: 1.2rem 1rem;
        border-radius: 0;
        font-size: 1rem;
    }

    .main-nav .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background: var(--light);
        margin: 0;
        border-radius: 0;
        padding: 0;
    }

    .main-nav .dropdown.active .dropdown-menu {
        display: block;
    }

    .main-nav .dropdown-menu a {
        padding: 1rem 2rem;
        font-size: 0.95rem;
    }

    .main-nav .dropdown > a::after {
        float: right;
        transition: transform 0.3s;
    }

    .main-nav .dropdown.active > a::after {
        transform: rotate(180deg);
    }

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10000;
        position: relative;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background: var(--dark);
        margin: 3px 0;
        transition: all 0.3s;
        border-radius: 3px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Mobile CTA */
    .header-cta {
        display: none; /* Hide in header on mobile */
    }

    .main-nav .mobile-cta {
        display: block;
        margin-top: 1rem;
        text-align: center;
        background: var(--gradient-2);
        color: var(--white);
        padding: 1rem 1.5rem;
        border-radius: 50px;
        text-decoration: none;
        font-weight: 600;
    }

    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .footer-bottom {
        padding: 2rem 1rem 0;
        font-size: 0.85rem;
    }

    /* Top Bar Dropdown Mobile Fix */
    .top-bar-links .dropdown-menu {
        right: auto;
        left: 0;
    }
}

@media (max-width: 480px) {
    .logo img {
        height: 45px;
    }

    .logo-text h1 {
        font-size: 1rem;
        line-height: 1.2;
    }

    .logo-text h1 span {
        margin-top: 0.1rem;
    }

    .logo-text p {
        font-size: 0.6rem;
        margin-top: 0.1rem;
    }

    .main-nav {
        padding: 4rem 1.5rem 1.5rem;
    }

    .main-nav a {
        padding: 1rem 0.8rem;
        font-size: 0.95rem;
    }

    .main-nav .dropdown-menu a {
        padding: 0.9rem 1.5rem;
        font-size: 0.9rem;
    }

    .footer-brand h3 {
        font-size: 1.5rem;
    }

    .footer-section h4 {
        font-size: 1.1rem;
    }
}

/* Desktop Only - Show Menu Button */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }

    .main-nav .mobile-cta {
        display: none;
    }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {
    .main-nav a,
    .header-cta,
    .mobile-menu-toggle {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .top-bar-links a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Performance Optimizations */
* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GPU Acceleration for animations */
.main-nav,
.mobile-menu-toggle span,
.header-cta,
.dropdown-menu {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}