* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --dark: #f9fafb;
    --light: #111827;
    --gray: #9ca3af;
    --transition: all 0.3s ease;
}

body {
    background: #111827;
    color: var(--dark);
    min-height: 100vh;
    transition: var(--transition);
    overflow-x: hidden;
}

#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

/* Animated Background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-size: cover;
    background-position: center;
    transform: translateZ(0);
    will-change: transform;
}

.layer-1 {
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 20%),
                radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 20%),
                radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 30%);
    animation: moveLayer1 50s linear infinite;
}

.layer-2 {
    background: radial-gradient(circle at 30% 40%, rgba(6, 182, 212, 0.1) 0%, transparent 15%),
                radial-gradient(circle at 70% 30%, rgba(14, 165, 233, 0.1) 0%, transparent 15%),
                radial-gradient(circle at 20% 70%, rgba(244, 63, 94, 0.05) 0%, transparent 20%);
    animation: moveLayer2 70s linear infinite;
}

.layer-3 {
    background: radial-gradient(circle at 60% 10%, rgba(168, 85, 247, 0.1) 0%, transparent 10%),
                radial-gradient(circle at 40% 90%, rgba(239, 68, 68, 0.1) 0%, transparent 10%),
                radial-gradient(circle at 80% 60%, rgba(59, 130, 246, 0.05) 0%, transparent 15%);
    animation: moveLayer3 90s linear infinite;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: floatParticle linear infinite;
}

@keyframes moveLayer1 {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-10%, -5%); }
    50% { transform: translate(-20%, -10%); }
    75% { transform: translate(-10%, -5%); }
    100% { transform: translate(0, 0); }
}

@keyframes moveLayer2 {
    0% { transform: translate(0, 0); }
    25% { transform: translate(5%, 10%); }
    50% { transform: translate(10%, 20%); }
    75% { transform: translate(5%, 10%); }
    100% { transform: translate(0, 0); }
}

@keyframes moveLayer3 {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-15%, 5%); }
    50% { transform: translate(-30%, 10%); }
    75% { transform: translate(-15%, 5%); }
    100% { transform: translate(0, 0); }
}

@keyframes floatParticle {
    to {
        transform: translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

/* Content Wrapper */
.content-wrapper {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
}

.controls {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border-radius: 30px;
    border: none;
    background: #374151;
    color: var(--dark);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Hero Section */
.hero {
    padding: 150px 0 100px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.hero-text h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero-text h1 span {
    display: block;
}

.name {
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 30px;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
}

.cta-button {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

.hero-image {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.image-grid {
    position: relative;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    transform-style: preserve-3d;
}

.image-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden; /* Ключевой стиль - скрывает выступающие части */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    will-change: transform;
    background-color: transparent;
    width: 100%; /* Убедитесь, что ширина задана */
}

.image-item:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border-color: var(--primary);
}

/* Стили для каждого конкретного изображения */
.image-1 {
    width: 300px;
    height: 300px;
    z-index: 3;
}

.image-2 {
    width: 200px;
    height: 200px;
    z-index: 2;
}

.image-3 {
    width: 150px;
    height: 150px;
    z-index: 1;
}

/* Ключевой стиль для изображений */
.image-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Изменено со 'cover' на 'contain' */
    object-position: center;
    transition: transform 0.5s ease;
    opacity: 1;
    display: block;
}

.image-item:hover img {
    transform: scale(1.1);
    opacity: 0.9;
}

/* Обработка прозрачности */
.image-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 20px;
}

.image-item:hover::before {
    opacity: 0.1;
}

/* Sections */
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.section-title .underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    margin: 0 auto;
    border-radius: 2px;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--gray);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.skill-card {
    background: #374151;
    padding: 20px 20px;
    border-radius: 20px;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

.skill-card h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-top: 0px;
}

/* Footer */
footer {
    background: #111827;
    color: var(--dark);
    padding: 60px 0 30px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content h3 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.footer-content p {
    color: var(--gray);
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.footer-social a {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    font-size: 1.2rem;
    text-decoration: none;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    transform: translateY(-5px);
}

.copyright {
    border-top: 1px solid #374151;
    padding-top: 30px;
    color: var(--gray);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .hero-text h1 {
        font-size: 3rem;
    }

    .hero-image {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 120px 0 80px;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    section {
        padding: 80px 0;
    }

    .section-title h2 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .image-grid {
        flex-direction: column;
        align-items: center;
    }

    .image-item {
        margin-bottom: 20px;
    }
}