/* ─── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0b;
    --bg-card: #131316;
    --bg-card-hover: #1a1a1f;
    --border: #25252b;
    --text: #e4e4e7;
    --text-muted: #8b8b94;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-bg: rgba(99, 102, 241, 0.1);
    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.1);
    --orange: #f59e0b;
    --red: #ef4444;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 8px;
    --radius-lg: 12px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ─── Layout ──────────────────────────────────────────────────────────── */
.container {
    max-width: 1100px; margin: 0 auto; padding: 0 20px;
    width: 100%; overflow-x: hidden;
}
.section { padding: 80px 0; }

/* ─── Nav ─────────────────────────────────────────────────────────────── */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(10, 10, 11, 0.85); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
nav .container {
    display: flex; align-items: center; justify-content: space-between;
    overflow: visible;
}
.nav-logo {
    font-size: 20px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0; z-index: 210; position: relative;
}
.nav-logo span { color: var(--primary); }
.nav-logo svg { flex-shrink: 0; }

/* Desktop nav links */
.nav-links {
    display: flex; gap: 28px; align-items: center;
}
.nav-links a {
    color: var(--text-muted); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.nav-links a:hover { color: var(--text); }

/* Hamburger — hidden on desktop */
.nav-toggle {
    display: none; background: none; border: none; cursor: pointer;
    padding: 8px; z-index: 210; -webkit-tap-highlight-color: transparent;
    flex-shrink: 0; position: relative;
}
.nav-toggle span {
    display: block; width: 22px; height: 2px; background: var(--text);
    margin: 5px 0; transition: all 0.3s; border-radius: 2px;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── Mobile Menu Overlay ─────────────────────────────────────────────── */
.mobile-menu {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 60px; left: 0; right: 0; bottom: 0;
    z-index: 99;
    background: #0a0a0b;
    padding: 24px 32px 32px;
}
.mobile-menu a {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    padding: 18px 0;
    border-bottom: 1px solid #25252b;
    text-decoration: none;
}
.mobile-menu a:hover { color: #818cf8; }
.mobile-menu .mobile-menu-btn {
    display: block;
    margin-top: 24px;
    padding: 16px;
    background: #6366f1;
    color: #ffffff;
    border-radius: 10px;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    border-bottom: none;
}
.mobile-menu .mobile-menu-btn:hover { background: #818cf8; }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; cursor: pointer;
    border: none; transition: all 0.2s; white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--text-muted); color: #fff; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }

/* ─── Hero ────────────────────────────────────────────────────────────── */
.hero {
    padding: 140px 0 80px;
    text-align: center;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--primary-bg); border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 6px 16px; border-radius: 100px; font-size: 13px;
    color: var(--primary-hover); margin-bottom: 24px;
}
.hero h1 {
    font-size: clamp(32px, 6vw, 56px); font-weight: 800; line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: clamp(16px, 2.5vw, 20px); color: var(--text-muted);
    max-width: 600px; margin: 0 auto 32px; padding: 0 8px;
}
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ─── Code Block ──────────────────────────────────────────────────────── */
.code-block {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    text-align: left; max-width: 100%; margin: 40px auto 0;
    overflow: hidden;
}
.code-block .code-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.code-block .code-lang { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.code-block .code-copy {
    font-size: 12px; color: var(--text-muted); cursor: pointer;
    background: none; border: 1px solid var(--border); padding: 4px 10px;
    border-radius: 4px; -webkit-tap-highlight-color: transparent;
}
.code-block .code-copy:hover { color: var(--text); border-color: var(--text-muted); }
.code-block pre {
    margin: 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.code-block code {
    font-family: var(--mono); font-size: 13px; line-height: 1.7;
    color: var(--text-muted); word-break: break-all; overflow-wrap: break-word;
}
.code-block code .token-key { color: #7dd3fc; }
.code-block code .token-string { color: #86efac; }
.code-block code .token-number { color: #fbbf24; }
.code-block code .token-comment { color: #525264; }

/* ─── Features ────────────────────────────────────────────────────────── */
.features-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.feature-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px;
    transition: all 0.2s;
}
.feature-card:hover { border-color: var(--primary); background: var(--bg-card-hover); }
.feature-icon {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--primary-bg); display: flex; align-items: center;
    justify-content: center; font-size: 20px; margin-bottom: 14px;
}
.feature-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ─── How It Works ────────────────────────────────────────────────────── */
.steps { display: flex; gap: 24px; margin-top: 40px; }
.step {
    flex: 1; text-align: center; padding: 28px 20px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); position: relative;
}
.step-number {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px;
    margin: 0 auto 14px;
}
.step h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--text-muted); }

/* ─── Pricing ─────────────────────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.pricing-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px 24px; text-align: center;
}
.pricing-card.featured { border-color: var(--primary); position: relative; }
.pricing-card.featured::before {
    content: "Most Popular";
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: #fff; font-size: 11px;
    font-weight: 700; padding: 4px 12px; border-radius: 100px;
    text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
.pricing-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.pricing-card .price { font-size: 38px; font-weight: 800; margin: 14px 0 4px; }
.pricing-card .price span { font-size: 15px; font-weight: 400; color: var(--text-muted); }
.pricing-card .pages { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.pricing-card ul { list-style: none; text-align: left; margin-bottom: 20px; }
.pricing-card li {
    font-size: 14px; color: var(--text-muted); padding: 5px 0;
    display: flex; align-items: center; gap: 8px;
}
.pricing-card li::before { content: "\2713"; color: var(--green); font-weight: 700; }
.pricing-card .btn { width: 100%; justify-content: center; }

/* ─── Section Headers ─────────────────────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; margin-bottom: 12px; }
.section-header p { font-size: 16px; color: var(--text-muted); max-width: 500px; margin: 0 auto; }

/* ─── Footer ──────────────────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border); padding: 40px 0;
    text-align: center; color: var(--text-muted); font-size: 14px;
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }

/* ─── Scrollable tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ─── Responsive: Tablet (max 1024px) ────────────────────────────────── */
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .section { padding: 60px 0; }
    .code-block { max-width: 100%; }
}

/* ─── Responsive: Mobile (max 900px) — hamburger + layout ────────────── */
@media (max-width: 900px) {
    .container { padding: 0 16px; }

    /* Show hamburger, hide nav links */
    .nav-toggle { display: block; }
    .nav-links {
        display: none !important;
        flex-direction: column;
        position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background-color: #0a0a0b !important;
        padding: 80px 32px 32px;
        gap: 0; z-index: 200;
        opacity: 1 !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    .nav-links.open { display: flex !important; }
    .nav-links a {
        font-size: 20px; padding: 18px 0;
        border-bottom: 1px solid #25252b;
        white-space: normal;
        color: #ffffff !important;
        font-weight: 600;
    }
    .nav-links a:hover {
        color: #818cf8 !important;
    }
    .nav-links .btn {
        margin-top: 20px; width: 100%; padding: 16px;
        font-size: 17px; border-bottom: none;
        color: #ffffff !important;
        background: #6366f1 !important;
        border-radius: 10px;
    }

    /* Hero */
    .hero { padding: 110px 0 60px; }
    .hero-badge { font-size: 12px; padding: 5px 12px; }
    .hero-buttons { flex-direction: column; align-items: stretch; padding: 0 16px; }
    .hero-buttons .btn { width: 100%; }
    .code-block { padding: 14px; margin-top: 24px; }
    .code-block code { font-size: 11px; }

    /* Grids */
    .features-grid { grid-template-columns: 1fr; gap: 12px; }
    .feature-card { padding: 22px 18px; }
    .steps { flex-direction: column; gap: 12px; }
    .step { padding: 22px 16px; }
    .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; gap: 14px; }

    .section { padding: 48px 0; }
    .section-header { margin-bottom: 24px; }

    /* Prevent ANY horizontal overflow */
    pre { max-width: calc(100vw - 72px); }
    table { display: block; overflow-x: auto; max-width: 100%; }
    img, video, svg:not(.nav-logo svg) { max-width: 100%; height: auto; }
}

/* ─── Responsive: Small phones (max 380px) ───────────────────────────── */
@media (max-width: 380px) {
    .container { padding: 0 12px; }
    .hero { padding: 100px 0 40px; }
    .btn-lg { padding: 12px 20px; font-size: 15px; }
    .pricing-card .price { font-size: 32px; }
    .pricing-card { padding: 22px 16px; }
    .code-block code { font-size: 10px; }
    pre { max-width: calc(100vw - 56px); }
}
