/* ==========================================================================
   Serverpacemaker — style.css
   A pacemaker for services. Minimal, sysadmin-oriented, no external assets.
   ========================================================================== */

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

/* --- Variables ------------------------------------------------------------ */
:root {
    /* Backgrounds */
    --bg:           #fafaf9;
    --bg-alt:       #f4f4f2;
    --surface:      #ffffff;

    /* Text */
    --text:         #1c1c1a;
    --text-muted:   #57534e;
    --text-subtle:  #a8a29e;

    /* Accent — the pulse color */
    --accent:       #b91c1c;
    --accent-hover: #991b1b;
    --accent-soft:  #fee2e2;

    /* Borders */
    --border:       #e7e5e4;
    --border-strong:#d6d3d1;

    /* Code blocks */
    --code-bg:      #1c1c1a;
    --code-text:    #e7e5e4;
    --code-accent:  #f87171;

    /* Status */
    --ok:           #16a34a;
    --warn:         #ca8a04;
    --error:        #dc2626;

    /* Type */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono',
                 Consolas, 'Courier New', monospace;

    /* Layout */
    --radius:       8px;
    --container:    960px;
    --prose:        720px;
}

/* --- Base ----------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

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

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

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

/* --- Typography ----------------------------------------------------------- */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.125rem;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

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

li {
    margin-bottom: 0.35rem;
}

strong {
    font-weight: 600;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-alt);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--border);
}

pre {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

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

/* --- Layout --------------------------------------------------------------- */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.container-prose {
    max-width: var(--prose);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 4rem 0;
}

.section-tight {
    padding: 2.5rem 0;
}

.section-alt {
    background: var(--bg-alt);
}

/* --- Topbar --------------------------------------------------------------- */
.topbar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
    background: rgba(250, 250, 249, 0.92);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

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

.logo span {
    color: var(--accent);
}

.logo-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav a {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
}

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

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

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
    letter-spacing: -0.025em;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 1.5rem;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.12s ease, border-color 0.12s ease;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    background: var(--bg-alt);
    color: var(--text);
    text-decoration: none;
}

/* --- Grid ----------------------------------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

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

/* --- Card ----------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* --- Checklist (pre-flight) ----------------------------------------------- */
.checklist {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 2rem;
}

.checklist li {
    padding: 0.5rem 0;
    padding-left: 1.75rem;
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.checklist li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--ok);
    font-weight: bold;
}

.checklist li.no::before {
    content: "✗";
    color: var(--error);
}

/* --- TOC ------------------------------------------------------------------ */
.toc {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.toc h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 2rem;
}

.toc li {
    margin-bottom: 0.35rem;
    font-size: 0.9375rem;
}

/* --- Tables --------------------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

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

th {
    font-weight: 600;
    background: var(--bg-alt);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

td code {
    font-size: 0.85em;
}

/* --- Footer --------------------------------------------------------------- */
.footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 3rem 0 2rem;
    margin-top: 6rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin: 1.25rem 0;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--text);
    text-decoration: underline;
}

.copyright {
    margin-top: 1.25rem;
    color: var(--text-subtle);
    font-size: 0.8125rem;
}

/* --- Utility -------------------------------------------------------------- */
.text-muted {
    color: var(--text-muted);
}

.text-subtle {
    color: var(--text-subtle);
    font-size: 0.875rem;
}

.text-mono {
    font-family: var(--font-mono);
}

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 2rem; }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 640px) {
    h1 { font-size: 1.75rem; }
    .hero h1 { font-size: 1.875rem; }
    h2 { font-size: 1.25rem; }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .toc ul {
        columns: 1;
    }

    .container,
    .container-prose {
        padding: 0 20px;
    }

    .section {
        padding: 2.5rem 0;
    }

    .topbar-inner {
        height: auto;
        padding: 12px 0;
    }

    .nav {
        gap: 16px;
    }

    .nav a {
        font-size: 0.8125rem;
    }
}
