/* ==========================================================================
   Xenon Docs — Custom Theme

   Deep slate + electric indigo. Inspired by modern dev-tool aesthetics.
   Palette:
     bg-deep     #0c0e14     Deepest background
     bg          #12141c     Page background
     surface     #1a1d28     Cards, code blocks
     elevated    #232733     Table headers, hover states
     border      #2a2f3e     Subtle borders
     border-lit  #363c4e     Emphasized borders
     text        #e2e8f0     Primary text
     text-muted  #8892a4     Secondary text
     text-faint  #5a6376     Tertiary / disabled
     accent      #6c63ff     Electric indigo — primary accent
     accent-lit  #8b83ff     Lighter accent for hover
     accent-dim  rgba(108,99,255,0.12)  Accent tint
     cyan        #22d3ee     Secondary accent
     green       #34d399     Success states
     amber       #fbbf24     Warning states
     rose        #f472b6     Errors / important
   ========================================================================== */

/* ── Custom color scheme ────────────────────────────────────────────────── */

[data-md-color-scheme="xenon"] {
    --md-default-bg-color: #12141c;
    --md-default-fg-color: #e2e8f0;
    --md-default-fg-color--light: #8892a4;
    --md-default-fg-color--lighter: #5a6376;
    --md-default-fg-color--lightest: rgba(226, 232, 240, 0.07);

    --md-primary-fg-color: #6c63ff;
    --md-primary-fg-color--light: #8b83ff;
    --md-primary-fg-color--dark: #5549e0;
    --md-primary-bg-color: #e2e8f0;
    --md-primary-bg-color--light: #8892a4;

    --md-accent-fg-color: #6c63ff;
    --md-accent-fg-color--transparent: rgba(108, 99, 255, 0.12);
    --md-accent-bg-color: rgba(108, 99, 255, 0.12);

    --md-code-bg-color: #1a1d28;
    --md-code-fg-color: #e2e8f0;
    --md-code-hl-color: rgba(108, 99, 255, 0.1);

    --md-code-hl-keyword-color: #c084fc;
    --md-code-hl-function-color: #6c63ff;
    --md-code-hl-string-color: #34d399;
    --md-code-hl-number-color: #f472b6;
    --md-code-hl-comment-color: #5a6376;
    --md-code-hl-operator-color: #22d3ee;
    --md-code-hl-punctuation-color: #8892a4;
    --md-code-hl-constant-color: #fbbf24;
    --md-code-hl-name-color: #e2e8f0;
    --md-code-hl-generic-color: #e2e8f0;
    --md-code-hl-variable-color: #e2e8f0;
    --md-code-hl-special-color: #22d3ee;

    --md-typeset-color: #e2e8f0;
    --md-typeset-a-color: #6c63ff;

    --md-admonition-bg-color: #1a1d28;

    --md-footer-bg-color: #0c0e14;
    --md-footer-bg-color--dark: #080a0f;
    --md-footer-fg-color: #8892a4;
    --md-footer-fg-color--light: #5a6376;
    --md-footer-fg-color--lighter: rgba(226, 232, 240, 0.12);

    --md-shadow-z1: 0 2px 6px rgba(0, 0, 0, 0.25), 0 0 1px rgba(108, 99, 255, 0.05);
    --md-shadow-z2: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 1px rgba(108, 99, 255, 0.08);
    --md-shadow-z3: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 1px rgba(108, 99, 255, 0.1);
}


/* ── Header ─────────────────────────────────────────────────────────────── */

.md-header {
    background: rgba(12, 14, 20, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(108, 99, 255, 0.08);
    box-shadow: none;
}

.md-header[data-md-state="shadow"] {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.md-header__title {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.md-header__topic:first-child {
    font-weight: 700;
}

/* Gradient accent bar under header */
.md-header::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        #6c63ff 20%,
        #22d3ee 50%,
        #6c63ff 80%,
        transparent 100%);
    opacity: 0.5;
}


/* ── Nav tabs ───────────────────────────────────────────────────────────── */

.md-tabs {
    background: rgba(12, 14, 20, 0.6);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.md-tabs__link {
    color: #8892a4;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    opacity: 1;
    transition: color 0.15s ease;
}

.md-tabs__link--active,
.md-tabs__link:hover {
    color: #e2e8f0;
}

.md-tabs__link--active {
    font-weight: 600;
}


/* ── Sidebar ────────────────────────────────────────────────────────────── */

.md-sidebar {
    scrollbar-width: thin;
    scrollbar-color: #2a2f3e transparent;
}

.md-nav__link {
    color: #8892a4;
    font-size: 0.82rem;
    transition: color 0.1s ease;
}

.md-nav__link:hover {
    color: #e2e8f0;
}

.md-nav__link--active,
.md-nav__item--active > .md-nav__link {
    color: #6c63ff;
    font-weight: 600;
}

.md-nav__item--nested > .md-nav__link {
    color: #e2e8f0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    opacity: 0.6;
}


/* ── Headings ───────────────────────────────────────────────────────────── */

.md-typeset h1 {
    color: #e2e8f0;
    font-weight: 800;
    letter-spacing: -0.025em;
    font-size: 2em;
}

.md-typeset h2 {
    color: #e2e8f0;
    font-weight: 700;
    padding-bottom: 0.4em;
    border-bottom: 1px solid #2a2f3e;
    letter-spacing: -0.01em;
    margin-top: 2em;
}

.md-typeset h3 {
    color: #c9d1e0;
    font-weight: 600;
    letter-spacing: -0.005em;
}

/* h4 = function names in API pages — style like code */
.md-typeset h4 {
    color: #8b83ff;
    font-weight: 600;
    font-family: "JetBrains Mono", var(--md-code-font-family);
    font-size: 0.95em;
    letter-spacing: -0.02em;
    padding: 0.3em 0;
    border-bottom: 1px solid rgba(108, 99, 255, 0.1);
}


/* ── Links ──────────────────────────────────────────────────────────────── */

.md-typeset a:not(.md-button):not(.headerlink):not([class*="cta"]) {
    color: #6c63ff;
    text-decoration: none;
    transition: color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: inset 0 -1px 0 rgba(108, 99, 255, 0.25);
}

.md-typeset a:not(.md-button):not(.headerlink):not([class*="cta"]):hover {
    color: #8b83ff;
    box-shadow: inset 0 -1px 0 #8b83ff;
}


/* ── Inline code ────────────────────────────────────────────────────────── */

.md-typeset code {
    background: rgba(26, 29, 40, 0.8);
    color: #22d3ee;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 5px;
    padding: 0.15em 0.45em;
    font-size: 0.82em;
    font-weight: 500;
}


/* ── Code blocks ────────────────────────────────────────────────────────── */

.md-typeset pre {
    position: relative;
    border: 1px solid #2a2f3e;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

/* Colored top edge on code blocks */
.md-typeset pre::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #6c63ff, #22d3ee);
    opacity: 0.6;
    z-index: 1;
}

.md-typeset pre > code {
    border: none;
    background: transparent;
    color: #e2e8f0;
    font-size: 0.85em;
    padding: 1.2em;
}

/* Copy button */
.md-clipboard {
    color: #5a6376;
    transition: color 0.15s ease;
}

.md-clipboard:hover {
    color: #6c63ff;
}


/* ── Tables ─────────────────────────────────────────────────────────────── */

.md-typeset table:not([class]) {
    border: 1px solid #2a2f3e;
    border-radius: 10px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    font-size: 0.84em;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    width: 100%;
}

.md-typeset table:not([class]) thead {
    background: #232733;
}

.md-typeset table:not([class]) th {
    color: #c9d1e0;
    font-weight: 600;
    padding: 0.75em 1.1em;
    border-bottom: 1px solid #2a2f3e;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.06em;
}

.md-typeset table:not([class]) td {
    padding: 0.65em 1.1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #c9d1e0;
}

.md-typeset table:not([class]) tbody tr:last-child td {
    border-bottom: none;
}

.md-typeset table:not([class]) tbody tr {
    transition: background 0.1s ease;
}

.md-typeset table:not([class]) tbody tr:hover {
    background: rgba(108, 99, 255, 0.04);
}

.md-typeset table code {
    padding: 0.1em 0.4em;
    font-size: 0.88em;
}


/* ── Admonitions ────────────────────────────────────────────────────────── */

.md-typeset .admonition,
.md-typeset details {
    background: #1a1d28;
    border: 1px solid #2a2f3e;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    border-left: 3px solid;
    overflow: hidden;
}

.md-typeset .admonition-title,
.md-typeset details summary {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-weight: 600;
}

/* Note — indigo */
.md-typeset .admonition.note {
    border-left-color: #6c63ff;
    background: rgba(108, 99, 255, 0.06);
}
.md-typeset .admonition.note > .admonition-title {
    background: rgba(108, 99, 255, 0.08);
}
.md-typeset .admonition.note > p,
.md-typeset .admonition.note > :not(.admonition-title) {
    color: #c9d1e0;
}

/* Tip — cyan */
.md-typeset .admonition.tip {
    border-left-color: #22d3ee;
    background: rgba(34, 211, 238, 0.06);
}
.md-typeset .admonition.tip > .admonition-title {
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.08);
}
.md-typeset .admonition.tip > p,
.md-typeset .admonition.tip > :not(.admonition-title) {
    color: #c9d1e0;
}

/* Warning — amber */
.md-typeset .admonition.warning {
    border-left-color: #fbbf24;
    background: rgba(251, 191, 36, 0.06);
}
.md-typeset .admonition.warning > .admonition-title {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
}
.md-typeset .admonition.warning > p,
.md-typeset .admonition.warning > :not(.admonition-title) {
    color: #c9d1e0;
}


/* ── Horizontal rules ───────────────────────────────────────────────────── */

.md-typeset hr {
    border-color: #2a2f3e;
}


/* ── Permalink anchors ──────────────────────────────────────────────────── */

.md-typeset .headerlink {
    color: #363c4e;
    transition: color 0.15s ease;
}

.md-typeset .headerlink:hover {
    color: #6c63ff;
}


/* ── TOC (right sidebar) ───────────────────────────────────────────────── */

.md-nav--secondary .md-nav__link {
    color: #5a6376;
    font-size: 0.76rem;
}

.md-nav--secondary .md-nav__link--active {
    color: #6c63ff;
}

.md-nav--secondary .md-nav__link:hover {
    color: #8892a4;
}


/* ── Search ─────────────────────────────────────────────────────────────── */

.md-search__form {
    background: #1a1d28;
    border: 1px solid #2a2f3e;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.md-search__form:focus-within {
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.md-search__input {
    color: #e2e8f0;
}

.md-search__input::placeholder {
    color: #5a6376;
}


/* ── Scrollbar ──────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2a2f3e;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #363c4e;
}


/* ── Footer ─────────────────────────────────────────────────────────────── */

.md-footer {
    background: #0c0e14;
    border-top: 1px solid #2a2f3e;
}

.md-footer-nav__link {
    transition: color 0.15s ease;
}

.md-footer-nav__link:hover {
    color: #6c63ff;
}

.md-footer-meta {
    background: #080a0f;
}


/* ── Selection ──────────────────────────────────────────────────────────── */

::selection {
    background: rgba(108, 99, 255, 0.3);
    color: #fff;
}


/* ── Back-to-top ────────────────────────────────────────────────────────── */

.md-top {
    background: #232733;
    color: #8892a4;
    border: 1px solid #2a2f3e;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.md-top:hover {
    color: #6c63ff;
    border-color: rgba(108, 99, 255, 0.3);
}


/* ══════════════════════════════════════════════════════════════════════════
   Landing Page
   ══════════════════════════════════════════════════════════════════════════ */

/* Hero section */
.hero-section {
    position: relative;
    text-align: center;
    padding: 5em 2em 4em;
    margin: -0.6rem -0.6rem 3em;
    overflow: hidden;
}

/* Gradient background with noise texture */
.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% 40%,
            rgba(108, 99, 255, 0.12) 0%,
            transparent 70%),
        radial-gradient(ellipse 40% 40% at 70% 60%,
            rgba(34, 211, 238, 0.06) 0%,
            transparent 60%);
    z-index: 0;
}

/* Grid pattern overlay */
.hero-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(108, 99, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(108, 99, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
    z-index: 0;
}

.hero-section > * {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 3.4em;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 0.2em;
    background: linear-gradient(135deg, #e2e8f0 0%, #8b83ff 50%, #22d3ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    border: none;
    padding: 0;
}

.hero-section .tagline {
    font-size: 1.25em;
    color: #8892a4;
    margin-bottom: 2.5em;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.hero-section .cta-row {
    display: flex;
    gap: 1em;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-section .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.75em 2em;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
    cursor: pointer;
}

.hero-section .btn-primary {
    background: #6c63ff;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3) !important;
}

.hero-section .btn-primary:hover {
    background: #8b83ff;
    box-shadow: 0 6px 24px rgba(108, 99, 255, 0.4) !important;
    transform: translateY(-1px);
}

.hero-section .btn-outline {
    background: transparent;
    color: #e2e8f0 !important;
    border: 1px solid #363c4e;
}

.hero-section .btn-outline:hover {
    border-color: #6c63ff;
    color: #8b83ff !important;
    background: rgba(108, 99, 255, 0.06);
}


/* Feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5em;
    margin: 2.5em 0;
}

@media (max-width: 900px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 550px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
    .hero-section h1 {
        font-size: 2.2em;
    }
}

.feature-card {
    background: #1a1d28;
    border: 1px solid #2a2f3e;
    border-radius: 12px;
    padding: 1.6em 1.5em;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Subtle top gradient edge per card */
.feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #6c63ff, #22d3ee);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.feature-card:hover {
    border-color: rgba(108, 99, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(108, 99, 255, 0.1);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-size: 1em;
    color: #e2e8f0;
    font-weight: 600;
}

.feature-card p {
    margin-bottom: 0;
    font-size: 0.88em;
    color: #8892a4;
    line-height: 1.55;
}


/* Next steps / link list */
.next-steps {
    margin-top: 2.5em;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1em;
}

@media (max-width: 600px) {
    .next-steps {
        grid-template-columns: 1fr;
    }
}

.next-step-card {
    display: block;
    background: #1a1d28;
    border: 1px solid #2a2f3e;
    border-radius: 10px;
    padding: 1.2em 1.4em;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.next-step-card:hover {
    border-color: rgba(108, 99, 255, 0.3);
    transform: translateY(-1px);
}

.next-step-card strong {
    color: #e2e8f0;
    font-size: 0.95em;
}

.next-step-card span {
    display: block;
    color: #5a6376;
    font-size: 0.82em;
    margin-top: 0.25em;
}


/* ── Download / CTA buttons (standalone, outside hero) ─────────────────── */

.md-typeset .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.65em 1.8em;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
    cursor: pointer;
}

.md-typeset .btn-primary {
    background: #6c63ff;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3) !important;
}

.md-typeset .btn-primary:hover {
    background: #8b83ff;
    box-shadow: 0 6px 24px rgba(108, 99, 255, 0.4) !important;
    transform: translateY(-1px);
}


/* ── API signature blocks (for custom use) ──────────────────────────────── */

.api-signature {
    background: #1a1d28;
    border: 1px solid #2a2f3e;
    border-left: 3px solid #6c63ff;
    padding: 0.8em 1.2em;
    margin: 1em 0;
    font-family: "JetBrains Mono", var(--md-code-font-family);
    font-size: 0.84em;
    overflow-x: auto;
    border-radius: 0 10px 10px 0;
}


/* ── Misc polish ────────────────────────────────────────────────────────── */

/* Smoother transitions on content area */
.md-content {
    transition: opacity 0.1s ease;
}

/* Make sure lists have comfortable spacing */
.md-typeset li {
    margin-bottom: 0.3em;
}

/* Nav path breadcrumbs */
.md-path {
    color: #5a6376;
    font-size: 0.75rem;
}

.md-path a {
    color: #5a6376 !important;
    box-shadow: none !important;
}

.md-path a:hover {
    color: #6c63ff !important;
}
