/* custom styles */

@font-face {
    font-family: 'Audiowide';
    src: url('../fonts/Audiowide-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ── Theme tokens ── */
:root {
    color-scheme: light;
    --bg: #f2f2f0;
    --bg-elev: #ffffff;
    --bg-sunken: #e8e8e6;
    --border: #d8d8d5;
    --text: #0a0a09;
    --text-muted: #6b6b66;
    --text-subtle: #95958f;
    --brand: oklch(65% 0.16 55);
    --success: oklch(58% 0.12 155);
    --nav-h: 48px;
}
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0a0a09;
    --bg-elev: #141413;
    --bg-sunken: #0f0f0e;
    --border: #232321;
    --text: #f5f5f2;
    --text-muted: #9a9a94;
    --text-subtle: #66665f;
}

/* ── Base ── */
html { scroll-behavior: smooth; }
html, body { height: 100%; margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--rl-font-sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1 { margin-block: 0.22em; }
code { font-family: var(--rl-font-mono); font-size: 0.875em; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }

/* ── Logo dark/light — CSS-driven so it works regardless of load order ── */
[data-theme="dark"]  .logo-light { display: none; }
[data-theme="dark"]  .logo-dark  { display: block; }
[data-theme="light"] .logo-dark  { display: none; }
[data-theme="light"] .logo-light { display: block; }

.hero-title {
    font-family: 'Audiowide', sans-serif;
    font-weight: 400;
    font-size: 3.25rem;
    letter-spacing: 0;
    line-height: 1;
    color: var(--text);
}

/* ── Nav ── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--nav-h);
    background: color-mix(in oklch, var(--bg) 65%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { height: 100%; padding: 0 2rem; }
.nav-logo img { height: 24px; width: auto; display: block; }
.nav-links a { font-size: 0.9375rem; color: var(--text-muted); transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); font-weight: 500; }
.nav-link { font-size: 0.9375rem; color: var(--text-muted); text-decoration: none; transition: color .15s; }
.nav-link:hover { color: var(--text); }
.nav-section-label { font-size: 0.875rem; color: var(--text); letter-spacing: 0.08em; text-transform: uppercase; padding-left: 1rem; border-left: 1px solid var(--border); }
.nav-back { display: flex; align-items: center; color: var(--text-muted); transition: color .15s; }
.nav-back:hover { color: var(--text); }
.theme-btn {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: none; background: none; cursor: pointer;
    border-radius: 7px; color: var(--text-muted);
    transition: color .15s, background .15s;
}
.theme-btn:hover { color: var(--text); background: var(--bg-sunken); }

/* ── Docs nav ── SDK dropdown ── */
.nav-docs-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-sdk-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-sdk-wrap::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-subtle);
    pointer-events: none;
}
.nav-sdk-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg);
    border: none;
    cursor: pointer;
    font-family: var(--rl-font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0 24px 0 6px;
    outline: none;
    color-scheme: inherit;
}
.nav-sdk-select option {
    background: var(--bg);
    color: var(--text);
}
.nav-sdk-select:hover { color: var(--text); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; font-size: 0.9375rem; font-weight: 500;
    border-radius: 7px; border: none; cursor: pointer;
    font-family: var(--rl-font-sans);
    transition: opacity .15s, transform .08s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:hover { opacity: .88; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-secondary { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); }
.btn-lg { padding: 0.6875rem 1rem; font-size: 0.9375rem; border-radius: 8px; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.875rem; border-radius: 6px; }
.btn-amber { background: transparent; color: var(--color-community-badge); border: 1px solid var(--color-community-border); transition: background .15s, color .15s, transform .08s; }
.btn-amber:hover { background: var(--color-community-badge); color: oklch(0.98 0 0); opacity: 1; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); transition: background .15s, color .15s, transform .08s; }
.btn-ghost:hover { background: var(--text); color: var(--bg); opacity: 1; }

/* ── Page scroll offset for fixed nav ── */
main { padding-top: var(--nav-h); }

/* ── Sections ── */
.section { padding: 2rem; border-top: 1px solid var(--border); }
.section-sunken { background: var(--bg-sunken); }
.container { max-width: 1120px; margin: 0 auto; }

/* ── Section header ── */
.section-label { font-family: var(--rl-font-mono); font-size: 0.8125rem; color: var(--text-subtle); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 0.75rem; }
.section-title { font-size: clamp(1.8125rem, 4vw, 2.5625rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.section-body { font-size: 1.0625rem; color: var(--text-muted); line-height: 1.6; max-width: 40rem; }

/* ── Placeholder blocks ── */
.placeholder {
    background: var(--bg-sunken);
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-subtle);
    font-size: 0.875rem;
    font-family: var(--rl-font-mono);
    min-height: 8rem;
}

/* ── Footer ── */
footer { border-top: 1px solid var(--border); }
.footer-logo img { height: 1.5rem; width: auto; display: block; }
.footer-links a { font-size: 0.875rem; color: var(--text-subtle); }
.footer-links a:hover { color: var(--text-muted); }

/* ── Badge ── */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; font-size: 0.8125rem; font-weight: 500;
    border-radius: 999px; line-height: 1.5; letter-spacing: .01em;
    background: var(--bg-sunken); color: var(--text-muted);
    border: 1px solid var(--border);
}
.badge-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--success); flex-shrink: 0; }

/* ── Code window ── */
.code-window {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 24px 48px -12px rgba(0,0,0,.1), 0 8px 16px -4px rgba(0,0,0,.05);
    overflow: hidden;
}
[data-theme="dark"] .code-window {
    box-shadow: 0 24px 48px -12px rgba(0,0,0,.6), 0 8px 16px -4px rgba(0,0,0,.3);
}
.code-titlebar {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    background: var(--bg-sunken);
}
.code-dot { width: 10px; height: 10px; border-radius: 99px; flex-shrink: 0; }
.code-filename { font-family: var(--rl-font-mono); font-size: 0.8125rem; color: var(--text-subtle); margin-left: 10px; }
.code-body {
    font-family: var(--rl-font-mono); font-size: 0.875rem;
    line-height: 1.75; padding: 22px 24px;
    overflow-x: auto; white-space: pre; color: var(--text);
}

/* ── Syntax tokens ── */
.t-tag  { color: color-mix(in oklch, var(--brand) 85%, var(--text-muted)); }
.t-attr { color: var(--text-muted); }
.t-val  { color: oklch(60% 0.14 145); }
.t-cmt  { color: var(--text-subtle); }

/* ── Feature cells ── */
.feat-cell { background: var(--bg-elev); padding: 2rem 1.75rem; }
.feat-icon {
    width: 32px; height: 32px; border-radius: 7px;
    background: var(--bg-sunken); border: 1px solid var(--border);
    display: grid; place-items: center; margin-bottom: 1.125rem; color: var(--text);
}
.feat-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.375rem; letter-spacing: -.01em; }
.feat-body  { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.55; }

/* ── Format traits ── */
.format-point { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.format-point:last-child { border-bottom: none; }
.format-point-icon {
    width: 28px; height: 28px; border-radius: 6px;
    background: var(--bg-sunken); border: 1px solid var(--border);
    display: grid; place-items: center; flex-shrink: 0; color: var(--text); margin-top: 2px;
}
.format-point-title { font-weight: 600; font-size: 0.9375rem; margin-bottom: 4px; }
.format-point-body  { font-size: 0.90625rem; color: var(--text-muted); line-height: 1.5; }

/* ── Document-type cards ── */
.doc-card {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: 12px; padding: 1.5rem;
    display: flex; flex-direction: column; gap: 0.625rem;
}
.doc-card-icon {
    width: 36px; height: 36px; background: var(--bg-sunken);
    border: 1px solid var(--border); border-radius: 8px;
    display: grid; place-items: center; color: var(--text);
}
.doc-card-title { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.doc-card-body  { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.55; flex: 1; }

/* ── Capability chips ── */
.cap-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; font-size: 0.875rem; font-weight: 500;
    border-radius: 999px; background: var(--bg-sunken);
    border: 1px solid var(--border); color: var(--text-muted);
}
.cap-chip svg { color: var(--success); flex-shrink: 0; }

/* ── SDK / platform strip ── */
.sdk-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    flex-wrap: wrap;
}

.sdk-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.sdk-icon-fa {
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    color: var(--text-muted);
}
.sdk-tile-icon {
    width: 2.75rem;
    height: 2.75rem;
    color: var(--text-muted);
}
.icon-sm {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
}

.sdk-icon-svg {
    display: block;
}

.sdk-item-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .02em;
}

.sdk-item-links {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

.sdk-item-links a {
    color: var(--text-subtle);
    text-decoration: none;
    transition: color .15s;
}

.sdk-item-links a:hover {
    color: var(--brand);
}

.sdk-dot {
    color: var(--border);
    user-select: none;
}

.sdk-sep {
    width: 1px;
    height: 64px;
    background: var(--border);
    flex-shrink: 0;
    align-self: center;
}

/* ── Platform cards ── */
.plat-card {
    display: flex; flex-direction: column; align-items: center;
    gap: 0.5rem; width: 5.5rem; padding: 1.25rem 0.5rem;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg-elev); transition: border-color .15s;
}
.plat-card:hover { border-color: var(--text-subtle); }
.plat-name { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }

/* ── Comparison table ── */
.cmp-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; overflow-x: auto; }
.cmp-table { width: 100%; border-collapse: collapse; }
.cmp-table th {
    padding: 12px 16px; font-size: 0.6875rem; font-weight: 600;
    letter-spacing: .05em; text-transform: uppercase;
    color: var(--text-subtle); background: var(--bg-sunken);
    border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap;
}
.cmp-table th:first-child { text-align: left; }
.cmp-table th.cmp-h-lpdf {
    background: color-mix(in oklch, var(--brand) 8%, var(--bg-sunken));
    color: var(--brand);
    border-bottom: 2px solid color-mix(in oklch, var(--brand) 40%, transparent);
}
.cmp-table td {
    padding: 13px 16px; font-size: 0.84375rem;
    border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle;
}
.cmp-table td:first-child { text-align: left; font-weight: 500; color: var(--text); }
.cmp-table td.cmp-d-lpdf { background: color-mix(in oklch, var(--brand) 4%, var(--bg-elev)); }
.cmp-table tr:last-child td { border-bottom: none; }
.cmp-table tr:hover td { background: var(--bg-sunken); }
.cmp-table tr:hover td.cmp-d-lpdf { background: color-mix(in oklch, var(--brand) 7%, var(--bg-sunken)); }
.cmp-yes     { color: var(--success); }
.cmp-no      { color: var(--text-subtle); }
.cmp-partial { color: oklch(68% 0.13 70); }
.cmp-lib { font-size: 0.6875rem; color: var(--text-subtle); display: block; font-weight: 400; margin-top: 2px; font-family: var(--rl-font-mono); }

/* ── Docs prose ── */
.docs-content h1 { font-size: 1.875rem; font-weight: 500; letter-spacing: -.02em; margin: 0 0 1rem; color: color-mix(in oklch, var(--text) 60%, var(--text-muted)); }
.docs-content h2 { font-size: 1.25rem; font-weight: 500; letter-spacing: -.01em; margin: 2.25rem 0 0.75rem; padding-top: 2.25rem; border-top: 1px solid var(--border); color: color-mix(in oklch, var(--text) 60%, var(--text-muted)); }
.docs-content h2:first-child { border-top: none; padding-top: 0; }
.docs-content h3 { font-size: 1rem; font-weight: 500; margin: 1.5rem 0 0.5rem; color: color-mix(in oklch, var(--text) 60%, var(--text-muted)); }
.docs-content p  { color: var(--text-muted); line-height: 1.7; margin: 0.75rem 0; }
.docs-content a  { color: var(--brand); text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--brand) 40%, transparent); }
.docs-content a:hover { text-decoration-color: var(--brand); }
.docs-content ul, .docs-content ol { color: var(--text-muted); line-height: 1.7; padding-left: 1.5rem; margin: 0.75rem 0; }
.docs-content li { margin: 0.25rem 0; }
.docs-content code { font-family: var(--rl-font-mono); font-size: 0.875em; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.docs-content h1, .docs-content h2, .docs-content h3,
.docs-content p, .docs-content ul, .docs-content ol { max-width: 680px; }

/* ── Docs code blocks (CodeMirror) ── */
.doc-code {
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.doc-tabs {
    display: flex;
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border);
    padding: 0 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.doc-tabs::-webkit-scrollbar { display: none; }

.doc-tab {
    padding: 7px 14px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--rl-font-sans);
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
    user-select: none;
}
.doc-tab:hover   { color: var(--text); }
.doc-tab.active  { color: var(--brand); border-bottom-color: var(--brand); }
.doc-tab:disabled { opacity: .5; cursor: wait; }

.doc-cm .cm-editor { max-height: 60vh; }

/* ── Docs landing page ── */
#docs-landing {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    padding: 0 2rem;
    position: relative;
}
.docs-landing-glow {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 50% 0%, color-mix(in oklch, var(--brand) 8%, transparent), transparent 35%);
    pointer-events: none;
}
.docs-landing-inner {
    text-align: center;
    max-width: 600px;
    width: 100%;
}
.docs-landing-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 600;
    letter-spacing: -.03em;
    color: var(--text);
    margin: 0 0 0.75rem;
}
.docs-landing-sub {
    font-size: 1.0625rem;
    color: var(--text-muted);
    margin: 0 0 2.5rem;
}
.docs-sdk-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 640px;
    margin: 0 auto;
}
.docs-sdk-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 1.75rem 1rem;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    transition: border-color .15s, background .15s, transform .1s;
}
.docs-sdk-tile:hover {
    border-color: var(--brand);
    background: color-mix(in oklch, var(--brand) 5%, var(--bg-elev));
    transform: translateY(-2px);
}
.sdk-tile-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}
.sdk-tile-desc {
    font-size: 0.8125rem;
    color: var(--text-subtle);
}

/* ── Legal / prose pages ── */
.page-legal { --text: #3c3c39; }
[data-theme="dark"] .page-legal { --text: #b8b8b2; }

/* ── SDK-specific sections (::: platform) ── */
.sdk-section { display: none; }
.sdk-section.sdk-active { display: block; }

/* ── Docs layout ── */
.docs-layout {
    display: flex;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
    min-height: 100vh;
}

/* ── Sidebar ── */
nav.sidebar {
    width: 220px;
    flex-shrink: 0;
    align-self: flex-start;
    padding: 2rem 1rem 2rem 0;
    position: sticky;
    top: var(--nav-h);
    max-height: calc(100vh - var(--nav-h));
    padding-top: 2rem;
    overflow-y: auto;
}

.nav-group { margin-bottom: 1.75rem; }

.nav-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-bottom: 0.5rem;
}

.nav-group a {
    display: block;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}

.nav-group a:hover,
.nav-group a.active {
    color: var(--text);
    background: var(--bg-sunken);
}

.nav-group a.active { color: var(--brand); }

.nav-group a.nav-sub {
    padding-left: 1.4rem;
    font-size: 0.8125rem;
}

/* ── Docs content ── */
.docs-content {
    flex: 1;
    min-width: 0;
    padding: calc(var(--nav-h) + 2.5rem) 0 4rem 2.5rem;
    border-left: 1px solid var(--border);
}

.docs-layout[hidden], #docs-landing[hidden] { display: none !important; }

@media (max-width: 700px) {
    nav.sidebar { display: none; }
    .docs-content { padding: calc(var(--nav-h) + 1.5rem) 0 1.5rem; border-left: none; }
}

/* ── Pricing FAQ ── */
.faq-item {
    border-top: 1px solid var(--border);
    padding: 1.25rem 0;
}
.faq-item:last-child {
    border-bottom: 1px solid var(--border);
}
.faq-q {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.faq-a {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.faq-a a { color: var(--brand); }

/* ── 404 page ── */
.nav-logo-only { max-width: 1200px; margin: 0 auto; height: 100%; padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; }
.fourohfour { font-size: 1.5rem; font-weight: 600; color: var(--text); line-height: 1; }
a.home-link { color: #f97316; text-decoration: none; font-size: 0.9375rem; font-weight: 500; }
a.home-link:hover { opacity: 0.8; }
