/* Builder's Path — Sub-page theme */
:root {
    --bg: #fafaf9;
    --surface: #ffffff;
    --surface-2: #f5f4f1;
    --border: #e7e6e2;
    --text: #1a1a1a;
    --text-muted: #6a6a67;
    --accent: #b8860b;
    --green: #2a7d52;
    --red: #a52f2f;
    --blue: #1d4d8c;
    --amber: #8c5e1d;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* Site header */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
}
.site-header-inner {
    max-width: 1060px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-header .site-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
}
.site-header .site-name:hover { opacity: 0.7; }
.site-header .site-cta {
    font-size: 12px;
    font-weight: 600;
    color: var(--bg);
    background: var(--text);
    padding: 6px 14px;
    border-radius: 5px;
    text-decoration: none;
}
.site-header .site-cta:hover { opacity: 0.85; }

/* Layout — sidebar + content */
.page-layout {
    display: flex;
    max-width: 1060px;
    margin: 0 auto;
    padding: 48px 20px 64px;
    gap: 0;
}

/* Sidebar nav */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    padding-right: 32px;
    position: sticky;
    top: 48px;
    align-self: flex-start;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
}
.sidebar .sidebar-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 12px;
}
.sidebar a {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 5px;
    margin-bottom: 2px;
    line-height: 1.4;
    transition: background 0.1s, color 0.1s;
}
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.active { background: var(--surface); color: var(--text); font-weight: 500; border: 1px solid var(--border); }
.sidebar .sidebar-num {
    display: inline-block;
    width: 18px;
    color: var(--text-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}
.sidebar .sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

/* Main content */
.container {
    max-width: 760px;
    flex: 1;
    min-width: 0;
    padding: 0;
}

/* Mobile: compact breadcrumb-style nav */
@media (max-width: 860px) {
    .page-layout {
        flex-direction: column;
        max-width: 760px;
        padding: 24px 14px 64px;
    }
    .sidebar {
        width: 100%;
        position: static;
        padding: 0 0 16px;
        margin-bottom: 16px;
        border-bottom: 1px solid var(--border);
        max-height: none;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0;
        overflow: hidden;
    }
    .sidebar .sidebar-label { display: none; }
    .sidebar .sidebar-divider { display: none; }
    .sidebar a {
        display: none;
        padding: 4px 8px;
        font-size: 12px;
    }
    .sidebar a.active {
        display: inline-block;
        font-size: 13px;
        font-weight: 600;
        padding: 4px 0;
        background: none;
        border: none;
    }
    .sidebar a:last-child {
        display: inline-block;
        margin-left: auto;
        font-size: 12px;
        flex-shrink: 0;
    }
}

/* Navigation */
nav {
    margin-bottom: 24px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
nav a { color: #888; text-decoration: none; }
nav a:hover { color: var(--text); }

/* Page header */
h1 {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--text);
}
.page-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.65;
    max-width: 600px;
}

/* Content shell */
h2 {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-top: 36px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
h3 {
    font-size: 14px;
    font-weight: 500;
    margin-top: 24px;
    margin-bottom: 8px;
    color: var(--text);
}
p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.65;
}
strong { color: var(--text); font-weight: 500; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Lists */
ul, ol { padding-left: 1.25rem; margin-bottom: 12px; }
li {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.6;
}
li strong { color: var(--text); }

/* Code */
code {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    color: var(--text);
    border: 1px solid var(--border);
}
pre {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    margin: 12px 0 16px;
    line-height: 1.55;
}
pre code {
    background: none;
    padding: 0;
    border: none;
    color: var(--text);
    font-size: inherit;
}

/* Tables — card-style like phased.html */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 12px 0 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
th, td {
    padding: 10px 14px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
tr:last-child td { border-bottom: none; }
td { color: var(--text-muted); }
td strong { color: var(--text); font-weight: 500; }

/* Callout boxes — card-style */
.info, .tip, .warn, .danger, .vault {
    padding: 14px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid var(--border);
}
.info { background: #f0f5fb; border-color: #d0e0f0; }
.tip { background: #edf7f0; border-color: #c8e6d0; }
.warn { background: #fdf8ef; border-color: #eedcb0; }
.danger { background: #fdf2f2; border-color: #f0d0d0; }
.vault { background: #edf7f0; border-color: #c8e6d0; }
.info p, .tip p, .warn p, .danger p, .vault p { font-size: 13px; margin-bottom: 6px; }
.info p:last-child, .tip p:last-child, .warn p:last-child, .danger p:last-child, .vault p:last-child { margin-bottom: 0; }
.info strong { color: var(--blue); }
.tip strong { color: var(--green); }
.warn strong { color: var(--amber); }
.danger strong { color: var(--red); }
.vault strong { color: var(--green); }
.vault h4 { margin: 0 0 8px; color: var(--green); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }

/* Ordered lists with prominent numbers */
ol { counter-reset: steps; padding-left: 0; list-style: none; }
ol > li {
    counter-increment: steps;
    padding-left: 2rem;
    position: relative;
}
ol > li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* Newsletter CTA (sub-pages) */
.newsletter-cta {
    margin-top: 36px;
    padding: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.newsletter-cta .newsletter-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.newsletter-cta .newsletter-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }

/* Email forms (sub-pages) */
.email-form { display: flex; gap: 8px; flex-wrap: wrap; }
.email-form input[type="email"] {
    flex: 1; min-width: 180px; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 13px; font-family: inherit; outline: none;
    background: var(--surface);
}
.email-form input[type="email"]:focus { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 1px; }
.email-form .btn-dark {
    background: var(--text); color: var(--bg); border: none;
    padding: 8px 16px; border-radius: 6px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    font-family: inherit; white-space: nowrap;
}
.email-form .btn-dark:hover { opacity: 0.85; }
.form-success { color: var(--green); font-weight: 500; font-size: 13px; margin: 0; }
.form-error { color: #c0392b; font-size: 12px; margin: 6px 0 0; }

/* Page navigation (sub-pages) */
.page-nav {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.page-nav .nav-prev { font-size: 13px; color: var(--text-muted); text-decoration: none; }
.page-nav .nav-prev:hover { color: var(--text); }
.page-nav .nav-next {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--text); color: var(--bg);
    padding: 10px 18px; border-radius: 6px;
    font-size: 13px; font-weight: 500; text-decoration: none;
}
.page-nav .nav-next:hover { opacity: 0.85; }

/* Responsive */
@media (max-width: 540px) {
    .container { padding: 24px 14px; }
    h1 { font-size: 19px; }
    table { font-size: 12px; }
    th, td { padding: 8px 10px; }
}
