﻿@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&display=swap");

:root {
    --bg: #0b1220;
    --paper: #121d31;
    --ink: #e8eef8;
    --muted: #a8b7cf;
    --accent: #67b1ff;
    --accent-2: #3ed0b2;
    --accent-soft: #0f1f36;
    --border: #243550;
    --shadow: 0 16px 42px rgba(1, 7, 16, 0.5);
    --measure: 68ch;
}

html[data-theme="light"] {
    --bg: #f4f6fb;
    --paper: #ffffff;
    --ink: #101a26;
    --muted: #596679;
    --accent: #0f67d8;
    --accent-2: #19a58a;
    --accent-soft: #e8f2ff;
    --border: #dfe6f2;
    --shadow: 0 16px 42px rgba(16, 32, 58, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(
            circle at 86% -10%,
            rgba(15, 103, 216, 0.16),
            transparent 34%
        ),
        radial-gradient(
            circle at -8% 18%,
            rgba(25, 165, 138, 0.12),
            transparent 36%
        ),
        var(--bg);
    font-family: "Source Serif 4", Georgia, serif;
    line-height: 1.75;
}

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

.site-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.site-nav-inner {
    width: min(1100px, 92%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    font-family: "Instrument Sans", sans-serif;
}

.brand {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 18px;
    font-size: 0.94rem;
}

.nav-links a {
    color: var(--ink);
    opacity: 0.8;
    text-decoration: none;
}

.theme-toggle {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    color: var(--ink);
    font: inherit;
    padding: 5px 11px;
    cursor: pointer;
}

.nav-links a:hover {
    opacity: 1;
}

.page {
    width: min(1100px, 92%);
    margin: 0 auto;
    padding: 34px 0 80px;
}

.hero {
    background: var(--paper);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 22px;
    padding: 30px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    right: -120px;
    top: -120px;
    width: 300px;
    height: 300px;
    border-radius: 999px;
    background: radial-gradient(
        circle,
        rgba(15, 103, 216, 0.22),
        rgba(15, 103, 216, 0)
    );
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
    align-items: end;
}

.hero-rail {
    display: grid;
    gap: 10px;
}

.metric {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    font-family: "Instrument Sans", sans-serif;
    background: color-mix(in srgb, var(--paper) 88%, var(--accent-soft));
}

.metric strong {
    display: block;
    font-size: 1.25rem;
    color: #0f67d8;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.badge {
    font-family: "Instrument Sans", sans-serif;
    font-size: 0.78rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 6px 10px;
}

.kicker {
    font-family: "Instrument Sans", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 10px;
}

h1 {
    margin: 0;
    font-family: "Instrument Sans", sans-serif;
    font-size: clamp(2rem, 3.6vw, 3.15rem);
    line-height: 1.1;
}

.dek {
    margin: 14px 0 0;
    max-width: 68ch;
    color: var(--muted);
    font-size: 1.09rem;
}

.meta {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    font-family: "Instrument Sans", sans-serif;
    font-size: 0.9rem;
    color: var(--muted);
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 24px;
    align-items: start;
}

article {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.prose {
    max-width: var(--measure);
}

.prose p {
    margin: 0 0 1.15em;
    font-size: 1.1rem;
}

.inline-visual {
    margin: 0 0 1.1em;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: color-mix(in srgb, var(--paper) 92%, var(--accent-soft));
}

.inline-visual img {
    width: min(256px, 100%);
    border-radius: 10px;
}

.inline-visual figcaption {
    margin-top: 8px;
    font-family: "Instrument Sans", sans-serif;
    font-size: 0.82rem;
    color: var(--muted);
}

.prose h2 {
    margin: 1.5em 0 0.65em;
    font-family: "Instrument Sans", sans-serif;
    font-size: 1.45rem;
    line-height: 1.25;
}

.prose h2::after {
    content: "";
    display: block;
    margin-top: 10px;
    width: 56px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.lead {
    font-size: 1.2rem;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.4em;
    font-family: "Instrument Sans", sans-serif;
    font-size: 0.95rem;
}

.prose th,
.prose td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}

.prose th {
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

.prose ul {
    margin: 0 0 1.2em;
    padding-left: 1.2em;
}

.prose li {
    margin-bottom: 0.6em;
}

.pull {
    margin: 1.4em 0;
    border-left: 4px solid var(--accent);
    padding: 0.3em 0 0.3em 1em;
    color: var(--ink);
    font-size: 1.12rem;
}

.aside {
    position: sticky;
    top: 76px;
    display: grid;
    gap: 14px;
}

.card {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.card.toc {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--paper) 95%, white) 0%,
        color-mix(in srgb, var(--paper) 96%, var(--accent-soft)) 100%
    );
}

.card h3 {
    margin: 0 0 10px;
    font-family: "Instrument Sans", sans-serif;
    font-size: 0.98rem;
}

.card ul {
    margin: 0;
    padding-left: 18px;
}

.card li {
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 0.95rem;
}

.source-list li {
    margin-bottom: 10px;
}

.source-list span {
    color: var(--muted);
    font-family: "Instrument Sans", sans-serif;
    font-size: 0.82rem;
}

.muted {
    color: var(--muted);
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .layout {
        grid-template-columns: 1fr;
    }
    .aside {
        position: static;
        order: -1;
    }
    .hero,
    article {
        padding: 22px;
    }
    .prose p {
        font-size: 1.05rem;
    }
}
