/* Swival — static site stylesheet */

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

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

:root {
    --blue: #1a5fb4;
    --orange: #d65d0e;
    --dark: #1a1a2e;
    --text: #1a1a2e;
    --bg: #ffffff;
    --bg-alt: #f5f5f5;
    --code-bg: #1a1a2e;
    --code-text: #e0e0e0;
    --border: #e0e0e0;
    --link: #1a5fb4;
    --link-hover: #d65d0e;
    --nav-active: #1a5fb4;
    --max-width: 48rem;
    --sidebar-width: 14rem;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

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

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

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

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

.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 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;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

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

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

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

.header-nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

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

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

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: auto;
}

.site-footer a {
    color: #666;
}

.site-footer a:hover {
    color: var(--orange);
}

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

/* Hero */
.hero {
    text-align: center;
    padding: 4rem 1.5rem 3rem;
}

.hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.hero .tagline {
    font-size: 1.15rem;
    color: #555;
    max-width: 36rem;
    margin: 0 auto 2rem;
    line-height: 1.5;
}

/* Calibra CTA */
.calibra-cta {
    font-size: 1.1rem;
    margin: 0 auto 2rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-alt);
    border: 2px solid var(--orange);
    border-radius: 0.5rem;
    display: inline-block;
    color: var(--text);
}

.calibra-cta a {
    color: var(--orange);
    font-weight: 700;
    text-decoration: underline;
}

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

/* Terminal block */
.terminal {
    background: var(--code-bg);
    border-radius: 0.5rem;
    max-width: 36rem;
    margin: 0 auto;
    text-align: left;
    overflow: hidden;
}

.terminal-titlebar {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.6rem 0.75rem;
    background: #2a2a3e;
}

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

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

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

.terminal-body .prompt {
    color: var(--orange);
    user-select: none;
}

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

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

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

.features h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text);
}

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

.feature-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.feature-card h3 {
    font-size: 1rem;
    color: var(--blue);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

/* Quickstart */
.quickstart {
    padding: 3rem 1.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.quickstart h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.quickstart ol {
    padding-left: 1.25rem;
}

.quickstart li {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.quickstart code {
    background: var(--bg-alt);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 0.85em;
}

.quickstart pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
}

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

/* ===== 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 1rem 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.25rem;
}

.sidebar-section h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

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

.sidebar-section a {
    display: block;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    color: #555;
    border-radius: 0.25rem;
    text-decoration: none;
}

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

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

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

.docs-content h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.docs-content h2 {
    font-size: 1.35rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.docs-content h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

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

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

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

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

.docs-content code {
    background: var(--bg-alt);
    padding: 0.1rem 0.35rem;
    border-radius: 0.2rem;
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 0.85em;
}

.docs-content pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1rem 1.25rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    border: 1px solid #2a2a3e;
}

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

.docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

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

.docs-content th {
    background: var(--bg-alt);
    font-weight: 600;
}

.docs-content blockquote {
    border-left: 3px solid var(--blue);
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    color: #555;
    background: var(--bg-alt);
    border-radius: 0 0.25rem 0.25rem 0;
}

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

/* Docs hub */
.docs-hub-group {
    margin-bottom: 2rem;
}

.docs-hub-group h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    border-bottom: none;
    margin-top: 0;
}

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

.docs-hub-list li {
    margin-bottom: 0.75rem;
}

.docs-hub-list a {
    font-weight: 600;
    font-size: 0.95rem;
}

.docs-hub-list .desc {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.1rem;
}

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

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

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

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

    /* 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;
    }
}

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

@media (prefers-color-scheme: dark) {
    :root {
        --text: #e0e0e0;
        --bg: #1a1a2e;
        --bg-alt: #0d0d1a;
        --code-bg: #0d0d1a;
        --code-text: #e0e0e0;
        --border: #333;
        --link: #6ea8fe;
        --link-hover: #f0a050;
        --nav-active: #6ea8fe;
    }

    .site-header {
        background: var(--bg);
    }

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

    .site-footer {
        color: #999;
    }

    .site-footer a {
        color: #999;
    }

    .terminal {
        background: #0d0d1a;
    }

    .terminal-titlebar {
        background: #151528;
    }

    .feature-card {
        background: #151528;
        border-color: #333;
    }

    .feature-card h3 {
        color: #6ea8fe;
    }

    .feature-card p {
        color: #bbb;
    }

    .hero .tagline {
        color: #bbb;
    }

    .quickstart code {
        background: #0d0d1a;
    }

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

    .sidebar-section h4 {
        color: #999;
    }

    .sidebar-section a {
        color: #bbb;
    }

    .sidebar-section a:hover {
        color: #6ea8fe;
        background: #0d0d1a;
    }

    .sidebar-section a.active {
        color: #6ea8fe;
        background: #1a2a4e;
    }

    .docs-content code {
        background: #0d0d1a;
    }

    .docs-content th {
        background: #0d0d1a;
    }

    .docs-content blockquote {
        background: #0d0d1a;
        color: #bbb;
        border-left-color: #6ea8fe;
    }

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