:root {
    --brand:       #6366f1;
    --brand-dark:  #4f46e5;
    --brand-light: #a5b4fc;
    --accent:      #06b6d4;
    --accent-light:#67e8f9;
    --ink:         #0f172a;
    --muted:       #64748b;
    --bg:          #f8fafc;
    --card:        #ffffff;
    --border:      #e2e8f0;
    --code-bg:     #0f172a;
    --code-text:   #e2e8f0;
    --get:         #10b981;
}

* { -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}

code, pre, .mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

/* HERO */
.hero {
    position: relative;
    background:
        radial-gradient(circle at 20% 20%, rgba(99,102,241,0.35), transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(6,182,212,0.30), transparent 55%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: #fff;
    padding: 0 0 5rem;
    overflow: hidden;
}
.hero--sm { padding: 0 0 3.5rem; }
.hero-content { padding-top: 3rem; }
.hero::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
    font-weight: 800;
    font-size: clamp(2.25rem, 4vw, 3.75rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 1rem;
}
.hero h1 .gradient-text {
    background: linear-gradient(90deg, #a5b4fc, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p.lead { color: #cbd5e1; max-width: 640px; }

.pill {
    display: inline-flex; align-items: center; gap: .5rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    padding: .35rem .85rem;
    border-radius: 999px;
    color: #e2e8f0;
    font-size: .85rem;
    font-weight: 500;
}
.pill .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.2);
}

/* STATS */
.stat-row { position: relative; z-index: 1; margin-top: 3rem; }
.stat {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    backdrop-filter: blur(10px);
}
.stat .num {
    font-size: 2rem; font-weight: 800;
    background: linear-gradient(90deg, #a5b4fc, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat .lbl { color: #94a3b8; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }

/* SECTION */
section.api-section { padding: 4rem 0; }
.section-eyebrow {
    color: var(--brand);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .8rem;
    margin-bottom: .75rem;
}
.section-title { font-weight: 800; font-size: 2rem; letter-spacing: -0.02em; }

/* CARDS */
.card-glass {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.card-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -20px rgba(15,23,42,.18);
    border-color: var(--brand-light);
}

/* ENDPOINT TABLE */
.endpoint-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.endpoint-table th {
    text-align: left;
    padding: 1rem 1.25rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
}
.endpoint-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.endpoint-table tr:last-child td { border-bottom: none; }
.endpoint-table tr:hover td { background: #f8fafc; }
.endpoint-table code {
    background: #eef2ff;
    color: var(--brand-dark);
    padding: .2rem .55rem;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 500;
}

.method-get {
    display: inline-block;
    background: var(--get);
    color: #fff; font-weight: 700;
    padding: .15rem .55rem;
    border-radius: 6px;
    font-size: .7rem;
    letter-spacing: .04em;
    font-family: 'JetBrains Mono', monospace;
}

/* CODE BLOCK */
.code-block {
    background: var(--code-bg);
    color: var(--code-text);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: .9rem;
    position: relative;
    overflow-x: auto;
    line-height: 1.7;
}
.code-block .terminal-header { display: flex; gap: .35rem; margin-bottom: .85rem; }
.code-block .terminal-header span { width: 12px; height: 12px; border-radius: 50%; }
.code-block .dot-r { background: #ef4444; }
.code-block .dot-y { background: #f59e0b; }
.code-block .dot-g { background: #22c55e; }
.code-block .prompt { color: #67e8f9; user-select: none; }
.code-block .cmd    { color: #f1f5f9; }
.code-block .url    { color: #a5b4fc; }
.code-block .json-key    { color: #93c5fd; }
.code-block .json-string { color: #86efac; }
.copy-btn {
    position: absolute; top: .75rem; right: .75rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    color: #cbd5e1;
    border-radius: 6px;
    padding: .25rem .55rem;
    font-size: .75rem;
    cursor: pointer;
    transition: all .15s;
}
.copy-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.copy-btn.copied { background: var(--get); color: #fff; border-color: var(--get); }

/* QUICK LINKS */
.quick-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .9rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--ink);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: .85rem;
    transition: all .15s;
}
.quick-link:hover {
    border-color: var(--brand);
    color: var(--brand-dark);
    transform: translateX(2px);
}
.quick-link i { color: var(--brand); }

/* CTA BANNER */
.cta-banner {
    background:
        radial-gradient(circle at 80% 20%, rgba(6,182,212,0.25), transparent 55%),
        linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 60%, var(--accent) 130%);
    border-radius: 24px;
    padding: 3rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.cta-banner::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse at top right, black 0%, transparent 60%);
}
.cta-banner > * { position: relative; z-index: 1; }
.cta-banner h2 { font-weight: 800; letter-spacing: -0.02em; margin-bottom: .75rem; }
.cta-banner p  { color: rgba(255,255,255,.85); margin-bottom: 1.5rem; }

/* TOP NAV — in-flow on the hero, never overlapping */
.top-nav {
    position: relative;
    z-index: 5;
    padding: 1.5rem 0 0;
}
.top-nav .container {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
    position: relative;
}
.top-nav .brand {
    color: #fff; font-weight: 800; font-size: 1.25rem;
    letter-spacing: -0.02em; text-decoration: none;
    min-height: 44px; display: inline-flex; align-items: center;
}
.top-nav .brand .dot { color: var(--accent-light); }

.top-nav-right {
    display: flex; align-items: center; gap: 1.5rem;
}
.top-nav-links { display: flex; gap: 1.5rem; align-items: center; }
.top-nav-links a {
    color: #cbd5e1; text-decoration: none;
    font-size: .92rem; font-weight: 500;
    transition: color .15s;
    padding: .5rem 0;
    min-height: 44px;
    display: inline-flex; align-items: center;
}
.top-nav-links a:hover, .top-nav-links a.is-active { color: #fff; }
.top-nav-links a.is-active {
    text-decoration: underline;
    text-decoration-color: var(--accent-light);
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
}

/* LANG SWITCHER — sits at the end of top-nav-right */
.lang-switcher {
    display: flex; gap: .35rem;
}
.lang-switcher a {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .75rem;
    min-height: 36px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    color: #cbd5e1;
    font-size: .78rem; font-weight: 600;
    text-decoration: none;
    backdrop-filter: blur(6px);
    transition: all .15s;
    letter-spacing: .04em;
}
.lang-switcher a:hover { background: rgba(255,255,255,0.16); color: #fff; }
.lang-switcher a.active { background: #fff; color: var(--ink); border-color: #fff; }
.lang-switcher img {
    width: 18px; height: 13px; object-fit: cover; border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

/* FOOTER */
footer.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}
footer.site-footer a { color: #cbd5e1; text-decoration: none; }
footer.site-footer a:hover { color: #fff; }
footer.site-footer h5 {
    color: #fff;
    font-size: .85rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .1em;
    margin-bottom: 1rem;
}
footer.site-footer ul { list-style: none; padding: 0; margin: 0; }
footer.site-footer ul li { margin-bottom: .5rem; }
footer.site-footer .copyline {
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 1.5rem;
    margin-top: 2rem;
    font-size: .85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}

.skip-link {
    position: absolute; left: -9999px; top: 0;
    background: #0f172a; color: #fff;
    padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* HAMBURGER TOGGLE — hidden on desktop */
.top-nav-toggle {
    display: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    color: #fff;
    padding: .55rem .85rem;
    min-height: 44px;
    min-width: 44px;
    border-radius: 8px;
    align-items: center; justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    backdrop-filter: blur(6px);
}
.top-nav-toggle:hover { background: rgba(255,255,255,0.16); }

/* MOBILE */
@media (max-width: 768px) {
    .hero       { padding: 0 0 3rem; }
    .hero--sm   { padding: 0 0 2rem; }
    .hero-content { padding-top: 2rem; }

    section.api-section { padding: 2.5rem 0; }
    .stat            { padding: 1rem 1.1rem; }
    .stat .num       { font-size: 1.5rem; }
    .stat .lbl       { font-size: .75rem; }
    .cta-banner      { padding: 2rem; border-radius: 16px; }

    .top-nav { padding-top: 1rem; }
    .top-nav .container { gap: .75rem; }
    .top-nav-toggle { display: inline-flex !important; }

    /* Nav links collapse into a dropdown beneath the bar */
    .top-nav-right { gap: .5rem; }
    .top-nav-links {
        display: none;
        position: absolute;
        top: calc(100% + .5rem);
        left: 1rem; right: 1rem;
        flex-direction: column;
        align-items: stretch;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 12px;
        padding: .5rem;
        z-index: 10;
        gap: 0;
    }
    .top-nav-links.is-open { display: flex; }
    .top-nav-links a {
        width: 100%;
        padding: .75rem 1rem;
        min-height: 48px;
        border-radius: 8px;
    }
    .top-nav-links a:hover, .top-nav-links a.is-active {
        background: rgba(255,255,255,0.06);
        text-decoration: none;
    }

    .lang-switcher a { padding: .4rem .6rem; }
    .lang-switcher a span.lang-name { display: none; }

    /* Footer touch-targets */
    footer.site-footer ul li a {
        display: inline-block;
        padding: .25rem 0;
        min-height: 32px;
    }
}

@media (max-width: 380px) {
    .hero h1 { font-size: 1.85rem; }
    .stat .num { font-size: 1.35rem; }
    .stat       { padding: .85rem 1rem; }
}
