/*
 * The public site's stylesheet.
 *
 * A real file rather than an inline <style> block, and not for tidiness: the
 * application sends a strict CSP of `style-src 'self' 'nonce-...'`, so an
 * inline block without a nonce is blocked outright and the page renders with
 * no styling at all. A file is covered by 'self', is cacheable, and cannot
 * silently lose its nonce.
 *
 * Deliberately not the application's stylesheet. That one is built for a
 * signed-in dashboard and pulls in a component library this page has no use
 * for; loading it would make the marketing site slower than the product it
 * advertises — which we now measure.
 */
:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --surface: #f7f8fa;
    --text: #0b1220;
    --muted: #5b6577;
    --border: #e4e7ec;
    --accent: #2563eb;
    --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1220;
        --surface: #131b2b;
        --text: #eef2f8;
        --muted: #97a1b3;
        --border: #253048;
        --accent: #7aa5ff;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap { width: min(var(--measure), 100% - 2.5rem); margin-inline: auto; }
.wide { width: min(64rem, 100% - 2.5rem); margin-inline: auto; }

/* --- Header ---------------------------------------------------- */
header.site {
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 0;
}

header.site .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

.brand svg { color: var(--accent); }

nav.site a {
    margin-left: 1.25rem;
    font-size: 0.95rem;
    color: var(--muted);
    text-decoration: none;
}

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

/*
 * Specificity, not decoration. `nav.site a` is (0,1,2) and a bare `.btn` is
 * (0,1,0), so inside the nav the muted link colour won and the button rendered
 * dark grey on blue — unreadable, and invisible to every test that only reads
 * the HTML.
 */
nav.site a.btn,
.btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}

/* --- Content ---------------------------------------------------- */
main { padding: 3.5rem 0 4rem; }

h1 {
    font-size: clamp(2rem, 5vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin: 0 0 1rem;
    text-wrap: balance;
}

h2 { font-size: 1.4rem; letter-spacing: -0.02em; margin: 2.5rem 0 0.75rem; text-wrap: balance; }
h3 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }
p { margin: 0 0 1.1rem; }

.lede { font-size: 1.15rem; color: var(--muted); }

/* Prose lists lose their markers to no reset here, but they are set
   explicitly anyway so a change to the reset cannot silently flatten
   them into paragraphs. */
article ul, article ol { padding-left: 1.4rem; margin: 0 0 1.1rem; }
article ul { list-style: disc; }
article ol { list-style: decimal; }
article li { margin-bottom: 0.4rem; }

article table {
    display: block;
    overflow-x: auto;
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.5rem;
}

article th, article td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    font-size: 0.95rem;
}

article img { max-width: 100%; height: auto; }

article pre {
    overflow-x: auto;
    padding: 1rem;
    border-radius: 8px;
    background: var(--surface);
    font-size: 0.9rem;
}

article blockquote {
    margin: 0 0 1.1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--border);
    color: var(--muted);
}

/* --- Post list -------------------------------------------------- */
.posts { display: grid; gap: 1.75rem; margin: 2rem 0 0; padding: 0; list-style: none; }

.posts li { padding-bottom: 1.75rem; border-bottom: 1px solid var(--border); }
.posts li:last-child { border-bottom: 0; }

.posts h3 { margin: 0 0 0.35rem; font-size: 1.2rem; letter-spacing: -0.01em; }
.posts h3 a { color: var(--text); text-decoration: none; }
.posts h3 a:hover { color: var(--accent); }

.meta { font-size: 0.85rem; color: var(--muted); }

/* --- Footer ------------------------------------------------------ */
footer.site {
    border-top: 1px solid var(--border);
    padding: 2rem 0 3rem;
    font-size: 0.9rem;
    color: var(--muted);
}

footer.site .cols {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: space-between;
}

footer.site a { color: var(--muted); text-decoration: none; margin-right: 1rem; }
footer.site a:hover { color: var(--text); }

.note {
    margin-top: 1.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font-size: 0.9rem;
}
