:root {
    --bg: #fafaf9;
    --surface: #ffffff;
    --text: #1c1917;
    --muted: #6b6560;
    --border: #e7e5e4;
    --accent: #2f5bea;
    --accent-text: #ffffff;
    --tag-bg: #eef2fd;
    --tag-text: #2546b8;
    --radius: 10px;
    --max-width: 1040px;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121214;
        --surface: #1b1b1f;
        --text: #ececec;
        --muted: #a1a1aa;
        --border: #2c2c32;
        --accent: #6d8dff;
        --accent-text: #0b0b0d;
        --tag-bg: #1f2747;
        --tag-text: #b4c4ff;
    }
}

*, *::before, *::after { box-sizing: border-box; }

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

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

h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); margin: 0.25em 0 0.4em; }
h2 { margin-top: 2.5rem; }

h1:focus { outline: none; }

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

.site { min-height: 100vh; display: flex; flex-direction: column; }
.site main { flex: 1; padding-top: 2rem; padding-bottom: 3rem; width: 100%; }

/* Header */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 10;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 60px;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--text); }
.nav a.active { text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--accent); }

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

/* Content */
.hero { padding: 2rem 0 1rem; }
.eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; margin: 0; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }

.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.5rem 0; }
.button {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-text);
    text-decoration: none;
    font-weight: 600;
}
.button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.card h3 { margin: 0.25rem 0 0.5rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0 0 1rem; color: var(--muted); }
.card-meta { font-size: 0.8rem; color: var(--muted); }

.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li {
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.8rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}

.detail { max-width: 70ch; }
.link-list { padding-left: 1.2rem; }

.boot { padding: 3rem 16px; text-align: center; color: var(--muted); }

/* Blazor error UI */
#blazor-error-ui {
    background: #fff4d6;
    color: #3d2e00;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
