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

:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-muted: #666666;
    --color-border: #e0e0e0;
    --color-accent: #1a73e8;
    --color-accent-hover: #1558b0;
    --font: system-ui, -apple-system, sans-serif;
    --radius: 8px;
    --max-width: 720px;
}

body {
    font-family: var(--font);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

header {
    border-bottom: 1px solid var(--color-border);
    padding: 0 1.5rem;
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.brand {
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--color-text);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

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

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

main {
    flex: 1;
}

main.home {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8rem 1.5rem;
    gap: 1rem;
    min-height: calc(100vh - 56px);
}

.tagline {
    color: var(--color-muted);
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 560px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-form input[type="search"]:focus {
    border-color: var(--color-accent);
}

.search-form button {
    padding: 0.75rem 1.5rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.search-form button:hover {
    background: var(--color-accent-hover);
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #121212;
        --color-text: #e8e8e8;
        --color-muted: #999999;
        --color-border: #2e2e2e;
    }
}

.results-page,
.content-page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.search-form--compact {
    max-width: 100%;
    margin-bottom: 1rem;
}

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

.no-results {
    padding: 2rem 0;
}

.no-results .hint {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.result-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-title {
    font-size: 1.15rem;
    color: var(--color-accent);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.15rem;
}

.result-title:hover {
    text-decoration: underline;
}

.result-url {
    color: #0a7d33;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    word-break: break-all;
}

.result-snippet {
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.5;
}

.result-snippet mark {
    background: #fff3a0;
    color: inherit;
    padding: 0 1px;
}

.pagination {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    justify-content: center;
}

.page-link {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-accent);
    font-size: 0.9rem;
}

.page-link:hover {
    background: var(--color-accent);
    color: #fff;
}

.content-page h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.content-page h2 {
    font-size: 1.3rem;
    margin: 2rem 0 0.75rem;
}

.content-page .lead {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.content-page .stat {
    color: var(--color-muted);
    margin-bottom: 1.5rem;
}

.content-page p {
    margin-bottom: 0.75rem;
}

.content-page dl {
    margin: 1rem 0;
}

.content-page dt {
    font-weight: 600;
    margin-top: 1rem;
}

.content-page dd {
    margin: 0.25rem 0 0 0;
    color: var(--color-text);
}

.content-page code {
    background: var(--color-border);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.content-page a {
    color: var(--color-accent);
}

@media (prefers-color-scheme: dark) {
    .result-url { color: #4ade80; }
    .result-snippet mark { background: #665c00; color: #fff; }
}
