/* Swival — static site stylesheet */

/* ===== Reset & Base ===== */

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

:root {
    --blue: #2563eb;
    --blue-light: #3b82f6;
    --blue-subtle: #eff6ff;
    --blue-deep: #1d4ed8;
    --orange: #ea580c;
    --orange-light: #f97316;
    --orange-deep: #c2410c;
    --dark: #0f172a;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-subtle: #f1f5f9;
    --code-bg: #1e293b;
    --code-text: #e2e8f0;
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --link: #2563eb;
    --link-hover: #ea580c;
    --nav-active: #2563eb;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --max-width: 48rem;
    --sidebar-width: 15rem;
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Offset anchor jumps for the sticky header */
    scroll-padding-top: 5rem;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    color: var(--link-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Accessibility: focus, selection, skip link, scrollbar ===== */

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
    border-radius: 4px;
}

a:focus-visible,
button:focus-visible,
.tab-button:focus-visible {
    outline-offset: 3px;
}

::selection {
    background: rgba(37, 99, 235, 0.18);
    color: var(--text);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 6px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--blue);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 1000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0.75rem;
    color: #fff;
    text-decoration: none;
}

/* ===== Header ===== */

.site-header {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
}

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

.header-logo img {
    height: 1.75rem;
    width: auto;
}

.header-nav {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.header-nav a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    position: relative;
}

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

.header-nav a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--blue);
    border-radius: 1px;
    transition: all 0.25s ease;
    transform: translateX(-50%);
}

.header-nav a:hover::after {
    width: 60%;
}

/* ===== Footer ===== */

.site-footer {
    background: var(--dark);
    color: #94a3b8;
    padding: 3rem 1.5rem 1.5rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 64rem;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    height: 1.5rem;
    width: auto;
    margin-bottom: 0.75rem;
    filter: brightness(0) invert(1) opacity(0.85);
}

.footer-tagline {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #64748b;
}

.footer-col h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #e2e8f0;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: #94a3b8;
    font-size: 0.875rem;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: #f97316;
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: #475569;
}

/* ===== Landing Page ===== */

/* Hero */
.hero {
    text-align: center;
    padding: 5.5rem 1.5rem 3.5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37,99,235,0.08), transparent);
    pointer-events: none;
}

.hero h1 {
    font-size: 3.25rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.12;
    letter-spacing: -0.035em;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, var(--text) 0%, var(--blue) 50%, var(--orange) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 8s ease infinite;
}

.hero .tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 36rem;
    margin: 0 auto 2rem;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* Hero CTA buttons */
.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.25s ease;
    border: 1.5px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

.btn-primary:hover {
    background: var(--blue-deep);
    border-color: var(--blue-deep);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(37,99,235,0.35);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    border-color: var(--blue-light);
    color: var(--blue);
    text-decoration: none;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

/* Providers strip */
.providers {
    background: var(--bg);
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.providers-inner {
    max-width: 64rem;
    margin: 0 auto;
    text-align: center;
}

.providers-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

.providers-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.provider-badge {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.4rem 0.875rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.provider-badge:hover {
    border-color: var(--blue-light);
    color: var(--blue);
    background: var(--blue-subtle);
}

/* Terminal block */
.terminal {
    background: var(--code-bg);
    border-radius: var(--radius-lg);
    max-width: 38rem;
    margin: 0 auto;
    text-align: left;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255,255,255,0.06);
    position: relative;
    z-index: 1;
}

.terminal-titlebar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #0f172a;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.terminal-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #eab308; }
.terminal-dot.green { background: #22c55e; }

.terminal-body {
    padding: 1.25rem 1.5rem;
    font-family: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 0.875rem;
    line-height: 1.8;
    color: var(--code-text);
}

.terminal-body .prompt {
    color: var(--orange-light);
    user-select: none;
    margin-right: 0.5rem;
}

.terminal-body .cmd {
    color: #e2e8f0;
}

.terminal-body .comment {
    color: #64748b;
    font-style: italic;
}

.terminal-body .cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.1em;
    background: var(--orange-light);
    border-radius: 1px;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

/* Section titles */
.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.0625rem;
    color: var(--text-secondary);
    max-width: 40rem;
    margin: 0 auto 2.5rem;
    line-height: 1.65;
}

/* Features grid */
.features {
    padding: 4.5rem 1.5rem;
    background: var(--bg-alt);
}

.features-inner {
    max-width: 64rem;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.feature-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all 0.3s ease;
    position: relative;
}

.feature-card:hover {
    border-color: var(--blue-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.feature-card h3 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.feature-card code {
    background: var(--bg-subtle);
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-family: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
    font-size: 0.8em;
    color: var(--orange);
}

/* Feature card hover glow */
.feature-card:hover::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(37,99,235,0.1), transparent, rgba(234,88,12,0.08));
    z-index: -1;
    opacity: 0;
    animation: fade-in-up 0.3s ease forwards;
}

/* Feature card entrance animation */
.feature-card[data-animate] {
    opacity: 0;
    transform: translateY(24px);
}

.feature-card[data-animate].visible {
    animation: fade-in-up 0.5s ease forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.05s; }
.feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-card:nth-child(3) { animation-delay: 0.15s; }
.feature-card:nth-child(4) { animation-delay: 0.2s; }
.feature-card:nth-child(5) { animation-delay: 0.25s; }
.feature-card:nth-child(6) { animation-delay: 0.3s; }
.feature-card:nth-child(7) { animation-delay: 0.35s; }
.feature-card:nth-child(8) { animation-delay: 0.4s; }

/* Terminal entrance */
.terminal {
    opacity: 0;
    animation: fade-in-up 0.8s ease 0.3s forwards;
}

/* Calibra banner */
.calibra-cta {
    font-size: 0.9375rem;
    margin: 0 auto 2.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: inline-block;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.calibra-cta:hover {
    border-color: var(--orange-light);
    box-shadow: var(--shadow-sm);
}

.calibra-cta a {
    color: var(--orange);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.calibra-cta a:hover {
    color: var(--link-hover);
}

.calibra-banner {
    background: linear-gradient(135deg, var(--blue-subtle) 0%, #fff7ed 100%);
    padding: 3.5rem 1.5rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.calibra-inner {
    max-width: 40rem;
    margin: 0 auto;
    text-align: center;
}

.calibra-banner h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.calibra-banner p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.calibra-banner a {
    color: var(--blue);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.calibra-banner a:hover {
    color: var(--orange);
}

/* Quickstart */
.quickstart {
    padding: 5rem 1.5rem;
    max-width: 52rem;
    margin: 0 auto;
}

/* Tabs */
.tabs {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.tab-list {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-list::-webkit-scrollbar {
    display: none;
}

.tab-button {
    padding: 0.625rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    font-family: inherit;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-button:hover {
    color: var(--text);
    background: var(--bg-subtle);
}

.tab-button.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    background: var(--blue-subtle);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fade-in-up 0.3s ease forwards;
}

.tab-panel ol {
    padding-left: 1.25rem;
}

.tab-panel li {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.tab-panel code {
    background: var(--bg-subtle);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 0.85em;
    color: var(--orange);
}

.tab-panel pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
}

.tab-panel pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

.quickstart-also {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.quickstart-also a {
    color: var(--blue);
    font-weight: 500;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

/* Mode grid (interactive + python) */
.mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.mode-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all var(--transition);
}

.mode-card:hover {
    border-color: var(--blue-light);
    box-shadow: var(--shadow-sm);
}

.mode-card h3 {
    font-size: 1.0625rem;
    margin-bottom: 0.75rem;
    color: var(--text);
    font-weight: 600;
}

.mode-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 0.75rem;
}

.mode-card code {
    background: var(--bg);
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-family: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
    font-size: 0.8em;
    color: var(--orange);
}

.mode-card pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.55;
    box-shadow: var(--shadow-sm);
}

.mode-card pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    background: var(--blue-deep);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* ===== Docs Layout ===== */

.docs-layout {
    display: flex;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    padding: 1.5rem 1.25rem 1.5rem 0;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 3.5rem;
    align-self: flex-start;
    max-height: calc(100vh - 3.5rem);
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section h4 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-left: 0.875rem;
    font-weight: 600;
}

.sidebar-section ul {
    list-style: none;
}

.sidebar-section a {
    display: block;
    padding: 0.3rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition);
    line-height: 1.5;
    position: relative;
}

.sidebar-section a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 0;
    background: var(--blue);
    border-radius: 1px;
    transition: height 0.2s ease;
}

.sidebar-section a:hover {
    color: var(--link);
    background: var(--blue-subtle);
    text-decoration: none;
}

.sidebar-section a:hover::before,
.sidebar-section a.active::before {
    height: 60%;
}

.sidebar-section a.active {
    color: var(--nav-active);
    background: var(--blue-subtle);
    font-weight: 600;
}

/* Docs content */
.docs-content {
    flex: 1;
    min-width: 0;
    padding: 2rem 0 4rem 2.5rem;
    max-width: var(--max-width);
}

.docs-content h1 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.docs-content h2 {
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.01em;
    scroll-margin-top: 5rem;
}

.docs-content h3 {
    font-size: 1.15rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 600;
    scroll-margin-top: 5rem;
}

.docs-content h4 {
    font-size: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 600;
}

/* Hover-revealed anchor link on h2/h3 in docs */
.docs-content h2,
.docs-content h3 {
    position: relative;
}

.docs-content h2 > .heading-anchor,
.docs-content h3 > .heading-anchor {
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    opacity: 0;
    text-decoration: none;
    font-weight: 400;
    border-radius: 4px;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
    font-size: 0.95em;
}

.docs-content h2:hover > .heading-anchor,
.docs-content h3:hover > .heading-anchor,
.docs-content h2 > .heading-anchor:focus-visible,
.docs-content h3 > .heading-anchor:focus-visible {
    opacity: 1;
}

.docs-content .heading-anchor:hover {
    color: var(--blue);
    background: var(--blue-subtle);
    text-decoration: none;
}

.docs-content h3 > .heading-anchor {
    left: -1.25rem;
    font-size: 0.85em;
}

@media (max-width: 900px) {
    .docs-content h2 > .heading-anchor,
    .docs-content h3 > .heading-anchor {
        display: none;
    }
}

.docs-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

.docs-content li {
    margin-bottom: 0.375rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

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

.docs-content code {
    background: var(--bg-subtle);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 0.85em;
    color: var(--orange);
    border: 1px solid var(--border-subtle);
}

/* Code block wrapper: provides a stable positioning context for the
   copy button and optional language label without disturbing <pre>'s
   horizontal overflow. */
.code-block {
    position: relative;
    margin-bottom: 1.25rem;
}

.code-block .code-lang {
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    font-family: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

.code-block .copy-button {
    position: absolute;
    top: 0.45rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    z-index: 2;
}

.code-block:hover .copy-button,
.code-block .copy-button:focus-visible {
    opacity: 1;
}

.code-block .copy-button:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.code-block .copy-button.copied {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.25);
    opacity: 1;
}

.code-block .copy-button svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.code-block .copy-button .check-icon {
    display: none;
}

.code-block .copy-button.copied .copy-icon {
    display: none;
}

.code-block .copy-button.copied .check-icon {
    display: inline;
}

/* When a language label is shown, nudge the copy button left so they don't
   overlap. The copy button always wins on hover. */
.code-block.has-lang .copy-button {
    right: 0.5rem;
}

.docs-content pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.125rem 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.65;
    border: 1px solid #334155;
    box-shadow: var(--shadow-sm);
}

.docs-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
    border: none;
}

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: block;
    overflow-x: auto;
}

.docs-content th,
.docs-content td {
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 1rem;
    text-align: left;
}

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

.docs-content tbody tr {
    transition: background 0.15s ease;
}

.docs-content tbody tr:hover {
    background: var(--blue-subtle);
}

.docs-content th {
    background: var(--bg-alt);
    font-weight: 600;
    color: var(--text);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border);
}

.docs-content blockquote {
    border-left: 3px solid var(--blue);
    padding: 0.85rem 1.15rem;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    background: var(--bg-alt);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.docs-content blockquote > :last-child {
    margin-bottom: 0;
}

.docs-content blockquote p {
    margin-bottom: 0.5rem;
}

.docs-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Callout/admonition boxes for use in markdown. Markdown source:
   > [!TIP] Optional title
   > Body text
   We render a regular blockquote and add visual style via `.docs-content
   blockquote.callout` plus `.callout-{kind}` set by the build pipeline
   or by hand. The `[!KIND]` syntax is recognised by the doc-builder
   preprocessing step in build.py and converted to a class. */
.docs-content blockquote.callout {
    border-left-width: 4px;
    padding: 1rem 1.15rem;
    background: var(--blue-subtle);
    border-left-color: var(--blue);
}

.docs-content blockquote.callout .callout-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    letter-spacing: -0.005em;
}

.docs-content blockquote.callout .callout-title svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.docs-content blockquote.callout p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.65;
}

.docs-content blockquote.callout.callout-tip {
    background: rgba(34, 197, 94, 0.07);
    border-left-color: #16a34a;
}

.docs-content blockquote.callout.callout-tip .callout-title {
    color: #15803d;
}

.docs-content blockquote.callout.callout-warning {
    background: rgba(234, 88, 12, 0.08);
    border-left-color: var(--orange);
}

.docs-content blockquote.callout.callout-warning .callout-title {
    color: var(--orange-deep);
}

.docs-content blockquote.callout.callout-danger {
    background: rgba(239, 68, 68, 0.08);
    border-left-color: #dc2626;
}

.docs-content blockquote.callout.callout-danger .callout-title {
    color: #b91c1c;
}

.docs-content blockquote.callout.callout-note {
    background: var(--blue-subtle);
    border-left-color: var(--blue);
}

.docs-content blockquote.callout.callout-note .callout-title {
    color: var(--blue-deep);
}

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

.docs-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(37,99,235,0.3);
    transition: text-decoration-color var(--transition);
}

.docs-content a:hover {
    text-decoration-color: var(--link-hover);
}

/* Docs hub */
.docs-hub-lede {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 40rem;
    margin: 0 0 2.25rem;
}

.docs-hub-group {
    margin-bottom: 2.5rem;
}

.docs-hub-group h2 {
    font-size: 1.25rem;
    margin-bottom: 0.875rem;
    border-bottom: none;
    margin-top: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.docs-hub-list {
    list-style: none;
    padding: 0;
}

.docs-hub-list li {
    margin-bottom: 0.875rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.docs-hub-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--blue);
    border-radius: 0 2px 2px 0;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.docs-hub-list li:hover::before {
    transform: scaleY(1);
}

.docs-hub-list li:hover {
    border-color: var(--blue-light);
    box-shadow: var(--shadow-sm);
}

.docs-hub-list a {
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
}

.docs-hub-list .desc {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    line-height: 1.5;
}

/* ===== Right-rail page TOC (docs pages) ===== */

.docs-layout-3col {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width, 13rem);
    gap: 2rem;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    flex: 1;
    align-items: start;
}

.docs-layout-3col .sidebar {
    position: sticky;
    top: 3.5rem;
    align-self: start;
    max-height: calc(100vh - 3.5rem);
    overflow-y: auto;
    padding: 1.5rem 0 1.5rem 0;
    border-right: 1px solid var(--border);
    width: auto;
    flex-shrink: 0;
    /* Sticky-scoped padding handled in original .sidebar */
}

.docs-layout-3col .docs-content {
    padding: 2rem 0 4rem 0;
    min-width: 0;
}

.page-toc {
    position: sticky;
    top: 3.5rem;
    align-self: start;
    max-height: calc(100vh - 3.5rem);
    overflow-y: auto;
    padding: 1.5rem 0 1.5rem 1rem;
    border-left: 1px solid var(--border);
    font-size: 0.8125rem;
}

.page-toc-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.page-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-toc li {
    margin: 0;
}

.page-toc a {
    display: block;
    padding: 0.3rem 0.625rem;
    margin-left: 0;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0;
    line-height: 1.4;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    font-size: 0.8125rem;
}

.page-toc a:hover {
    color: var(--blue);
    background: transparent;
    text-decoration: none;
}

.page-toc a.active {
    color: var(--blue);
    border-left-color: var(--blue);
    font-weight: 600;
    background: transparent;
}

.page-toc .toc-h3 {
    padding-left: 1.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.page-toc .toc-h3:hover {
    color: var(--text-secondary);
}

.page-toc .toc-h3.active {
    color: var(--blue);
    border-left-color: var(--blue-light);
    font-weight: 500;
}

@media (max-width: 1100px) {
    .docs-layout-3col {
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    }
    .page-toc {
        display: none;
    }
}

/* Prev/next page navigation at the bottom of docs pages */
.page-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.page-nav a {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text);
    background: var(--bg);
    transition: all 0.2s ease;
    min-height: 4.5rem;
    position: relative;
    overflow: hidden;
}

.page-nav a:hover {
    border-color: var(--blue-light);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--text);
    transform: translateY(-1px);
}

.page-nav .nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.page-nav .nav-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.page-nav a:hover .nav-title {
    color: var(--blue);
}

.page-nav .nav-next {
    text-align: right;
    grid-column: 2;
}

.page-nav .nav-prev {
    grid-column: 1;
}

.page-nav .nav-empty {
    grid-column: span 1;
    visibility: hidden;
}

/* ===== Landing polish: final CTA + feature highlight ===== */

.cta-band {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 60%, #1e3a8a 100%);
    color: #fff;
    padding: 4.5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-band::before,
.cta-band::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(60px);
    opacity: 0.45;
}

.cta-band::before {
    width: 360px;
    height: 360px;
    top: -120px;
    left: -80px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 70%);
}

.cta-band::after {
    width: 320px;
    height: 320px;
    bottom: -120px;
    right: -80px;
    background: radial-gradient(circle, rgba(251, 146, 60, 0.35), transparent 70%);
}

.cta-inner {
    max-width: 44rem;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.cta-band h2 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #fff;
    margin-bottom: 0.75rem;
    line-height: 1.15;
}

.cta-band p {
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 1.75rem;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

.cta-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-band .btn-primary {
    background: #fff;
    color: var(--blue-deep);
    border-color: #fff;
}

.cta-band .btn-primary:hover {
    background: rgba(255, 255, 255, 0.92);
    color: var(--blue-deep);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.cta-band .btn-secondary {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.cta-band .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.7);
}

/* Feature spotlight: larger 2-up "feature highlight" cards on the landing page */
.spotlight {
    padding: 4.5rem 1.5rem;
    background: var(--bg);
}

.spotlight-inner {
    max-width: 64rem;
    margin: 0 auto;
}

.spotlight-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.spotlight-card {
    position: relative;
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg);
    transition: all 0.3s ease;
    overflow: hidden;
}

.spotlight-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, var(--accent-glow, rgba(37, 99, 235, 0.08)), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transition: transform 0.4s ease, opacity 0.4s ease;
    transform: translate(30%, -30%);
}

.spotlight-card:hover {
    border-color: var(--accent-border, var(--blue-light));
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.spotlight-card:hover::after {
    transform: translate(20%, -20%) scale(1.1);
}

.spotlight-card .icon {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.6rem;
    background: var(--accent-bg, var(--blue-subtle));
    color: var(--accent-fg, var(--blue));
    margin-bottom: 1rem;
}

.spotlight-card .icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.spotlight-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.015em;
}

.spotlight-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

.spotlight-card.spotlight-blue {
    --accent-bg: var(--blue-subtle);
    --accent-fg: var(--blue);
    --accent-border: var(--blue-light);
    --accent-glow: rgba(37, 99, 235, 0.12);
}

.spotlight-card.spotlight-orange {
    --accent-bg: #fff7ed;
    --accent-fg: var(--orange);
    --accent-border: var(--orange-light);
    --accent-glow: rgba(234, 88, 12, 0.12);
}

@media (max-width: 768px) {
    .spotlight-grid {
        grid-template-columns: 1fr;
    }
    .cta-band h2 {
        font-size: 1.75rem;
    }
    .cta-band p {
        font-size: 1rem;
    }
}

/* ===== Animations ===== */

@keyframes orb-drift-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(10px, -10px) scale(1.02); }
}

@keyframes orb-drift-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-40px, 20px) scale(0.97); }
    50% { transform: translate(30px, -30px) scale(1.03); }
    75% { transform: translate(-10px, 10px) scale(0.98); }
}

@keyframes orb-drift-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, 30px) scale(1.04); }
    66% { transform: translate(-30px, -20px) scale(0.96); }
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Hero orbs — floating gradient circles */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.hero-orb-1 {
    width: 500px;
    height: 500px;
    top: -15%;
    left: -5%;
    background: radial-gradient(circle, rgba(37,99,235,0.4), transparent 70%);
    animation: orb-drift-1 20s ease-in-out infinite;
}

.hero-orb-2 {
    width: 400px;
    height: 400px;
    top: 10%;
    right: -10%;
    background: radial-gradient(circle, rgba(234,88,12,0.3), transparent 70%);
    animation: orb-drift-2 25s ease-in-out infinite;
}

.hero-orb-3 {
    width: 300px;
    height: 300px;
    bottom: -5%;
    left: 30%;
    background: radial-gradient(circle, rgba(37,99,235,0.25), transparent 70%);
    animation: orb-drift-3 18s ease-in-out infinite;
}

.hero-glow {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,0.12), transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: glow-pulse 8s ease-in-out infinite;
}

.hero h1,
.hero .tagline,
.hero .hero-actions,
.hero .calibra-cta,
.hero .terminal {
    position: relative;
    z-index: 1;
}

/* Calibra CTA shimmer on hover */
.calibra-cta:hover {
    background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--blue-subtle) 50%, var(--bg-subtle) 75%);
    background-size: 200% auto;
    border-color: var(--blue-light);
}

/* ===== Reduced Motion ===== */

@media (prefers-reduced-motion: reduce) {
    .hero-orb,
    .hero-glow {
        animation: none;
    }

    .hero h1 {
        animation: none;
        background: var(--text);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .terminal-body .cursor {
        animation: none;
        opacity: 1;
    }

    .feature-card[data-animate] {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .terminal {
        opacity: 1;
        animation: none;
    }

    .calibra-cta:hover {
        animation: none;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Mobile ===== */

@media (max-width: 768px) {
    .hero {
        padding: 3.5rem 1.25rem 2.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .tagline {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 16rem;
        justify-content: center;
    }

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

    .features {
        padding: 3rem 1.25rem;
    }

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

    .providers-strip {
        gap: 0.375rem;
    }

    .provider-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.625rem;
    }

    .tab-button {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .calibra-banner {
        padding: 2.5rem 1.25rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    /* Sidebar becomes vertical list above content */
    .docs-layout {
        flex-direction: column;
        padding: 0 1rem;
    }

    .sidebar {
        width: 100%;
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1rem 0;
    }

    .sidebar-section {
        margin-bottom: 0.75rem;
    }

    .sidebar-section ul {
        display: flex;
        flex-direction: column;
        gap: 0.125rem;
    }

    .sidebar-section a {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }

    .docs-content {
        padding: 1.5rem 0 2rem;
    }

    .docs-layout-3col {
        grid-template-columns: 1fr;
        padding: 0 1rem;
        gap: 0;
    }

    .docs-layout-3col .sidebar {
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1rem 0;
    }

    .docs-layout-3col .docs-content {
        padding: 1.5rem 0 2rem;
    }

    .page-nav {
        grid-template-columns: 1fr;
    }

    .page-nav .nav-next {
        grid-column: 1;
        text-align: left;
    }

    .code-block .copy-button {
        opacity: 1;
    }

    .code-block .code-lang {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .feature-card {
        padding: 1.25rem;
    }

    .quickstart {
        padding: 3rem 1rem;
    }

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

/* ===== Dark Mode ===== */

@media (prefers-color-scheme: dark) {
    :root {
        --text: #e2e8f0;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;
        --bg: #0f172a;
        --bg-alt: #1e293b;
        --bg-subtle: #1e293b;
        --code-bg: #0f172a;
        --code-text: #e2e8f0;
        --border: #334155;
        --border-subtle: #1e293b;
        --link: #60a5fa;
        --link-hover: #fb923c;
        --nav-active: #60a5fa;
        --blue-subtle: rgba(96,165,250,0.08);
        --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.3);
        --shadow: 0 1px 3px 0 rgba(0,0,0,0.4), 0 1px 2px -1px rgba(0,0,0,0.3);
        --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.4);
        --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.6), 0 8px 10px -6px rgba(0,0,0,0.5);
    }

    .site-header {
        background: rgba(15,23,42,0.88);
    }

    .header-logo img {
        filter: brightness(0) invert(1);
    }

    .header-logo {
        color: var(--text);
    }

    .header-nav a {
        color: var(--text-secondary);
    }

    .header-nav a:hover {
        background: rgba(96,165,250,0.1);
    }

    .header-nav a::after {
        background: #60a5fa;
    }

    /* Footer */
    .site-footer {
        background: #080f1e;
        border-top: 1px solid #1e293b;
    }

    .footer-col a {
        color: #94a3b8;
    }

    .footer-col a:hover {
        color: #fb923c;
    }

    .footer-bottom {
        border-top-color: #1e293b;
    }

    /* Hero */
    .hero::before {
        background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(96,165,250,0.1), transparent);
    }

    .hero h1 {
        background: linear-gradient(135deg, #e2e8f0 0%, #60a5fa 50%, #fb923c 100%);
        background-size: 200% auto;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    /* Buttons */
    .btn-primary {
        background: var(--blue);
        border-color: var(--blue);
    }

    .btn-primary:hover {
        background: var(--blue-light);
        border-color: var(--blue-light);
        box-shadow: 0 4px 14px rgba(96,165,250,0.3);
    }

    .btn-secondary {
        background: #1e293b;
        color: #e2e8f0;
        border-color: #334155;
    }

    .btn-secondary:hover {
        border-color: #60a5fa;
        color: #60a5fa;
    }

    /* Providers */
    .providers {
        background: #080f1e;
    }

    .provider-badge {
        background: #1e293b;
        color: #94a3b8;
        border-color: #334155;
    }

    .provider-badge:hover {
        border-color: #60a5fa;
        color: #60a5fa;
        background: rgba(96,165,250,0.08);
    }

    /* Terminal */
    .terminal {
        border-color: rgba(255,255,255,0.04);
    }

    .terminal-titlebar {
        background: #0c1222;
    }

    .terminal-body .prompt {
        color: #fb923c;
    }

    .terminal-body .cursor {
        background: #fb923c;
    }

    /* Features */
    .feature-card {
        background: #1e293b;
        border-color: #334155;
    }

    .feature-card:hover {
        border-color: var(--blue-light);
    }

    .feature-card h3 {
        color: #e2e8f0;
    }

    .feature-card p {
        color: #94a3b8;
    }

    .feature-card code {
        background: #0f172a;
        color: var(--orange-light);
    }

    .feature-card:hover::after {
        background: linear-gradient(135deg, rgba(96,165,250,0.08), transparent, rgba(249,115,22,0.06));
    }

    .hero .tagline {
        color: #94a3b8;
    }

    /* Calibra */
    .calibra-cta {
        background: #1e293b;
        border-color: #334155;
    }

    .calibra-banner {
        background: linear-gradient(135deg, rgba(96,165,250,0.05) 0%, rgba(251,146,60,0.05) 100%);
    }

    .calibra-banner a {
        color: #60a5fa;
    }

    /* Quickstart */
    .tab-button {
        color: #94a3b8;
    }

    .tab-button:hover {
        color: #e2e8f0;
        background: #1e293b;
    }

    .tab-button.active {
        color: #60a5fa;
        background: rgba(96,165,250,0.1);
    }

    .tab-panel code {
        background: #1e293b;
        color: var(--orange-light);
    }

    .tab-panel pre {
        border-color: #334155;
    }

    .mode-card {
        background: #0f172a;
        border-color: #334155;
    }

    .mode-card:hover {
        border-color: #60a5fa;
    }

    .mode-card h3 {
        color: #e2e8f0;
    }

    .mode-card code {
        background: #1e293b;
        color: var(--orange-light);
    }

    /* Docs */
    .quickstart code {
        background: #1e293b;
        color: var(--orange-light);
    }

    .quickstart pre {
        border-color: #334155;
    }

    .docs-content pre {
        border-color: #334155;
    }

    .docs-content code {
        background: #1e293b;
        color: var(--orange-light);
    }

    .docs-content th {
        background: #1e293b;
    }

    .docs-content blockquote {
        background: #1e293b;
        color: #94a3b8;
        border-left-color: #60a5fa;
    }

    .docs-content a {
        text-decoration-color: rgba(96,165,250,0.3);
    }

    .docs-content p,
    .docs-content li {
        color: #94a3b8;
    }

    .docs-content strong {
        color: #e2e8f0;
    }

    .sidebar-section h4 {
        color: #64748b;
    }

    .sidebar-section a {
        color: #94a3b8;
    }

    .sidebar-section a:hover {
        color: #60a5fa;
        background: rgba(96,165,250,0.08);
    }

    .sidebar-section a.active {
        color: #60a5fa;
        background: rgba(96,165,250,0.12);
    }

    .sidebar-section a::before {
        background: #60a5fa;
    }

    .docs-hub-list li {
        background: #1e293b;
        border-color: #334155;
    }

    .docs-hub-list li:hover {
        border-color: #60a5fa;
    }

    .docs-hub-list li::before {
        background: #60a5fa;
    }

    .docs-hub-list .desc {
        color: #64748b;
    }

    /* Back to top */
    .back-to-top {
        background: #3b82f6;
    }

    .back-to-top:hover {
        background: #60a5fa;
    }

    /* Hero orbs */
    .hero-orb-1 {
        background: radial-gradient(circle, rgba(96,165,250,0.25), transparent 70%);
    }

    .hero-orb-2 {
        background: radial-gradient(circle, rgba(249,115,22,0.2), transparent 70%);
    }

    .hero-orb-3 {
        background: radial-gradient(circle, rgba(96,165,250,0.15), transparent 70%);
    }

    .hero-glow {
        background: radial-gradient(circle, rgba(96,165,250,0.08), transparent 60%);
    }

    /* Selection */
    ::selection {
        background: rgba(96, 165, 250, 0.25);
        color: #e2e8f0;
    }

    /* Right-rail TOC */
    .docs-layout-3col .sidebar,
    .page-toc {
        border-color: #1e293b;
    }

    .page-toc a {
        color: #94a3b8;
    }

    .page-toc a:hover {
        color: #60a5fa;
    }

    .page-toc a.active {
        color: #60a5fa;
        border-left-color: #60a5fa;
    }

    .page-toc .toc-h3.active {
        border-left-color: #93c5fd;
    }

    /* Page nav */
    .page-nav a {
        background: #1e293b;
        border-color: #334155;
    }

    .page-nav a:hover {
        border-color: #60a5fa;
    }

    .page-nav .nav-title {
        color: #e2e8f0;
    }

    .page-nav a:hover .nav-title {
        color: #60a5fa;
    }

    /* Tables */
    .docs-content table {
        border-color: #334155;
    }

    .docs-content th,
    .docs-content td {
        border-color: #1e293b;
    }

    .docs-content th {
        background: rgba(96, 165, 250, 0.06);
        border-bottom-color: #334155;
    }

    .docs-content tbody tr:hover {
        background: rgba(96, 165, 250, 0.06);
    }

    /* Inline code */
    .docs-content code {
        background: #1e293b;
        border-color: #334155;
        color: #fb923c;
    }

    /* Callouts */
    .docs-content blockquote.callout.callout-tip {
        background: rgba(34, 197, 94, 0.08);
    }

    .docs-content blockquote.callout.callout-tip .callout-title {
        color: #4ade80;
    }

    .docs-content blockquote.callout.callout-warning {
        background: rgba(249, 115, 22, 0.08);
    }

    .docs-content blockquote.callout.callout-warning .callout-title {
        color: #fb923c;
    }

    .docs-content blockquote.callout.callout-danger {
        background: rgba(239, 68, 68, 0.1);
    }

    .docs-content blockquote.callout.callout-danger .callout-title {
        color: #f87171;
    }

    .docs-content blockquote.callout.callout-note {
        background: rgba(96, 165, 250, 0.08);
    }

    .docs-content blockquote.callout.callout-note .callout-title {
        color: #93c5fd;
    }

    /* Scrollbar */
    ::-webkit-scrollbar-thumb {
        background: #334155;
        border-color: #0f172a;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #475569;
    }

    /* Spotlight cards */
    .spotlight-card {
        background: #1e293b;
        border-color: #334155;
    }

    .spotlight-card.spotlight-orange {
        --accent-bg: rgba(251, 146, 60, 0.1);
    }

    .spotlight-card.spotlight-blue {
        --accent-bg: rgba(96, 165, 250, 0.1);
    }
}