@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=Syne:wght@400;700;800&display=swap');

/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --bg-color: #050505;
    --card-bg: rgba(20, 20, 20, 0.6);
    --border-color: rgba(255, 255, 255, 0.15);
    --accent: #fff;
    --neon-pink: #ff0055; 
    --text-gray: #aaa;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%; 
    height: 100%;
    background-color: var(--bg-color);
    color: var(--accent);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;       
    position: relative;       
    touch-action: pan-y;      
    -webkit-overflow-scrolling: touch; 
}

section {
    padding: 0 5%; 
    min-height: 100vh; 
    box-sizing: border-box;
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    position: relative;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

/* =========================================
   2. TYPOGRAPHY
   ========================================= */
h2 {
    font-family: 'Syne', sans-serif; 
    font-size: 3rem; 
    font-weight: 700;
    margin-bottom: 0; 
    text-transform: uppercase;
    text-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.section-header {
    display: flex; 
    justify-content: flex-start; 
    align-items: center;
    margin-bottom: 50px; 
    position: relative; 
    z-index: 1;
}

.big-name {
    font-family: 'Syne', sans-serif; 
    font-size: clamp(3rem, 10vw, 6rem); 
    line-height: 0.9; 
    font-weight: 800; 
    text-transform: uppercase;
    margin-bottom: 40px; 
    letter-spacing: -2px;
    background: linear-gradient(to right, #e4e4e4, #848484); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
    word-wrap: break-word; 
}

.big-name span {
    display: block; 
    font-family: 'Inter', sans-serif; 
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 300; 
    letter-spacing: 5px; 
    margin-top: 15px; 
    color: var(--text-gray);
    -webkit-text-fill-color: var(--text-gray);
}

/* =========================================
   3. BACKGROUNDS & OVERLAYS
   ========================================= */
.video-background {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2; object-fit: cover;
}

.video-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(5,5,5,0.2) 0%, var(--bg-color) 95%);
    z-index: -1;
}

#features .video-overlay {
     backdrop-filter: none;
     background: rgba(5,5,5,0.85); 
}

/* =========================================
   4. NAVIGATION
   ========================================= */
nav {
    display: flex; justify-content: center; align-items: center;
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%) translateY(-20px); 
    z-index: 100; opacity: 0; transition: 0.5s ease;
    background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(10px);
    padding: 5px; border-radius: 50px; border: 1px solid rgba(255,255,255,0.1);
}
nav.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.menu { position: relative; display: flex; gap: 5px; }
.menu a {
    position: relative; color: #fff; padding: 10px 25px;
    font-size: 0.85rem; font-weight: 500; text-transform: uppercase;
    letter-spacing: 1px; cursor: pointer; z-index: 2; transition: color 0.3s;
}
.menu a:hover { color: #000; }

.nav-marker {
    position: absolute; left: 0; top: 0; height: 100%;
    background: #fff; border-radius: 50px; z-index: 1; 
    opacity: 0; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); pointer-events: none;
}

/* =========================================
   5. HERO SECTION
   ========================================= */
#hero {
    align-items: center; 
    justify-content: flex-end; 
    padding-bottom: 50px;
    overflow: hidden;
}

.scroll-indicator {
    width: 30px; height: 30px; 
    border-bottom: 3px solid var(--neon-pink); 
    border-right: 3px solid var(--neon-pink);
    transform: rotate(45deg); 
    animation: float 2.5s infinite ease-in-out; 
    cursor: pointer;
    margin-bottom: 40px;
    filter: drop-shadow(0 0 5px var(--neon-pink)) drop-shadow(0 0 15px var(--neon-pink));
    transition: opacity 0.3s, transform 0.3s;
}
.scroll-indicator:hover { opacity: 1; transform: rotate(45deg) scale(1.1); }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(45deg); }
    50% { transform: translateY(15px) rotate(45deg); }
}

/* =========================================
   6. SKILLS (BENTO GRID)
   ========================================= */
.bento-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; width: 100%; position: relative; z-index: 1;
}

.tech-card {
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 30px; 
    display: flex; flex-direction: column; justify-content: space-between; 
    min-height: 250px; position: relative; overflow: hidden;
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer; display: block;
}
.tech-card::before {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 0, 85, 0.1), transparent 40%);
    opacity: 0; transition: opacity 0.5s; z-index: 0; pointer-events: none;
}
.tech-card:hover::before { opacity: 1; } 
.tech-card > * { position: relative; z-index: 1; }
.tech-card:hover { 
    border-color: var(--neon-pink); transform: translateY(-5px) scale(1.02); 
    box-shadow: 0 0 25px rgba(255, 0, 85, 0.4), inset 0 0 10px rgba(255, 0, 85, 0.1); 
    background: rgba(255, 0, 85, 0.05); 
}
.card-icon { font-size: 2rem; margin-bottom: 20px; color: var(--neon-pink); transition: 0.3s; }
.tech-card:hover .card-icon { text-shadow: 0 0 15px var(--neon-pink); transform: scale(1.1); }
.tech-card h3 { font-family: 'Syne', sans-serif; font-size: 1.6rem; margin: 0 0 15px 0; color: #fff; line-height: 1.2; }
.tech-card p { color: var(--text-gray); font-size: 0.95rem; line-height: 1.6; font-weight: 300; margin: 0; }

/* =========================================
   7. WORKS GALLERY
   ========================================= */
.gallery { 
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; 
    position: relative; z-index: 1; 
}
.work-item { 
    position: relative; border-radius: 12px; overflow: hidden; 
    aspect-ratio: 16/9; border: 1px solid var(--border-color); cursor: pointer; 
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.work-item img, .work-item video { 
    width: 100%; height: 100%; object-fit: cover; 
    transition: 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); 
    filter: grayscale(100%) brightness(0.8); display: block;
}
.work-item:hover img, .work-item:hover video { transform: scale(1.05); filter: grayscale(0%) brightness(1); }

.work-label {
    position: absolute; bottom: 20px; left: 20px;
    background: rgba(0, 0, 0, 0.6); color: #fff; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    padding: 8px 16px; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.9rem;
    text-transform: uppercase; border-radius: 50px; z-index: 10; backdrop-filter: blur(5px);
    pointer-events: none; transition: 0.4s ease;
}
.work-item:hover .work-label {
    background: var(--neon-pink); color: #000; border-color: var(--neon-pink);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.5); transform: translateY(-2px);
}

/* =========================================
   8. CONTACTS & FORM
   ========================================= */
#contacts { position: relative; }

.contact-wrapper { 
    position: relative; z-index: 2; display: flex; 
    justify-content: space-between; align-items: center; 
    width: 100%; max-width: 1200px; margin: 0 auto; gap: 50px; 
}

.contact-info { 
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; align-items: flex-start; text-align: left;
}

.contact-title {
    font-family: 'Syne', sans-serif; font-size: clamp(3rem, 5vw, 5rem);
    font-weight: 800; line-height: 1; margin-bottom: 20px; 
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.pointing-arrow {
    width: 80px; height: 60px; margin-bottom: 40px; color: var(--neon-pink);
    animation: pointerMove 2s infinite ease-in-out;
}
.pointing-arrow svg {
    width: 100%; height: 100%; fill: none; stroke: currentColor; 
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
@keyframes pointerMove {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.social-container { margin-top: 0; }
.find-me-text {
    color: var(--text-gray); font-size: 0.85rem;
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 15px; font-family: 'Syne', sans-serif; font-weight: 700;
}
.social-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-start; }
.social-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 22px; border-radius: 50px; 
    border: 1px solid rgba(255,255,255,0.2); 
    color: #fff; text-decoration: none;
    font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.9rem;
    text-transform: uppercase; letter-spacing: 1px; transition: 0.3s;
}
.social-btn:hover {
    background: var(--neon-pink); border-color: var(--neon-pink); color: #000;
    transform: translateY(-5px); box-shadow: 0 0 15px var(--neon-pink);
}

.form-container {
    flex: 1; max-width: 500px; width: 100%;
    background: rgba(20, 20, 20, 0.4); padding: 40px; 
    border-radius: 20px; border: 1px solid var(--border-color); 
    backdrop-filter: blur(10px);
}
.modern-form { display: flex; flex-direction: column; gap: 25px; }
.modern-input {
    width: 100%; padding: 15px 0; background: transparent; border: none;
    border-bottom: 1px solid #333; color: #fff; 
    font-family: 'Inter', sans-serif; font-size: 1rem; outline: none; transition: all 0.3s;
}
.modern-input:focus { border-bottom-color: var(--neon-pink); padding-left: 10px; }

.submit-btn {
    position: relative; align-self: flex-start; margin-top: 10px; padding: 15px 40px; 
    background: transparent; border: 1px solid rgba(255,255,255,0.3); color: #fff; 
    font-family: 'Syne', sans-serif; font-weight: 700; text-transform: uppercase; 
    cursor: pointer; transition: 0.3s; border-radius: 50px; overflow: hidden; z-index: 1;
}
.submit-btn::before {
    content: ''; position: absolute; top: 0; left: 0; width: 0; height: 100%;
    background: #fff; z-index: -1; transition: 0.3s ease;
}
.submit-btn:hover::before { width: 100%; }
.submit-btn:hover { color: #000; border-color: #fff; }

/* Floating Button */
.floating-contact-btn {
    position: fixed; bottom: 40px; left: 50%;
    transform: translateX(-50%) translateY(50px); 
    background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.4); color: #fff;
    padding: 14px 35px; font-size: 1rem; border-radius: 50px;
    font-family: 'Inter', sans-serif; font-weight: 500;
    text-transform: uppercase; text-decoration: none; letter-spacing: 1px;
    z-index: 999; opacity: 0; pointer-events: none;
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.floating-contact-btn.visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: all; }
.floating-contact-btn:hover {
    border-color: #fff; background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4); 
}

/* =========================================
   9. UI COMPONENTS (Lightbox, Footer)
   ========================================= */
#lightbox {
    visibility: hidden; opacity: 0; position: fixed; z-index: 10000;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.4s;
}
#lightbox.active { visibility: visible; opacity: 1; }
#lightbox img {
    max-width: 85vw; max-height: 85vh; object-fit: contain; border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5); transform: scale(0.7); opacity: 0;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.5s ease;
}
#lightbox.active img { transform: scale(1); opacity: 1; }

footer {
    text-align: center; padding: 30px 20px;
    color: #555; font-size: 0.8rem; font-family: 'Inter', sans-serif;
    text-transform: uppercase; letter-spacing: 1px;
    border-top: 1px solid rgba(255,255,255,0.05); margin-top: 50px;
}

/* =========================================
   10. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    section { padding: 50px 5%; }
    h2 { font-size: 2.2rem; }
    nav { width: 85%; }
    .menu a { padding: 10px 15px; font-size: 0.75rem; }
    
    .big-name { 
        font-size: 9vw; 
        margin-bottom: 20px; 
        line-height: 0.9;
    }
    .big-name span { 
        font-size: 0.8rem; 
        letter-spacing: 3px; 
    }
    
    .work-label {
        font-size: 0.7rem; padding: 6px 12px;      
        bottom: 15px; left: 15px;
    }

    .work-item {
        padding: 0 !important;    
        display: block !important;  
        aspect-ratio: 16/9;         
        height: auto !important;
        /* Начальное состояние для анимации появления */
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }
    .work-item.mobile-visible {
        opacity: 1;
        transform: translateY(0);
    }

    .work-item img, 
    .work-item video {
        filter: grayscale(100%) brightness(0.5); 
        transform: scale(0.95); 
        transition: all 0.4s ease-out; 
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        margin: 0 !important;
        border-radius: 12px;
    }

    .work-item.active-center img, 
    .work-item.active-center video {
        filter: grayscale(0%) brightness(1); 
        transform: scale(1); 
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    .bento-grid { grid-template-columns: 1fr 1fr; gap: 15px; }
    .tech-card { padding: 15px; min-height: 160px; }
    .tech-card h3 { font-size: 1.1rem; margin-bottom: 5px; }
    .card-icon { font-size: 1.5rem; margin-bottom: 10px; }
    .tech-card p { display: none; }  

    .gallery { grid-template-columns: 1fr; gap: 20px; }
    
    .contact-wrapper { flex-direction: column; text-align: center; gap: 30px; }
    .contact-info { width: 100%; align-items: flex-start; text-align: left; margin-bottom: 10px; }
    .form-container { width: 100%; padding: 30px 20px; box-sizing: border-box; }
    .contact-title { font-size: 2.6rem; text-align: left; }
    
    .pointing-arrow { 
        transform: rotate(90deg); 
        animation: pointerMoveMobile 2s infinite ease-in-out;
        margin-bottom: 20px; margin-top: 10px;
        align-self: center; 
    }
    @keyframes pointerMoveMobile {
        0%, 100% { transform: rotate(90deg) translateX(0); }
        50% { transform: rotate(90deg) translateX(10px); }
    }
    .social-links { justify-content: flex-start; }
    .social-btn { padding: 8px 18px; font-size: 0.8rem; }
    .submit-btn { width: 100%; align-self: center; }
    .floating-contact-btn {
        bottom: 25px; padding: 12px 30px; font-size: 0.9rem; width: max-content;
    }
}