/* ==========================================================
   Jamii AI — Landing Page Styles
   ========================================================== */

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Palette */
    --bg:           #06080d;
    --bg-card:      #0d1117;
    --bg-card-alt:  #111820;
    --surface:      #161b22;
    --border:       #21262d;
    --border-light: #30363d;
    --text:         #e6edf3;
    --text-muted:   #8b949e;
    --text-secondary: #8b949e;
    --text-dim:     #484f58;

    /* Accents */
    --accent:       #7c3aed;
    --accent-light: #a78bfa;
    --accent-glow:  rgba(124, 58, 237, .35);
    --cyan:         #22d3ee;
    --emerald:      #34d399;
    --amber:        #fbbf24;
    --rose:         #fb7185;
    --blue:         #60a5fa;

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, var(--accent-light), var(--cyan));
    --gradient-card:  linear-gradient(145deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);

    /* Typography */
    --font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:  'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Spacing */
    --container: 1200px;
    --section-py: 120px;
    --radius:     12px;
    --radius-lg:  20px;

    /* Code */
    --code-bg:    #0a0e14;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

code {
    font-family: var(--font-mono);
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .25s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 24px var(--accent-glow);
}
.btn-primary:hover {
    background: #6d28d9;
    border-color: #6d28d9;
    box-shadow: 0 0 36px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border-light);
}
.btn-outline:hover {
    border-color: var(--accent-light);
    color: var(--accent-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}
.btn-ghost:hover {
    color: var(--text);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: 12px;
}

.btn-block {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* ---- Gradient Text ---- */
.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    background: rgba(6, 8, 13, .65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s, background .3s;
}
.navbar.scrolled {
    border-bottom-color: var(--border);
    background: rgba(6, 8, 13, .85);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.mobile-menu {
    display: contents;
}

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-icon {
    color: var(--accent-light);
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    position: relative;
}
.logo-icon svg {
    width: 1.2em;
    height: 1.2em;
    filter: drop-shadow(0 0 6px var(--accent-glow));
}
.logo-star {
    fill: #fff;
    opacity: 0;
    animation: sparkle 2.4s ease-in-out infinite;
}
.logo-star:nth-child(2) { animation-delay: .5s; }
.logo-star:nth-child(3) { animation-delay: 1s; }
.logo-star:nth-child(4) { animation-delay: 1.5s; }
.logo-star:nth-child(5) { animation-delay: 2s; }
@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(.5); }
    50%      { opacity: 1; transform: scale(1); }
}
.logo-highlight {
    color: var(--accent-light);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 32px;
}
.nav-links a {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color .2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-links a:hover {
    color: var(--text);
}

.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}

.lang-switch {
    font-size: .85rem;
    padding: 6px 14px;
    color: var(--text) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 8px;
    gap: 6px;
    flex-shrink: 0;
}
.lang-switch:hover {
    border-color: var(--accent-light) !important;
    color: var(--accent-light) !important;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .4;
}
.hero-glow--1 {
    width: 600px;
    height: 600px;
    top: -150px;
    right: -100px;
    background: var(--accent);
}
.hero-glow--2 {
    width: 500px;
    height: 500px;
    bottom: -100px;
    left: -100px;
    background: var(--cyan);
    opacity: .2;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
}

.hero-container {
    position: relative;
    text-align: center;
    max-width: 820px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(124, 58, 237, .12);
    border: 1px solid rgba(124, 58, 237, .25);
    border-radius: 100px;
    padding: 6px 18px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--accent-light);
    margin-bottom: 28px;
}
.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-light);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

.hero-title {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.03em;
    margin-bottom: 24px;
}

/* ---- Handwriting / Typewriter Animation ---- */
.handwriting-line {
    display: inline;
}

.handwriting-cursor {
    display: inline-block;
    font-weight: 300;
    color: var(--accent-light);
    animation: blink-cursor .7s step-end infinite;
    margin-left: 2px;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 64px;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 36px;
    flex-wrap: wrap;
}
.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
}
.stat-label {
    font-size: .78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

/* ===== SECTION HEADERS ===== */
.section-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 64px;
}
.section-tag {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--accent-light);
    background: rgba(124, 58, 237, .1);
    border: 1px solid rgba(124, 58, 237, .2);
    padding: 4px 14px;
    border-radius: 100px;
    margin-bottom: 20px;
}
.section-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.025em;
    margin-bottom: 16px;
}
.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ===== FEATURES ===== */
.features {
    padding: var(--section-py) 0;
    position: relative;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    transition: border-color .3s, transform .3s, box-shadow .3s;
    position: relative;
    overflow: hidden;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-brand);
    opacity: 0;
    transition: opacity .3s;
}
.feature-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, .3);
}
.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature-card--chat .feature-icon  { background: rgba(124,58,237,.15); color: var(--accent-light); }
.feature-card--voice .feature-icon { background: rgba(34,211,238,.12); color: var(--cyan); }
.feature-card--video .feature-icon { background: rgba(168,85,247,.12); color: #a855f7; }
.feature-card--code .feature-icon  { background: rgba(245,158,11,.12); color: #f59e0b; }
.feature-card--agent .feature-icon { background: rgba(139,92,246,.12); color: #8b5cf6; }
.feature-card--vision .feature-icon { background: rgba(251,191,36,.12); color: var(--amber); }
.feature-card--doc .feature-icon   { background: rgba(52,211,153,.12); color: var(--emerald); }
.feature-card--db .feature-icon    { background: rgba(96,165,250,.12); color: var(--blue); }
.feature-card--auth .feature-icon  { background: rgba(251,113,133,.12); color: var(--rose); }
.feature-card--text .feature-icon  { background: rgba(14,165,233,.12); color: #0ea5e9; }
.feature-card--moderation .feature-icon { background: rgba(244,63,94,.12); color: #f43f5e; }
.feature-card--embeddings .feature-icon { background: rgba(16,185,129,.12); color: #10b981; }
.feature-card--web .feature-icon   { background: rgba(99,102,241,.12); color: #6366f1; }
.feature-card--memory .feature-icon { background: rgba(217,119,6,.12); color: #d97706; }
.feature-card--africa .feature-icon { background: rgba(34,197,94,.12); color: #22c55e; }

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.feature-card p {
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 20px;
}

.feature-endpoints {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.feature-endpoints code {
    font-size: .72rem;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 6px;
    color: var(--text-muted);
}

/* ===== API EXPLORER ===== */
.endpoints {
    padding: var(--section-py) 0;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-card) 50%, var(--bg) 100%);
}

.api-explorer {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
}

.api-tabs {
    display: flex;
    overflow-x: auto;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 8px;
}
.api-tab {
    padding: 14px 24px;
    font-family: var(--font);
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color .2s, border-color .2s;
    white-space: nowrap;
}
.api-tab:hover {
    color: var(--text);
}
.api-tab.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent-light);
}

.api-panel {
    display: none;
    grid-template-columns: 1fr 1fr;
}
.api-panel.active {
    display: grid;
}

.api-info {
    padding: 36px;
    border-right: 1px solid var(--border);
}
.api-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.api-info > p {
    font-size: .9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.endpoint-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color .2s;
}
.endpoint:hover {
    border-color: var(--border-light);
}

.method {
    font-family: var(--font-mono);
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
    text-transform: uppercase;
    min-width: 48px;
    text-align: center;
}
.method.get  { background: rgba(52,211,153,.15); color: var(--emerald); }
.method.post { background: rgba(96,165,250,.15); color: var(--blue); }
.method.put  { background: rgba(251,191,36,.15); color: var(--amber); }

.path {
    font-family: var(--font-mono);
    font-size: .82rem;
    color: var(--text);
    flex: 1;
}

.auth-badge {
    font-size: .68rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 100px;
    background: rgba(124,58,237,.12);
    color: var(--accent-light);
    border: 1px solid rgba(124,58,237,.2);
}
.auth-badge.admin {
    background: rgba(251,113,133,.12);
    color: var(--rose);
    border-color: rgba(251,113,133,.2);
}

/* ---- Code Blocks ---- */
.code-block {
    background: #0a0e14;
    border-radius: 0;
    overflow: hidden;
}
.code-block--dark {
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255,255,255,.03);
    border-bottom: 1px solid var(--border);
}
.code-lang {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.copy-btn {
    font-family: var(--font);
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-dim);
    background: none;
    border: 1px solid var(--border);
    padding: 3px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}
.copy-btn:hover {
    color: var(--text);
    border-color: var(--border-light);
}

.code-block pre {
    padding: 20px 24px;
    overflow-x: auto;
    font-size: .82rem;
    line-height: 1.65;
}
.code-block code {
    color: #c9d1d9;
}
.code-block .kw  { color: #ff7b72; }
.code-block .str { color: #a5d6ff; }
.code-block .fn  { color: #d2a8ff; }
.code-block .cm  { color: #484f58; font-style: italic; }
.code-block .var { color: #79c0ff; }

/* ===== INTEGRATION ===== */
.integration {
    padding: var(--section-py) 0;
}

.integration-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 64px;
}

.integration-step {
    text-align: center;
    padding: 32px 24px;
}
.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(124,58,237,.12);
    border: 2px solid var(--accent);
    color: var(--accent-light);
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.integration-step h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.integration-step p {
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.65;
}
.integration-step code {
    font-size: .82rem;
    color: var(--accent-light);
    background: rgba(124,58,237,.1);
    padding: 1px 6px;
    border-radius: 4px;
}

.lang-showcase {
    max-width: 800px;
    margin: 0 auto;
}

.lang-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}
.lang-tab {
    padding: 10px 24px;
    font-family: var(--font);
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    transition: color .2s, background .2s;
}
.lang-tab:hover {
    color: var(--text);
}
.lang-tab.active {
    color: var(--accent-light);
    background: var(--bg-card);
    border-color: var(--border);
}

.lang-panel {
    display: none;
}
.lang-panel.active {
    display: block;
}
.lang-panel .code-block--dark {
    border-radius: 0 var(--radius) var(--radius) var(--radius);
}

/* ===== PRICING ===== */
.pricing {
    padding: var(--section-py) 0;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-card) 50%, var(--bg) 100%);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

.pricing-card {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    position: relative;
    transition: transform .3s, box-shadow .3s;
}
.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, .2);
}

.pricing-card--popular {
    border-color: var(--accent);
    box-shadow: 0 0 48px var(--accent-glow);
    transform: scale(1.03);
}
.pricing-card--popular:hover {
    transform: scale(1.03) translateY(-4px);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: 4px 18px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.pricing-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.pricing-price {
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.price-amount {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -.03em;
}
.price-period {
    font-size: .95rem;
    color: var(--text-muted);
}

.pricing-desc {
    font-size: .88rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.6;
}

.pricing-features {
    list-style: none;
    margin-bottom: 32px;
}
.pricing-features li {
    padding: 8px 0;
    font-size: .88rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.pricing-features li:last-child {
    border-bottom: none;
}
.pricing-features li::before {
    content: '✓';
    color: var(--emerald);
    font-weight: 700;
    font-size: .82rem;
}

/* ===== FOOTER ===== */
.footer {
    padding: 80px 0 40px;
    border-top: 1px solid var(--border);
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 64px;
    margin-bottom: 48px;
}

.footer-brand p {
    font-size: .9rem;
    color: var(--text-muted);
    margin-top: 16px;
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.footer-col h4 {
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text);
    margin-bottom: 16px;
}
.footer-col a {
    display: block;
    font-size: .88rem;
    color: var(--text-muted);
    padding: 4px 0;
    transition: color .2s;
}
.footer-col a:hover {
    color: var(--text);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.footer-bottom p {
    font-size: .82rem;
    color: var(--text-dim);
}
.powered-by {
    font-size: .82rem;
    color: var(--text-muted);
    font-weight: 500;
}
.powered-by a {
    color: var(--accent-light);
    transition: color .2s;
}
.powered-by a:hover {
    color: var(--text);
}
.footer-legal {
    display: flex;
    gap: 24px;
}
.footer-legal a {
    font-size: .82rem;
    color: var(--text-dim);
    transition: color .2s;
}
.footer-legal a:hover {
    color: var(--text);
}

/* ===== ANIMATIONS ===== */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-badge,
.hero-title,
.hero-subtitle,
.hero-cta,
.hero-stats {
    animation: fade-up .7s ease both;
}
.hero-title   { animation-delay: .1s; }
.hero-subtitle { animation-delay: .2s; }
.hero-cta     { animation-delay: .3s; }
.hero-stats   { animation-delay: .4s; }

/* ---- Scroll-reveal ---- */
.feature-card,
.integration-step,
.pricing-card {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .6s ease, transform .6s ease;
}
.feature-card.visible,
.integration-step.visible,
.pricing-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pricing-card--popular {
        grid-column: span 2;
        max-width: 420px;
        justify-self: center;
    }
}

@media (max-width: 768px) {
    :root {
        --section-py: 80px;
    }

    .mobile-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 16px 24px;
        gap: 16px;
        z-index: 100;
    }
    .mobile-menu.open {
        display: flex;
    }
    .mobile-menu .nav-links {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .mobile-menu .nav-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        border-top: 1px solid var(--border);
        padding-top: 12px;
    }
    .lang-switch {
        display: flex !important;
        order: 1;
        margin-left: auto;
        margin-right: 8px;
        font-size: .85rem;
        padding: 6px 10px;
    }
    .mobile-toggle {
        display: flex;
        order: 2;
    }

    .hero { padding: 100px 0 60px; }
    .hero-stats { gap: 20px; }
    .stat-divider { display: none; }

    .features-grid,
    .integration-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    .pricing-card--popular {
        grid-column: auto;
        max-width: none;
    }

    .api-panel {
        grid-template-columns: 1fr;
    }
    .api-info {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .footer-links {
        grid-template-columns: repeat(3, 1fr);
    }
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2rem; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .footer-links { grid-template-columns: 1fr 1fr; gap: 24px; }
    .api-tabs { gap: 0; }
    .api-tab { padding: 12px 14px; font-size: .8rem; }
}

/* =========================================
   Documentation Page
   ========================================= */

.doc-header {
    padding: 140px 0 60px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.doc-title {
    font-size: 3rem;
    font-weight: 800;
    margin: 16px 0 12px;
}
.doc-subtitle {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Layout */
.doc-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    max-width: var(--container);
    margin: 0 auto;
    gap: 48px;
    padding: 48px 24px 120px;
}

/* Sidebar */
.doc-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 16px;
}
.doc-sidebar::-webkit-scrollbar { width: 3px; }
.doc-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.doc-nav-group { margin-bottom: 24px; }
.doc-nav-group h4 {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-left: 12px;
}
.doc-nav-link {
    display: block;
    padding: 6px 12px;
    font-size: .9rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: all .2s;
}
.doc-nav-link:hover {
    color: var(--text);
    background: rgba(124, 58, 237, .06);
}
.doc-nav-link.active {
    color: var(--accent-light);
    border-left-color: var(--accent);
    background: rgba(124, 58, 237, .08);
}

/* Main content */
.doc-content { min-width: 0; }
.doc-section {
    padding-top: 48px;
    margin-bottom: 24px;
}
.doc-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.doc-modality-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 720px;
}

/* Endpoint cards */
.doc-endpoint {
    background: rgba(255, 255, 255, .02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.doc-endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.doc-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: .95rem;
    color: var(--text);
    font-weight: 500;
}
.doc-tag {
    font-size: .75rem;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(34, 211, 238, .12);
    color: var(--cyan);
    font-weight: 500;
}
.doc-endpoint h4 {
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-secondary);
    margin: 20px 0 8px;
}
.doc-endpoint p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

/* Method badges */
.method {
    font-family: 'JetBrains Mono', monospace;
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.method.get { background: rgba(34, 197, 94, .15); color: #22c55e; }
.method.post { background: rgba(59, 130, 246, .15); color: #3b82f6; }
.method.put { background: rgba(251, 191, 36, .15); color: #fbbf24; }
.method.delete { background: rgba(239, 68, 68, .15); color: #ef4444; }
.method.patch { background: rgba(168, 85, 247, .15); color: #a855f7; }

/* Auth badge */
.auth-badge {
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(124, 58, 237, .12);
    color: var(--accent-light);
    font-weight: 500;
}
.auth-badge.admin {
    background: rgba(251, 191, 36, .12);
    color: #fbbf24;
}

/* Parameter table */
.doc-params {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
    margin-bottom: 12px;
}
.doc-params th {
    text-align: left;
    padding: 8px 12px;
    background: rgba(255, 255, 255, .03);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
}
.doc-params td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    color: var(--text-secondary);
}
.doc-params td code {
    color: var(--accent-light);
    font-family: 'JetBrains Mono', monospace;
    font-size: .85rem;
}

/* Doc code block */
.doc-code {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}
.doc-code pre {
    background: var(--code-bg);
    padding: 16px 20px;
    overflow-x: auto;
    margin: 0;
}
.doc-code code {
    font-family: 'JetBrains Mono', monospace;
    font-size: .85rem;
    color: var(--text);
    line-height: 1.6;
}

/* Responsive docs */
@media (max-width: 900px) {
    .doc-header {
        padding: 110px 0 40px;
    }
    .doc-title { font-size: 2rem; }
    .doc-subtitle { font-size: 1rem; }
    .doc-layout {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 24px 16px 80px;
    }
    .doc-sidebar {
        position: static;
        max-height: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: 24px;
        margin-bottom: 24px;
        padding-right: 0;
    }
    .doc-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 12px;
    }
    .doc-nav-group { margin-bottom: 12px; }
    .doc-nav-link {
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 6px 6px 0 0;
        padding: 4px 10px;
        font-size: .82rem;
    }
    .doc-nav-link.active { border-left-color: transparent; border-bottom-color: var(--accent); }
    .doc-section h2 { font-size: 1.4rem; }
    .doc-endpoint { padding: 16px; }
}
@media (max-width: 600px) {
    .doc-header { padding: 90px 0 32px; }
    .doc-title { font-size: 1.6rem; }
    .doc-endpoint-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .doc-params { font-size: .8rem; }
    .doc-params th, .doc-params td { padding: 6px 8px; }
    .doc-code pre { padding: 12px 14px; }
    .doc-code code { font-size: .78rem; }
}

/* ==========================================================
   Chatbot Widget
   ========================================================== */

/* ---- FAB (Floating Action Button) ---- */
.jcb-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--accent-glow), 0 2px 8px rgba(0,0,0,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s;
}
.jcb-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px var(--accent-glow), 0 4px 12px rgba(0,0,0,.4);
}
.jcb-fab-icon {
    width: 24px;
    height: 24px;
    position: absolute;
    transition: opacity .25s, transform .3s;
}
.jcb-fab-icon--chat  { opacity: 1; transform: rotate(0deg); }
.jcb-fab-icon--close { opacity: 0; transform: rotate(-90deg); }
.jcb-fab--open .jcb-fab-icon--chat  { opacity: 0; transform: rotate(90deg); }
.jcb-fab--open .jcb-fab-icon--close { opacity: 1; transform: rotate(0deg); }

/* ---- Panel ---- */
.jcb-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 9998;
    width: 380px;
    max-height: 560px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 12px 48px rgba(0,0,0,.5), 0 0 0 1px rgba(124,58,237,.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(.96);
    transform-origin: bottom right;
    transition: opacity .3s cubic-bezier(.4,0,.2,1),
                transform .3s cubic-bezier(.4,0,.2,1),
                visibility .3s;
}
.jcb-panel.jcb-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ---- Header ---- */
.jcb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(124,58,237,.15), rgba(34,211,238,.08));
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.jcb-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.jcb-header-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}
.jcb-header-avatar svg { width: 100%; height: 100%; }
.jcb-header-title {
    font-size: .88rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.jcb-header-subtitle {
    font-size: .72rem;
    color: var(--text-muted);
    line-height: 1.3;
}
.jcb-header-actions {
    display: flex;
    gap: 4px;
}
.jcb-icon-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s;
}
.jcb-icon-btn:hover {
    background: rgba(255,255,255,.08);
    color: var(--text);
}
.jcb-icon-btn svg { width: 16px; height: 16px; }

/* ---- Login view ---- */
.jcb-login {
    display: none;
    flex: 1;
    overflow-y: auto;
}
.jcb-login.jcb-active { display: flex; }
.jcb-login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 20px;
}
.jcb-login-header {
    text-align: center;
    margin-bottom: 4px;
}
.jcb-login-avatar {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
}
.jcb-login-avatar svg { width: 100%; height: 100%; }
.jcb-login-header h3 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.jcb-login-header p {
    font-size: .78rem;
    color: var(--text-muted);
}
.jcb-login-error {
    display: none;
    font-size: .78rem;
    color: var(--rose);
    background: rgba(251,113,133,.08);
    border: 1px solid rgba(251,113,133,.2);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
}
.jcb-login-error.jcb-active { display: block; }
.jcb-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.jcb-field span {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
}
.jcb-field input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: .85rem;
    outline: none;
    transition: border-color .2s;
}
.jcb-field input:focus {
    border-color: var(--accent-light);
}
.jcb-login-btn {
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    margin-top: 4px;
}
.jcb-login-btn:hover { background: #6d28d9; }
.jcb-login-btn:disabled { opacity: .6; cursor: wait; }

/* ---- Chat view ---- */
.jcb-chat {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.jcb-chat.jcb-active { display: flex; }

/* Messages */
.jcb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
    max-height: 380px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}
.jcb-messages::-webkit-scrollbar { width: 5px; }
.jcb-messages::-webkit-scrollbar-track { background: transparent; }
.jcb-messages::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 10px;
}

.jcb-msg {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    animation: jcb-fadeIn .3s ease;
}
.jcb-msg--user {
    flex-direction: row-reverse;
}
.jcb-msg-avatar {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.jcb-msg-avatar svg { width: 100%; height: 100%; }
.jcb-msg-content {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: .84rem;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}
.jcb-msg--user .jcb-msg-content {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.jcb-msg--assistant .jcb-msg-content {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

/* Thinking animation */
.jcb-dots {
    display: inline-flex;
    gap: 4px;
    padding: 2px 0;
}
.jcb-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: jcb-bounce .6s ease-in-out infinite;
}
.jcb-dots span:nth-child(2) { animation-delay: .15s; }
.jcb-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes jcb-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

@keyframes jcb-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Input bar */
.jcb-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}
.jcb-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: .84rem;
    outline: none;
    transition: border-color .2s;
}
.jcb-input:focus { border-color: var(--accent-light); }
.jcb-input::placeholder { color: var(--text-dim); }
.jcb-send-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s, transform .15s;
}
.jcb-send-btn:hover { background: #6d28d9; transform: scale(1.05); }
.jcb-send-btn:disabled { opacity: .5; cursor: wait; }
.jcb-send-btn svg { width: 16px; height: 16px; }

/* ---- Mobile responsive ---- */
@media (max-width: 480px) {
    .jcb-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 88px;
        max-height: calc(100vh - 120px);
        border-radius: 16px;
    }
    .jcb-fab {
        bottom: 16px;
        right: 16px;
    }
}

/* ==========================================================
   Signup Modal
   ========================================================== */
.signup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: signup-fadeIn .25s ease;
}
.signup-overlay.active { display: flex; }

.signup-modal {
    width: 100%;
    max-width: 460px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .6), 0 0 0 1px var(--accent-glow);
    overflow: hidden;
    animation: signup-slideUp .3s cubic-bezier(.4, 0, .2, 1);
}

.signup-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}
.signup-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.signup-modal-header .signup-plan-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    margin-left: 10px;
}
.signup-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background .2s, color .2s;
}
.signup-modal-close:hover {
    background: rgba(255, 255, 255, .08);
    color: var(--text);
}

.signup-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}
.signup-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: color .2s, border-color .2s;
    border-bottom: 2px solid transparent;
}
.signup-tab.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent-light);
}
.signup-tab:hover:not(.active) {
    color: var(--text);
}

.signup-form {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.signup-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.signup-field label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
}
.signup-field input {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    font-family: var(--font);
    font-size: .88rem;
    outline: none;
    transition: border-color .2s;
}
.signup-field input:focus {
    border-color: var(--accent-light);
}
.signup-field input::placeholder {
    color: var(--text-dim);
}

.signup-error {
    display: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: .78rem;
    color: var(--rose);
    background: rgba(251, 113, 133, .08);
    border: 1px solid rgba(251, 113, 133, .2);
    text-align: center;
}
.signup-error.active { display: block; }

.signup-success {
    display: none;
    padding: 16px 12px;
    border-radius: 8px;
    font-size: .88rem;
    color: var(--emerald);
    background: rgba(52, 211, 153, .08);
    border: 1px solid rgba(52, 211, 153, .2);
    text-align: center;
    line-height: 1.5;
}
.signup-success.active { display: block; }

.signup-submit {
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s;
    margin-top: 4px;
}
.signup-submit:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}
.signup-submit:disabled {
    opacity: .6;
    cursor: wait;
    transform: none;
}

.signup-footer {
    padding: 0 24px 20px;
    text-align: center;
    font-size: .78rem;
    color: var(--text-muted);
}
.signup-footer a {
    color: var(--accent-light);
    text-decoration: none;
}
.signup-footer a:hover {
    text-decoration: underline;
}

@keyframes signup-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes signup-slideUp {
    from { opacity: 0; transform: translateY(24px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
    .signup-modal { max-width: 100%; }
    .signup-form { padding: 16px 16px 20px; }
}
