/* =====================================================
   COMPONENTS — ИСПРАВЛЕННАЯ ВЕРСИЯ
   ===================================================== */

/* ===== BUTTONS ===== */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 36px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple-600), var(--magenta-500));
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--magenta-500), var(--purple-700));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-strong);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary span,
.btn-primary svg {
    position: relative;
    z-index: 1;
}

.btn-secondary {
    background: white;
    border: 2px solid var(--color-border-medium);
    color: var(--color-text);
}

.btn-secondary:hover {
    border-color: var(--purple-500);
    background: var(--purple-50);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.btn-lg {
    padding: 20px 44px;
    font-size: 1rem;
}

.btn-glow {
    animation: glow 3s ease-in-out infinite;
}

/* ===== NAVIGATION ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
    padding: 20px 0;
    transition: all var(--transition-base);
}

.nav::before {
    content: '';
    position: absolute;
    inset: 0;
    /* ИСПРАВЛЕНИЕ #5, #20: Fallback для backdrop-filter */
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--color-border-soft);
    opacity: 0;
    transition: opacity var(--transition-base);
}

/* Для браузеров с поддержкой backdrop-filter */
@supports (backdrop-filter: blur(20px)) {
    .nav::before {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(20px);
    }
}

.nav.scrolled::before {
    opacity: 1;
}

.nav__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1;
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--color-text);
}

.nav__logo-mark {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--purple-600), var(--magenta-500));
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    box-shadow: var(--shadow-glow);
    transition: all var(--transition-base);
}

.nav__logo:hover .nav__logo-mark {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: var(--shadow-glow-strong);
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav__link {
    position: relative;
    padding: 12px 24px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-muted);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    overflow: hidden;
}

.nav__link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--purple-600), var(--magenta-500));
    opacity: 0;
    transition: opacity var(--transition-fast);
    border-radius: inherit;
}

.nav__link span {
    position: relative;
    z-index: 1;
}

.nav__link:hover {
    color: white;
}

.nav__link:hover::before {
    opacity: 1;
}

/* ===== NAV CTA ===== */
.nav__cta {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--color-bg-muted);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-full);
    margin-left: 16px;
}

.lang-btn {
    position: relative;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--purple-600), var(--magenta-500));
    box-shadow: var(--shadow-sm);
}

.lang-btn:not(.active):hover {
    color: var(--purple-600);
    background: rgba(139, 92, 246, 0.1);
}

/* ===== NAV TOGGLE (BURGER) — ИСПРАВЛЕНИЕ #13 ===== */
.nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.nav__toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s var(--ease-out-expo);
    transform-origin: center;
}

/* ИСПРАВЛЕНИЕ #13: Анимация бургера в X */
.nav__toggle.is-open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav__toggle.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav__toggle.is-open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-header) - 1);
    /* ИСПРАВЛЕНИЕ #20: Fallback для backdrop-filter */
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

@supports (backdrop-filter: blur(20px)) {
    .mobile-menu {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
    }
}

.mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s var(--ease-out-expo) 0.1s;
}

.mobile-menu.is-open .mobile-menu__content {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu__link {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    transition: color var(--transition-fast);
}

.mobile-menu__link:hover {
    color: var(--purple-600);
}

.mobile-menu__lang {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

/* ===== CUSTOM CURSOR ===== */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-cursor);
    pointer-events: none;
}

.cursor-dot {
    width: 10px;
    height: 10px;
    background: var(--purple-500);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.15s var(--ease-out-expo), 
                width 0.3s var(--ease-out-expo), 
                height 0.3s var(--ease-out-expo),
                background 0.3s ease;
}

.cursor-outline {
    width: 45px;
    height: 45px;
    border: 2px solid var(--purple-400);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.2s var(--ease-out-expo);
    opacity: 0.8;
}

.cursor.is-hovering .cursor-dot {
    width: 60px;
    height: 60px;
    background: rgba(139, 92, 246, 0.3);
}

.cursor.is-hovering .cursor-outline {
    width: 80px;
    height: 80px;
    border-color: var(--magenta-500);
    opacity: 0.5;
}

.cursor.is-clicking .cursor-dot {
    transform: translate(-50%, -50%) scale(0.7);
}

/* ===== TEAM CARD PHOTO ===== */
.team-card__photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 50%;
}

/* ===== CARDS ===== */
.card {
    background: var(--glass-bg-strong);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card:hover {
    border-color: var(--purple-300);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .nav__links {
        display: none;
    }
    
    .nav__toggle {
        display: flex;
    }
    
    .lang-switcher {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav__cta {
        gap: 8px;
    }
    
    .nav__cta .btn-primary {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    /* Скрываем текст кнопки, оставляем иконку */
    .nav__cta .btn-primary span {
        display: none;
    }
}

/* ===== MEMBER WORKS IN MODAL ===== */
.modal__member-works {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.modal__work-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #f3e8ff, #fce7f3);
}

/* ИСПРАВЛЕНИЕ #4: Fallback для aspect-ratio */
@supports not (aspect-ratio: 4/3) {
    .modal__work-item {
        padding-top: 75%; /* 3/4 = 0.75 */
        height: 0;
    }
    
    .modal__work-item > * {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

.modal__work-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
}

.modal__work-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal__work-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.modal__work-item-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal__work-item-cat {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.7);
}

@media (max-width: 768px) {
    .modal__member-works {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }
}

/* ===== PORTFOLIO ITEMS WITH MEDIA ===== */
.modal__portfolio-item--media {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: none;
    padding: 0;
}

.modal__portfolio-item--media img,
.modal__portfolio-item--media video {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal__portfolio-item--media:hover img,
.modal__portfolio-item--media:hover video {
    transform: scale(1.08);
}

.modal__portfolio-item-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
}

.modal__portfolio-item--media:hover .modal__portfolio-item-label {
    opacity: 1;
    transform: translateY(0);
}