/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

:root {
    --bg-color: #05070b;
    /* Deep space color to match canvas gradient */
    --text-white: #ffffff;
    --text-gray: rgba(255, 255, 255, 0.7);
    --accent-purple: #9D6CFF;
    --btn-purple: #8B63B3;
    --btn-blue: #0071C8;
}

html {
    height: 100%;
    min-height: 100%;
    margin: 0;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Solid dark background */
    background: #2D1F4E;
}

body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    font-family: 'Open Sans', sans-serif;
    color: var(--text-white);
    overflow-x: hidden;
    position: relative;
}

/* Canvas Background - Fixed & Extended for Overscroll */
#space {
    position: fixed;
    top: -20vh;
    left: 0;
    width: 100vw;
    height: 140vh;
    z-index: -1;
    pointer-events: none;
    background: #2D1F4E;
    /* Performance optimizations */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Sections - Snap Logic */
section {
    scroll-snap-align: start;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding: 80px 0;
    /* Убираем любые фоны у секций, чтобы не было границ */
    background: transparent;
    /* Performance: defer rendering of off-screen content */
    content-visibility: auto;
    contain-intrinsic-size: auto 100vh;
}

/* Header */
.header-wrapper {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
}

.header {
    background: rgba(30, 20, 50, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 12px 30px;
    width: 90%;
    max-width: 1100px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    /* Performance: GPU acceleration */
    will-change: background, backdrop-filter, height, border-radius;
    transform: translateZ(0);
    transition: background 0.3s ease, border-radius 0.3s ease;
}

.header.active {
    border-radius: 30px;
    background: rgba(30, 20, 50, 0.95);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-size: 20px;
    font-weight: 300;
    flex-shrink: 0;
    white-space: nowrap;
}

.logo img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.nav {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-shrink: 0;
}

.nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
    white-space: nowrap;
}

.nav a:hover {
    color: white;
}

.btn-header {
    background: #6B5CE7;
    color: rgba(255, 255, 255, 0.9);
    padding: 10px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s, color 0.3s;
}

.btn-header:hover {
    background: #7D6FEB;
    color: #ffffff;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 101;
    padding: 0;
}

/* Hamburger Icons */
.hamburger svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hamburger .icon-menu {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.hamburger .icon-close {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.hamburger.active .icon-menu {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.hamburger.active .icon-close {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Old .mobile-menu removed, styles moved to .mobile-nav inside header */

.mobile-nav {
    display: none;
    /* Hidden on desktop, shown on mobile via media query */
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding-top: 0;
    margin-top: 0;

    /* Transition properties */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-10px);
    transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease, margin 0.4s ease, transform 0.4s ease;

    /* Border handling to avoid double border when hidden */
    border-top: 1px solid rgba(255, 255, 255, 0);
}

.header.active .mobile-nav {
    max-height: 400px;
    /* Arbitrary large height to fit content */
    opacity: 1;
    transform: translateY(0);
    padding-top: 20px;
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}



.mobile-nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 20px;
    font-weight: 400;
    transition: color 0.3s;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

.mobile-nav-link:hover {
    color: var(--accent-purple);
}

.mobile-nav-link.btn-mobile {
    background: #6B5CE7;
    color: white;
    padding: 14px 24px;
    border-radius: 30px;
    text-align: center;
    margin-top: 20px;
    border: none;
}

/* Hero Section */
.hero {
    justify-content: flex-start;
    padding-top: 120px;
    text-align: left;
    padding-bottom: 60px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20vh;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, #2D1F4E 0%, #2D1F4E 15%, rgba(45, 31, 78, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

h1 {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    font-size: 60px;
    line-height: 1.15;
    margin-bottom: 30px;
    /* Spacing before phones */
}

.pill-btn {
    display: inline-block;
    border: 2px solid #6c5ce7;
    background: rgba(108, 92, 231, 0.15);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-decoration: none;
    cursor: default;
    pointer-events: none;
    /* FORCE non-clickable behavior including hover */
    backdrop-filter: blur(5px);
    vertical-align: middle;
    /* Align with text */
    margin-left: 12px;
    /* Small gap from text */
    white-space: nowrap;
    /* Prevent wrapping inside pill */
}

/* Phones Composition */
.phones-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 24px;
    /* Slightly more gap */
    margin-bottom: 40px;
    position: relative;
    width: 100%;
}

.phone {
    width: 300px;
    /* Increased from 260px */
    border-radius: 40px;
    /* Убрана тень (box-shadow) по запросу */
    box-shadow: none;
    transition: transform 0.3s ease;
}

.phone.center {
    width: 340px;
    /* Increased from 280px */
    z-index: 10;
    margin-top: -20px;
    /* Pull center phone up a bit */
}

.phone.side {
    margin-top: 40px;
    /* Less offset for sides */
    opacity: 0.95;
    transform: scale(0.96);
    z-index: 5;
}

.btn-telegram {
    display: inline-block;
    background: #6B5CE7;
    color: rgba(255, 255, 255, 0.9);
    padding: 16px 36px;
    border-radius: 50px;
    font-size: 18px;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 10px 20px rgba(107, 92, 231, 0.3);
    transition: background 0.3s, color 0.3s, transform 0.2s;
    margin-bottom: 0;
}

.btn-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

/* Если Hero - это flex column, то align-self: flex-start выровняет кнопку влево. 
   Но телефоны мы хотим по центру? 
   Пользователь просил "выравнивание текста по левому краю". 
   Телефоны обычно по центру. Оставим телефоны по центру, а тексты слева.
*/
.hero .container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Текст и кнопки слева */
}

.hero .phones-container {
    align-self: center;
    /* А телефоны по центру */
    margin-top: 20px;
}

.hero .btn-telegram {
    align-self: center;
}

.btn-telegram:hover {
    transform: translateY(-2px);
    background: #7D6FEB;
    color: #ffffff;
}

/* Features */
.features {
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 7, 11, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 0;
    pointer-events: none;
}

.features .container {
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: 56px;
    font-weight: 600;
    margin-bottom: 60px;
    text-align: left;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px 40px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    background: rgba(30, 20, 50, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 40px;
    backdrop-filter: blur(10px);
}

.feature-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
    object-fit: contain;
}

.feature-title {
    font-size: 22px;
    color: #BF91FF;
    margin-bottom: 12px;
    font-weight: 600;
}

.feature-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

/* Philosophy */
.philosophy {
    align-items: center;
    text-align: left;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
}

.philosophy .container {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

.philosophy-text {
    font-size: 60px;
    line-height: 1.2;
    font-weight: 400;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    transition: all 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.philosophy-text.visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.philosophy-text span {
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile adjustments for Philosophy */
@media (max-width: 900px) {
    .philosophy-text {
        /* Matching h1 size behavior or just max-width adjustment */
        max-width: 100%;
    }
}



/* How It Works */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.dark-card {
    background: rgba(30, 20, 50, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 50px;
    text-align: left;
    backdrop-filter: blur(10px);
}

.card-title {
    font-size: 28px;
    color: #BF91FF;
    margin-bottom: 15px;
    font-weight: 600;
}

.card-desc {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Waitlist */
.waitlist {
    justify-content: center;
    position: relative;
    background: rgba(157, 108, 255, 0.08);
    border-top: 1px solid rgba(157, 108, 255, 0.1);
    backdrop-filter: blur(10px);
    padding-bottom: 0;
}

.waitlist::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 7, 11, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 0;
    pointer-events: none;
}

.waitlist .container {
    position: relative;
    z-index: 1;
}

.waitlist-screenshot {
    width: 100%;
    height: auto;
    display: block;
    margin-top: 20px;
    margin-bottom: 20px;
}

.waitlist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 80px;
    align-items: start;
}

.waitlist-column {
    display: flex;
    flex-direction: column;
    background: rgba(30, 20, 50, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 40px;
    backdrop-filter: blur(10px);
}

.column-title {
    font-size: 28px;
    color: #BF91FF;
    margin-bottom: 30px;
    font-weight: 600;
}

.form-row {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 500px;
}

.input-email {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding: 12px 0;
    color: white;
    font-size: 18px;
    outline: none;
}

.input-email::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.btn-submit {
    background: transparent;
    border: 1px solid white;
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-submit:hover {
    background: white;
    color: black;
}

/* Form feedback messages */
.form-message {
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 16px;
    text-align: center;
    width: 100%;
    max-width: 500px;
    display: none;
    animation: slideIn 0.3s ease;
}

.form-message.success {
    background: rgba(46, 213, 115, 0.15);
    border: 1px solid rgba(46, 213, 115, 0.3);
    color: #2ed573;
}

.form-message.error {
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: #ff4757;
}

.form-message.show {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
.footer {
    padding: 40px 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
}

/* Mobile */
@media (max-width: 768px) {

    h1 {
        font-size: 32px;
        line-height: 1.2;
        margin-bottom: 30px;
        text-align: left;
    }

    .phones-container {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        /* Center vertically */
        gap: 0;
        margin: 40px auto;
        /* Break out of container padding to ensure true viewport centering */
        width: 100vw;
        margin-left: -20px;
        overflow: visible;
        /* Allow phones to extend beyond container if needed, parent handles overflow */
        transform: none;
    }

    .phone {
        width: 56vw;
        /* 80% of 70vw */
        max-width: none;
        transform: none;
        /* Reset transforms */
        z-index: 1;
        margin: 0;
        /* Reset margins */
    }

    .phone.center {
        width: 70vw;
        max-width: none;
        z-index: 10;
        margin: 0 -15%;
        /* Negative margin to pull sides in symmetrically */
        transform: none;
    }

    .phone.side {
        margin-top: 60px;
        /* Push sides down visually */
    }





    .features-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .feature-desc {
        line-height: 1.7;
    }

    .header {
        width: calc(100% - 20px);
        padding: 12px 20px;
        margin: 10px;
        flex-wrap: wrap;
        /* Allow wrapping for mobile menu */
    }

    .nav {
        display: none;
    }

    .logo {
        font-size: 18px;
    }

    .hamburger {
        display: flex !important;
        /* Show hamburger on mobile */
    }

    .mobile-nav {
        display: flex;
        /* Show mobile nav on mobile devices */
    }

    .philosophy-text {
        font-size: 32px;
        line-height: 1.2;
        text-align: left;
        /* Left align */
    }

    .section-title {
        font-size: 28px;
        line-height: 1.3;
        margin-bottom: 40px;
        text-align: left;
        padding-left: 20px;
        /* Left align */
    }

    .card-title {
        font-size: 22px;
        line-height: 1.4;
    }

    .card-desc {
        font-size: 16px;
        line-height: 1.7;
    }

    section {
        padding: 80px 0;
        min-height: auto;
    }

    .hero {
        align-items: flex-start;
        text-align: left;
        padding-top: 120px;
        padding-bottom: 60px;
    }

    .hero .container {
        align-items: flex-start;
        text-align: left;
    }

    .btn-wrapper {
        justify-content: center;
        width: 100vw;
        margin-left: -20px;
        margin-bottom: 40px;
    }

    .hero .btn-telegram {
        /* Clean state */
        margin: 0;
    }

    .pill-btn {
        display: table;
        margin: 20px auto 0 auto;
        font-size: 14px;
        padding: 8px 20px;
    }

    .dark-card {
        padding: 30px 20px;
    }

    .feature-item {
        align-items: flex-start;
        text-align: left;
    }



    .waitlist-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 40px;
    }

    .column-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .form-row {
        flex-direction: column;
    }

    .waitlist-column {
        align-items: flex-start;
        text-align: left;
        padding: 30px 20px;
        overflow: hidden;
        /* Prevent content from spilling out */
    }

    .waitlist-column img {
        max-width: 100%;
        height: auto;
    }

}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
    will-change: opacity, transform;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-100 {
    transition-delay: 0.1s;
}

.reveal-delay-200 {
    transition-delay: 0.2s;
}

.reveal-delay-300 {
    transition-delay: 0.3s;
}