/* =========== БАЗОВЫЕ СБРОСЫ =========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #1a1a1a;
    color: #fff;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* =========== ОСНОВНЫЕ АНИМАЦИИ =========== */
@keyframes gradientFlow {
    0% {
        background-position: 0% 0%;
    }
    25% {
        background-position: 100% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

@keyframes gradientPulse {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 
            0 0 5px #00f0ff,
            0 0 10px #00f0ff,
            0 0 20px #00f0ff,
            0 0 40px #00f0ff,
            0 0 80px #00f0ff;
    }
    20%, 24%, 55% {
        text-shadow: 
            0 0 2px #00f0ff,
            0 0 5px #00f0ff,
            0 0 10px #00f0ff,
            0 0 20px #00f0ff,
            0 0 40px #00f0ff;
    }
}

@keyframes flicker-mobile {
    0%, 100% {
        text-shadow: 
            0 0 5px #00f0ff,
            0 0 10px #00f0ff,
            0 0 20px #00f0ff;
    }
    50% {
        text-shadow: 
            0 0 2px #00f0ff,
            0 0 5px #00f0ff,
            0 0 10px #00f0ff;
    }
}

@keyframes flicker-link {
    0%, 100% {
        text-shadow: 0 0 5px #00f0ff, 0 0 10px #00f0ff, 0 0 20px #00f0ff;
    }
    50% {
        text-shadow: 0 0 2px #00f0ff, 0 0 5px #00f0ff, 0 0 10px #00f0ff;
    }
}

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

@keyframes typing {
    0% { width: 0; }
    50% { width: 300px; }
    100% { width: 300px; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #a855f7; }
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes fadeTrail {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.5); }
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* =========== ФОНОВЫЕ ЭФФЕКТЫ =========== */
body::before {
    content: '';
    position: absolute;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, 
            rgba(255, 0, 0, 0.3) 0%, 
            rgba(255, 165, 0, 0.3) 20%, 
            rgba(0, 0, 255, 0.3) 80%, 
            rgba(128, 0, 128, 0.3) 100%),
        radial-gradient(circle at center, 
            rgba(255, 255, 255, 0.1) 0%, 
            transparent 70%);
    background-size: 100% 100%, 100% 100%;
    animation: 
        gradientFlow 25s ease infinite,
        gradientPulse 10s ease infinite alternate;
    z-index: -2;
    filter: blur(20px);
    mix-blend-mode: screen;
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, 
            rgba(255, 255, 255, 0.05) 0%, 
            transparent 30%),
        radial-gradient(circle at 80% 70%, 
            rgba(255, 255, 255, 0.05) 0%, 
            transparent 30%);
    z-index: -1;
    animation: gradientPulse 5s ease infinite alternate-reverse;
}

/* =========== ШАПКА =========== */
/* Стили для header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    position: fixed; /* Фиксированная позиция */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000; /* Высокий z-index чтобы был поверх */
    backdrop-filter: blur(10px); /* Размытие фона */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Эффект при скролле */
header.scrolled {
    background: rgba(10, 10, 10, 0.95);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    padding: 15px 5%;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin: 0 20px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    text-transform: uppercase;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #a855f7;
}

.cta-button {
    background-color: transparent;
    border: 2px solid #a855f7;
    color: #a855f7;
    padding: 10px 20px;
    text-transform: uppercase;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    font-family: 'Montserrat', sans-serif;
    border-radius: 5px;
}

.cta-button:hover {
    background-color: #a855f7;
    color: #fff;
}

/* =========== ПРЕЛОАДЕР =========== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
    backdrop-filter: blur(20px);
}

.preloader.hide {
    transform: translateY(-100%);
}

.ks-logo {
    position: relative;
    font-size: 100px;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    overflow: hidden;
}

.ks-logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: shine 1s infinite;
}

.kstudio-text {
    color: #FFF;
    font-size: 30px;
    font-weight: 500;
    opacity: 0;
    animation: fadeIn 1s forwards 0.5s;
}

/* =========== ГЛАВНЫЙ БЛОК =========== */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Изменено с 800px на 100vh */
    position: relative;
    padding: 0 5%;
    width: 100%;
    box-sizing: border-box;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 60px;
    line-height: 1.2;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.highlight {
    display: inline-block;
    position: relative;
    color: #a855f7;
    font-weight: bold;
}

.highlight-purple {
    color: #a855f7;
    font-size: 80px;
}

.hero-text p {
    font-size: 18px;
    margin-top: 20px;
    line-height: 1.5;
    color: #b0b0b0;
}

/* Неоновый текст */
.hero-neon {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex: 1;
}

.neon-text {
    font-family: 'Poppins', sans-serif;
    font-size: 150px;
    font-weight: 700;
    text-transform: uppercase;
    color: #00f0ff;
    text-shadow: 
        0 0 5px #00f0ff,
        0 0 10px #00f0ff,
        0 0 20px #00f0ff,
        0 0 40px #00f0ff,
        0 0 80px #00f0ff;
    animation: flicker 3s infinite alternate;

    position: relative;
    z-index: 2;
    padding: 20px;
    letter-spacing: 5px;
}

.hero-neon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 250px;
    height: 250px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.scroll-down {
    position: absolute;
    bottom: 50px;
    font-size: 24px;
    color: #b0b0b0;
    animation: bounce 2s infinite;
    text-decoration: none;
}

/* =========== СТАТИСТИКА =========== */
.stats {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 50px 5%;
    position: relative;
}

.stats-container {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-areas: 
        "top-left image top-right"
        "bottom-left image bottom-right";
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 40px;
    position: relative;
}

.stat-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-10px);
}

.stat-item h2 {
    font-size: 48px;
    font-weight: 700;
    text-transform: uppercase;
    color: #a855f7;
    margin-bottom: 10px;
}

.stat-item p {
    font-size: 16px;
    color: #b0b0b0;
    margin-top: 10px;
    text-transform: uppercase;
}

.stat-item .note {
    font-size: 14px;
    color: #888;
    font-style: italic;
    margin-top: 10px;
}

.top-left { grid-area: top-left; }
.top-right { grid-area: top-right; }
.bottom-left { grid-area: bottom-left; }
.bottom-right { grid-area: bottom-right; }

.stat-image {
    grid-area: image;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stat-image img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 20px;
    object-fit: cover;
}

.logo-overlay {
    position: absolute;
    font-family: 'Poppins', sans-serif;
    font-size: 40px;
    font-weight: 700;
    color: #b0b0b0;
    text-transform: uppercase;
    background-color: rgba(26, 26, 26, 0.8);
    padding: 10px 20px;
    border-radius: 5px;
}

/* =========== ПРОЕКТЫ =========== */
.cases {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
    color: #000;
    padding: 100px 5%;
}

.cases-container {
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

.cases-container h2 {
    font-size: 48px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: #1a1a1a;
}

.cases-container p {
    font-size: 18px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 50px;
}

/* Ссылка "ПОГОВОРИТЬ" */
.talk-link {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #a855f7;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    text-shadow: 0 0 5px #a855f7, 0 0 10px #a855f7;
}

.talk-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #a855f7;
    box-shadow: 0 0 5px #a855f7, 0 0 10px #a855f7;
    bottom: -5px;
    left: 0;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.talk-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.talk-link:hover {
    animation: flicker-link 1.5s infinite alternate;
}

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

.tags span {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    text-transform: uppercase;
    color: #333;
}

.case-link {
    display: block;
    text-decoration: none;
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.case-link:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.3);
}

.case-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #d4ff00;
    position: relative;
    cursor: pointer;
}

.case-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    max-width: 400px;
    text-align: left;
    backdrop-filter: blur(10px);
}

.case-overlay h3 {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.case-overlay p {
    font-size: 14px;
    color: #666;
    text-transform: none;
    line-height: 1.5;
}

.like-button {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    border: none;
    outline: none;
}

.like-button:hover {
    background: rgba(255, 0, 0, 0.3);
    transform: scale(1.1);
}

.like-button.active {
    color: #ff3b3b;
    background: rgba(255, 0, 0, 0.2);
}

.like-button.active {
    animation: heartBeat 0.5s;
}

.likes-count {
    font-size: 12px;
    margin-left: 3px;
    position: relative;
    top: -1px;
}

/* =========== КОНТАКТЫ =========== */
.contact {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 100px 5%;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, 
            rgba(255, 0, 0, 0.3) 0%, 
            rgba(255, 165, 0, 0.3) 20%, 
            rgba(0, 0, 255, 0.3) 80%, 
            rgba(128, 0, 128, 0.3) 100%),
        radial-gradient(circle at center, 
            rgba(255, 255, 255, 0.1) 0%, 
            transparent 70%);
    background-size: 200% 200%, 100% 100%;
    animation: 
        gradientFlow 25s ease infinite,
        gradientPulse 10s ease infinite alternate;
    z-index: -2;
    filter: blur(20px);
    mix-blend-mode: screen;
}

.contact::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, 
            rgba(255, 255, 255, 0.05) 0%, 
            transparent 30%),
        radial-gradient(circle at 80% 70%, 
            rgba(255, 255, 255, 0.05) 0%, 
            transparent 30%);
    z-index: -1;
    animation: gradientPulse 5s ease infinite alternate-reverse;
}

.contact-container {
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

.contact-container h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 48px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 0 5px #a855f7, 0 0 10px #a855f7;
}

.contact-container p {
    font-size: 18px;
    color: #b0b0b0;
    text-transform: uppercase;
    margin-bottom: 50px;
}

.typewriter {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #a855f7;
    text-shadow: 0 0 5px #a855f7, 0 0 10px #a855f7;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid #a855f7;
    animation: 
        typing 5s steps(30, end) infinite,
        blink-caret 0.75s step-end infinite;
}

/* Блок контактов */
.contacts-block {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    border-color: #a855f7;
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.3);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #a855f7, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.contact-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.contact-info p {
    font-size: 0.9rem;
    opacity: 0.8;
    color: #b0b0b0;
    margin: 0;
}

.contact-note {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.contact-note p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    font-size: 0.95rem;
    opacity: 0.9;
    color: #b0b0b0;
}

.contact-note i {
    color: #a855f7;
}

/* =========== ФУТЕР =========== */
footer {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 30px 5% 30px;
    font-family: 'Arial', sans-serif;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-logo {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ffffff;
}

.footer-about p {
    margin-bottom: 20px;
    line-height: 1.6;
    opacity: 0.8;
}

.footer-links h3, 
.footer-contact h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h3::after,
.footer-contact h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: #a855f7;
}

.footer-links ul {
    list-style: none;
    margin-bottom: 20px;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ffffff;
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: #a855f7;
    opacity: 1;
    padding-left: 5px;
}

.footer-contact p {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    opacity: 0.8;
}

.footer-contact i {
    margin-right: 10px;
    color: #a855f7;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: #a855f7;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.6;
    font-size: 14px;
}

/* =========== АДАПТИВНОСТЬ =========== */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 50px;
    }
    
    .hero-text h1 {
        font-size: 48px;
    }
    
    .neon-text {
        font-size: 100px;
    }
    
    .stats-container {
        grid-template-areas: 
            "top-left"
            "top-right"
            "image"
            "bottom-left"
            "bottom-right";
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .hero-text h1 {
        font-size: 36px;
    }
    
    .highlight-purple {
        font-size: 50px;
    }
    
    .hero-text p {
        font-size: 16px;
    }
    
    .neon-text {
        font-size: 70px;
        transform: none;
        animation: flicker-mobile 4s infinite alternate;
    }
    
    .hero-neon::before {
        width: 200px;
        height: 200px;
    }
    
    .cases-container h2,
    .contact-container h2 {
        font-size: 36px;
    }
    
    .contacts-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .case-link {
        height: 400px;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 28px;
    }
    
    .highlight-purple {
        font-size: 40px;
    }
    
    .neon-text {
        font-size: 50px;
    }
    
    .cases-container h2,
    .contact-container h2 {
        font-size: 28px;
    }
    
    .stat-item h2 {
        font-size: 36px;
    }
    
    .case-link {
        height: 300px;
    }
    
    .case-overlay {
        max-width: 250px;
        padding: 15px;
    }
    
    .case-overlay h3 {
        font-size: 18px;
    }
}