/* ===== Глобальные настройки ===== */
:root {
    --mai-primary: #6366f1;
    --mai-primary-dark: #4f46e5;
    --mai-accent: #ec4899;
    --mai-dark: #0f0f23;
    --mai-darker: #0a0a1a;
    --gradient-main: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --gradient-glow: radial-gradient(ellipse at center, rgba(99,102,241,0.3) 0%, transparent 70%);
}

body {
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    background-color: var(--mai-darker);
    color: #f1f5f9;
    overflow-x: hidden;
}

/* ===== Анимированный фон ===== */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 25s infinite ease-in-out;
}

.blob-1 {
    width: 700px;
    height: 700px;
    background: var(--mai-primary);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--mai-accent);
    bottom: -100px;
    right: -50px;
    animation-delay: -8s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: #8b5cf6;
    top: 40%;
    left: 60%;
    animation-delay: -15s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 25px) scale(0.95); }
}

/* ===== Навигация ===== */
.navbar {
    background: rgba(15, 15, 35, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 0.25rem 0;
    background: rgba(10, 10, 26, 0.95);
}

.navbar-brand {
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    margin: 0 0.25rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* ===== Hero секция ===== */
.hero-section {
    min-height: 100vh;
    padding-top: 80px;
    padding-bottom: 60px;
    position: relative;
    display: flex;
    align-items: center;
}

.text-gradient {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 10px rgba(99,102,241,0.5)); }
    to { filter: drop-shadow(0 0 25px rgba(236,72,153,0.7)); }
}

/* ===== Кнопки ===== */
.btn-primary {
    background: var(--gradient-main);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
}

.btn-outline-primary {
    border-color: rgba(99, 102, 241, 0.5);
    color: var(--mai-primary);
}

.btn-outline-primary:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--mai-primary);
}

.bg-gradient-primary {
    background: var(--gradient-main);
}

/* ===== Карточки проектов ===== */
.project-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s ease;
}

.project-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.project-card-inner {
    background: rgba(30, 30, 55, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.project-card-inner:hover {
    transform: translateY(-8px);
    border-color: var(--mai-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 60px rgba(99, 102, 241, 0.2);
}

.card-img-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card-inner:hover .card-img-wrapper img {
    transform: scale(1.08);
}

.card-img-overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15,15,35,0.9), transparent 60%);
}

.card-tags .badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    transition: all 0.2s ease;
}

.card-tags .badge:hover {
    background: var(--mai-primary) !important;
    color: white !important;
    border-color: var(--mai-primary) !important;
}

/* ===== Фильтры тегов ===== */
#tagsFilter .btn {
    font-size: 0.85rem;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    transition: all 0.2s ease;
}

#tagsFilter .btn.active,
#tagsFilter .btn:hover {
    background: var(--mai-primary);
    border-color: var(--mai-primary);
    color: white;
}

/* ===== CTA секция ===== */
.cta-section {
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-glow);
    pointer-events: none;
}

/* ===== Футер ===== */
.footer {
    background: rgba(10, 10, 26, 0.8);
}

.hover-primary {
    transition: color 0.2s ease;
}

.hover-primary:hover {
    color: var(--mai-primary) !important;
}

/* ===== Анимации появления при скролле ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.animate-on-scroll.visible {
    opacity: 1;
}

/* ===== Адаптивность ===== */
@media (max-width: 991px) {
    .hero-section {
        min-height: auto;
        padding: 120px 0 60px;
    }

    .display-4 {
        font-size: 2.5rem;
    }
}

@media (max-width: 767px) {
    .navbar-collapse {
        background: rgba(15, 15, 35, 0.98);
        padding: 1rem;
        border-radius: 12px;
        margin-top: 0.5rem;
    }

    .hero-section .btn-lg {
        width: 100%;
        max-width: 300px;
    }

    .display-4 {
        font-size: 2rem;
    }

    .card-img-wrapper {
        height: 180px;
    }
}

/* ===== Доступность ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--mai-primary);
    outline-offset: 2px;
}

/* ===== Утилиты ===== */
.text-muted {
    color: #94a3b8 !important;
}

.bg-secondary-subtle {
    background-color: rgba(99, 102, 241, 0.1) !important;
}
