* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    line-height: 1.4;
    color: rgb(255, 255, 255);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3 {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5), 0 0 10px rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

p, .btn, .nav-link {
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.5s ease-out;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    display: none;
    min-height: 100vh;
    position: relative;
    border: none;
    flex: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    perspective: 1000px;
}

.section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.section.active h1 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.section.active h2 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.section.active h3 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.section.active p {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

.section.active .btn,
.section.active .nav-link {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

.background-placeholder {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #000;
    border: none;
}

/* Анимации для стеклянных панелей */
@keyframes glassAppear {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
        transform: scale(0.98) translateY(20px);
    }
    100% {
        opacity: 1;
        backdrop-filter: blur(12px);
        transform: scale(1) translateY(0);
    }
}

@keyframes subtleGlow {
    0% {
        box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.5),
                   0 0 24px rgba(0, 0, 0, 0.7);
    }
    100% {
        box-shadow: none;
    }
}

.glass-panel {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    border-radius: 15px;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(25px) scale(0.98);
    transform-style: preserve-3d;
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.4s;
}

.section.active .glass-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: glassAppear 0.9s ease-out forwards,
               subtleGlow 2s ease-in-out 0.5s;
}

.hero-content .glass-panel {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    border-radius: 15px;
    padding: 2rem;
    max-width: 800px;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

/* Специфичные направления появления для разных секций */
.section:nth-child(odd) {
    transform: translateX(30px);
}

.section:nth-child(even) {
    transform: translateX(-30px);
}

.section.active:nth-child(odd),
.section.active:nth-child(even) {
    transform: translateX(0);
}

/* Эффекты для кнопок и интерактивных элементов */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::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.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,255,255,0.1);
}

/* Навигационные ссылки */
.nav-link {
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: rgba(255,255,255,0.8);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Для HTML-эффекта */
body.html-reversed {
    flex-direction: column-reverse;
}

body.html-reversed .glass-panel {
    flex-direction: column-reverse;
}

/* Для CSS-эффекта */
body.css-dark {
    background-color: #1a1a1a !important;
    transition: background-color 0.5s ease;
}

body.css-dark .glass-panel {
    background: rgba(50, 50, 50, 0.6) !important;
    transition: background 0.5s ease;
}

/* Эффект параллакса для фона */
.parallax-bg {
    transition: transform 0.1s ease-out;
}

/* Плавное исчезновение при переходе */
.section.leaving {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.5s ease-in;
}

/* Анимация загрузки */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

/* Микро-взаимодействия */
.glass-panel:hover {
    transform: translateY(-5px) scale(1.01);
    transition: all 0.3s ease;
}

/* Специальные эффекты для определенных элементов */
.special-transition {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.section.active .special-transition {
    opacity: 1;
    transform: scale(1) rotate(0);
}

/* ============================
   Мобильная адаптация
   ============================ */
@media (max-width: 768px) {
    body {
        line-height: 1.35;
    }

    .container {
        max-width: 100%;
        padding: 0 15px;
    }

    .section {
        min-height: auto;
        padding-top: 60px;
        padding-bottom: 40px;
        transform: translateY(15px);
        transition: all 0.5s ease-in-out;
    }

    .glass-panel {
        max-width: 100%;
        padding: 1.2rem;
        border-radius: 12px;
        margin-bottom: 1.5rem;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        transform: translateY(15px);
        transition: all 0.6s ease-in-out 0.2s;
    }

    h1, h2, h3 {
        text-shadow: 0 0 4px rgba(255, 255, 255, 0.4),
                     0 0 8px rgba(255, 255, 255, 0.15);
    }

    .btn:hover {
        transform: none;
    }

    /* Отключаем сложные 3D-трансформации на мобильных */
    .section {
        perspective: none;
    }

    .glass-panel {
        transform-style: flat;
    }

    /* Чтобы HTML reverse смотрелся нормально */
    body.html-reversed {
        flex-direction: column;
    }

    body.html-reversed .glass-panel {
        flex-direction: column;
    }

    /* Чуть затемняем фон на мобиле — читаемость лучше */
    body.css-dark .glass-panel {
        background: rgba(50, 50, 50, 0.55) !important;
    }

    /* Меньшие задержки для мобильных */
    .section.active h1 { transition-delay: 0.1s; }
    .section.active h2 { transition-delay: 0.2s; }
    .section.active h3 { transition-delay: 0.3s; }
    .section.active p { transition-delay: 0.4s; }
    .section.active .glass-panel { transition-delay: 0.2s; }
}

/* Убираем визуальный скроллбар но сохраняем возможность скролла */
html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Для Webkit браузеров (Chrome, Safari) */
::-webkit-scrollbar {
    display: none;
}

/* Для Firefox */
html {
    scrollbar-width: none;
}

/* Для IE и Edge */
body {
    -ms-overflow-style: none;
}

/* Дополнительные утилитарные классы для анимаций */
.delay-1 { transition-delay: 0.1s !important; }
.delay-2 { transition-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.3s !important; }
.delay-4 { transition-delay: 0.4s !important; }
.delay-5 { transition-delay: 0.5s !important; }

.fade-in { animation: fadeInUp 0.6s ease-out; }
.slide-in-left { transform: translateX(-50px); }
.slide-in-right { transform: translateX(50px); }
.slide-in-up { transform: translateY(50px); }

.section.active .slide-in-left,
.section.active .slide-in-right,
.section.active .slide-in-up {
    transform: translate(0, 0);
}
/* Отключаем нативный скролл, чтобы не мешал Lenis */
html {
    scroll-behavior: auto !important;
}