/* CSS переменные */
:root {
    --primary: #e74c3c;
    --secondary: #2c3e50;
    --accent: #f39c12;
    --light: #ecf0f1;
    --dark: #2c3e50;
}

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
}

h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--secondary);
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 14px 32px;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
    text-align: center;
}

.btn:hover {
    background-color: #c0392b;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.6);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid white;
    margin-left: 15px;
}

.btn-outline:hover {
    background-color: white;
    color: var(--primary);
}

/* Герой секция */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--dark) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23e74c3c" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,197.3C1248,203,1344,149,1392,122.7L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: center;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.profile-img {
    width: 380px;
    height: 380px;
    border-radius: 50%;
    object-fit: cover;
    border: 8px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s ease;
    position: relative;
    z-index: 2;
}

.profile-img:hover {
    transform: scale(1.05);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--accent), #ff9ff3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
    opacity: 0.9;
    text-align: left;
    color: white;
}

.description {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Анимация для героя */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

/* Обо мне */
.about {
    background-color: white;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Навыки */
.skills {
    background-color: var(--light);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.skill-item {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    border-top: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.skill-item:hover {
    transform: translateY(-10px);
}

.skill-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.skill-item h3 {
    margin-bottom: 15px;
    color: var(--secondary);
}

.skill-item p {
    color: #666;
    line-height: 1.5;
}

/* Портфолио - ИСПРАВЛЕННЫЙ БЛОК */
.portfolio {
    background-color: white;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.portfolio-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.portfolio-img-container {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-item:hover .portfolio-img {
    transform: scale(1.05);
}

.portfolio-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.portfolio-info h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--secondary);
}

/* Контакты */
.contact {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--dark) 100%);
    color: white;
}

.contact h2 {
    color: white;
}

.contact-content {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.contact-info {
    flex: 1;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.contact-form {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: border 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* Футер */
footer {
    background-color: var(--dark);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.social-link:hover {
    transform: translateY(-5px);
}

/* Адаптивность */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        padding: 60px 0;
    }
    
    .hero-text {
        margin-bottom: 50px;
    }
    
    .hero h2 {
        text-align: center;
    }
    
    h1 {
        font-size: 2.8rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .contact-content {
        flex-direction: column;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 2.2rem;
    }
    
    .hero h2 {
        font-size: 1.3rem;
    }
    
    .description {
        font-size: 1rem;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 1rem;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-outline {
        margin-left: 0;
    }
    
    .profile-img {
        width: 280px;
        height: 280px;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-img-container {
        height: 220px;
    }
}