:root {
    --bg-color: #fbfbfd;
    --text-color: #1a1a1e;
    --text-secondary: #63636e;
    --primary: #7c6ef6;
    --primary-hover: #5e4ee5;
    --accent: #40b5a6;
    --border-color: rgba(0, 0, 0, 0.08);
    --card-bg: rgba(255, 255, 255, 1);
    --card-bg-hover: rgba(255, 255, 255, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    /* Prevent horizontal scroll on mobile. `clip` is preferred over `hidden`
       because it does NOT create a new scrolling context and does NOT break
       `position: sticky`. `hidden` is kept as a fallback for older browsers. */
    overflow-x: hidden;
    overflow-x: clip;
    max-width: 100%;
    width: 100%;
}

body {
    font-family: 'Onest', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
}

/* Background Ambient Glows */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
    animation: float 10s ease-in-out infinite alternate;
    /* Cap width so inline `width: 60vw` can never exceed the viewport and,
       combined with negative left/right offsets, cause horizontal scroll on mobile. */
    max-width: 100vw;
    max-height: 100vh;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 30px) scale(1.05); }
}

/* Typography Gradient */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-gradient-blue {
    background: linear-gradient(135deg, #0071e3, #40B5A6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(251, 251, 253, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.header-top {
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--border-color);
}
.header-top-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 6px 40px;
    gap: 20px;
}
.top-link {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.top-link:hover { color: var(--primary); }

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 12px;
    font-family: 'Onest', sans-serif;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 110, 246, 0.4);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 110, 246, 0.6);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 150px 20px 60px;
    position: relative;
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero p {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin-bottom: 40px;
}

/* Interface Preview (Glassmorphism Mockup) */
.interface-mockup {
    margin-top: 60px;
    width: 100%;
    max-width: 1100px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1), 0 0 40px rgba(124, 110, 246, 0.1);
    overflow: hidden;
    display: flex;
    height: 600px;
    animation: slideUp 1s ease-out both;
    animation-delay: 0.3s;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Features Grid */
section {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.1;
    letter-spacing: -1px;
}

.section-desc {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 650px;
    margin: 0 auto 80px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.feature-card:hover {
    background: var(--card-bg-hover);
    transform: translateY(-5px);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.fc-icon {
    width: 48px;
    height: 48px;
    background: rgba(124, 110, 246, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 24px;
}

.fc-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.fc-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    flex-grow: 1;
}

/* Grid Spans */
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.pricing-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    position: relative;
}
.pricing-card:hover { transform: translateY(-5px); }
.pricing-card.popular {
    border-color: var(--primary);
    background: linear-gradient(180deg, rgba(124, 110, 246, 0.05) 0%, rgba(255, 255, 255, 1) 100%);
}

.pricing-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pricing-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.pricing-price {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    text-align: left;
    gap: 8px;
}
.pricing-price span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.2;
}

.pricing-features {
    list-style: none;
    margin: 32px 0;
    flex-grow: 1;
}
.pricing-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text-color);
    font-size: 1.05rem;
}
.pricing-features li i { color: #27c93f; width: 18px; }

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 80px 40px 40px;
    margin-top: 80px;
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 1fr 0.9fr 1.1fr;
    gap: 24px;
}
.footer-group h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color);
}
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.9rem;
}
.footer-links a:hover { color: var(--primary); }

.legal-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 8px;
}

/* FAQ */
.faq-item {
    border-bottom: 1px solid var(--border-color);
}
.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: left;
    transition: color 0.2s;
}
.faq-question:hover { color: var(--primary); }
.faq-chevron {
    width: 20px; height: 20px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}
.faq-item.open .faq-answer {
    max-height: 300px;
}
.faq-answer p {
    padding: 0 0 24px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Stats responsive */
@media (max-width: 600px) {
    .stat-number { font-size: 2rem !important; }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    z-index: 99999;
    transition: all 0.3s ease;
}
.cookie-content {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
}
.cookie-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}
.cookie-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.cookie-content a:hover {
    text-decoration: underline;
}

/* Animations Trigger */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Nav */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}
.mobile-only { display: none; }

@media (max-width: 992px) {
    .features-grid, .pricing-grid { grid-template-columns: 1fr; }
    .col-span-2, .col-span-3 { grid-column: span 1; }
    .footer-content { grid-template-columns: 1fr 1fr; }
    .interface-mockup { height: 400px; }
}

@media (max-width: 600px) {
    /* Shrink the hero mockup internals so the fixed-width sidebar+list
       (80 + 300 = 380px) cannot exceed narrow viewports. */
    .mock-sidebar { width: 60px; gap: 16px; padding: 16px 0; }
    .mock-list { width: 180px; }
    .mock-icon { width: 36px; height: 36px; }
}

@media (max-width: 768px) {
    .header-top { display: none; }
    .nav { padding: 12px 20px; }
    .nav-links, .desktop-only { display: none !important; }
    .menu-toggle { display: block; }
    .footer-content { grid-template-columns: 1fr; }
    .hero { padding-top: 120px; }
    
    .page-header { padding-top: 140px !important; padding-bottom: 24px !important; }
    .page-title { font-size: clamp(1.5rem, 6vw, 2.5rem); }
    .content-section { padding: 0 20px 60px !important; }
    .content-card { padding: 32px 24px !important; border-radius: 20px !important; }
    
    .cookie-banner {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: 100%;
        padding: 16px;
    }
    .cookie-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .cookie-content button {
        width: 100%;
    }
}

/* Page Headers (legal / info pages) */
.page-header {
    padding-top: 195px;
    padding-bottom: 40px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}
.page-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 12px;
}
.page-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
}
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}
.content-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px 80px;
}
.content-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 60px;
    backdrop-filter: blur(10px);
}

/* Mobile Nav Overlay */
.mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(251, 251, 253, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px 40px;
    gap: 0;
}
.mobile-nav.open {
    display: flex !important;
}
.mobile-nav-link {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    letter-spacing: -0.03em;
    transition: color 0.2s;
    display: block;
    text-align: center;
}
.mobile-nav-link:hover {
    color: var(--primary);
}
.mobile-nav-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.05);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s;
}
.mobile-nav-close:hover {
    background: rgba(0,0,0,0.1);
}

/* Mockup Internals Specifics */
.mock-sidebar { width: 80px; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; padding: 20px 0; gap: 24px; }
.mock-list { width: 300px; border-right: 1px solid var(--border-color); background: rgba(0,0,0,0.02); }
.mock-main { flex: 1; display: flex; flex-direction: column; background: #ffffff; }
.mock-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: all 0.3s; }
.mock-icon.active { background: rgba(124, 110, 246, 0.1); color: var(--primary); }
.mock-header { padding: 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.mock-chat { flex: 1; padding: 20px; overflow: hidden; display: flex; flex-direction: column; gap: 16px; justify-content: flex-end; }
.mock-input { padding: 20px; border-top: 1px solid var(--border-color); }
.mock-msg { padding: 12px 16px; border-radius: 16px; max-width: 70%; font-size: 0.95rem; }
.mock-msg-left { background: rgba(0,0,0,0.05); align-self: flex-start; border-bottom-left-radius: 4px; color: var(--text-color); }
.mock-msg-right { background: var(--primary); align-self: flex-end; border-bottom-right-radius: 4px; color: #fff; }

/* ═══════════════════════════════════════════════
   Comparison Tables (SEO pages: /compare/*)
   Ported from RU landing jivosite-alternative
   ═══════════════════════════════════════════════ */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 16px;
    overflow: hidden;
}
.comparison-table th {
    background: var(--primary);
    color: #fff;
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
}
.comparison-table th:first-child {
    border-radius: 0;
}
.comparison-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-secondary);
}
.comparison-table tr:last-child td {
    border-bottom: none;
}
.comparison-table tr:hover td {
    background: rgba(124, 110, 246, 0.03);
}
.comparison-table .col-svyazio {
    color: var(--text-color);
    font-weight: 600;
}
.check { color: #22c55e; font-weight: 700; }
.cross { color: #ef4444; }
.partial { color: #f59e0b; }

@media (max-width: 768px) {
    .comparison-table { font-size: 0.85rem; }
    .comparison-table td,
    .comparison-table th { padding: 10px 12px; }
}

/* ═══════════════════════════════════════════════
   Blog & Article Styles (/blog/*, /use-cases/*, /integrations/*)
   ═══════════════════════════════════════════════ */
.article-body {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-color);
}
.article-body h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 48px 0 16px;
    line-height: 1.2;
    color: var(--text-color);
}
.article-body h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text-color);
}
.article-body p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}
.article-body ul, .article-body ol {
    margin: 0 0 24px 24px;
    color: var(--text-secondary);
}
.article-body li {
    margin-bottom: 8px;
    line-height: 1.7;
}
.article-body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.article-body a:hover {
    color: var(--primary-hover);
}
.article-body img {
    max-width: 100%;
    border-radius: 16px;
    margin: 32px 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.article-body blockquote {
    border-left: 3px solid var(--primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: rgba(124, 110, 246, 0.04);
    border-radius: 0 12px 12px 0;
    color: var(--text-secondary);
    font-style: italic;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}
.article-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(124, 110, 246, 0.08);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════
   Responsive Utilities
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .mobile-stack {
        grid-template-columns: 1fr !important;
        flex-direction: column !important;
    }
    .order-mobile-1 { order: 1 !important; }
    .order-mobile-2 { order: 2 !important; }
}
