/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.25rem;
    max-width: 1200px;
    margin: 0 auto;
}
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    transition: color 0.2s;
}
.logo:hover { color: var(--neon-cyan); }
.logo-icon {
    font-size: 1.4rem;
    color: var(--neon-violet);
}
.nav {
    display: flex;
    align-items: center;
    gap: 0.15rem 0.5rem;
}
.nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.nav a:hover {
    color: var(--neon-cyan);
    background: var(--surface);
}
.nav a.active {
    color: var(--neon-cyan);
    background: rgba(34, 211, 238, 0.12);
}
.nav-icon {
    display: inline-flex;
    flex-shrink: 0;
}
.nav-icon svg {
    display: block;
}
.logo-yt-mobile {
    display: none;
    margin-left: 0.5rem;
    padding: 0.25rem 0.6rem;
    color: #f87171;
    border-radius: 999px;
    border: 1px solid rgba(248, 113, 113, 0.6);
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.8rem;
    text-decoration: none;
    align-items: center;
    gap: 0.3rem;
}
.logo-yt-mobile svg {
    display: block;
}
.logo-yt-text {
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.nav-icon-yt {
    margin-left: 0.25rem;
    padding: 0.35rem;
    color: #f00;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s, transform 0.2s;
}
.nav-icon-yt:hover {
    color: #fff;
    background: #f00;
    transform: scale(1.08);
}
.nav-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    position: relative;
}
.nav-toggle::before {
    content: '';
    width: 1.2rem;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -5px 0, 0 5px 0;
}
.nav-toggle[aria-expanded="true"]::before {
    box-shadow: none;
    transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"]::after {
    content: '';
    position: absolute;
    width: 1.2rem;
    height: 2px;
    background: currentColor;
    transform: rotate(-45deg);
}

/* ===== Responsive Header ===== */
@media (max-width: 768px) {
    .logo-yt-mobile {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Скрываем ссылку на YouTube в меню, чтобы не дублировать иконку */
    .nav-icon-yt {
        display: none;
    }
    .nav-toggle {
        display: flex;
        z-index: 102;
    }
    .nav {
        position: fixed;
        top: 3.25rem;
        left: 0;
        right: 0;
        bottom: auto;
        flex-direction: column;
        align-items: stretch;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(16px);
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        gap: 0.25rem;
        transform: translateY(-100%);
        visibility: hidden;
        transition: transform 0.3s ease, visibility 0.3s;
        z-index: 101;
        max-height: 80vh;
        overflow-y: auto;
    }
    .header.nav-open .nav {
        transform: translateY(0);
        visibility: visible;
    }
    .nav a {
        padding: 0.85rem 1rem;
        justify-content: center;
        font-size: 1rem;
    }
    .nav-icon-yt {
        margin-left: 0;
        justify-content: center;
    }
}
@media (max-width: 640px) {
    .header-inner { padding: 0.5rem 1rem; }
    .logo-name { font-size: 1rem; }
}

/* ===== Falling Musical Beats Animation ===== */
.falling-beats-container {
    position: fixed;
    top: 3.25rem;
    left: 0;
    right: 0;
    height: 2rem;
    z-index: 98;
    pointer-events: none;
    overflow: hidden;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2px;
    padding: 0 0.5rem;
}
@media (min-width: 769px) {
    .falling-beats-container {
        top: 3.25rem;
        height: 2.5rem;
    }
}
.falling-beat {
    flex: 0 0 auto;
    width: 3px;
    min-width: 2px;
    max-width: 5px;
    height: var(--beat-height, 30px);
    background: linear-gradient(180deg, var(--neon-pink), var(--neon-violet));
    border-radius: 2px;
    opacity: 0.8;
    box-shadow: 
        0 0 8px rgba(236, 72, 153, 0.6),
        0 0 16px rgba(168, 85, 247, 0.4),
        inset 0 0 4px rgba(255, 255, 255, 0.1);
    animation: falling-beat-drop 2s linear infinite;
    animation-delay: var(--beat-delay, 0s);
    transform-origin: top center;
    margin: 0;
}
.falling-beat:nth-child(odd) {
    background: linear-gradient(180deg, var(--neon-violet), var(--neon-cyan));
    box-shadow: 
        0 0 8px rgba(168, 85, 247, 0.6),
        0 0 16px rgba(34, 211, 238, 0.4),
        inset 0 0 4px rgba(255, 255, 255, 0.1);
}
.falling-beat:nth-child(3n) {
    width: 2px;
    opacity: 0.6;
}
.falling-beat:nth-child(5n) {
    width: 4px;
    opacity: 1;
}
.falling-beat:nth-child(7n) {
    width: 3px;
    opacity: 0.7;
}
@keyframes falling-beat-drop {
    0% {
        transform: translateY(-50px) scaleY(0.3);
        opacity: 0;
    }
    5% {
        opacity: 0.8;
    }
    95% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(calc(2.5rem + 40px)) scaleY(1);
        opacity: 0;
    }
}
