/* ============================================================
   Spaces StartOS Guide — styles
   ============================================================ */

:root {
    --bg: #fafafb;
    --bg-elevated: #ffffff;
    --bg-muted: #f4f4f7;
    --border: #e6e6ec;
    --border-strong: #d4d4dc;
    --text: #1a1b2e;
    --text-muted: #585a73;
    --text-soft: #8a8ca0;

    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-soft: #eef0ff;
    --accent: #7c3aed;

    --warn-bg: #fff8e6;
    --warn-border: #f5d27a;
    --info-bg: #eff6ff;
    --info-border: #93c5fd;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(15, 17, 39, 0.04), 0 1px 1px rgba(15, 17, 39, 0.03);
    --shadow-md: 0 4px 14px rgba(15, 17, 39, 0.06), 0 1px 3px rgba(15, 17, 39, 0.04);
    --shadow-lg: 0 16px 40px rgba(15, 17, 39, 0.08), 0 4px 12px rgba(15, 17, 39, 0.04);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    display: block;
}

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

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

code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    padding: 0.15em 0.4em;
    background: var(--bg-muted);
    border-radius: 4px;
    border: 1px solid var(--border);
    color: #2d2f4a;
}

pre {
    background: #0f1023;
    color: #e8e8f6;
    padding: 18px 22px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    box-shadow: var(--shadow-md);
}

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

pre .prompt {
    color: #8b9eff;
    user-select: none;
    margin-right: 0.5em;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(150%) blur(10px);
    -webkit-backdrop-filter: saturate(150%) blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-weight: 700;
    font-size: 16px;
}

.brand-sub {
    color: var(--text-soft);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.top-nav {
    display: flex;
    gap: 28px;
}

.top-nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14.5px;
}

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

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 18px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 80ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.28);
}

.btn-primary:hover {
    color: white;
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.34);
}

.btn-outline {
    background: white;
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--bg-muted);
    color: var(--text);
}

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

.hero {
    padding: 72px 0 56px;
    background:
        radial-gradient(1200px 360px at 50% -10%, rgba(124, 58, 237, 0.12), transparent 60%),
        radial-gradient(900px 320px at 10% 20%, rgba(99, 102, 241, 0.10), transparent 60%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    text-align: center;
}

.eyebrow {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.hero h1 {
    font-size: clamp(34px, 5.5vw, 56px);
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0 auto 18px;
    max-width: 880px;
    font-weight: 800;
}

.grad {
    background: linear-gradient(90deg, #7c3aed, #6366f1 60%, #06b6d4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lead {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 28px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.hero-meta {
    display: flex;
    justify-content: center;
    gap: 28px;
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    flex-wrap: wrap;
}

.hero-meta li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-meta span {
    font-size: 16px;
}

/* ---------- Layout ---------- */

.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 56px;
    padding: 56px 24px 96px;
    align-items: start;
}

/* ---------- TOC ---------- */

.toc {
    position: sticky;
    top: 88px;
    align-self: start;
    font-size: 14px;
}

.toc-title {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-soft);
    letter-spacing: 0.08em;
    margin: 0 0 12px;
}

.toc ol {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    border-left: 1px solid var(--border);
}

.toc li {
    margin: 0;
}

.toc a {
    display: block;
    padding: 7px 14px;
    color: var(--text-muted);
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.toc a:hover {
    color: var(--text);
    text-decoration: none;
    background: var(--bg-muted);
}

.toc a.active {
    color: var(--primary-dark);
    border-left-color: var(--primary);
    font-weight: 600;
}

.toc-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.toc-card-title {
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 6px;
}

.toc-card-body {
    color: var(--text-muted);
    font-size: 13.5px;
    margin: 0 0 12px;
    line-height: 1.55;
}

/* ---------- Content ---------- */

.content {
    min-width: 0;
}

.doc-section {
    padding-bottom: 56px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 56px;
    scroll-margin-top: 96px;
}

.doc-section:last-child {
    border-bottom: 0;
    margin-bottom: 0;
}

.doc-section h2 {
    font-size: 30px;
    letter-spacing: -0.01em;
    margin: 0 0 18px;
    font-weight: 700;
}

.doc-section h3 {
    font-size: 20px;
    margin: 32px 0 12px;
    font-weight: 700;
}

.doc-section p,
.doc-section ul,
.doc-section ol {
    color: #2c2e44;
}

.doc-section p {
    margin: 0 0 16px;
}

.check-list,
.numbered {
    padding-left: 0;
    list-style: none;
}

.check-list li {
    position: relative;
    padding: 6px 0 6px 30px;
}

.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 13px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-soft) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 6.5l2.6 2.6L10 3'/></svg>") center / 12px no-repeat;
}

.numbered {
    counter-reset: step;
}

.numbered > li {
    counter-increment: step;
    position: relative;
    padding: 6px 0 6px 42px;
    margin-bottom: 4px;
}

.numbered > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Figures */

figure {
    margin: 24px 0 28px;
}

figure img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

figcaption {
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 13.5px;
    text-align: center;
    font-style: italic;
}

/* Callouts */

.callout {
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 20px 0;
    font-size: 15px;
    line-height: 1.6;
    background: var(--bg-elevated);
}

.callout strong {
    margin-right: 4px;
}

.callout-info {
    background: var(--info-bg);
    border-color: var(--info-border);
}

.callout-warn {
    background: var(--warn-bg);
    border-color: var(--warn-border);
}

/* Tables */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 16px 0 24px;
    background: var(--bg-elevated);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}

thead {
    background: var(--bg-muted);
}

th,
td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

tbody tr:last-child td {
    border-bottom: 0;
}

th {
    font-weight: 700;
    color: var(--text);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Details (FAQ) */

details {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    margin: 12px 0;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

details summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 600;
    color: var(--text);
    position: relative;
    padding-right: 44px;
    user-select: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    text-align: center;
    line-height: 22px;
    font-weight: 700;
    transition: transform 160ms ease;
}

details[open] summary::after {
    content: "−";
}

details p {
    padding: 0 18px 16px;
    margin: 0;
    color: var(--text-muted);
}

/* Next-step cards */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.card {
    display: block;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform 120ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card:hover {
    text-decoration: none;
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.card h4 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
}

.card p {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.card-link {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 13.5px;
}

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

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    padding: 40px 0 56px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
}

.footer-brand p {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 13.5px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-meta {
    grid-column: 1 / -1;
    color: var(--text-soft);
    font-size: 13px;
    margin: 16px 0 0;
}

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

@media (max-width: 960px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top: 32px;
    }

    .toc {
        position: static;
        order: 2;
    }

    .content {
        order: 1;
    }

    .top-nav {
        display: none;
    }
}

@media (max-width: 560px) {
    .hero {
        padding: 48px 0 36px;
    }

    .hero-meta {
        gap: 14px;
        font-size: 13.5px;
    }

    .doc-section h2 {
        font-size: 24px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        text-align: left;
    }
}
