/* InterpLens Documentation — Clean Editorial Technical Theme */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --bg: #0b0d11;
    --bg-surface: #11141b;
    --bg-subtle: #171b24;
    --bg-code: #080a0e;
    --border: #222630;
    --border-strong: #313746;

    --text: #f3f4f6;
    --text-secondary: #c4cad4;
    --text-muted: #8b93a3;

    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-soft: rgba(59, 130, 246, 0.12);

    --green: #10b981;
    --amber: #f59e0b;

    --header-h: 56px;
    --sidebar-w: 236px;
    --radius: 8px;
}

[data-theme="light"] {
    --bg: #ffffff;
    --bg-surface: #f9fafb;
    --bg-subtle: #f3f4f6;
    --bg-code: #0f1117;
    --border: #e5e7eb;
    --border-strong: #d1d5db;

    --text: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.08);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.25s cubic-bezier(0.22, 1, 0.36, 1), color 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Subtle 2px Reading Progress Bar */
.scroll-progress {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 45;
    pointer-events: none;
    background: transparent;
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #38bdf8, #3b82f6);
    transform-origin: left center;
    transition: width 0.08s linear;
}

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

a:hover {
    text-decoration: underline;
}

code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--text);
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--header-h);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1240px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.02em;
    text-decoration: none;
}

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

.version-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    padding: 1px 7px;
    border-radius: 999px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.header-nav a:hover {
    color: var(--text);
    text-decoration: none;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn:hover {
    border-color: var(--border-strong);
    color: var(--text);
    background: var(--bg-subtle);
    text-decoration: none;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.btn-primary:hover {
    opacity: 0.9;
    background: var(--text);
    color: var(--bg);
}

.search-btn {
    min-width: 180px;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 12.5px;
}

.kbd {
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
}

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

/* Main Docs Shell */
.docs-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

/* Sidebar */
.docs-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    padding-bottom: 32px;
}

.nav-group {
    margin-bottom: 24px;
}

.nav-group-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 10px;
}

.nav-link {
    display: block;
    font-size: 13.5px;
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: color 0.12s ease, background 0.12s ease;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-subtle);
    text-decoration: none;
}

.nav-link.active {
    color: var(--text);
    font-weight: 500;
    background: var(--bg-subtle);
    border-left-color: var(--accent);
}

/* Content Column */
.docs-main {
    min-width: 0;
    max-width: 840px;
    padding: 40px 0 88px;
}

.docs-section {
    padding-bottom: 52px;
    margin-bottom: 52px;
    border-bottom: 1px solid var(--border);
}

.docs-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 14px;
}

h1 {
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.18;
    color: var(--text);
    margin-bottom: 16px;
}

.lead {
    font-size: 16.5px;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 680px;
    margin-bottom: 28px;
}

h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 12px;
}

h3 {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 8px;
}

p {
    color: var(--text-secondary);
    margin-bottom: 14px;
}

/* Hero Install Bar */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.install-box {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
}

.install-box .prompt-sign {
    color: var(--text-muted);
    user-select: none;
}

.copy-inline-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 11.5px;
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
}

.copy-inline-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

/* Metrics Strip */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: border-color 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.22s ease;
}

.metric-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: border-color 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.22s ease;
}

.feature-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.feature-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.feature-card h3 {
    margin: 0;
    font-size: 14.5px;
}

.feature-card p {
    font-size: 13.5px;
    margin: 0;
    color: var(--text-muted);
}

.tag {
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--bg-subtle);
}

.tag-new {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    background: var(--accent-soft);
}

/* Code Blocks */
.code-block {
    margin: 14px 0 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-code);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #12151e;
    border-bottom: 1px solid #1e2330;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: #9ca3af;
}

.code-copy-btn {
    background: transparent;
    border: 1px solid #2b3140;
    color: #9ca3af;
    font-family: var(--font-sans);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.code-copy-btn:hover {
    color: #f3f4f6;
    border-color: #4b5563;
}

.code-block pre {
    padding: 14px 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 12.8px;
    line-height: 1.6;
    color: #e5e7eb;
}

.code-block pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin: 18px 0 0;
}

.tab-btn {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 14px;
    cursor: pointer;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: gentleFadeIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes gentleFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth Scroll Reveal */
.docs-section.reveal-ready {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1), transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.docs-section.reveal-ready.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 16px 0 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: left;
}

th {
    background: var(--bg-surface);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: none;
}

.method-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.method-get {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}

.method-post {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
}

/* Callout */
.callout {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 18px 0;
    font-size: 13.8px;
    color: var(--text-secondary);
}

.callout strong {
    color: var(--text);
}

/* Search Modal */
.search-modal {
    display: flex;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(4px);
    align-items: flex-start;
    justify-content: center;
    padding: 80px 16px 16px;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.search-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.search-dialog {
    width: 100%;
    max-width: 520px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    transform: translateY(-6px) scale(0.985);
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.search-modal.open .search-dialog {
    transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.search-input {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
}

.search-results {
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
}

.search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13.5px;
    text-decoration: none;
}

.search-item:hover {
    background: var(--bg-subtle);
    color: var(--text);
    text-decoration: none;
}

.search-item span:last-child {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.footer-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
}

/* Responsive */
@media (max-width: 960px) {
    .header-nav,
    .search-btn {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .docs-shell {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0 18px;
    }

    .docs-sidebar {
        display: none;
        position: static;
        max-height: none;
        padding: 16px 0 8px;
        border-bottom: 1px solid var(--border);
    }

    .docs-sidebar.open {
        display: block;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}
