@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
html, body { overflow-x: hidden !important; width: 100%; max-width: 100%; margin: 0; padding: 0; }
* { box-sizing: border-box; }

:root {
    --bg-main: #09090b; /* Zinc 950 */
    --card-bg: #18181b; /* Zinc 900 */
    --card-border: #27272a; /* Zinc 800 */
    --text-primary: #fafafa;
    --text-muted: #a1a1aa;
    --accent: #ffffff;
    --glow: rgba(255, 255, 255, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* NAVBAR (Fixed, Centered Button, Follows on Scroll Always) */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    background: rgba(9, 9, 11, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    height: 90px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 max(20px, calc((100vw - 1200px) / 2));
    box-sizing: border-box;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.navbar.scrolled {
    background: rgba(9, 9, 11, 0.96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border-bottom-color: rgba(255, 255, 255, 0.12);
}
.navbar a {
    text-decoration: none;
    color: var(--text-muted);
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 36px;
    justify-content: flex-start;
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 36px;
    justify-content: flex-end;
}
.nav-center {
    display: flex;
    justify-content: center;
}
.nav-brand { 
    font-weight: 800; 
    font-size: 1.5rem; 
    letter-spacing: -0.5px; 
    color: #fff !important; 
    text-decoration: none !important; 
    flex-shrink: 0;
}
.nav-links { 
    display: flex; 
    gap: 28px; 
    align-items: center; 
}
.nav-link, .nav-links a { 
    color: var(--text-muted) !important; 
    text-decoration: none !important; 
    font-size: 0.95rem; 
    font-weight: 500; 
    transition: color 0.3s ease; 
    position: relative;
    padding: 6px 0;
}
.nav-link:hover, .nav-link.active, .nav-links a:hover, .nav-links a.active { 
    color: var(--text-primary) !important; 
}
.nav-link.active::after, .nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}
.nav-order-btn-center {
    background: linear-gradient(135deg, #ffffff, #d4d4d8);
    color: #000 !important;
    padding: 12px 28px;
    border-radius: 100px;
    font-weight: 700 !important;
    font-size: 1rem !important;
    text-decoration: none !important;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.nav-order-btn-center:hover {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.45);
}
.nav-mobile-dropdown {
    display: none;
}

/* CONTAINER & LAYOUT */
body {
    padding-top: 90px;
}
.container { max-width: 1200px; margin: 0 auto; padding: 60px 20px; text-align: center; }

/* TYPOGRAPHY */
h1 { font-size: 4.5rem; font-weight: 800; line-height: 1.1; letter-spacing: -2px; margin-bottom: 24px; }
.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #71717a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 2.5rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.badge { display: inline-block; padding: 8px 16px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 100px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 24px; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 14px 28px; border-radius: 12px; font-weight: 600; text-decoration: none; transition: all 0.3s ease; cursor: pointer; border: none; font-size: 1rem; }
.btn.primary { background: var(--text-primary); color: var(--bg-main); box-shadow: 0 0 20px rgba(255,255,255,0.1); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(255,255,255,0.2); }
.btn.secondary { background: var(--card-bg); color: var(--text-primary); border: 1px solid var(--card-border); }
.btn.secondary:hover { background: #27272a; }
.full-width { width: 100%; }

/* BENTO GRID (Главная) */
.bento-grid-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, minmax(200px, auto));
    gap: 20px;
    margin-top: 40px;
    text-align: left;
}
.col-span-2 { grid-column: span 2; }
.row-span-2 { grid-row: span 2; }
.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.bento-card:hover {
    border-color: #3f3f46;
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.icon { margin-bottom: 24px; color: var(--text-primary); }
.bento-card h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; color: var(--text-primary); }
.bento-card p { color: var(--text-muted); font-size: 1rem; line-height: 1.6; }
.stat-number { font-size: 4rem; font-weight: 800; letter-spacing: -2px; color: var(--text-primary); opacity: 0.9; margin-top: auto; }

/* PRICING GRID (Услуги) */
.pricing-grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: left; margin-top: 40px; }
.price-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    position: relative;
    /* overflow removed to allow absolute badges to bleed outside */
    transition: border-color 0.4s, box-shadow 0.4s;
}
.price-card:hover { border-color: #3f3f46; } /* Removed translateY to fix 3D transform conflict */
.price-card.popular { border-color: #52525b; }
.popular-badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: #fff; color: #000; padding: 6px 16px; border-radius: 100px; font-size: 0.85rem; font-weight: 700; z-index: 10; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.price-header { margin-bottom: 30px; border-bottom: 1px solid var(--card-border); padding-bottom: 25px; }
.price-header h3 { font-size: 1.4rem; margin-bottom: 15px; color: var(--text-primary); }
.price { font-size: 2.2rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.price-desc { color: var(--text-muted); font-size: 0.95rem; }
.features { list-style: none; margin-bottom: 35px; flex-grow: 1; }
.features li { margin-bottom: 15px; color: var(--text-primary); font-size: 0.95rem; position: relative; padding-left: 24px; }
.features li::before { content: '→'; position: absolute; left: 0; color: #52525b; }

/* FLIP CARDS CSS */
.flip-prompt::before {
    content: 'Наведите для подробностей ⤻';
}
.flip-card {
    background-color: transparent;
    width: 100%;
    height: 480px; /* strict height prevents stretching and layout jumps */
    perspective: 1200px;
    position: relative;
    z-index: 1; /* Default stacking order */
    transition: z-index 0s linear 0.6s; /* Wait for flip animation to finish before dropping z-index */
}
/* Elevate the card above everything else when hovered or active to prevent clipping in 3D space */
.flip-card:hover, .flip-card.flipped {
    z-index: 50; 
    transition: z-index 0s; /* Instantly apply z-index */
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}
.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
    position: absolute !important;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    top: 0;
    left: 0;
    background: var(--card-bg); /* Enforce solid background so it doesn't clip transparently */
}
.flip-card-front {
    z-index: 2; /* Fix flickering */
    transform: rotateY(0deg);
}
.flip-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(145deg, rgba(20, 20, 25, 1), rgba(9, 9, 11, 1));
    border: 1px solid var(--accent);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.1);
    z-index: 1;
}
.back-text {
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 15px;
    font-size: 0.95rem;
}
.flip-prompt {
    margin-top: auto;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.5;
    padding-top: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* CASES GRID */
.cases-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; text-align: left; }
.case-card { 
    background: var(--card-bg); 
    border: 1px solid var(--card-border); 
    border-radius: 24px; 
    overflow: hidden; 
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}
.case-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}
.case-img-wrap { width: 100%; height: 260px; overflow: hidden; position: relative; }
.case-img-wrap::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0; height: 80px;
    background: linear-gradient(to bottom, transparent, var(--card-bg));
    z-index: 1;
}
.case-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.case-card:hover .case-img-wrap img { transform: scale(1.05); }
.case-content { padding: 0 30px 30px 30px; display: flex; flex-direction: column; flex: 1; position: relative; z-index: 2; }
.case-content h3 { font-size: 1.5rem; margin-bottom: 10px; color: #fff; }
.case-tag { 
    display: inline-block; 
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.75rem; 
    font-weight: 700; 
    color: #fff;
    margin-bottom: 15px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    align-self: flex-start;
    /* Premium Liquid Glass effect */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

/* REVIEWS GRID */
.reviews-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 40px; text-align: left; }
.review-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 24px; padding: 40px; }
.stars { color: #f59e0b; font-size: 1.2rem; margin-bottom: 15px; }
.review-text { font-size: 1.1rem; font-style: italic; margin-bottom: 20px; color: var(--text-primary); }
.reviewer-name { font-weight: 700; }
.reviewer-role { font-size: 0.9rem; color: var(--text-muted); }

/* FOOTER / CONTACT */
.footer { margin-top: 100px; border-top: 1px solid var(--card-border); padding-top: 80px; text-align: center; }
.footer-content { max-width: 600px; margin: 0 auto; text-align: center; }
.footer-bottom { text-align: center; color: var(--text-muted); margin-top: 80px; font-size: 0.9rem; }

/* ORDER PAGE STYLES */
.order-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 40px; align-items: stretch; text-align: left; }
.order-form-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}
.order-form-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.1), transparent 40%);
    pointer-events: none;
}
.form-group label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}
.form-group input[type="text"], .form-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}
.form-group input[type="text"]:focus, .form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    background: rgba(0,0,0,0.4);
}
.order-form-box textarea { resize: vertical; min-height: 140px; }
.order-img-box img { width: 100%; border-radius: 32px; border: 1px solid var(--card-border); object-fit: cover; height: 100%; }

/* CUSTOM RADIO PILLS FOR CONTACT METHOD */
.radio-group { display: flex; gap: 10px; }
.radio-pill { flex: 1; }
.radio-pill input { display: none; }
.radio-pill span { display: block; text-align: center; padding: 16px; background: var(--bg-main); border: 1px solid var(--card-border); border-radius: 12px; cursor: pointer; transition: 0.3s; color: var(--text-muted); font-weight: 500; }
.radio-pill input:checked + span { background: #fff; color: #000; border-color: #fff; font-weight: 700; box-shadow: 0 0 15px rgba(255,255,255,0.2); }

/* RESPONSIVE */
@media (max-width: 900px) {
    body {
        padding-top: 70px !important;
    }
    .container { padding: 30px 16px 50px !important; }
    h1 { font-size: clamp(2.2rem, 7vw, 3.2rem) !important; letter-spacing: -1px !important; }
    .hero-subtitle { font-size: 1.05rem !important; margin-bottom: 25px !important; }
    
    .bento-grid-6, .pricing-grid-6, .cases-grid, .reviews-grid, .order-wrapper { grid-template-columns: 1fr; }
    .col-span-2, .row-span-2 { grid-column: span 1; grid-row: span 1; }
    
    /* MOBILE FIXED NAVBAR (Follows on scroll always) */
    .navbar {
        height: 70px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 20px !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background: rgba(9, 9, 11, 0.94) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-bottom: 1px solid var(--card-border) !important;
        z-index: 10000 !important;
        box-sizing: border-box !important;
    }
    .nav-left .nav-links,
    .nav-center,
    .nav-right .nav-links {
        display: none !important;
    }
    .nav-brand {
        font-size: 1.4rem !important;
    }
    .hamburger {
        display: flex !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
        padding: 8px !important;
        flex-direction: column !important;
        gap: 5px !important;
        z-index: 10002 !important;
    }
    .hamburger span {
        display: block !important;
        width: 25px !important;
        height: 2.5px !important;
        background: #fff !important;
        border-radius: 2px !important;
        transition: transform 0.3s ease, opacity 0.3s ease !important;
    }
    
    /* Hamburger morph to X */
    .navbar.nav-active .hamburger span:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg) !important;
    }
    .navbar.nav-active .hamburger span:nth-child(2) {
        opacity: 0 !important;
    }
    .navbar.nav-active .hamburger span:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg) !important;
    }
    
    /* Mobile Dropdown Menu with gradient overlay */
    .nav-mobile-dropdown {
        display: none !important;
        position: fixed !important;
        top: 70px !important;
        left: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background: rgba(12, 12, 16, 0.98) !important;
        backdrop-filter: blur(24px) !important;
        -webkit-backdrop-filter: blur(24px) !important;
        border-bottom: 1px solid rgba(255,255,255,0.12) !important;
        flex-direction: column !important;
        padding: 20px 20px 28px !important;
        gap: 10px !important;
        box-shadow: 0 25px 50px rgba(0,0,0,0.85) !important;
        z-index: 9999 !important;
    }
    
    /* Open State */
    .navbar.nav-active .nav-mobile-dropdown {
        display: flex !important;
        animation: navSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    }
    @keyframes navSlideDown {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    /* Menu Links in Mobile Dropdown */
    .nav-mobile-item {
        font-size: 1.05rem !important;
        padding: 14px 18px !important;
        background: rgba(255,255,255,0.04) !important;
        border-radius: 12px !important;
        text-align: center !important;
        border: 1px solid rgba(255,255,255,0.06) !important;
        width: 100% !important;
        box-sizing: border-box !important;
        color: #e4e4e7 !important;
        text-decoration: none !important;
        font-weight: 500 !important;
        transition: all 0.3s ease !important;
    }
    .nav-mobile-item:hover, .nav-mobile-item.active {
        background: rgba(255,255,255,0.1) !important;
        border-color: rgba(255,255,255,0.2) !important;
        color: #fff !important;
        font-weight: 700 !important;
    }
    
    .nav-mobile-cta {
        display: block !important;
        margin-top: 6px !important;
        background: linear-gradient(135deg, #ffffff, #d4d4d8) !important;
        color: #000 !important;
        padding: 16px !important;
        border-radius: 12px !important;
        font-weight: 700 !important;
        font-size: 1.05rem !important;
        text-align: center !important;
        text-decoration: none !important;
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.25) !important;
    }

    .flip-card {
        height: 500px !important;
    }
    .flip-prompt::before {
        content: 'Тапните для подробностей ⤻' !important;
    }
    
    .bento-card {
        padding: 28px 20px !important;
    }
    .order-img-box { display: none; }
    .order-form-box { padding: 30px 20px; }
    .radio-group { flex-direction: column; gap: 12px; }
}

/* OPACITY RESET FOR GSAP */
.gs-reveal { opacity: 0; transform: translateY(40px); visibility: hidden; }

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1000;
}
.hamburger span {
    width: 25px;
    height: 3px;
    background: #fff;
    transition: 0.3s;
}


/* =========================================
   DEMOS SHOWCASE
   ========================================= */
.demos-showcase {
    margin-top: 100px;
    margin-bottom: 80px;
}
.demos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}
.demo-card {
    background: linear-gradient(145deg, #18181b, #0f0f11);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s, border-color 0.4s;
    display: flex;
    flex-direction: column;
}
.demo-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.05), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}
.demo-card:hover::before {
    left: 150%;
}
.demo-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    border-color: #52525b;
}
.demo-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.demo-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.demo-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}
.demo-card h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.demo-card p {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
}
.demo-features {
    list-style: none;
    margin-bottom: 35px;
    padding: 0;
}
.demo-features li {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
}
.demo-features li span {
    color: #fff;
    font-weight: bold;
    background: rgba(255,255,255,0.1);
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    flex-shrink: 0; /* Prevent stretching on mobile */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
}
@media (max-width: 900px) {
    .demos-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   DEMO GALLERY STYLES
   ========================================= */
.demo-image-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
    height: 240px; /* Forced height to ensure identical sizes */
}
.demo-screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.7s ease;
}
.demo-card:hover .demo-screenshot {
    transform: scale(1.05);
}

/* Mobile Spacing Fixes */
@media (max-width: 900px) {
    .demos-showcase {
        margin-top: 50px !important;
        margin-bottom: 50px !important;
    }
    .demo-card {
        padding: 25px !important;
    }
    .demo-image-wrapper {
        margin-bottom: 15px;
    }
    .demo-card h3 {
        font-size: 1.5rem !important;
    }
}
