:root {
    /* --- МАГИЧЕСКАЯ ПАЛИТРА --- */
    /* Фиолетовый (основной магический) */
    --magic-purple: #9B59B6;
    /* Хром/Серебро (вторичный текст и детали) */
    --chrome-silver: #ECF0F1;
    /* Розовое золото (акценты и активные элементы) */
    --rose-gold: #E0A3A3; 
    
    /* Темный фон с фиолетовым отливом */
    --dark-bg: #232330;
    /* Светлый фон для контента */
    --light-bg: #F4F6F7;
    
    /* Переопределение старых переменных для совместимости */
    --mint-green: var(--magic-purple); 
    --gold: var(--rose-gold);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    background-color: var(--dark-bg);
    color: var(--chrome-silver);
}

/* Анимированный фон: Фиолетовый -> Серебро -> Розовое золото -> Темный */
.bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 400% 400%;
    background-image: linear-gradient(-45deg, #232330 0%, #4A235A 25%, #76448A 50%, #9B59B6 75%, #E0A3A3 100%);
    -webkit-animation: AnimateBG 20s ease infinite;
    animation: AnimateBG 20s ease infinite;
    z-index: -1;
}

@keyframes AnimateBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Паттерн поверх фона (звездная пыль/точки) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.5;
    z-index: -1;
}

.menu-wrapper {
    background-color: rgba(35, 35, 48, 0.95); /* Темно-фиолетовая подложка */
    padding: 10px 0;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(155, 89, 182, 0.3); /* Тонкая фиолетовая линия */
}

.menu {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.menu-items, .sub-menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.menu-items {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.menu-item {
    position: relative;
    margin: 5px;
}

/* Ссылки меню */
.menu-item > a {
    color: var(--chrome-silver); /* Серебристый текст */
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: bold;
    border: 1px solid transparent;
}

/* Наведение на меню: Фиолетовый фон, белые буквы */
.menu-item > a:hover, .menu-item > a:focus {
    background-color: rgba(155, 89, 182, 0.2);
    color: #fff;
    border-color: var(--magic-purple);
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.4);
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

/* Активная страница: Розовое золото */
.menu-item > a.active {
    color: var(--rose-gold);
    background-color: transparent;
    border-color: var(--rose-gold);
    box-shadow: 0 0 10px rgba(224, 163, 163, 0.3);
}

.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--dark-bg);
    border-radius: 15px;
    padding: 10px 0;
    z-index: 1000;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border: 1px solid var(--magic-purple);
}

.sub-menu-item a {
    color: var(--chrome-silver);
    text-decoration: none;
    display: block;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.sub-menu-item a:hover, .sub-menu-item a.active {
    background-color: var(--magic-purple);
    color: white;
}

.menu-toggle {
    display: none;
}

.social-icons {
    display: flex;
    align-items: center;
}

.social-icons img {
    height: 24px;
    margin-left: 10px;
    cursor: pointer;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.3));
    transition: transform 0.3s ease;
}

.social-icons img:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 5px var(--magic-purple));
}

@media (max-width: 768px) {
    .menu-wrapper {
        padding: 5px;
        margin: 0;
        width: 100vw;
        box-sizing: border-box;
    }

    .menu {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .menu-toggle {
        display: inline-block;
        padding: 10px;
        background-color: transparent;
        color: var(--chrome-silver);
        font-weight: bold;
        border: 1px solid var(--magic-purple);
        border-radius: 5px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 14px;
    }
    
    .menu-toggle:hover {
        background-color: var(--magic-purple);
        color: white;
    }

    .social-icons {
        display: flex;
        align-items: center;
    }

    .social-icons img {
        height: 24px;
        margin-left: 10px;
    }

    .menu-items {
        display: none;
        flex-direction: column;
        background-color: rgba(35, 35, 48, 0.98);
        border-radius: 15px;
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        position: absolute;
        top: 50px;
        left: 0;
        width: 100vw;
        box-sizing: border-box;
        border-bottom: 2px solid var(--rose-gold);
    }

    .menu-items.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    .menu-item {
        margin: 10px 0;
        text-align: left;
    }

    .menu-item > a {
        color: var(--chrome-silver);
    }

    .sub-menu {
        position: static;
        background-color: transparent;
        box-shadow: none;
        display: none;
        padding-left: 20px;
        border: none;
    }

    .sub-menu.active {
        display: block;
        z-index: 2000;
    }
}