/* ==========================================================================
   DysonHarness site theme — layered on Bootstrap 5.
   Palette: deep indigo/violet accent on a near-white background, dark footer.
   ========================================================================== */

:root {
    --dh-brand: #4f46e5;          /* indigo-600 */
    --dh-brand-dark: #4338ca;     /* indigo-700 */
    --dh-brand-light: #eef2ff;    /* indigo-50  */
    --dh-accent: #7c3aed;         /* violet-600 */
    --dh-ink: #1e293b;            /* slate-800  */
    --dh-muted: #64748b;          /* slate-500  */
    --dh-bg: #fafafc;
    --dh-surface: #ffffff;
    --dh-border: #e2e8f0;         /* slate-200  */
    --dh-dark: #17131f;           /* footer / dark hero */
    --dh-dark-2: #241d33;
    --dh-radius: 0.75rem;
    --dh-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji";
    --dh-mono-stack: ui-monospace, SFMono-Regular, "SF Mono", Menlo,
        Consolas, "Liberation Mono", monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--dh-font-stack);
    color: var(--dh-ink);
    background-color: var(--dh-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.015em;
}

a {
    color: var(--dh-brand);
}

a:hover {
    color: var(--dh-brand-dark);
}

code, pre, kbd {
    font-family: var(--dh-mono-stack);
}

/* ---- Buttons ------------------------------------------------------------ */

.btn-primary {
    --bs-btn-bg: var(--dh-brand);
    --bs-btn-border-color: var(--dh-brand);
    --bs-btn-hover-bg: var(--dh-brand-dark);
    --bs-btn-hover-border-color: var(--dh-brand-dark);
    --bs-btn-active-bg: var(--dh-brand-dark);
    --bs-btn-active-border-color: var(--dh-brand-dark);
}

/* ---- Navbar ------------------------------------------------------------- */

.site-navbar {
    background-color: var(--dh-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-navbar .navbar-brand span {
    color: #fff;
    letter-spacing: -0.01em;
}

.site-navbar .nav-link {
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
}

.site-navbar .nav-link:hover,
.site-navbar .nav-link:focus {
    color: #fff;
}

.site-navbar .nav-link.active {
    color: #fff;
    border-bottom: 2px solid var(--dh-brand);
}

/* ---- Hero --------------------------------------------------------------- */

.hero {
    background:
        radial-gradient(60rem 30rem at 80% -10%, rgba(124, 58, 237, 0.35), transparent 60%),
        radial-gradient(50rem 25rem at 10% 0%, rgba(79, 70, 229, 0.4), transparent 60%),
        linear-gradient(160deg, var(--dh-dark) 0%, var(--dh-dark-2) 100%);
    color: #f4f2ff;
    padding: 6rem 0 5rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hero .lead {
    color: rgba(244, 242, 255, 0.8);
    max-width: 44rem;
    margin-left: auto;
    margin-right: auto;
}

/* ---- GitHub stars badge (navbar) ---------------------------------------- */

.github-stars-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    color: #f5d97a;
    background: rgba(245, 217, 122, 0.12);
    border: 1px solid rgba(245, 217, 122, 0.35);
    border-radius: 999px;
    white-space: nowrap;
}

.github-stars-badge[hidden] {
    display: none;
}

.hero-badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #d9d4ff;
    background: rgba(124, 58, 237, 0.18);
    border: 1px solid rgba(167, 139, 250, 0.4);
    border-radius: 999px;
}

/* ---- Feature cards ------------------------------------------------------ */

.feature-card {
    background: var(--dh-surface);
    border: 1px solid var(--dh-border);
    border-radius: var(--dh-radius);
    padding: 1.75rem;
    height: 100%;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--dh-brand);
    box-shadow: 0 0.75rem 2rem rgba(79, 70, 229, 0.12);
}

.feature-card h3 {
    font-size: 1.15rem;
}

.feature-card p {
    color: var(--dh-muted);
    margin-bottom: 0;
}

/* ---- Docs page: hero ----------------------------------------------------- */

.docs-hero {
    position: relative;
    overflow: hidden;
    padding: 4.5rem 0;
    text-align: center;
    background:
        radial-gradient(40rem 20rem at 85% -20%, rgba(124, 58, 237, 0.18), transparent 60%),
        radial-gradient(36rem 18rem at 8% 0%, rgba(79, 70, 229, 0.22), transparent 60%),
        linear-gradient(165deg, var(--dh-brand-light) 0%, #f6f4ff 55%, var(--dh-bg) 100%);
    border-bottom: 1px solid var(--dh-border);
}

.docs-hero .docs-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    color: var(--dh-brand);
    opacity: 0.08;
}

.docs-hero-content {
    position: relative;
    z-index: 1;
}

.docs-hero h1 {
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.docs-hero .lead {
    color: var(--dh-muted);
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

.docs-hero .lead code {
    font-size: 0.875em;
    color: var(--dh-brand-dark);
    background: rgba(79, 70, 229, 0.1);
    padding: 0.15em 0.35em;
    border-radius: 0.3rem;
}

.docs-hero-badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    margin-bottom: 1.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dh-brand-dark);
    background: rgba(79, 70, 229, 0.09);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 999px;
}

.docs-hero-hint {
    color: var(--dh-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.docs-hash-chip {
    font-family: var(--dh-mono-stack);
    font-size: 0.8em;
    color: var(--dh-brand-dark);
    background: var(--dh-surface);
    border: 1px solid var(--dh-border);
    padding: 0.1em 0.4em;
    border-radius: 0.3rem;
}

/* ---- Docs page: layout & sidebar ---------------------------------------- */

.docs-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

.docs-sidebar {
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding-right: 1.25rem;
    border-right: 1px solid var(--dh-border);
}

.docs-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    margin-bottom: 1.25rem;
    background: var(--dh-surface);
    border: 1px solid var(--dh-border);
    border-radius: var(--dh-radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.docs-filter:focus-within {
    border-color: var(--dh-brand);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.docs-filter svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--dh-muted);
}

.docs-filter input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0;
    font-size: 0.925rem;
    background: transparent;
    color: var(--dh-ink);
}

.docs-filter input::placeholder {
    color: var(--dh-muted);
}

/* Knock out the native search-field clear control for consistency. */
.docs-filter input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.docs-filter-empty {
    color: var(--dh-muted);
    font-size: 0.875rem;
    margin: 0.5rem 0 0;
}

.docs-category {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--dh-muted);
    margin: 1.5rem 0 0.4rem;
}

.docs-group:first-child .docs-category {
    margin-top: 0;
}

.docs-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-sidebar a[data-docs-slug] {
    display: block;
    padding: 0.35rem 0.75rem;
    border-left: 2px solid transparent;
    border-radius: 0 0.5rem 0.5rem 0;
    color: var(--dh-muted);
    font-size: 0.925rem;
    text-decoration: none;
    transition: color 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.docs-sidebar a[data-docs-slug]:hover {
    color: var(--dh-brand);
    background: rgba(79, 70, 229, 0.06);
}

.docs-sidebar a[data-docs-slug]:focus-visible {
    outline: 2px solid var(--dh-brand);
    outline-offset: 1px;
}

.docs-sidebar a[data-docs-slug].active {
    color: var(--dh-brand);
    font-weight: 600;
    border-left-color: var(--dh-brand);
    background: var(--dh-brand-light);
}

/* ---- Docs page: content card -------------------------------------------- */

.docs-content {
    min-width: 0; /* allow code blocks to scroll instead of blowing out the grid */
}

#docs-app {
    min-height: 60vh;
}

.docs-doc-card {
    background: var(--dh-surface);
    border: 1px solid var(--dh-border);
    border-radius: var(--dh-radius);
    padding: 2rem 2.25rem;
    box-shadow: 0 0.5rem 1.5rem rgba(30, 41, 59, 0.06);
}

.docs-doc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--dh-border);
}

.docs-doc-category {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--dh-brand);
    margin-bottom: 0.25rem;
}

.docs-doc-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.docs-github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    padding: 0.4rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dh-brand);
    text-decoration: none;
    background: var(--dh-brand-light);
    border: 1px solid rgba(79, 70, 229, 0.25);
    border-radius: 999px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.docs-github-link svg {
    width: 1rem;
    height: 1rem;
}

.docs-github-link:hover {
    color: var(--dh-brand-dark);
    background: #e3e8ff;
    border-color: var(--dh-brand);
}

.docs-github-link:focus-visible {
    outline: 2px solid var(--dh-brand);
    outline-offset: 2px;
}

/* ---- Docs page: status, loading & empty states --------------------------- */

#docs-status {
    color: var(--dh-muted);
}

#docs-status.docs-status-visible {
    margin-bottom: 1rem;
}

#docs-status.docs-status-error {
    color: #b91c1c;
}

.docs-github-fallback {
    font-weight: 600;
    white-space: nowrap;
}

.docs-spinner {
    display: inline-block;
    width: 0.95rem;
    height: 0.95rem;
    margin-right: 0.4rem;
    vertical-align: -0.15em;
    border: 2px solid var(--dh-brand-light);
    border-top-color: var(--dh-brand);
    border-radius: 50%;
    animation: docs-spin 0.7s linear infinite;
}

.docs-doc-card.docs-loading .markdown-body {
    min-height: 16rem;
    background:
        linear-gradient(90deg, #eef1f7 25%, #f6f8fc 50%, #eef1f7 75%);
    background-size: 200% 100%;
    border-radius: calc(var(--dh-radius) - 0.25rem);
    animation: docs-shimmer 1.4s ease-in-out infinite;
}

@keyframes docs-spin {
    to { transform: rotate(360deg); }
}

@keyframes docs-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .docs-spinner,
    .docs-doc-card.docs-loading .markdown-body {
        animation: none;
    }
}

.docs-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
}

.docs-empty-icon {
    width: 3rem;
    height: 3rem;
    color: var(--dh-brand);
    opacity: 0.75;
    margin-bottom: 1rem;
}

.docs-empty-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.35rem;
}

.docs-empty-text {
    color: var(--dh-muted);
    margin-bottom: 1.5rem;
}

.docs-empty-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.docs-quick-link {
    display: inline-block;
    padding: 0.45rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dh-brand);
    text-decoration: none;
    background: var(--dh-brand-light);
    border: 1px solid rgba(79, 70, 229, 0.25);
    border-radius: 999px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.docs-quick-link:hover {
    color: var(--dh-brand-dark);
    background: #e3e8ff;
    border-color: var(--dh-brand);
}

.docs-quick-link:focus-visible {
    outline: 2px solid var(--dh-brand);
    outline-offset: 2px;
}

/* ---- Markdown typography ------------------------------------------------ */

.markdown-body {
    line-height: 1.7;
    font-size: 1rem;
}

.markdown-body h1 {
    font-size: 2rem;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--dh-border);
}

.markdown-body h2 {
    font-size: 1.5rem;
    margin: 2.25rem 0 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--dh-border);
}

.markdown-body h3 {
    font-size: 1.2rem;
    margin: 1.75rem 0 0.5rem;
}

.markdown-body h4 {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.5rem;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1rem;
}

.markdown-body code {
    font-size: 0.875em;
    color: var(--dh-brand-dark);
    background: var(--dh-brand-light);
    padding: 0.15em 0.35em;
    border-radius: 0.3rem;
}

.markdown-body pre {
    background: var(--dh-dark);
    color: #e6e2f5;
    padding: 1rem 1.25rem;
    border-radius: var(--dh-radius);
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.markdown-body pre code {
    color: inherit;
    background: transparent;
    padding: 0;
    font-size: 0.875rem;
}

.markdown-body table {
    width: 100%;
    margin-bottom: 1.25rem;
    border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--dh-border);
    text-align: left;
}

.markdown-body th {
    background: var(--dh-brand-light);
    font-weight: 600;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--dh-radius);
}

.markdown-body blockquote {
    margin: 0 0 1rem;
    padding: 0.5rem 1rem;
    color: var(--dh-muted);
    border-left: 3px solid var(--dh-brand);
    background: var(--dh-brand-light);
}

/* ---- Footer ------------------------------------------------------------- */

.site-footer {
    background: var(--dh-dark);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.925rem;
    flex-shrink: 0;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer-links li {
    margin-bottom: 0.35rem;
}

.site-footer-note {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.8rem;
}

/* ---- Features page sections --------------------------------------------- */

:root {
    --dh-sky: #0284c7;            /* sky-600     */
    --dh-emerald: #059669;        /* emerald-600 */
}

.features-section {
    position: relative;
    overflow: hidden;
    padding: 4.5rem 0;
}

.features-section .section-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    color: var(--dh-section-accent, var(--dh-brand));
    opacity: 0.08;
    transition: transform 0.15s ease-out;
}

.features-section-content {
    position: relative;
    z-index: 1;
}

.features-section-title {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.features-section-subtitle {
    color: var(--dh-muted);
    margin-bottom: 2rem;
}

.features-section .feature-card {
    border-top: 3px solid var(--dh-section-accent, var(--dh-brand));
}

.feature-icon {
    width: 1.5rem;
    height: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--dh-section-accent, var(--dh-brand));
}

.features-section--orchestrate {
    --dh-section-accent: var(--dh-brand);
    background: var(--dh-brand-light);
}

.features-section--persist {
    --dh-section-accent: var(--dh-accent);
    background: var(--dh-surface);
}

.features-section--models {
    --dh-section-accent: var(--dh-sky);
    background: #f0f9ff;
}

.features-section--tools {
    --dh-section-accent: var(--dh-emerald);
    background: var(--dh-surface);
}

.features-section--orchestrate .section-bg {
    opacity: 0.08;
}

.features-section--persist .section-bg {
    opacity: 0.07;
}

.features-section--models .section-bg {
    opacity: 0.09;
}

.features-section--tools .section-bg {
    opacity: 0.07;
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 991.98px) {
    .hero {
        padding: 4rem 0 3.5rem;
    }

    .docs-hero {
        padding: 3.25rem 0;
    }

    .docs-layout {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .docs-sidebar {
        position: static;
        max-height: 18rem;
        padding-right: 0;
        padding-bottom: 0.75rem;
        border-right: 0;
        border-bottom: 1px solid var(--dh-border);
    }

    .docs-doc-card {
        padding: 1.25rem 1.1rem;
    }

    .docs-doc-header {
        flex-direction: column;
        gap: 0.85rem;
    }

    .docs-empty {
        padding: 2.25rem 0.75rem;
    }
}
