/* ===== Базовые стили и переменные ===== */
:root {
    --bg-dark: #0a0a0f;
    --bg-gradient-1: #1a1a2e;
    --bg-gradient-2: #16213e;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-blue: #0a84ff;
    --accent-purple: #bf5af2;
    --accent-pink: #ff375f;
    --shadow-light: rgba(255, 255, 255, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.3);
}

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

html {
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 50%, #0f3460 100%) fixed;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ===== Анимированный фон ===== */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 50%, #0f3460 100%);
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    top: 50%;
    right: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--accent-pink) 0%, transparent 70%);
    bottom: -150px;
    left: 30%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(100px, -100px) scale(1.1);
    }
    66% {
        transform: translate(-100px, 100px) scale(0.9);
    }
}

/* ===== Контейнер ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
}

/* ===== Glassmorphism карточки ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.37),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 16px 48px 0 rgba(0, 0, 0, 0.5),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Секция профиля ===== */
.profile-section {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 50px;
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out both;
}

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

.profile-image-wrapper {
    position: relative;
    flex-shrink: 0;
    text-decoration: none;
    display: block;
    cursor: pointer;
}

.profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--glass-border);
    box-shadow: 
        0 0 0 4px rgba(255, 255, 255, 0.05),
        0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.4s ease;
}

.profile-image-wrapper:hover .profile-image {
    transform: scale(1.05);
    box-shadow: 
        0 0 0 4px rgba(10, 132, 255, 0.3),
        0 12px 40px rgba(10, 132, 255, 0.3);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-title {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.contact-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Стеклянные иконки контактов */
.contact-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: relative;
    overflow: hidden;
}

.contact-icon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.contact-icon-btn:hover::before {
    opacity: 1;
}

.contact-icon-btn svg {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
    transition: all 0.4s ease;
}

.contact-icon-btn:hover {
    background: rgba(10, 132, 255, 0.15);
    border-color: rgba(10, 132, 255, 0.4);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 10px 30px rgba(10, 132, 255, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
}

.contact-icon-btn:hover svg {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(10, 132, 255, 0.5));
}

.contact-icon-btn:active {
    transform: translateY(-2px) scale(1.02);
}

/* Специфичные цвета для каждой иконки */
.contact-icon-btn:nth-child(1):hover {
    /* Telegram */
    background: rgba(0, 136, 204, 0.15);
    border-color: rgba(0, 136, 204, 0.4);
    box-shadow: 
        0 10px 30px rgba(0, 136, 204, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
}

.contact-icon-btn:nth-child(2):hover {
    /* WhatsApp */
    background: rgba(37, 211, 102, 0.15);
    border-color: rgba(37, 211, 102, 0.4);
    box-shadow: 
        0 10px 30px rgba(37, 211, 102, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
}

.contact-icon-btn:nth-child(3):hover {
    /* Телефон */
    background: rgba(191, 90, 242, 0.15);
    border-color: rgba(191, 90, 242, 0.4);
    box-shadow: 
        0 10px 30px rgba(191, 90, 242, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
}

/* ===== Секция "Обо мне" ===== */
.about-section {
    padding: 40px 50px;
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.about-text:last-child {
    margin-bottom: 0;
}

/* ===== Секция навыков ===== */
.skills-section {
    padding: 40px 50px;
    margin-bottom: 30px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.skill-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 30px 25px;
    transition: all 0.3s ease;
    text-align: center;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.skill-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.skill-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(10, 132, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(10, 132, 255, 0.15);
}

.skill-item.visible:hover {
    transform: translateX(0) translateY(-5px);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    filter: grayscale(0.3);
    transition: all 0.3s ease;
}

.skill-item:hover .skill-icon {
    filter: grayscale(0);
    transform: scale(1.1);
}

.skill-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.skill-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ===== Секция проектов ===== */
.projects-section {
    margin-bottom: 50px;
}

.projects-section > .section-title {
    margin-bottom: 25px;
    padding-left: 10px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.project-card {
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.project-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(0, 0, 0, 0.2);
    filter: blur(8px) brightness(0.3) saturate(0.6);
    opacity: 0;
    transition: all 0.4s ease, opacity 0.6s ease;
    z-index: 0;
    will-change: transform, filter;
}

.project-card.visible .project-background {
    opacity: 0.4;
}

.project-card:hover .project-background {
    filter: blur(6px) brightness(0.35) saturate(0.7);
    opacity: 0.5;
    transform: scale(1.05);
}

.project-content {
    position: relative;
    z-index: 1;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease;
}

.project-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.project-title-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.project-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(10, 132, 255, 0.15);
    border: 1px solid rgba(10, 132, 255, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-weight: 500;
}

.expand-icon {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.project-header.active .expand-icon {
    transform: rotate(180deg);
    color: var(--accent-blue);
}

.project-description {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    opacity: 0;
    padding: 0 40px;
}

.project-description.expanded {
    max-height: 1000px;
    padding: 0 40px 30px;
    opacity: 1;
}

.project-description p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.tech-badge {
    padding: 8px 16px;
    background: rgba(191, 90, 242, 0.1);
    border: 1px solid rgba(191, 90, 242, 0.25);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--accent-purple);
    font-weight: 500;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(10, 132, 255, 0.1);
    border: 1px solid rgba(10, 132, 255, 0.3);
    border-radius: 10px;
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 5px;
    width: fit-content;
}

.project-link:hover {
    background: rgba(10, 132, 255, 0.2);
    border-color: var(--accent-blue);
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.2);
}

.project-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.project-link:hover svg {
    transform: translateX(3px) translateY(-3px);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    opacity: 0.7;
}

/* ===== Адаптивность ===== */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .profile-section {
        flex-direction: column;
        text-align: center;
        padding: 30px 25px;
    }

    .profile-name {
        font-size: 2rem;
    }

    .profile-title {
        font-size: 1.1rem;
    }

    .contact-buttons {
        justify-content: center;
    }

    .contact-icon-btn {
        width: 52px;
        height: 52px;
    }

    .contact-icon-btn svg {
        width: 22px;
        height: 22px;
    }

    .about-section {
        padding: 30px 25px;
    }

    .skills-section {
        padding: 30px 25px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .project-header {
        padding: 20px 25px;
    }

    .project-title {
        font-size: 1.2rem;
    }

    .project-description.expanded {
        padding: 0 25px 20px;
    }

    .gradient-orb {
        filter: blur(60px);
    }

    .orb-1, .orb-2, .orb-3 {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .profile-name {
        font-size: 1.6rem;
    }

    .profile-image {
        width: 140px;
        height: 140px;
    }

    .contact-btn {
        font-size: 0.9rem;
        padding: 10px 18px;
    }

    .project-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ===== Плавная прокрутка ===== */
html {
    scroll-behavior: smooth;
}

/* ===== Кастомный скроллбар ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
