/* ═══════════════════════════════════════════════════
   STELAE DOCS — Design tokens (subset of main system)
   ═══════════════════════════════════════════════════ */
:root {
    --stone-50: #f7f5f2;
    --stone-100: #ede9e3;
    --stone-200: #ddd6cc;
    --stone-300: #c4b9aa;
    --stone-400: #a89888;
    --stone-500: #8d7b69;
    --stone-600: #746252;
    --stone-700: #5c4d42;
    --stone-800: #3e342c;
    --stone-900: #262019;
    --stone-950: #151210;
    --ochre: #b8943e;
    --ochre-light: #d4b05a;
    --ochre-glow: rgba(184, 148, 62, 0.15);
    --basalt: #2a2520;
    --basalt-light: #3a332c;
    --ember: #c45d3e;
    --sage: #7a8c6e;
    --sage-muted: #a3b096;
    --sky: #6e8a9c;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--stone-200);
    background: var(--stone-950);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--ochre-light); text-decoration: none; }
a:hover { color: var(--ochre); text-decoration: underline; }
::selection { background: var(--ochre); color: var(--stone-950); }

/* ═══════════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════════ */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 56px;
    background: var(--stone-950);
    border-bottom: 1px solid var(--stone-700);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand-text {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.35rem;
    letter-spacing: 0.12em;
    color: var(--stone-100);
    text-transform: uppercase;
}
.nav-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ochre);
    background: rgba(184, 148, 62, 0.1);
    border: 1px solid rgba(184, 148, 62, 0.2);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.82rem;
}
.nav-right a { color: var(--stone-400); }
.nav-right a:hover { color: var(--stone-200); text-decoration: none; }

/* ═══════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════ */
.docs-layout {
    display: flex;
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════ */
.docs-sidebar {
    width: 240px;
    flex-shrink: 0;
    padding: 2rem 1.5rem;
    border-right: 1px solid var(--stone-800);
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}
.docs-sidebar ul {
    list-style: none;
    padding: 0;
}
.docs-sidebar li {
    margin-bottom: 2px;
}
.docs-sidebar a {
    display: block;
    padding: 0.4rem 0.75rem;
    font-size: 0.84rem;
    color: var(--stone-400);
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}
.docs-sidebar a:hover {
    color: var(--stone-100);
    background: var(--basalt);
    text-decoration: none;
}
.docs-sidebar a.active {
    color: var(--ochre-light);
    background: rgba(184, 148, 62, 0.08);
}
.sidebar-heading {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--stone-600);
    padding: 0.4rem 0.75rem;
    margin-top: 1.25rem;
    margin-bottom: 0.25rem;
}
.sidebar-heading:first-child { margin-top: 0; }

/* ═══════════════════════════════════════════════════
   CONTENT
   ═══════════════════════════════════════════════════ */
.doc-body {
    flex: 1;
    min-width: 0;
    padding: 3rem 3rem 5rem;
    max-width: 780px;
}
.doc-body h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 400;
    color: var(--stone-100);
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}
.doc-lead {
    font-size: 1.05rem;
    color: var(--stone-400);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 620px;
}
h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--stone-100);
    margin: 3rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--stone-800);
}
h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--stone-200);
    margin: 2rem 0 0.75rem;
}
p { margin-bottom: 1rem; color: var(--stone-300); font-size: 0.92rem; }
ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--stone-300);
    font-size: 0.92rem;
}
li { margin-bottom: 0.35rem; }
li::marker { color: var(--stone-600); }

code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: var(--basalt);
    border: 1px solid var(--stone-800);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    color: var(--ochre-light);
}
pre {
    background: var(--basalt);
    border: 1px solid var(--stone-800);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.7;
}
pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--stone-300);
}

/* ═══════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════ */
.compat-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 2rem;
    font-size: 0.85rem;
}
.compat-table th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--stone-500);
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--stone-700);
}
.compat-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--stone-800);
    color: var(--stone-300);
    vertical-align: top;
}
.compat-table tr:last-child td { border-bottom: none; }
.compat-table tr:hover td { background: rgba(255,255,255,0.015); }

.status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.status-works { color: var(--sage-muted); }
.status-partial { color: var(--ochre); }
.status-no { color: var(--ember); }
.workaround { font-size: 0.82rem; color: var(--stone-400); }

/* ═══════════════════════════════════════════════════
   CALLOUTS
   ═══════════════════════════════════════════════════ */
.callout {
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--stone-700);
    border-left: 3px solid var(--ochre);
    border-radius: var(--radius-md);
    background: var(--basalt);
    margin: 1.5rem 0;
}
.callout-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ochre);
    margin-bottom: 0.5rem;
}
.callout p { margin-bottom: 0; color: var(--stone-400); }
.callout p + p { margin-top: 0.75rem; }

.callout-info { border-left-color: var(--sky); }
.callout-info .callout-title { color: var(--sky); }
.callout-warning { border-left-color: var(--ember); }
.callout-warning .callout-title { color: var(--ember); }
.callout-success { border-left-color: var(--sage-muted); }
.callout-success .callout-title { color: var(--sage-muted); }

/* ═══════════════════════════════════════════════════
   STEPS (numbered procedure)
   ═══════════════════════════════════════════════════ */
.steps {
    counter-reset: doc-step;
    margin: 1.5rem 0;
}
.step {
    counter-increment: doc-step;
    padding: 1.25rem 1.5rem 1.25rem 3.5rem;
    border: 1px solid var(--stone-800);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    position: relative;
}
.step::before {
    content: counter(doc-step);
    position: absolute;
    left: 1.25rem;
    top: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ochre);
}
.step-title {
    font-weight: 600;
    color: var(--stone-100);
    font-size: 0.92rem;
    margin-bottom: 0.3rem;
}
.step p { margin-bottom: 0.5rem; }
.step p:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════
   INDEX CARDS (for home page)
   ═══════════════════════════════════════════════════ */
.doc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}
.doc-card {
    display: block;
    padding: 1.5rem;
    border: 1px solid var(--stone-800);
    border-radius: var(--radius-md);
    transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}
.doc-card:hover {
    border-color: var(--stone-600);
    background: rgba(255,255,255,0.015);
    text-decoration: none;
}
.doc-card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--stone-100);
    margin-bottom: 0.35rem;
}
.doc-card-desc {
    font-size: 0.82rem;
    color: var(--stone-400);
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   FAQ
   ═══════════════════════════════════════════════════ */
.faq-item {
    border-bottom: 1px solid var(--stone-800);
    padding: 1.25rem 0;
}
.faq-q {
    font-weight: 600;
    color: var(--stone-100);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.faq-a {
    color: var(--stone-400);
    font-size: 0.88rem;
    line-height: 1.7;
}
.faq-a a { color: var(--ochre-light); }

/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */
footer {
    text-align: center;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--stone-800);
    font-size: 0.8rem;
    color: var(--stone-600);
}
footer a { color: var(--stone-600); }
footer a:hover { color: var(--stone-400); text-decoration: none; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 860px) {
    .docs-sidebar {
        display: none;
    }
    .doc-body {
        padding: 2rem 1.25rem 3rem;
    }
    nav { padding: 0 1rem; }
    .compat-table th, .compat-table td { padding: 0.6rem 0.6rem; }
    .doc-cards { grid-template-columns: 1fr; }
}
