/* ========================================
   SHARED STYLES FOR ALL PAGES
   ======================================== */

/* Hero Section */
.section-hero {
    background: var(--bg-deepest);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-animate {
    /* Animation placeholder */
}

.webgl-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: radial-gradient(circle at center, rgba(255,140,0,0.05) 0%, transparent 70%);
}

.animation-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

.hero-inner {
    text-align: center;
    padding: 4rem 0;
}

.hero-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.hero-brand-text {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.hero-title-main {
    font-size: clamp(2rem, 10vw, 7.2rem);
    font-weight: 200;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 4rem;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.hero-title-typewriter {
    min-height: 180px;
}

.hero-description {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 3rem auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* btn-primary и btn-secondary используют глобальное правило ниже */

/* Responsive */
@media (max-width: 768px) {
    .hero-title-main {
        font-size: clamp(1.6rem, 8vw, 3.4rem) !important;
        line-height: 1.2 !important;
    }
}

/* Animations */
@keyframes fadeInButtons {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Layouts */
.section-dark {
    background: var(--bg-deepest);
    padding: 8rem 0;
}

.section-overflow {
    overflow: hidden;
}

.section-bottom {
    padding: 6rem 0 10rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-wide {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Section Headers */
.section-header {
    margin-bottom: 5rem;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: left;
}

.section-title-small {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 3rem;
}

/* Grid Layouts */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.grid-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 1024px) {
    .grid-two-col {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

.features-list {
    /* Container for feature list */
}

/* Cards */
.card-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.card-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.card-footer {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.stat-big {
    font-size: 3rem;
    font-weight: 200;
    margin-bottom: 1.5rem;
}

/* Glass Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 3rem;
}

.panel-title {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    color: var(--text-secondary);
}

.feature-item {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-icon {
    color: var(--accent-emerald);
}

/* Dashboard Preview */
.dashboard-preview {
    position: relative;
}

.decorative-circle {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,140,0,0.2), transparent 70%);
    border-radius: 50%;
}

.dashboard-mockup {
    background: #111;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.dashboard-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.control-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control-dot.red {
    background: #EF4444;
}

.control-dot.yellow {
    background: #F59E0B;
}

.control-dot.green {
    background: #FF8C00;
}

.chart-mockup {
    height: 200px;
    background: linear-gradient(180deg, rgba(255, 140, 0, 0.1) 0%, rgba(255, 140, 0, 0) 100%);
    border-top: 2px solid #FF8C00;
    position: relative;
}

.chart-stat {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
}

.chart-label {
    position: absolute;
    bottom: 20px;
    left: 140px;
    color: #aaa;
}

/* Timeline */
.timeline-node {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 3rem;
    border-left: 2px solid rgba(255,255,255,0.05);
}

.timeline-node.last {
    border-left: none;
}

.timeline-dot {
    position: absolute;
    left: -9px;
    top: 0;
    width: 16px;
    height: 16px;
    background: var(--bg-deepest);
    border: 2px solid var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.timeline-dot.blue {
    border-color: #3B82F6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.timeline-dot.purple {
    border-color: #A855F7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.timeline-dot.yellow {
    border-color: #F59E0B;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.timeline-title {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.timeline-text {
    color: var(--text-secondary);
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.pricing-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 2.5rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
}

.pricing-hit {
    border-color: var(--accent-purple);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.1);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #A855F7;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.pricing-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.pricing-title.purple {
    color: #A855F7;
}

.pricing-price {
    font-size: 2rem;
    color: #fff;
    font-weight: 700;
    margin-bottom: 2rem;
}

.pricing-features {
    color: var(--text-secondary);
    list-style: none;
    padding: 0;
    line-height: 1.8;
}

.pricing-button {
    width: 100%;
    text-align: center;
    margin-top: 2rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
}

.btn-gradient {
    background: linear-gradient(135deg, #FF8C00, #FF6347);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s;
}

/* FAQ */
.faq-wrapper {
    margin-bottom: 6rem;
}

.faq-item {
    border-bottom: 1px solid var(--border-subtle);
}

.faq-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    text-align: left;
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-open .faq-content {
    padding-bottom: 2rem;
}

/* Contact Form */
.contact-form-wrapper {
    background: var(--bg-surface);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    text-align: center;
}

.contact-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.contact-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.form-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-subtle);
    padding: 1rem;
    border-radius: 12px;
    color: white;
}

.form-submit {
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

/* Case Cards */
.case-metric {
    font-size: 3rem;
    font-weight: 200;
    margin-bottom: 1.5rem;
}

.case-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.case-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.case-company {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* Global glass style for all large buttons - ИИ-дашборды стиль */
a.btn,
button.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-gradient,
.btn-glass,
.service-hero-button,
.service-hero-button-primary,
.service-hero-button-secondary,
.pricing-button,
.form-submit,
.faq-trigger,
.form-button {
    background: transparent;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 2px 1px rgba(255, 255, 255, 0.35) inset,
                0 0 10px 4px rgba(255, 255, 255, 0.15) inset,
                0px 8px 32px rgba(0, 0, 0, 0.12),
                0px 16px 48px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden !important;
    z-index: 40;
    min-width: 360px;
    min-height: 100px;
    font-size: 1.25rem;
    padding: 1.5rem 3rem;
    border-radius: 50px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#navbar > div > a.btn.btn-primary {
    min-width: auto !important;
    min-height: auto !important;
    width: auto !important;
    height: auto !important;
    font-size: 0.875rem !important;
    padding: 12px 24px !important;
}

a.btn:hover,
button.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-outline:hover,
.btn-gradient:hover,
.btn-glass:hover,
.service-hero-button:hover,
.service-hero-button-primary:hover,
.service-hero-button-secondary:hover,
.pricing-button:hover,
.form-submit:hover,
.faq-trigger:hover,
.form-button:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
    a.btn,
    button.btn,
    .btn-primary,
    .btn-secondary,
    .btn-outline,
    .btn-gradient,
    .btn-glass,
    .service-hero-button,
    .service-hero-button-primary,
    .service-hero-button-secondary,
    .pricing-button,
    .form-submit,
    .faq-trigger,
    .form-button {
        background: transparent;
        box-shadow: 0 0 2px 1px rgba(255, 255, 255, 0.28) inset,
                    0 0 10px 4px rgba(255, 255, 255, 0.12) inset,
                    0px 8px 32px rgba(0, 0, 0, 0.2),
                    0px 16px 48px rgba(0, 0, 0, 0.15);
    }

    a.btn:hover,
    button.btn:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .btn-outline:hover,
    .btn-gradient:hover,
    .btn-glass:hover,
    .service-hero-button:hover,
    .service-hero-button-primary:hover,
    .service-hero-button-secondary:hover,
    .pricing-button:hover,
    .form-submit:hover,
    .faq-trigger:hover,
    .form-button:hover {
        background: rgba(255, 255, 255, 0.12) !important;
    }
}

/* ========================================
   MOBILE-FIRST COMPREHENSIVE FIXES
   ======================================== */

/* Prevent horizontal overflow on ALL pages
   overflow-x: clip (не overflow-x: hidden!) — не создаёт новый stacking context,
   поэтому не ломает backdrop-filter на position:fixed элементах (navbar, мобильное меню) */
html, body {
    overflow-x: clip;
    max-width: 100%;
}

@media (max-width: 768px) {

    /* ── Section paddings ── */
    .section-dark {
        padding: 3.5rem 0;
    }

    .section-bottom {
        padding: 3rem 0 5rem 0;
    }

    /* ── Hero: clear fixed navbar (≈72px) + comfortable padding ── */
    .section-hero {
        min-height: 100svh; /* iOS Safari safe */
        padding-top: 5rem;
        padding-bottom: 3rem;
    }

    .hero-inner {
        padding: 2rem 0;
    }

    .hero-title-typewriter {
        min-height: 100px;
    }

    .hero-brand {
        margin-bottom: 2rem;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    /* ── Buttons: stack on small screens ── */
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .hero-buttons .btn,
    .hero-buttons a,
    .hero-buttons button {
        width: 100%;
        text-align: center;
    }

    /* ── Container safe horizontal padding ── */
    .container,
    .hero-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* ── Large stats numbers ── */
    .stat-big {
        font-size: 2.2rem;
    }

    /* ── Grid columns collapse ── */
    .grid-two-col {
        grid-template-columns: 1fr;
    }

    /* ── Footer brand animation — disable on mobile ── */
    .float-letter {
        animation: none;
    }

    /* ── Overflow от mega-menu backdrop ── */
    .mega-menu {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .section-dark {
        padding: 2.5rem 0;
    }

    .hero-inner {
        padding: 1.5rem 0;
    }
}
