/* --- Глобальные переменные и сброс стилей --- */
:root {
    --primary-color: #7c3aed; /* Основной фиолетовый */
    --secondary-color: #a855f7; /* Светлый фиолетовый */
    --accent-color: #fbbf24; /* Желтый для акцентов (опционально) */
    --light-bg-color: #fafafa;
    --dark-bg-color: #f3f4f6;
    --text-color: #1f2937;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--light-bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Типографика --- */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.5rem; }

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section {
    padding: 80px 0;
}

.section-bg {
    background-color: var(--dark-bg-color);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

/* --- Навигация --- */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.1);
    color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
    left: 0;
}

/* --- Секция Hero --- */
.hero {
    padding: 120px 0 80px 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
    align-items: center;
}

.hero-photo img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.2);
    transition: all 0.5s ease;
}

.hero-photo img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 25px 50px rgba(124, 58, 237, 0.3);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #6b7280;
    margin-bottom: 20px;
}

.hero-description {
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* --- Кнопки --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(124, 58, 237, 0.4);
}

/* --- Секция "Обо мне" --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.about-info h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.about-info ul {
    list-style: none;
}

.about-info ul li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.about-info ul li:hover {
    transform: translateX(5px);
    color: var(--primary-color);
}

.about-info ul li::before {
    content: '✔';
    color: var(--secondary-color);
    position: absolute;
    left: 0;
}

/* --- Секция "Навыки" --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-item {
    transition: all 0.3s ease;
}

.skill-item:hover {
    transform: scale(1.05);
}

.skill-item h4 {
    margin-bottom: 10px;
}

.skill-bar {
    width: 100%;
    height: 10px;
    background-color: #e5e7eb;
    border-radius: 50px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.skill-item:hover .skill-bar {
    height: 15px;
}

.skill-progress {
    height: 100%;
    background: var(--gradient);
    width: 0; /* Начальная ширина для анимации */
    border-radius: 50px;
    transition: width 1.5s ease-in-out;
}

/* --- Секция "Портфолио" --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.portfolio-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    text-align: center;
    padding-bottom: 20px;
}

.portfolio-item:hover {
    transform: translateY(-10px) rotate(1deg);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.portfolio-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.portfolio-item h3 {
    margin: 20px 0 10px 0;
    color: var(--primary-color);
}

.portfolio-item p {
    padding: 0 20px;
    color: #6b7280;
}

/* --- Секция "Контакты" --- */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.contact-info p {
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.contact-info p:hover {
    transform: translateX(5px);
    color: var(--primary-color);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

/* --- Футер --- */
.footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 30px 0;
}

/* --- Анимации при прокрутке --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Дополнительные эффекты --- */
.morphing {
    animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* --- Адаптивность --- */
@media (max-width: 992px) {
    .hero-container, .about-grid, .contact-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-photo {
        max-width: 400px;
        margin: 0 auto;
    }
    .nav-menu {
        gap: 15px;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    .hero {
        padding-top: 180px;
    }
}