:root {
    --bg: #0b1020;
    --panel: #111a2e;
    --panel-2: #16213a;
    --text: #eef4ff;
    --muted: #9fb0ce;
    --line: rgba(255, 255, 255, 0.11);
    --accent: #8be9c7;
    --accent-2: #9cc7ff;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
    margin: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(139, 233, 199, 0.14), transparent 32rem),
        radial-gradient(circle at 90% 20%, rgba(156, 199, 255, 0.12), transparent 30rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a { color: inherit; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.container {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(11, 16, 32, 0.8);
    backdrop-filter: blur(18px);
}

.nav-wrap {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.03em;
}

.nav {
    display: flex;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

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

.hero { padding: 5rem 0 3rem; }
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 2rem;
    align-items: center;
}

.eyebrow {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 0.75rem;
}

h1, h2, h3 {
    line-height: 1.08;
    letter-spacing: -0.04em;
    margin: 0 0 1rem;
}

h1 { font-size: clamp(2.4rem, 6vw, 5.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.35rem; }

.lede {
    color: var(--muted);
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    max-width: 780px;
}
.lede.small { font-size: 1.05rem; }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
}
.button.primary {
    color: #06120d;
    background: var(--accent);
    border-color: var(--accent);
}

.callout, .search-panel, .article-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.callout { padding: 1.5rem; }
.callout h2 { font-size: 1.2rem; }
.callout ul { padding-left: 1.2rem; color: var(--muted); }

.section { padding: 3.5rem 0; }
.section-heading { margin-bottom: 1.5rem; }
.section-heading.wide { max-width: 840px; }

.article-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.article-card {
    padding: 1.35rem;
    transition: transform 150ms ease, border-color 150ms ease;
}
.article-card:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 233, 199, 0.35);
}
.article-card h2 { font-size: 1.35rem; margin-top: 0.3rem; }
.article-card h2 a { text-decoration: none; }
.article-card p { color: var(--muted); margin: 0.5rem 0 1rem; }

.article-meta {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.tag-row, .tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.tag-cloud { margin: 1rem 0 1.5rem; }
.tag {
    display: inline-flex;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
}
.tag:hover, .tag.active {
    color: var(--text);
    border-color: rgba(139, 233, 199, 0.45);
}
.pill {
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(156, 199, 255, 0.12);
    color: var(--accent-2);
}

.search-panel {
    padding: 1rem;
    margin: 1.5rem 0 1rem;
}
.search-panel label {
    display: block;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
}
input[type="search"] {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 1rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}
button {
    min-height: 46px;
    border: 0;
    border-radius: 999px;
    padding: 0 1.1rem;
    font-weight: 800;
    color: #06120d;
    background: var(--accent);
}

.article-shell { padding: 3rem 0 5rem; }
.article-page {
    max-width: 860px;
    margin-inline: auto;
}
.article-head {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--line);
}
.back-link {
    display: inline-block;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 1.25rem;
}
.prose {
    color: #dfe8f8;
    font-size: 1.05rem;
}
.prose h1, .prose h2, .prose h3 { margin-top: 2rem; }
.prose p, .prose ul, .prose ol { margin: 1rem 0; }
.prose a { color: var(--accent); }
.prose blockquote {
    margin: 1.5rem 0;
    padding: 0.1rem 1rem;
    border-left: 4px solid var(--accent);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}
.prose pre {
    overflow-x: auto;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #070b16;
}
.prose code {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.35rem;
    padding: 0.1rem 0.3rem;
}
.prose pre code {
    padding: 0;
    background: transparent;
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}
.prose th, .prose td {
    border: 1px solid var(--line);
    padding: 0.55rem;
}
.prose th { background: rgba(255, 255, 255, 0.06); }

.site-footer {
    border-top: 1px solid var(--line);
    padding: 2rem 0;
    color: var(--muted);
}
.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.muted { color: var(--muted); }

.htmx-request #article-results { opacity: 0.6; }

@media (max-width: 800px) {
    .hero-grid, .article-list { grid-template-columns: 1fr; }
    .search-row { grid-template-columns: 1fr; }
    .footer-grid, .nav-wrap { align-items: flex-start; flex-direction: column; }
    .nav-wrap { padding: 1rem 0; }
}
