/* helm — shared site styles
 *
 * Source of truth for chrome (vars, reset, body, container, header, footer,
 * buttons). Page-specific styles stay inline in each page's <style> block.
 *
 * Width convention:
 *   .container — 960px max, used on every page (keeps header + footer consistent)
 *   .narrow    — 720px max-width wrapper for prose sections (used inside .container
 *                for legal pages and the prose sections on index)
 */

/* ───────────────────────── Design tokens ───────────────────────── */

:root {
    --bg: #111A24;
    --surface: #1C2B39;
    --border: #374151;
    --text: #F9FAFB;
    --text-muted: #B0B7C2;        /* Bumped from #9CA3AF for WCAG AA on body text */
    --accent: #FF4F00;
    --accent-dim: #E04500;
}

/* ───────────────────────── Self-hosted fonts ───────────────────────── */
/* Files live in assets/fonts/. See assets/fonts/README.md for the source
 * (@fontsource/inter, @fontsource/jetbrains-mono — Latin subset, woff2). */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('assets/fonts/inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('assets/fonts/inter-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('assets/fonts/inter-600.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('assets/fonts/jetbrains-mono-400.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('assets/fonts/jetbrains-mono-500.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('assets/fonts/jetbrains-mono-600.woff2') format('woff2');
}

/* ───────────────────────── Reset + base ───────────────────────── */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ───────────────────────── Layout ───────────────────────── */

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.narrow {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* ───────────────────────── Header ───────────────────────── */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4rem;
}

.logo-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 14px 6px 8px;
    text-decoration: none;
    color: inherit;
}

.logo {
    width: 48px;
    height: 48px;
}

.wordmark {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.header-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.header-links a {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.header-links a:hover {
    color: var(--text);
}

/* ───────────────────────── Buttons ───────────────────────── */

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
}
.btn-primary:hover { background: #fff; }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); }

.btn-kofi {
    background: var(--accent);
    color: #fff;
}
.btn-kofi:hover { background: var(--accent-dim); }

.btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ───────────────────────── Footer ───────────────────────── */

.footer {
    padding-top: 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.footer-links a:hover { color: var(--text); }

.copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
    width: 100%;
    text-align: left;
}

/* ───────────────────────── Responsive ───────────────────────── */

@media (max-width: 720px) {
    .container { padding: 3rem 1.25rem; }
    .header {
        margin-bottom: 3rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    .header-links { flex-wrap: wrap; }
}
