@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400&family=Montserrat:wght@300;400;600;700;900&display=swap');

:root {
    --bg: #0a0a0a;           
    --bg-alt: #050505;       
    --text: #e0e0e0;         
    --text-muted: #888888;   
    --accent: #8a2be2; 

    --index: calc(1vw + 1vh);
    --transition: ease-in-out;
}

* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, .logo, nav a, .lang-btn, .letters, .huge-title, .footer-email, .footer-phone, .rounded-btn, .legal-title, .vr-btn, .stack-title {
    font-family: 'Montserrat', sans-serif;
}

body.no-scroll { overflow: hidden; }

.content, .hero, .project-media, .project-info, .header-content, footer, .animate-title {
    will-change: transform;
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 40px; }

/* ==========================================
   ПРЕЛОАДЕР И КУРСОР
   ========================================== */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg); z-index: 999999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease; overflow: hidden;
}
#preloader.hidden { opacity: 0; visibility: hidden; }

.morph-blob {
    position: absolute; width: 350px; height: 350px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.08));
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morphing 8s ease-in-out infinite, rotation 15s linear infinite; filter: blur(25px); z-index: 1;
}
@keyframes morphing {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    33% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    66% { border-radius: 70% 30% 50% 50% / 30% 70% 40% 60%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}
@keyframes rotation { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.preloader-content, .loading-bar { position: relative; z-index: 2; }
.preloader-content { font-family: 'Montserrat', sans-serif; font-size: clamp(3rem, 6vw, 6rem); font-weight: 700; color: var(--text); margin-bottom: 20px; letter-spacing: -2px; }
.loading-bar { width: 250px; height: 2px; background-color: rgba(255, 255, 255, 0.1); overflow: hidden; border-radius: 2px;}
.loading-bar-progress { width: 0%; height: 100%; background-color: var(--accent); }

.custom-cursor {
    position: fixed; top: 0; left: 0; width: 14px; height: 14px;
    background-color: var(--accent); border-radius: 50%; pointer-events: none; z-index: 9999999;
    transform: translate(-50%, -50%); transition: width 0.3s, height 0.3s, background-color 0.3s;
}

/* ==========================================
   ШАПКА
   ========================================== */
header {
    position: fixed; top: 0; width: 100%; padding: 30px 0; z-index: 100;
    transition: background-color 0.4s ease, padding 0.4s ease;
    background: linear-gradient(to bottom, rgba(10,10,10,0.8) 0%, rgba(10,10,10,0) 100%);
}
header.scrolled { background-color: rgba(10, 10, 10, 0.95); padding: 15px 0; backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,0.05); }

.header-content-nav { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.2rem; font-weight: 900; letter-spacing: 1px; color: var(--text); text-transform: uppercase; text-decoration: none; }

.logo-mobile { display: none; position: relative; width: 40px; height: 40px; }
.logo-m-1, .logo-m-2 { font-weight: 900; font-size: 1.8rem; line-height: 1; position: absolute; }
.logo-m-1 { top: 0; left: 0; color: var(--text); z-index: 2; }
.logo-m-2 { top: 8px; left: 14px; color: var(--accent); z-index: 1; }

.desktop-nav a { color: var(--text); text-decoration: none; margin-left: 40px; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; transition: color 0.3s; }
.desktop-nav a:hover { color: var(--accent); }

.lang-btn {
    background: transparent; border: none; color: var(--text);
    font-size: 0.85rem; font-weight: 900; margin-left: 40px; padding: 6px 12px; 
    border: 1px solid rgba(255,255,255,0.2); border-radius: 20px; transition: all 0.3s;
}
.lang-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.burger-btn { display: none; flex-direction: column; gap: 6px; cursor: pointer; z-index: 200; }
.burger-btn span { width: 35px; height: 3px; background: var(--text); border-radius: 3px; transition: 0.4s ease; }
.burger-btn.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); background: var(--accent); }
.burger-btn.active span:nth-child(2) { opacity: 0; }
.burger-btn.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); background: var(--accent); }

.mobile-menu {
    position: fixed; top: 0; right: -100%; width: 100%; height: 100vh;
    background: rgba(5,5,5,0.98); z-index: 150;
    display: flex; justify-content: center; align-items: center;
    transition: right 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.mobile-menu.active { right: 0; }
.mobile-menu nav { display: flex; flex-direction: column; align-items: center; gap: 40px; }
.mobile-menu a { font-size: 2rem; font-weight: 700; text-transform: uppercase; color: var(--text); text-decoration: none; transition: color 0.3s;}
.mobile-menu a:hover { color: var(--accent); }
.mobile-menu .mobile-lang-btn { font-size: 1.5rem; margin: 0; padding: 10px 30px; }

.close-menu {
    position: absolute; top: 25px; right: 25px; font-size: 50px; line-height: 1;
    color: var(--text); cursor: pointer; transition: color 0.3s;
}
.close-menu:hover { color: var(--accent); }

/* ==========================================
   ГЛАВНЫЙ ЭКРАН
   ========================================== */
.hero { height: 100vh; position: relative; background-color: var(--bg); }
.slider { height: 100%; }

.slider__layer {
    position: absolute; inset: 0; background-size: cover; background-position: center;
    will-change: transform;
}
.slider__item { overflow: hidden; transform: scale(1.15)!important; transition: 2s ease!important; }
.slider__item:not(.swiper-slide-active) { transform: scale(1)!important; }

.slider-ui { position: absolute; z-index: 10; inset: 0; pointer-events: none; }
.header-content {
    width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;
    text-align: center; flex-direction: column; line-height: 1;
}

.header-content__slide { position: absolute; }

.header-content h1 {
    font-size: clamp(2rem, 9vw, 10rem); 
    text-transform: uppercase; font-weight: 900;
    margin-bottom: 30px; color: var(--text);
}

.letters .letter {
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.9); 
    position: relative; opacity: 0; top: -5em; 
    transition: opacity var(--transition), top var(--transition); 
}
.header-content__slide.active .letter { opacity: 1; top: 0; }
.header-content__slide.active + * .letter { top: 5em; }

.header-content__info {
    max-width: 600px; margin: 0 auto; padding: 0 20px;
    font-weight: 400; line-height: 1.6; font-size: 1.1rem; color: #fff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
    
    top: -18em; position: relative; opacity: 0;
    transition: opacity 1s ease, top 1.25s ease;
}
.header-content__slide.active .header-content__info { opacity: 1; top: 0; }
.header-content__slide:has(* + .active .header-content__info),
.header-content__slide.active + * .header-content__info { top: 18em; }

/* ==========================================
   ПОРТФОЛИО
   ========================================== */
#portfolio { padding: 120px 40px 0; }

.huge-title {
    font-size: clamp(2rem, 5vw, 4.5rem); font-weight: 900; line-height: 1.1;
    text-transform: uppercase; letter-spacing: -1px; margin-bottom: 80px; color: var(--text); 
}

.project-row { display: flex; align-items: center; gap: 80px; margin-bottom: 160px; }
.project-row.reverse { flex-direction: row-reverse; }

.project-media {
    flex: 1.2; position: relative; overflow: hidden; background: #111;
    aspect-ratio: 4 / 3; border-radius: 24px;
}
.project-media img, .project-media video.thumbnail-video {
    width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}
.project-media:hover img, .project-media:hover video.thumbnail-video { transform: scale(1.05); }

.project-info { flex: 0.8; }
.project-info h3 { font-size: clamp(2rem, 3vw, 2.5rem); font-weight: 700; margin-bottom: 20px; line-height: 1.1; color: var(--text); }
.project-info p { font-size: 1.1rem; color: var(--text-muted); font-weight: 300; line-height: 1.7; }

.vr-overlay, .video-overlay {
    position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.4s ease;
}
.vr-trigger:hover .vr-overlay, .video-trigger:hover .video-overlay { opacity: 1; }

.vr-btn {
    padding: 16px 36px; border: 1px solid var(--accent); background: var(--accent);
    color: #fff; font-weight: 700; text-transform: uppercase; font-size: 0.9rem;
    border-radius: 50px; transition: transform 0.3s;
}
.vr-trigger:hover .vr-btn { transform: scale(1.05); }

.play-circle {
    width: 80px; height: 80px; border-radius: 50%;
    background: rgba(0,0,0,0.6); border: 2px solid var(--accent);
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(5px); transition: transform 0.3s, background 0.3s;
}
.video-trigger:hover .play-circle { transform: scale(1.1); background: var(--accent); }
.play-triangle {
    width: 0; height: 0; margin-left: 5px;
    border-top: 12px solid transparent; border-bottom: 12px solid transparent; border-left: 20px solid #fff;
}

/* ==========================================
   ДРУГИЕ РАБОТЫ (ГАЛЕРЕЯ)
   ========================================== */
#more-works { padding: 40px 40px 100px; overflow: hidden; }

.gallery-wrapper {
    position: relative; max-width: 900px; margin: 0 auto; padding: 0 80px; 
    display: flex; align-items: center; justify-content: center;
}

.cards-slider { width: 260px; height: 350px; margin: 0; padding: 40px 0; overflow: visible; }
.cards-slider .swiper-slide {
    display: flex; align-items: center; justify-content: center;
    border-radius: 20px; background: #1a1a1a; box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}
.cards-slider .swiper-slide img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }

.gallery-prev, .gallery-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    color: var(--accent); background: rgba(10,10,10,0.8); border: 1px solid var(--accent);
    width: 50px; height: 50px; border-radius: 50%; backdrop-filter: blur(5px);
    transition: all 0.3s; display: flex; justify-content: center; align-items: center; z-index: 20;
}
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }
.gallery-prev:hover, .gallery-next:hover { background: var(--accent); color: #fff; transform: translateY(-50%) scale(1.1); }
.gallery-prev::after, .gallery-next::after { font-size: 1.2rem; font-weight: 900; }

.swipe-hint {
    text-align: center; margin-top: 40px; color: var(--text-muted);
    font-size: 0.9rem; letter-spacing: 2px; text-transform: uppercase; font-family: 'Montserrat', sans-serif;
    animation: pulse 2s infinite; pointer-events: none;
}

/* ==========================================
   СТЕК ТЕХНОЛОГИЙ (ПО)
   ========================================== */
.tech-stack { padding: 40px 40px 80px; }
.stack-title {
    font-size: 0.9rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 2px; color: var(--text-muted); margin-bottom: 30px; text-align: center;
}
.tech-grid {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
}
.tech-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}
.tech-item:hover {
    border-color: var(--accent);
    background: rgba(138, 43, 226, 0.1);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(138, 43, 226, 0.2);
}

/* ==========================================
   ФУТЕР
   ========================================== */
footer { padding: 100px 40px 60px; background-color: var(--bg-alt); border-top: 1px solid #1a1a1a; }

.footer-subtitle { font-size: 1.2rem; color: var(--accent); margin-bottom: 20px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

.footer-email {
    display: block; font-size: clamp(16px, 5vw, 80px); font-weight: 300; 
    color: var(--text); text-decoration: none; line-height: 1.1; margin-bottom: 80px;
    letter-spacing: -1px; transition: color 0.3s; white-space: nowrap;
}
.footer-email:hover { color: var(--accent); }

.footer-grid { display: grid; grid-template-columns: 1fr 350px; gap: 60px; margin-bottom: 80px; align-items: center; }

.footer-phone {
    display: block; font-size: clamp(1.5rem, 3vw, 3rem); font-weight: 900;
    color: var(--text); text-decoration: none; line-height: 1.2; margin-bottom: 30px; transition: color 0.3s;
}
.footer-phone:hover { color: var(--accent); }

.socials a.rounded-btn { 
    display: inline-block; padding: 12px 28px; border: 1px solid #333; border-radius: 30px; 
    color: var(--text); text-decoration: none; margin-right: 15px; font-weight: 700; text-transform: uppercase;
    transition: border 0.3s, background 0.3s, color 0.3s; 
}
.socials a.rounded-btn:hover { border-color: var(--accent); background: var(--accent); color: #fff; }

.legal-info { background: #111; padding: 30px; border-radius: 20px; height: auto; border: 1px solid #222; }
.legal-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 15px; color: var(--text); text-transform: uppercase; }
.legal-text-wrapper p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 6px; line-height: 1.4; font-family: 'Inter', sans-serif;}

.footer-bottom { border-top: 1px solid #222; padding-top: 30px; text-align: center; font-size: 0.9rem; color: var(--text-muted); }

/* ==========================================
   ПОЛНОЭКРАННЫЕ МОДАЛКИ
   ========================================== */
.fullscreen-modal { 
    position: fixed; inset: 0; background-color: var(--bg);
    display: flex; justify-content: center; align-items: center; 
    z-index: 100000; opacity: 0; visibility: hidden; transition: 0.4s ease; cursor: default; 
}
.fullscreen-modal.active { opacity: 1; visibility: visible; }

.close-modal { 
    position: absolute; top: 30px; right: 40px; font-size: 40px; 
    color: #fff; cursor: pointer; z-index: 100001; transition: color 0.3s; 
}
.close-modal:hover { color: var(--accent); }

#lightbox img { max-width: 90%; max-height: 90vh; border-radius: 12px; transform: scale(0.9); transition: transform 0.5s ease; box-shadow: 0 30px 60px rgba(0,0,0,0.9); will-change: transform; }
#lightbox.active img { transform: scale(1); }

.vr-iframe-container { width: 100%; height: 100%; }
#vr-iframe { width: 100%; height: 100%; border: none; }

.custom-video-wrapper { position: relative; width: 90%; max-width: 1400px; border-radius: 12px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,0.9); }
#modal-video { width: 100%; display: block; }
.custom-controls {
    position: absolute; bottom: 20px; left: 20px; right: 20px; 
    display: flex; align-items: center; gap: 20px; 
    background: rgba(10,10,10,0.85); padding: 15px 25px; border-radius: 50px; 
    backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1);
}
.play-pause-btn {
    background: none; border: none; cursor: pointer; width: 24px; height: 24px;
    display: flex; justify-content: center; align-items: center;
}
.play-pause-btn svg { width: 100%; height: 100%; }
.progress-container {
    flex: 1; height: 6px; background: rgba(255,255,255,0.2); border-radius: 4px; cursor: pointer; position: relative;
}
.progress-bar { height: 100%; width: 0%; background: var(--accent); border-radius: 4px; position: relative; pointer-events: none;}
.progress-bar::after {
    content: ''; position: absolute; right: -6px; top: -4px; width: 14px; height: 14px;
    background: #fff; border-radius: 50%; box-shadow: 0 0 5px rgba(0,0,0,0.5);
}
.time-display { color: #fff; font-size: 0.9rem; font-family: 'Inter', sans-serif; min-width: 90px; text-align: right; }

/* ==========================================
   АДАПТИВ
   ========================================== */
@media (min-width: 768px) {
    .cards-slider { width: 450px; height: 600px; }
}
@media (max-width: 992px) {
    .project-row, .project-row.reverse { flex-direction: column; gap: 30px; margin-bottom: 100px; }
    .project-media { width: 100%; aspect-ratio: 16 / 9; }
    .project-info { width: 100%; }
    .footer-grid { grid-template-columns: 1fr; gap: 40px; align-items: start; }
}

@media (max-width: 768px) {
    * { cursor: auto; } .custom-cursor { display: none; }
    
    .container { padding: 0 20px; } 
    header { padding: 20px 0; }
    
    .desktop-nav { display: none; } 
    .logo-desktop { display: none; }
    .logo-mobile { display: block; }
    .burger-btn { display: flex; }

    .header-content h1 { font-size: clamp(2rem, 12vw, 4rem); letter-spacing: 0px; }

    #portfolio { padding: 80px 20px 0; }
    #more-works { padding: 40px 20px 100px; }
    .tech-stack { padding: 20px 20px 60px; }
    footer { padding: 80px 20px 40px; } 

    .gallery-wrapper { padding: 0 40px; } 
    .gallery-prev, .gallery-next { width: 40px; height: 40px; } 
    .socials a.rounded-btn { margin: 5px; }
    .custom-controls { bottom: 10px; left: 10px; right: 10px; padding: 10px 15px; }
    .close-menu { top: 20px; right: 20px; font-size: 40px; }
}