:root {
    --bg-canvas: #090d16;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(56, 189, 248, 0.3);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --primary: #0284c7;
    --primary-light: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.15);
    --accent-purple: #818cf8;
    --badge-bg: rgba(2, 132, 199, 0.15);
    --badge-border: rgba(56, 189, 248, 0.35);
    --badge-text: #7dd3fc;
    --success: #10b981;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    overflow-x: clip;
    position: relative;
    width: 100%;
    max-width: 100vw;
}

section[id] {
    scroll-margin-top: 68px;
}

/* Subtle radial ambient glows in background */
.ambient-glow-top {
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: min(800px, 90vw);
    max-width: 100%;
    height: 450px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(99, 102, 241, 0.08) 50%, transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-glow-bottom {
    position: absolute;
    bottom: 0;
    right: 0;
    width: min(600px, 80vw);
    max-width: 100%;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Container */
.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

/* Shared Sticky Header with Scroll-Shrink Effect (Matches Beta Landing Page) */
header.apex-header,
header {
    padding: 18px 0;
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(3, 7, 18, 0.85);
    width: 100%;
    transition: padding 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

header.apex-header.header-scrolled,
header.header-scrolled {
    background-color: rgba(3, 7, 18, 0.94) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(56, 189, 248, 0.2);
    border-bottom-color: rgba(56, 189, 248, 0.2) !important;
    padding: 7px 0 !important;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    transition: opacity 0.18s ease;
}

.brand-link:hover {
    opacity: 0.92;
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
    transition: width 0.25s ease, height 0.25s ease;
}

header.header-scrolled .brand-logo {
    width: 26px;
    height: 26px;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: font-size 0.25s ease;
}

header.header-scrolled .brand-name {
    font-size: 1.1rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 500;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: #38bdf8;
    background-color: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
    font-weight: 600;
}

header.header-scrolled .nav-link {
    font-size: 0.8rem;
    padding: 0.2rem 0.55rem;
}

.btn-sm-beta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary-light);
    border: 1px solid var(--border-highlight);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-left: 6px;
    white-space: nowrap;
}

.btn-sm-beta:hover {
    background: rgba(56, 189, 248, 0.2);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
    transform: translateY(-1px);
}

header.header-scrolled .btn-sm-beta {
    padding: 5px 12px;
    font-size: 0.78rem;
}

/* Shared Headings & Typography */
h1 {
    font-size: clamp(1.85rem, 4vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.18;
    margin-bottom: 20px;
    background: linear-gradient(180deg, #ffffff 30%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    overflow-wrap: break-word;
    word-break: normal;
    max-width: 100%;
}

.section-label {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-light);
    margin-bottom: 12px;
}

.section-heading {
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.section-sub {
    text-align: center;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 40px;
    font-size: 0.975rem;
}

/* Shared CTA Buttons */
.btn-primary-beta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 26px;
    border-radius: var(--radius-md);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4), 0 0 20px rgba(56, 189, 248, 0.2);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary-beta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6), 0 0 30px rgba(56, 189, 248, 0.35);
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 14px 22px;
    border-radius: var(--radius-md);
    text-decoration: none;
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Shared Article Layout (Guide Pages) */
.article-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 56px 0 80px;
}

.article-wrapper h1 {
    font-size: clamp(1.85rem, 4vw, 2.85rem);
    margin-bottom: 18px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--badge-bg);
    border: 1px solid var(--badge-border);
    color: var(--badge-text);
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
}

.lead {
    font-size: clamp(1rem, 1.8vw, 1.18rem);
    color: var(--text-muted);
    margin-bottom: 36px;
    line-height: 1.65;
}

.article-wrapper h2 {
    font-size: clamp(1.35rem, 2.5vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 36px 0 16px;
    color: #ffffff;
}

.article-wrapper h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.article-wrapper p {
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 0.96rem;
    line-height: 1.65;
}

.article-wrapper p:last-child {
    margin-bottom: 0;
}

.article-wrapper ul,
.article-wrapper ol {
    margin: 12px 0 4px 22px;
    color: var(--text-muted);
    font-size: 0.96rem;
}

.article-wrapper li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.article-wrapper li strong {
    color: #e2e8f0;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    margin-bottom: 20px;
    backdrop-filter: blur(12px);
    transition: border-color 0.25s ease;
}

.card:hover {
    border-color: var(--border-highlight);
}

.article-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0;
    font-size: 0.92rem;
}

.article-wrapper th,
.article-wrapper td {
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    text-align: left;
}

.article-wrapper th {
    background: rgba(30, 41, 59, 0.7);
    color: #ffffff;
    font-weight: 600;
}

.cta-banner {
    background: var(--bg-card);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 3.5vw, 36px);
    margin: 40px 0;
    text-align: center;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 30px rgba(56, 189, 248, 0.08);
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0284c7, #38bdf8, #818cf8);
}

/* Collapsible Attention Signals Grid */
.signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.signal-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    background: rgba(56, 189, 248, 0.1);
    color: #7dd3fc;
}

.signal-pill-amber {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
}

.signal-pill-emerald {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
}

.signal-pill-purple {
    border-color: rgba(129, 140, 248, 0.35);
    background: rgba(129, 140, 248, 0.12);
    color: #c7d2fe;
}

.signal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.signal-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.signal-item:hover {
    border-color: rgba(56, 189, 248, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

.signal-item[open] {
    border-color: var(--border-highlight);
    background: rgba(30, 41, 59, 0.55);
}

.signal-item summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
}

.signal-item summary::-webkit-details-marker {
    display: none;
}

.signal-chevron {
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.signal-item[open] .signal-chevron {
    transform: rotate(180deg);
    color: var(--primary-light);
}

.signal-desc {
    padding: 8px 12px 11px;
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.55;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Shared Developer Guides & Articles Section */
.guides-section {
    padding: 56px 0 64px;
    border-top: 1px solid var(--border-subtle);
}

.related-guides {
    margin-top: 48px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 32px;
}

.related-heading {
    color: var(--primary-light);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
}

.internal-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.related-guides .internal-links {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.link-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    display: block;
    text-decoration: none;
    backdrop-filter: blur(12px);
    transition: all 0.25s ease;
}

.link-tile:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-highlight);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.5);
}

.link-tile strong {
    display: block;
    color: #ffffff;
    font-size: 1.02rem;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.link-tile span {
    display: block;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* Shared FAQ Accordion Component (Matches Beta Landing Page) */
.faq-section {
    padding: 56px 0 72px;
    border-top: 1px solid var(--border-subtle);
}

.faq-accordion {
    max-width: 780px;
    margin: 0 auto 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-wrapper .faq-accordion {
    max-width: 100%;
}

.faq-item {
    background-color: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.faq-item:hover {
    border-color: rgba(56, 189, 248, 0.3);
}

.faq-item[open] {
    border-color: rgba(56, 189, 248, 0.4);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    user-select: none;
    transition: color 0.2s ease;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary:hover {
    color: var(--primary-light);
}

.faq-chevron {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out;
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
    color: var(--primary-light);
}

.faq-body {
    padding: 0 24px 20px 24px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

.faq-body p {
    margin: 0;
    color: var(--text-muted);
}

.faq-body ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
    color: var(--text-muted);
}

.faq-body li {
    margin-bottom: 6px;
}

.faq-body strong {
    color: #e2e8f0;
}

/* Shared Footer */
footer {
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
    background: rgba(9, 13, 22, 0.95);
    padding: 36px 0;
    color: var(--text-dim);
    font-size: 0.875rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text-main);
}

/* Floating Back to Top Button (Matches Beta Landing Page) */
.btn-back-to-top-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1040;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(15, 23, 42, 0.9);
    color: #38bdf8;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(2, 6, 23, 0.55), 0 0 14px rgba(56, 189, 248, 0.22);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-back-to-top-float.is-visible {
    display: inline-flex;
}

.btn-back-to-top-float:hover,
.btn-back-to-top-float:focus {
    transform: translateY(-3px);
    background: rgba(14, 116, 144, 0.95);
    border-color: rgba(125, 211, 252, 0.85);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.65), 0 0 18px rgba(56, 189, 248, 0.4);
    outline: none;
}

/* Mobile Responsive Tweaks */
@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    .article-wrapper {
        padding: 36px 0 56px;
    }

    .nav-link {
        display: none;
    }

    .card {
        padding: 18px 16px;
    }

    .guides-section,
    .faq-section {
        padding: 40px 0 48px;
    }

    .internal-links {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .link-tile {
        padding: 16px 18px;
    }

    .faq-item summary {
        padding: 12px 14px;
        font-size: 0.92rem;
        line-height: 1.4;
    }

    .faq-body {
        padding: 0 14px 16px 14px;
        font-size: 0.88rem;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }

    .footer-links {
        justify-content: center;
    }
}
