:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --card-bg: #ffffff;
    --accent-color: #0d6efd;
    --secondary-text: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    /* Spec Layout Specifics derived from palette */
    --code-bg: #e9ecef;
    --sidebar-bg: #ffffff;

    /* Syntax Highlighting - Light Theme */
    --sh-keyword: #0033b3;
    --sh-string: #067d17;
    --sh-number: #1750eb;
    --sh-comment: #8c8c8c;
    --sh-variable: #871094; /* Rainbow usually, picking a static color */
    --sh-node-title: #000000;
    --sh-operator: #000000;
    --sh-function: #00627a;
    --sh-hashtag: #8c8c8c;
    --sh-type: #0033b3;
    --sh-option-arrow: #000000;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --text-color: #e2e8f0;
        --card-bg: #1e293b;
        --accent-color: #38bdf8;
        --secondary-text: #94a3b8;
        --border-color: #334155;
        --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
        
        --code-bg: #1e293b;
        --sidebar-bg: #0f172a;

        /* Syntax Highlighting - Dark Theme */
        --sh-keyword: #cc7832;
        --sh-string: #6a8759;
        --sh-number: #6897bb;
        --sh-comment: #808080;
        --sh-variable: #9876aa;
        --sh-node-title: #ffc66d;
        --sh-operator: #a9b7c6;
        --sh-function: #ffc66d;
        --sh-hashtag: #808080;
        --sh-type: #cc7832;
        --sh-option-arrow: #a9b7c6;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Base Elements */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    text-decoration: underline;
    opacity: 0.9;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-color);
}

p {
    margin-bottom: 1.5rem;
}

code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    color: var(--accent-color);
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

pre {
    background-color: var(--code-bg);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

blockquote {
    border-left: 4px solid var(--accent-color);
    background-color: var(--card-bg);
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 0 4px 4px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

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

th {
    background-color: var(--card-bg);
    font-weight: 600;
}

/* =========================================
   Landing Page Styles
   ========================================= */
body.landing-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 800px;
    padding: 2rem;
    text-align: center;
}

.logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.tagline {
    font-size: 1.25rem;
    color: var(--secondary-text);
    margin-bottom: 2rem;
    font-weight: 300;
}

.content-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    text-align: left;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, opacity 0.2s;
}

.cta-button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    color: white;
    text-decoration: none;
}

footer {
    margin-top: 3rem;
    color: var(--secondary-text);
    font-size: 0.875rem;
    text-align: center;
}

/* =========================================
   Spec Page Layout
   ========================================= */
.spec-layout {
    display: flex;
    min-height: 100vh;
}

.spec-sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--text-color);
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
    position: fixed;
    top: 0;
    left: 0;
    padding: 2rem 1rem;
    box-sizing: border-box;
    border-right: 1px solid var(--border-color);
}

.spec-sidebar h3 {
    color: var(--accent-color);
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

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

.spec-sidebar ul ul {
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
    margin-left: 0.5rem;
}

.spec-sidebar a {
    color: var(--text-color);
    display: block;
    padding: 0.3rem 0;
    font-size: 0.95rem;
}

.spec-sidebar a:hover {
    color: var(--accent-color);
    text-decoration: none;
    transform: translateX(2px);
    transition: transform 0.2s, color 0.2s;
}

.spec-content {
    flex-grow: 1;
    margin-left: 280px; /* Width of sidebar */
    padding: 2rem 4rem;
    max-width: 900px;
}

/* Mobile Spec Layout */
@media (max-width: 768px) {
    .spec-layout {
        flex-direction: column;
    }
    .spec-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .spec-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* =========================================
   Yarn Syntax Highlighting
   ========================================= */
.yarn-keyword { color: var(--sh-keyword); font-weight: bold; }
.yarn-string { color: var(--sh-string); }
.yarn-number { color: var(--sh-number); }
.yarn-comment { color: var(--sh-comment); font-style: italic; }
.yarn-variable { color: var(--sh-variable); }
.yarn-node-title { color: var(--sh-node-title); font-weight: bold; }
.yarn-operator { color: var(--sh-operator); }
.yarn-function-call { color: var(--sh-function); }
.yarn-hashtag { color: var(--sh-hashtag); }
.yarn-type { color: var(--sh-type); }
.yarn-option-arrow { color: var(--sh-option-arrow); font-weight: bold; }
