html {
  overscroll-behavior: none;
}

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

body {
    font-family: 'Poppins', sans-serif;
    min-height: 200vh;
    height: auto;
    overflow-x: hidden;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 25%, #4a4a4a 50%, #2c2c2c 75%, #1a1a1a 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "liga", "kern";
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    touch-action: manipulation;
    will-change: background-position;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes gradientShift {
    0% { 
        background-position: 0% 50%; 
        transform: translateZ(0);
    }
    50% { 
        background-position: 100% 50%; 
        transform: translateZ(0);
    }
    100% { 
        background-position: 0% 50%; 
        transform: translateZ(0);
    }
}

/* Performance optimization for mobile */
@media (max-width: 768px) {
    .stars, .stars2, .stars3 {
        will-change: transform;
        transform: translateZ(0);
        animation-duration: 30s, 15s, 10s;
        contain: strict;
    }
    
    .social-icon {
        will-change: transform;
        transform: translateZ(0);
        contain: layout style;
    }
    
    .name {
        will-change: text-shadow;
        transform: translateZ(0);
        contain: layout style;
    }
    
    /* Reduce particle density on mobile */
    .stars {
        background-size: 300px 150px;
    }
    
    .stars2 {
        background-size: 350px 180px;
    }
    
    .stars3 {
        background-size: 280px 140px;
    }
}

.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.stars, .stars2, .stars3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}

.stars {
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: zoom 20s alternate infinite;
}

.stars2 {
    background-image: 
        radial-gradient(1px 1px at 40px 60px, #fff, transparent),
        radial-gradient(1px 1px at 120px 10px, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 170px 50px, #fff, transparent);
    background-repeat: repeat;
    background-size: 250px 120px;
    animation: zoom 10s alternate infinite;
}

.stars3 {
    background-image: 
        radial-gradient(1px 1px at 10px 10px, #fff, transparent),
        radial-gradient(2px 2px at 150px 90px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 60px 20px, #fff, transparent);
    background-repeat: repeat;
    background-size: 180px 90px;
    animation: zoom 7s alternate infinite;
}

@keyframes zoom {
    0% { 
        transform: scale3d(1, 1, 1) translateZ(0); 
        will-change: transform;
    }
    100% { 
        transform: scale3d(1.2, 1.2, 1) translateZ(0); 
        will-change: transform;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .stars, .stars2, .stars3 {
        animation: none;
    }
    
    .name {
        animation: none;
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    }
    
    .scroll-indicator {
        animation: none;
    }
    
    .content {
        animation: none;
        opacity: 1;
        transform: translateY(0);
    }
    
    body {
        animation: none;
        background-position: 0% 50%;
    }
}

.container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding-bottom: 50vh;
    position: relative;
    z-index: 1;
}

.content {
    text-align: center;
    color: white;
    animation: fadeInUp 2s ease-out;
    margin-top: 30vh;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translate3d(0, 50px, 0);
        will-change: transform, opacity;
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
        will-change: transform, opacity;
    }
}

.name {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 8px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: glow 3s ease-in-out infinite alternate;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "liga", "kern";
    font-variant-ligatures: common-ligatures;
    font-kerning: auto;
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
        transform: translateZ(0);
        will-change: text-shadow;
    }
    to {
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 255, 255, 0.6);
        transform: translateZ(0);
        will-change: text-shadow;
    }
}

.title {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 3px;
    margin-bottom: 40px;
    opacity: 0.9;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "liga", "kern";
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 60px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.social-icon:hover::before {
    left: 100%;
}

.social-icon:hover {
    transform: translate3d(0, -10px, 0) scale3d(1.1, 1.1, 1);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
    will-change: transform;
}

.twitter:hover {
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}



.instagram:hover {
    background: linear-gradient(45deg, rgba(225, 48, 108, 0.3), rgba(255, 220, 128, 0.3));
    box-shadow: 0 10px 30px rgba(225, 48, 108, 0.4);
}

/* Projects Section */
.projects-section {
    padding: 20px 20px 80px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.projects-title {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    color: white;
    margin-bottom: 60px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    animation: fadeInUp 1s ease-out;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    justify-items: center;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px 30px;
    width: 100%;
    max-width: 450px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.project-card::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.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.project-card:hover::before {
    opacity: 1;
}

.project-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
}

.project-icon i {
    font-size: 2.5rem;
    color: white;
    transition: all 0.4s ease;
}

.project-card:hover .project-icon {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.project-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.project-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 25px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.tech-tag {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 12px 25px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.project-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.project-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.project-link:hover::before {
    left: 100%;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .projects-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .project-card {
        max-width: 100%;
        padding: 30px 20px;
    }
    
    .projects-title {
        font-size: 2.5rem;
    }
    
    .project-title {
        font-size: 1.5rem;
    }
}

.telegram:hover {
    background: rgba(0, 136, 204, 0.3);
    box-shadow: 0 10px 30px rgba(0, 136, 204, 0.4);
}

.scroll-indicator {
    font-size: 2rem;
    animation: bounce 2s infinite;
    opacity: 0.7;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translate3d(0, 0, 0);
        will-change: transform;
    }
    40% {
        transform: translate3d(0, -10px, 0);
        will-change: transform;
    }
    60% {
        transform: translate3d(0, -5px, 0);
        will-change: transform;
    }
}

/* Enhanced Mobile Optimization */
@media (max-width: 768px) {
    body {
        background-attachment: fixed;
    }
    
    .container {
        padding: 20px;
        height: 100vh;
        height: 100dvh;
    }
    
    .content {
        transform: scale(0.95);
    }
    
    .name {
        font-size: 2.8rem;
        letter-spacing: 3px;
        margin-bottom: 15px;
        line-height: 1.1;
    }
    
    .title {
        font-size: 1.3rem;
        letter-spacing: 2px;
        margin-bottom: 35px;
    }
    
    .social-icons {
        gap: 25px;
        margin-bottom: 50px;
    }
    
    .social-icon {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
        -webkit-tap-highlight-color: transparent;
    }
    
    .scroll-indicator {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .content {
        transform: scale(0.9);
    }
    
    .name {
        font-size: 2.2rem;
        letter-spacing: 2px;
        margin-bottom: 12px;
    }
    
    .title {
        font-size: 1.1rem;
        letter-spacing: 1px;
        margin-bottom: 30px;
    }
    
    .social-icons {
        gap: 18px;
        margin-bottom: 40px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .social-icon {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }
    
    .scroll-indicator {
        font-size: 1.5rem;
    }
}

@media (max-width: 360px) {
    .content {
        transform: scale(0.85);
    }
    
    .name {
        font-size: 1.8rem;
        letter-spacing: 1px;
    }
    
    .title {
        font-size: 1rem;
        letter-spacing: 0.5px;
    }
    
    .social-icons {
        gap: 15px;
    }
    
    .social-icon {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}

/* High DPI displays optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    * {
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: subpixel-antialiased;
        -moz-osx-font-smoothing: auto;
    }
    
    .name {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.5), 0 0 1px rgba(255, 255, 255, 0.8);
    }
    
    .social-icon {
        border-width: 0.5px;
        box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1);
    }
    
    .stars, .stars2, .stars3 {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: pixelated;
    }
}

/* 4K and Ultra High DPI displays */
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
    .name {
        font-weight: 600;
        text-shadow: 0 0 25px rgba(255, 255, 255, 0.6), 0 0 2px rgba(255, 255, 255, 0.9);
    }
    
    .social-icon {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
}