/* Pitchbar documentation — Mintlify-inspired theme.
   Self-contained: no Tailwind, no preprocessing. Light/dark via
   data-theme attribute on <html>. Tokens chosen to match the app shell. */

:root {
    --doc-bg: #ffffff;
    --doc-bg-soft: #fafafa;
    --doc-bg-code: #f6f6f7;
    --doc-fg: #18181b;
    --doc-fg-soft: #52525b;
    --doc-fg-faded: #71717a;
    --doc-border: #e4e4e7;
    --doc-border-soft: #ececef;
    --doc-accent: #2563eb;
    --doc-accent-soft: #eff6ff;
    --doc-accent-fg: #1d4ed8;
    --doc-success: #059669;
    --doc-success-soft: #ecfdf5;
    --doc-warning: #b45309;
    --doc-warning-soft: #fef3c7;
    --doc-danger: #b91c1c;
    --doc-danger-soft: #fee2e2;
    --doc-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    --doc-radius: 0.5rem;
    --doc-radius-lg: 0.75rem;
    --doc-font-sans:
        'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --doc-font-mono:
        'Geist Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

html[data-theme='dark'] {
    --doc-bg: #0a0a0b;
    --doc-bg-soft: #111113;
    --doc-bg-code: #15151a;
    --doc-fg: #f4f4f5;
    --doc-fg-soft: #a1a1aa;
    --doc-fg-faded: #71717a;
    --doc-border: #27272a;
    --doc-border-soft: #1f1f23;
    --doc-accent: #60a5fa;
    --doc-accent-soft: #1e3a8a33;
    --doc-accent-fg: #93c5fd;
    --doc-success: #34d399;
    --doc-success-soft: #064e3b66;
    --doc-warning: #fbbf24;
    --doc-warning-soft: #78350f66;
    --doc-danger: #f87171;
    --doc-danger-soft: #7f1d1d66;
    --doc-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
    html[data-theme='auto'] {
        --doc-bg: #0a0a0b;
        --doc-bg-soft: #111113;
        --doc-bg-code: #15151a;
        --doc-fg: #f4f4f5;
        --doc-fg-soft: #a1a1aa;
        --doc-fg-faded: #71717a;
        --doc-border: #27272a;
        --doc-border-soft: #1f1f23;
        --doc-accent: #60a5fa;
        --doc-accent-soft: #1e3a8a33;
        --doc-accent-fg: #93c5fd;
        --doc-success: #34d399;
        --doc-success-soft: #064e3b66;
        --doc-warning: #fbbf24;
        --doc-warning-soft: #78350f66;
        --doc-danger: #f87171;
        --doc-danger-soft: #7f1d1d66;
        --doc-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--doc-bg);
    color: var(--doc-fg);
    font-family: var(--doc-font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
}

a {
    color: var(--doc-accent);
    text-decoration: none;
}

a:hover { text-decoration: underline; }

/* ================== Topbar ================== */

.docs-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in oklab, var(--doc-bg) 92%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--doc-border);
}

.docs-topbar-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    height: 60px;
}

.docs-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--doc-fg);
    font-weight: 600;
    letter-spacing: -0.01em;
    flex: 0 0 auto;
}

.docs-brand:hover { text-decoration: none; }

.docs-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--doc-fg), color-mix(in oklab, var(--doc-fg) 70%, var(--doc-accent)));
    color: var(--doc-bg);
    font-size: 13px;
    font-weight: 700;
}

.docs-brand-text {
    font-size: 15px;
}

.docs-brand-sub {
    color: var(--doc-fg-soft);
    font-weight: 500;
    margin-left: 0.25rem;
}

.docs-search {
    position: relative;
    flex: 1 1 480px;
    max-width: 480px;
    display: flex;
    align-items: center;
}

.docs-search input {
    width: 100%;
    height: 36px;
    padding: 0 2.4rem 0 0.9rem;
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    background: var(--doc-bg-soft);
    color: var(--doc-fg);
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.docs-search input::placeholder { color: var(--doc-fg-faded); }

.docs-search input:focus {
    border-color: var(--doc-accent);
    background: var(--doc-bg);
    box-shadow: 0 0 0 3px var(--doc-accent-soft);
}

.docs-search kbd {
    position: absolute;
    right: 0.5rem;
    height: 20px;
    min-width: 20px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--doc-border);
    border-radius: 4px;
    background: var(--doc-bg);
    color: var(--doc-fg-soft);
    font-family: var(--doc-font-mono);
    font-size: 11px;
}

.docs-topbar-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.docs-topbar-link {
    color: var(--doc-fg-soft);
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 6px;
}

.docs-topbar-link:hover {
    color: var(--doc-fg);
    background: var(--doc-bg-soft);
    text-decoration: none;
}

.docs-theme-toggle, .docs-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid var(--doc-border);
    border-radius: 7px;
    color: var(--doc-fg-soft);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.docs-theme-toggle:hover, .docs-mobile-toggle:hover {
    background: var(--doc-bg-soft);
    color: var(--doc-fg);
}

.docs-theme-icon { width: 16px; height: 16px; display: none; }

html[data-theme='light'] .docs-theme-icon-dark,
html[data-theme='auto'] .docs-theme-icon-dark { display: block; }
html[data-theme='dark'] .docs-theme-icon-light { display: block; }

@media (prefers-color-scheme: dark) {
    html[data-theme='auto'] .docs-theme-icon-dark { display: none; }
    html[data-theme='auto'] .docs-theme-icon-light { display: block; }
}

.docs-mobile-toggle { display: none; }

/* ================== Shell ================== */

.docs-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

/* ================== Sidebar ================== */

.docs-sidebar {
    position: sticky;
    top: 60px;
    align-self: start;
    height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 1.5rem 0.75rem 3rem 1.25rem;
    border-right: 1px solid var(--doc-border-soft);
}

.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--doc-border); border-radius: 3px; }

.docs-nav-group { margin-bottom: 1.4rem; }

.docs-nav-group-title {
    margin: 0 0 0.4rem 0.5rem;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--doc-fg-faded);
}

.docs-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.docs-nav-link {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--doc-fg-soft);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    transition: background 0.1s, color 0.1s;
}

.docs-nav-link:hover {
    color: var(--doc-fg);
    background: var(--doc-bg-soft);
    text-decoration: none;
}

.docs-nav-link.is-active {
    background: var(--doc-accent-soft);
    color: var(--doc-accent-fg);
    font-weight: 600;
}

.docs-nav-list li.is-search-hidden { display: none; }

/* ================== Main ================== */

.docs-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 3rem;
    padding: 2.5rem 2.5rem 5rem;
    align-items: start;
}

.docs-article {
    min-width: 0;
    max-width: 760px;
}

.docs-eyebrow {
    margin: 0 0 0.5rem;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--doc-accent-fg);
}

.docs-page-title {
    margin: 0 0 0.75rem;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.docs-content {
    color: var(--doc-fg);
    font-size: 15.5px;
    line-height: 1.72;
}

.docs-content > p:first-of-type {
    color: var(--doc-fg-soft);
    font-size: 17px;
    line-height: 1.65;
    margin-top: 0.25rem;
    margin-bottom: 1.75rem;
}

.docs-content h2 {
    margin-top: 2.4rem;
    margin-bottom: 0.6rem;
    padding-top: 0.4rem;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.3;
    scroll-margin-top: 80px;
}

.docs-content h3 {
    margin-top: 1.8rem;
    margin-bottom: 0.5rem;
    font-size: 16.5px;
    font-weight: 600;
    line-height: 1.35;
    scroll-margin-top: 80px;
}

.docs-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.3rem;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--doc-fg);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.docs-content p {
    margin: 0 0 1rem;
}

.docs-content ul, .docs-content ol {
    margin: 0 0 1rem;
    padding-left: 1.4rem;
}

.docs-content li {
    margin-bottom: 0.35rem;
}

.docs-content li::marker {
    color: var(--doc-fg-faded);
}

.docs-content strong { font-weight: 600; color: var(--doc-fg); }

.docs-content code {
    font-family: var(--doc-font-mono);
    font-size: 0.88em;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--doc-bg-code);
    border: 1px solid var(--doc-border-soft);
    color: var(--doc-fg);
}

.docs-content pre {
    position: relative;
    margin: 1.25rem 0 1.5rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    background: var(--doc-bg-code);
    overflow-x: auto;
    font-family: var(--doc-font-mono);
    font-size: 13px;
    line-height: 1.6;
}

.docs-content pre code {
    padding: 0;
    background: transparent;
    border: none;
    color: var(--doc-fg);
    font-size: inherit;
}

.docs-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid var(--doc-border);
    border-radius: 5px;
    background: var(--doc-bg);
    color: var(--doc-fg-soft);
    font-family: inherit;
    font-size: 11.5px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.12s;
}

.docs-content pre:hover .docs-copy { opacity: 1; }

.docs-copy:hover { color: var(--doc-fg); }

.docs-copy.is-copied { color: var(--doc-success); }

.docs-content blockquote {
    margin: 1rem 0;
    padding: 0.6rem 1rem;
    border-left: 3px solid var(--doc-border);
    color: var(--doc-fg-soft);
}

.docs-content table {
    width: 100%;
    margin: 1.25rem 0;
    border-collapse: collapse;
    font-size: 14px;
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    overflow: hidden;
}

.docs-content thead {
    background: var(--doc-bg-soft);
}

.docs-content th, .docs-content td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--doc-border-soft);
}

.docs-content th { font-weight: 600; }

.docs-content tr:last-child td { border-bottom: none; }

.docs-content hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid var(--doc-border-soft);
}

/* Callouts */

.callout {
    display: flex;
    gap: 0.75rem;
    margin: 1.25rem 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    background: var(--doc-bg-soft);
    font-size: 14.5px;
}

.callout-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.callout-body { min-width: 0; }

.callout-body > :first-child { margin-top: 0; }

.callout-body > :last-child { margin-bottom: 0; }

.callout-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.callout-info {
    border-color: color-mix(in oklab, var(--doc-accent) 28%, var(--doc-border));
    background: var(--doc-accent-soft);
}

.callout-info .callout-icon, .callout-info .callout-title { color: var(--doc-accent-fg); }

.callout-warning {
    border-color: color-mix(in oklab, var(--doc-warning) 30%, var(--doc-border));
    background: var(--doc-warning-soft);
}

.callout-warning .callout-icon, .callout-warning .callout-title { color: var(--doc-warning); }

.callout-danger {
    border-color: color-mix(in oklab, var(--doc-danger) 30%, var(--doc-border));
    background: var(--doc-danger-soft);
}

.callout-danger .callout-icon, .callout-danger .callout-title { color: var(--doc-danger); }

.callout-success {
    border-color: color-mix(in oklab, var(--doc-success) 28%, var(--doc-border));
    background: var(--doc-success-soft);
}

.callout-success .callout-icon, .callout-success .callout-title { color: var(--doc-success); }

/* Cards */

.docs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
    margin: 1.25rem 0;
}

.docs-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    background: var(--doc-bg);
    color: var(--doc-fg);
    transition: border-color 0.12s, transform 0.12s;
}

.docs-card:hover {
    border-color: color-mix(in oklab, var(--doc-accent) 40%, var(--doc-border));
    text-decoration: none;
    transform: translateY(-1px);
}

.docs-card-title {
    font-weight: 600;
    font-size: 14.5px;
    color: var(--doc-fg);
}

.docs-card-body {
    color: var(--doc-fg-soft);
    font-size: 13.5px;
    line-height: 1.55;
}

.docs-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border: 1px solid var(--doc-border);
    border-radius: 999px;
    background: var(--doc-bg-soft);
    color: var(--doc-fg-soft);
    font-size: 11.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.docs-pill-get { color: var(--doc-success); border-color: color-mix(in oklab, var(--doc-success) 35%, var(--doc-border)); background: var(--doc-success-soft); }
.docs-pill-post { color: var(--doc-accent-fg); border-color: color-mix(in oklab, var(--doc-accent) 35%, var(--doc-border)); background: var(--doc-accent-soft); }
.docs-pill-patch { color: var(--doc-warning); border-color: color-mix(in oklab, var(--doc-warning) 35%, var(--doc-border)); background: var(--doc-warning-soft); }
.docs-pill-delete { color: var(--doc-danger); border-color: color-mix(in oklab, var(--doc-danger) 35%, var(--doc-border)); background: var(--doc-danger-soft); }

/* Page nav */

.docs-page-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--doc-border-soft);
}

.docs-page-prev, .docs-page-next {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0.7rem 1rem;
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    color: var(--doc-fg);
    flex: 1 1 0;
    max-width: 280px;
}

.docs-page-next { text-align: right; }

.docs-page-prev:hover, .docs-page-next:hover {
    border-color: color-mix(in oklab, var(--doc-accent) 40%, var(--doc-border));
    text-decoration: none;
}

.docs-page-nav-label {
    font-size: 11.5px;
    color: var(--doc-fg-faded);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.docs-page-nav-title {
    font-size: 14px;
    font-weight: 600;
}

/* On-page TOC */

.docs-toc {
    position: sticky;
    top: 84px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-left: 0;
}

.docs-toc-title {
    margin: 0 0 0.5rem;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--doc-fg-faded);
}

.docs-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--doc-border-soft);
}

.docs-toc-list li { margin: 0; padding: 0; }

.docs-toc-list a {
    display: block;
    padding: 4px 0 4px 12px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--doc-fg-soft);
    font-size: 13px;
    line-height: 1.45;
}

.docs-toc-list a:hover { color: var(--doc-fg); text-decoration: none; }

.docs-toc-list a.is-active {
    color: var(--doc-accent-fg);
    border-left-color: var(--doc-accent);
    font-weight: 500;
}

.docs-toc-list a.is-h3 { padding-left: 22px; }

/* Responsive */

@media (max-width: 1100px) {
    .docs-main {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
        padding: 2rem 1.5rem 4rem;
    }
    .docs-toc { display: none; }
}

@media (max-width: 820px) {
    .docs-search { display: none; }
    .docs-mobile-toggle { display: inline-flex; }
    .docs-shell { grid-template-columns: minmax(0, 1fr); }
    .docs-sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        height: calc(100vh - 60px);
        width: 80%;
        max-width: 320px;
        background: var(--doc-bg);
        border-right: 1px solid var(--doc-border);
        transform: translateX(-100%);
        transition: transform 0.18s ease;
        z-index: 40;
    }
    .docs-sidebar.is-open { transform: translateX(0); }
    .docs-page-title { font-size: 28px; }
    .docs-topbar-link { display: none; }
}
