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

:root {
    --bg-deep: #06050a;
    --bg-card: #0f0b1a;
    --accent: #a855f7;
    --accent-glow: #c084fc;
    --text-primary: #ede9fe;
    --text-secondary: #b9aed3;
    --glass-bg: rgba(15, 11, 26, 0.8);
    --glass-border: rgba(168, 85, 247, 0.2);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Анимированный фиолетовый фон */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 15% 25%, rgba(124, 58, 237, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: bgPulse 10s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

a {
    text-decoration: none;
    color: var(--accent-glow);
    transition: color 0.3s;
}

a:hover {
    color: #d8b4fe;
}

/* ===== Шапка ===== */
header {
    background: rgba(8, 6, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    header.header-hidden {
        transform: translateY(-100%);
    }
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, #d8b4fe, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.lang-mini {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.5);
}

.lang-mini:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.7);
}

/* ===== Hero ===== */
.hero {
    padding: 6rem 0 5rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1.2rem;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease-out;
    background: linear-gradient(to bottom, #f3e8ff, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 2.5rem;
    animation: fadeInUp 0.8s ease-out 0.15s both;
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff;
    padding: 0.9rem 2.4rem;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.45);
    animation: fadeInUp 0.8s ease-out 0.3s both;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.6);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Общие секции ===== */
section {
    padding: 5rem 0;
    position: relative;
    z-index: 2;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #e2d4ff;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 70px;
    height: 3px;
    background: var(--accent);
    margin: 0.8rem auto 0;
    border-radius: 5px;
}

/* ===== Навыки ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.4s;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s;
}

.feature-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.4);
}

.feature-icon {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: #e9d5ff;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== ПРОЕКТЫ ===== */
.projects-fullwidth {
    padding: 3rem 0;
    background: rgba(10, 7, 18, 0.6);
    backdrop-filter: blur(4px);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #0d0a1c;
    border: 1px solid var(--glass-border);
    transition: transform 0.4s, box-shadow 0.4s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    cursor: pointer;
    height: 70vh;
    width: 100%;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.4s;
}

.project-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.3);
    border-color: var(--accent);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.project-card:hover .project-img {
    transform: scale(1.02);
}

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(6,5,10,0.9) 0%, rgba(6,5,10,0.4) 60%, transparent 100%);
    padding: 3rem 2rem 2rem;
    color: white;
    transition: background 0.4s;
}

.project-card:hover .project-overlay {
    background: linear-gradient(to top, rgba(6,5,10,0.95) 0%, rgba(6,5,10,0.5) 70%, transparent 100%);
}

.project-overlay h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #e9d5ff;
}

.project-overlay p {
    font-size: 1.1rem;
    color: #cdbfe3;
    margin-bottom: 1rem;
    max-width: 80%;
}

.project-link {
    display: inline-block;
    font-weight: 600;
    color: var(--accent-glow);
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s, color 0.3s;
    font-size: 1rem;
}

.project-link:hover {
    border-bottom-color: var(--accent);
    color: #d8b4fe;
}

/* ===== Лайтбокс ===== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(6px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.3);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    background: none;
    border: none;
}

.lightbox-close:hover {
    color: var(--accent-glow);
}

.lightbox-caption {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: center;
}

/* ===== Обо мне ===== */
.about-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: center;
    justify-content: center;
}

.about-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent);
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.45);
    background: #2a1e4a;
}

.about-text {
    flex: 1;
    min-width: 280px;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* ===== Подвал ===== */
footer {
    background: rgba(8, 6, 15, 0.9);
    backdrop-filter: blur(10px);
    text-align: center;
    padding: 2rem 0;
    color: #9d8cba;
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
}

.stats-btn {
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent-glow);
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s;
    margin-top: 0.8rem;
}

.stats-btn:hover {
    background: var(--accent);
    color: white;
}

/* ===== Статистика модалка ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    color: var(--text-primary);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close {
    float: right;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover { color: white; }

.stats-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.stats-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(168,85,247,0.1);
    font-size: 0.9rem;
}

/* ===== Адаптивность ===== */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-links {
        justify-content: center;
        width: 100%;
        gap: 1rem;
    }
    .hero {
        padding: 4rem 0 3rem;
    }
    section {
        padding: 3rem 0;
    }
    .project-card {
        height: 50vh;
    }
    .project-overlay h3 {
        font-size: 1.4rem;
    }
    .about-flex {
        flex-direction: column;
        text-align: center;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
}