:root {
    --bg: #fdfcf9;
    --bg-soft: #f5f2eb;
    --ink: #1f1d1a;
    --ink-soft: #5a554d;
    --rule: #d8d2c4;
    --accent: #2a4a7f;
    --accent-soft: #6b8bb5;
    --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Source Serif Pro", Georgia, serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --mono: "SF Mono", Menlo, Consolas, monospace;
    --measure: 38rem;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 18px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--serif);
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

.wrap-wide {
    max-width: 60rem;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

header.site {
    border-bottom: 1px solid var(--rule);
    padding: 1.25rem 1.5rem;
    background: var(--bg);
}

header.site .inner {
    max-width: 60rem;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1rem;
}

header.site .brand {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.01em;
}

header.site .brand em {
    font-style: italic;
    color: var(--ink-soft);
    font-weight: 400;
}

header.site nav a {
    font-family: var(--sans);
    font-size: 0.85rem;
    color: var(--ink-soft);
    text-decoration: none;
    margin-left: 1.25rem;
    letter-spacing: 0.02em;
}

header.site nav a:hover,
header.site nav a.current {
    color: var(--accent);
}

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.25;
    color: var(--ink);
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
}

h1 {
    font-size: 2.1rem;
    letter-spacing: -0.01em;
    margin-top: 1rem;
}

h2 {
    font-size: 1.4rem;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.35rem;
}

h3 {
    font-size: 1.1rem;
    color: var(--ink-soft);
    font-style: italic;
    font-weight: 500;
}

p, li {
    font-size: 1rem;
}

p {
    margin: 0 0 1.1rem;
}

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-soft);
}

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

blockquote {
    margin: 1.5rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 2px solid var(--accent-soft);
    color: var(--ink-soft);
    font-style: italic;
}

code, pre {
    font-family: var(--mono);
    font-size: 0.9rem;
}

code {
    background: var(--bg-soft);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

hr {
    border: 0;
    border-top: 1px solid var(--rule);
    margin: 2.5rem 0;
}

ul, ol {
    padding-left: 1.4rem;
}

li {
    margin-bottom: 0.4rem;
}

.lede {
    font-size: 1.15rem;
    color: var(--ink-soft);
    font-style: italic;
    margin-bottom: 2rem;
}

.kicker {
    font-family: var(--sans);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.meta {
    font-family: var(--sans);
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-bottom: 2rem;
}

footer.site {
    border-top: 1px solid var(--rule);
    padding: 2rem 1.5rem;
    margin-top: 3rem;
    color: var(--ink-soft);
    font-size: 0.85rem;
    font-family: var(--sans);
}

footer.site .inner {
    max-width: 60rem;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ---- Landing page specifics ---- */

.hero {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-size: 2.4rem;
    margin-bottom: 0.75rem;
    max-width: 30ch;
}

.hero p.lede {
    max-width: 50ch;
    font-size: 1.2rem;
}

.section-title {
    font-family: var(--sans);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-soft);
    font-weight: 600;
    margin: 2.5rem 0 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--rule);
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 1.25rem 2rem;
}

.topic-card {
    border-top: 2px solid var(--ink);
    padding-top: 0.9rem;
    display: block;
    color: inherit;
    border-bottom: 0;
}

.topic-card h3 {
    font-style: normal;
    color: var(--ink);
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 0 0.4rem;
}

.topic-card .author {
    font-family: var(--sans);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.5rem;
    display: block;
}

.topic-card p {
    font-size: 0.95rem;
    color: var(--ink-soft);
    margin: 0;
}

.topic-card:hover h3 {
    color: var(--accent);
}

.note-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.note-list li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
    display: flex;
    gap: 1.5rem;
    align-items: baseline;
}

.note-list .date {
    font-family: var(--sans);
    font-size: 0.8rem;
    color: var(--ink-soft);
    flex: 0 0 6rem;
    letter-spacing: 0.04em;
}

.note-list a {
    border-bottom: 0;
    color: var(--ink);
    font-weight: 500;
}

.note-list a:hover {
    color: var(--accent);
}

.empty {
    color: var(--ink-soft);
    font-style: italic;
    padding: 1rem 0;
}

/* ---- Topic page specifics ---- */

.topic-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule);
}

.concept-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.concept-list li {
    padding: 0.9rem 0 0.9rem 1.5rem;
    border-bottom: 1px solid var(--rule);
    position: relative;
}

.concept-list li::before {
    content: "§";
    position: absolute;
    left: 0;
    color: var(--accent-soft);
    font-weight: 600;
}

.concept-list strong {
    display: block;
    color: var(--ink);
    margin-bottom: 0.2rem;
}

.callout {
    background: var(--bg-soft);
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--accent);
    margin: 1.75rem 0;
    font-size: 0.95rem;
}

.callout .label {
    font-family: var(--sans);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    font-weight: 600;
    display: block;
    margin-bottom: 0.4rem;
}

.further {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}

.further h3 {
    font-style: normal;
    color: var(--ink);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--sans);
    font-weight: 600;
}

.further ul {
    list-style: none;
    padding: 0;
}

.further li {
    padding: 0.4rem 0;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

@media (max-width: 600px) {
    html { font-size: 17px; }
    .hero h1 { font-size: 1.9rem; }
    .note-list li { flex-direction: column; gap: 0.25rem; }
    .note-list .date { flex: none; }
}
