* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0f0528 0%, #1a0a2e 50%, #16213e 100%);
    color: #fff;
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.travelers-overlay {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -3;
    pointer-events: none;
    opacity: 1;
    width: 100%;
    height: 100%;
    display: block;
    filter: blur(1px);
}

.content-wrapper {
    background: rgba(42, 27, 74, 0.7);
    border-radius: 15px;
    margin: 2rem auto;
    max-width: 1200px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

@supports (backdrop-filter: blur(5px)) {
    .content-wrapper {
        background: rgba(42, 27, 74, 0.5);
        backdrop-filter: blur(5px);
    }
}

.navbar {
    position: sticky;
    top: 0;
    background: rgba(42, 27, 74, 0.9);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.navbar-hidden {
    transform: translateY(-100%);
}

.logo-anim {
    position: relative;
    width: 250px;
    filter: contrast(5);
    line-height: 1;
}

.logo-a, .logo-b {
    width: 100%;
    text-align: center;
    position: absolute;
    font-size: 3.5rem;
    margin: 0;
    color: #000;
    text-shadow:
            4px 4px 60px rgba(255, 255, 255, 1),
            -4px -4px 60px rgba(255, 255, 255, 1),
            -4px 4px 60px rgba(255, 255, 255, 1),
            4px -4px 60px rgba(255, 255, 255, 1);
    transition: all 0.3s ease;
    font-weight: 700;
}

.logo-b { animation-delay: 0.5s; }

@keyframes anim {
    0% { opacity: 0.3; filter: blur(10px); }
    10% { opacity: 0.5; }
    90% { opacity: 1; }
    100% { opacity: 1; filter: blur(2px); }
}

.logo-a { animation: anim 5s infinite alternate-reverse; }
.logo-b { animation: anim 5s infinite alternate; }

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #fff;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.section {
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #fff, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    color: #8b5cf6;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

p, ul {
    line-height: 1.6;
    max-width: 800px;
    margin: 1rem auto;
    color: rgba(255, 255, 255, 0.9);
}

#contact ul {
    list-style-position: inside;
    padding-left: 20px;
    max-width: 500px;
    margin: 1rem auto;
}

.portfolio-grid, .about-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.portfolio-grid > *:nth-last-child(1):nth-child(odd),
.about-grid > *:nth-last-child(1):nth-child(odd) {
    grid-column: 1 / -1;
    margin: 0 auto;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.portfolio-item, .pricing-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.portfolio-item:hover, .pricing-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
}

.portfolio-item::before, .pricing-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8b5cf6, #06b6d4, #8b5cf6);
    background-size: 200% 100%;
    animation: borderFlow 3s linear infinite;
}

@keyframes borderFlow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.portfolio-item img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.pricing-item .price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #8b5cf6;
    margin: 1rem 0;
}

.about-grid div {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 500px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

form input, form textarea {
    padding: 1rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    background: rgba(42, 27, 74, 0.5);
    color: #fff;
    font-family: inherit;
    transition: all 0.3s ease;
}

form input:focus, form textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.button-creative {
    position: relative;
    display: inline-block;
    padding: 1em 2em;
    background: linear-gradient(45deg, #8b5cf6, #06b6d4);
    color: white;
    border: none;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
    text-decoration: none;
}

.button-creative::before {
    content: '';
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s ease;
    border-radius: 50%;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.button-creative:hover::before {
    transform: translate(-50%, -50%) scale(1.2);
}

.button-creative:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4);
}

.cardbeam-section {
    position: relative;
    min-height: 300px;
    overflow: hidden;
    background: rgba(26, 10, 46, 0.8);
    margin-top: auto;
    z-index: 0;
    padding: 2rem 0;
}

#cardStream {
    width: 100%;
    height: 280px;
    display: flex;
    align-items: center;
    position: relative;
}

.card-line {
    display: flex;
    align-items: center;
    gap: var(--card-gap, 60px);
    white-space: nowrap;
    will-change: transform;
    transition: transform 0.1s linear;
}

.card-wrapper {
    width: var(--card-width, 400px);
    height: 250px;
    flex-shrink: 0;
    background: rgba(42, 27, 74, 0.8);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2);
    transition: all 0.3s ease;
    will-change: transform;
}

.card-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4);
}

.card-normal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 0 0 var(--clip-right, 0%));
    background: rgba(42, 27, 74, 0.95);
    border-radius: 15px;
}

.card-ascii {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 calc(100% - var(--clip-left, 0%)) 0 0);
    background: #0a0a0a;
    border-radius: 15px;
}

.ascii-content {
    width: 100%;
    height: 100%;
    color: rgba(139, 92, 246, 0.8);
    font-family: "Courier New", monospace;
    font-size: 11px;
    line-height: 13px;
    overflow: hidden;
    white-space: pre;
    margin: 0;
    padding: 8px;
    text-align: left;
    vertical-align: top;
    box-sizing: border-box;
    animation: glitch 0.1s infinite linear alternate-reverse;
}

@keyframes glitch {
    0% { opacity: 1; }
    15% { opacity: 0.9; }
    16% { opacity: 1; }
    49% { opacity: 0.8; }
    50% { opacity: 1; }
    99% { opacity: 0.9; }
    100% { opacity: 1; }
}

.header {
    position: absolute;
    top: 8%;
    left: 5%;
    width: 90%;
    height: 18%;
    background: linear-gradient(45deg, #8b5cf6, rgba(139, 92, 246, 0.7));
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
    transition: transform 0.3s ease;
}

.header:hover { transform: scale(1.02); }

.sidebar {
    position: absolute;
    left: 5%;
    top: 30%;
    width: 50px;
    height: 50px;
    border: 2px solid #8b5cf6;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.8), transparent);
    opacity: 0.8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.sidebar:hover { transform: rotate(10deg); }

.section-element, .product, .grid-item {
    position: absolute;
    background: linear-gradient(45deg, rgba(139, 92, 246, 0.7), rgba(139, 92, 246, 0.4));
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0.85;
    transition: transform 0.3s ease;
}

.section-element:hover, .product:hover, .grid-item:hover { transform: scale(1.03); }

.content-dash {
    position: absolute;
    height: 3px;
    background: linear-gradient(to right, #8b5cf6, transparent);
    border-radius: 0;
    opacity: 0.7;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.random-rect {
    position: absolute;
    background: linear-gradient(45deg, rgba(139, 92, 246, 0.6), rgba(139, 92, 246, 0.3));
    border-radius: 5px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    opacity: 0.8;
}

.button {
    position: absolute;
    background: linear-gradient(45deg, #8b5cf6, #06b6d4);
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
    transition: transform 0.3s ease;
}

.button:hover { transform: scale(1.05); }

.icon {
    position: absolute;
    border: 2px solid #8b5cf6;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.5), transparent);
    opacity: 0.7;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.icon:hover { transform: rotate(15deg); }

.scanner {
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 60%;
    background: linear-gradient(to bottom, transparent, #8b5cf6, #8b5cf6, transparent);
    box-shadow: 0 0 20px #8b5cf6, 0 0 40px #8b5cf6;
    animation: scanPulse 2s infinite alternate;
    z-index: 10;
    opacity: 1;
}

@keyframes scanPulse {
    0% { opacity: 0.8; transform: translate(-50%, -50%) scaleY(1); }
    100% { opacity: 1; transform: translate(-50%, -50%) scaleY(1.1); }
}

.footer-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 2rem;
    margin-top: 2rem;
    display: block;
    width: 100%;
    margin: 2rem auto 0;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Мобильная адаптация с фиксом меню */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
        position: relative;
        z-index: 10000; /* Выше nav-links, чтоб крестик кликался */
    }
    .navbar {
        justify-content: flex-start;
        position: relative;
    }
    .logo-anim {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 200px;
    }
    .logo-a, .logo-b {
        font-size: 2.5rem;
    }
    .nav-links {
        position: fixed;
        left: 0; /* Базовое: не -100%, используем transform для анимации */
        top: 0;
        flex-direction: column;
        background: rgba(42, 27, 74, 0.9);
        width: 250px;
        height: 100vh;
        padding-top: 5rem;
        transition: transform 0.3s ease; /* Transform вместо left для perf */
        text-align: left;
        gap: 1rem;
        transform: translateX(-100%); /* Скрыто слева по умолчанию */
        z-index: 9999; /* Выше всего */
    }
    .nav-links.active {
        transform: translateX(0); /* Выезжает на active */
    }
    .nav-links li {
        padding-left: 1rem;
    }
    .card-wrapper { width: var(--card-width, 250px); height: 180px; }
    h1 { font-size: 2.5rem; }
    .section { padding: 3rem 1rem; }
    .portfolio-grid, .pricing-grid, .about-grid {
        grid-template-columns: 1fr;
    }
    .portfolio-grid > *:nth-last-child(1):nth-child(odd),
    .pricing-grid > *:nth-last-child(1):nth-child(odd),
    .about-grid > *:nth-last-child(1):nth-child(odd) {
        grid-column: auto;
        max-width: 100%;
        margin: 0;
    }
    #contact ul {
        padding-left: 0.5rem;
    }
}

@media (max-width: 480px) {
    #cardStream { height: 200px; }
    .card-line { gap: var(--card-gap, 30px); }
    .card-wrapper { height: 150px; }
}

.placeholder {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* Для body при открытом меню */
body.menu-open {
    overflow: hidden; /* Блокирует скролл под меню */
}