:root {
    --bg: #07070f;
    --bg-card: #0e0e1a;
    --bg-card-hover: #13131f;
    --border: #1e1e2e;
    --border-subtle: #161622;
    --accent: #5865F2;
    --accent-hover: #4752c4;
    --accent-2: #7c3aed;
    --gradient: linear-gradient(135deg, #5865F2, #7c3aed);
    --gradient-text: linear-gradient(135deg, #818cf8, #a78bfa, #c084fc);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --premium: #f59e0b;
    --premium-gradient: linear-gradient(135deg, #f59e0b, #ef4444);
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 40px rgba(88,101,242,0.15);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: 1.4rem; }
p { color: var(--text-muted); }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: #818cf8; }

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── LAYOUT ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }

/* ── NAVBAR ── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(7,7,15,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    transition: all .3s;
}

.navbar.scrolled {
    background: rgba(7,7,15,0.95);
    border-bottom-color: var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    height: 64px;
    gap: 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo svg { width: 30px; height: 30px; }

.nav-logo span {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto;
}

.nav-center a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all .2s;
    text-decoration: none;
}

.nav-center a:hover, .nav-center a.active {
    color: var(--text);
    background: var(--bg-card);
}

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

.nav-right .btn-ghost {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.nav-right .btn-ghost:hover { color: var(--text); background: var(--bg-card); }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 16px rgba(88,101,242,0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(88,101,242,0.5);
    color: #fff;
}

.btn-premium {
    background: var(--premium-gradient);
    color: #fff;
    box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}

.btn-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(245,158,11,0.5);
    color: #fff;
}

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

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(88,101,242,0.05);
}

.btn-lg { padding: 14px 30px; font-size: 1rem; border-radius: 12px; }
.btn-sm { padding: 7px 16px; font-size: 0.82rem; }

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-blue { background: rgba(88,101,242,0.15); color: #818cf8; border: 1px solid rgba(88,101,242,0.2); }
.badge-green { background: rgba(34,197,94,0.1); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.badge-premium { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-new { background: rgba(124,58,237,0.15); color: #a78bfa; border: 1px solid rgba(124,58,237,0.2); }

/* ── HERO ── */
.hero {
    position: relative;
    padding: 120px 0 100px;
    overflow: hidden;
    text-align: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(88,101,242,0.18) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 80% 60%, rgba(124,58,237,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 80% at center, black 30%, transparent 80%);
    pointer-events: none;
}

.hero-badge { margin-bottom: 20px; }

.hero h1 { margin-bottom: 20px; }

.hero-sub {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 36px;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 56px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-num {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label { font-size: 0.85rem; color: var(--text-subtle); margin-top: 2px; }

/* ── SECTION HEADER ── */
.section-header { text-align: center; margin-bottom: 64px; }
.section-header p { font-size: 1.1rem; margin-top: 12px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* ── CARDS ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all .25s;
}

.card:hover {
    border-color: rgba(88,101,242,0.3);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ── FEATURES GRID ── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.feature-card { position: relative; }

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(88,101,242,0.12);
    border: 1px solid rgba(88,101,242,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; }

.feature-card.premium-feature {
    border-color: rgba(245,158,11,0.2);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245,158,11,0.03) 100%);
}

.feature-card.premium-feature .feature-icon {
    background: rgba(245,158,11,0.1);
    border-color: rgba(245,158,11,0.2);
}

/* ── VS COMPARISON TABLE ── */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.compare-table th {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.compare-table th:not(:first-child) { text-align: center; }

.compare-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-muted);
    vertical-align: middle;
}

.compare-table td:not(:first-child) { text-align: center; }

.compare-table tr:hover td { background: rgba(255,255,255,0.01); }

.compare-table .feature-name { color: var(--text); font-weight: 500; }

.compare-table .check { color: var(--green); font-size: 1.1rem; }
.compare-table .cross { color: var(--red); font-size: 1rem; opacity: 0.6; }
.compare-table .partial { color: var(--yellow); font-size: 0.8rem; font-weight: 600; }

.compare-table .rankify-col { background: rgba(88,101,242,0.04); }
.compare-table th.rankify-col {
    color: #818cf8;
    background: rgba(88,101,242,0.08);
    border-bottom-color: rgba(88,101,242,0.3);
}

/* ── PRICING ── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 780px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    position: relative;
    transition: all .25s;
}

.pricing-card.featured {
    border-color: rgba(245,158,11,0.4);
    background: linear-gradient(160deg, #0e0e1a 0%, rgba(245,158,11,0.05) 100%);
    box-shadow: 0 0 60px rgba(245,158,11,0.1);
}

.pricing-card.featured:hover { box-shadow: 0 0 80px rgba(245,158,11,0.15); }

.pricing-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--premium-gradient);
    color: #fff;
    padding: 4px 18px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.pricing-name { font-size: 1rem; color: var(--text-muted); font-weight: 600; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.pricing-price { font-size: 3rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.pricing-period { color: var(--text-subtle); font-size: 0.85rem; margin-bottom: 28px; }
.pricing-divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

.pricing-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.pricing-feature .icon { color: var(--green); font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.pricing-feature .icon.premium { color: var(--premium); }
.pricing-feature span { color: var(--text-muted); }
.pricing-feature strong { color: var(--text); }

/* ── API PREVIEW ── */
.api-preview {
    background: #0d0d14;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.api-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.api-preview-title { font-size: 0.8rem; color: var(--text-subtle); margin-left: 8px; font-family: monospace; }

.code-block {
    padding: 24px;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-x: auto;
}

.tok-comment { color: #4e5a6e; }
.tok-keyword { color: #c084fc; }
.tok-string { color: #86efac; }
.tok-function { color: #93c5fd; }
.tok-number { color: #fdba74; }
.tok-operator { color: #94a3b8; }
.tok-variable { color: #e2e8f0; }

/* ── BLOG ── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all .25s;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-3px);
    border-color: rgba(88,101,242,0.3);
    box-shadow: var(--shadow-glow);
}

.blog-thumbnail {
    height: 180px;
    background: linear-gradient(135deg, #0e0e1a, #13131f);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.blog-thumbnail::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient);
    opacity: 0.08;
}

.blog-body { padding: 24px; }
.blog-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.blog-date { font-size: 0.78rem; color: var(--text-subtle); }
.blog-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.blog-card p { font-size: 0.88rem; }

/* ── DOCS ── */
.docs-layout { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start; }

.docs-sidebar {
    position: sticky;
    top: 80px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.docs-sidebar-group { margin-bottom: 24px; }
.docs-sidebar-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-subtle); margin-bottom: 8px; padding: 0 8px; }

.docs-sidebar a {
    display: block;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: all .15s;
}

.docs-sidebar a:hover, .docs-sidebar a.active { color: var(--text); background: rgba(88,101,242,0.1); }

.docs-content h2 { margin: 40px 0 16px; }
.docs-content h3 { margin: 28px 0 12px; color: #a5b4fc; }
.docs-content p { margin-bottom: 16px; }

.endpoint-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 20px 0;
    overflow: hidden;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255,255,255,0.02);
}

.method-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.78rem;
    font-weight: 700;
}

.method-get { background: rgba(34,197,94,0.15); color: #4ade80; }
.method-post { background: rgba(88,101,242,0.15); color: #818cf8; }
.method-delete { background: rgba(239,68,68,0.15); color: #f87171; }

.endpoint-path { font-family: monospace; font-size: 0.9rem; color: var(--text); }
.endpoint-body { padding: 20px; }

/* ── TESTIMONIALS ── */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.testimonial-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.testimonial-stars { color: #fbbf24; margin-bottom: 12px; font-size: 0.9rem; }
.testimonial-text { font-size: 0.9rem; margin-bottom: 16px; color: var(--text-muted); font-style: italic; }

.testimonial-author { display: flex; align-items: center; gap: 10px; }
.author-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gradient); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.author-name { font-size: 0.88rem; font-weight: 600; }
.author-role { font-size: 0.78rem; color: var(--text-subtle); }

/* ── CTA BANNER ── */
.cta-banner {
    background: linear-gradient(135deg, rgba(88,101,242,0.12) 0%, rgba(124,58,237,0.08) 100%);
    border: 1px solid rgba(88,101,242,0.2);
    border-radius: var(--radius-lg);
    padding: 64px 48px;
    text-align: center;
}

/* ── FOOTER ── */
.footer {
    border-top: 1px solid var(--border-subtle);
    padding: 48px 0 32px;
}

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

.footer-brand p { font-size: 0.88rem; margin-top: 12px; max-width: 260px; }

.footer-col h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 14px; color: var(--text); }

.footer-col a {
    display: block;
    font-size: 0.85rem;
    color: var(--text-subtle);
    margin-bottom: 8px;
    transition: color .15s;
}

.footer-col a:hover { color: var(--text-muted); }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.82rem;
    color: var(--text-subtle);
}

.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: var(--text-subtle); }
.footer-bottom-links a:hover { color: var(--text-muted); }

/* ── STATUS DOT ── */
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--green); }
.status-dot::before { content: ''; display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .7; transform: scale(1.15); }
}

/* ── TABS ── */
.tabs { display: flex; gap: 4px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 4px; width: fit-content; margin: 0 auto 32px; }

.tab-btn {
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}

.tab-btn.active { background: var(--gradient); color: #fff; }

/* ── TABLE OF CONTENTS (docs) ── */
.toc { position: sticky; top: 80px; }
.toc-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-subtle); font-weight: 600; margin-bottom: 12px; }
.toc a { display: block; font-size: 0.83rem; color: var(--text-subtle); padding: 3px 0; border-left: 2px solid transparent; padding-left: 12px; margin-left: -2px; }
.toc a:hover { color: var(--accent); border-left-color: var(--accent); }

/* ── NOTICE BANNER ── */
.notice-banner {
    background: rgba(88,101,242,0.08);
    border-bottom: 1px solid rgba(88,101,242,0.15);
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.notice-banner a { font-weight: 600; }

/* ── MOBILE ── */
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-muted); border-radius: 1px; transition: all .3s; }
.mobile-menu { display: none; }

@media (max-width: 900px) {
    .nav-center { display: none; }
    .hamburger { display: flex; }
    .mobile-menu { position: fixed; inset: 64px 0 0; background: var(--bg); padding: 24px; display: none; flex-direction: column; gap: 8px; z-index: 999; border-top: 1px solid var(--border); }
    .mobile-menu.open { display: flex; }
    .mobile-menu a { display: block; padding: 12px 16px; border-radius: 10px; color: var(--text-muted); font-weight: 500; }
    .mobile-menu a:hover { background: var(--bg-card); color: var(--text); }
    .mobile-menu .mobile-cta { margin-top: 8px; }

    .footer-grid { grid-template-columns: 1fr 1fr; }
    .docs-layout { grid-template-columns: 1fr; }
    .docs-sidebar { position: static; }
    .hero-stats { gap: 28px; }
    .cta-banner { padding: 40px 24px; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 600px) {
    .footer-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .hero { padding: 80px 0 70px; }
}

/* ── ANIMATIONS ── */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .6s ease, transform .6s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

.stagger-1 { transition-delay: .1s; }
.stagger-2 { transition-delay: .2s; }
.stagger-3 { transition-delay: .3s; }
.stagger-4 { transition-delay: .4s; }
