:root {
    color-scheme: light dark;
    --bg: #f6f5f1;
    --surface: #ffffff;
    --text: #222525;
    --muted: #686d6d;
    --rule: #d9d9d4;
    --accent: #315b68;
    --accent-hover: #193f4b;
    --soft: #ecefeb;
    --shadow: 0 10px 30px rgba(25, 35, 35, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

main,
.site-header,
.site-footer {
    width: min(900px, calc(100% - 40px));
    margin-inline: auto;
}

.site-header {
    padding: 72px 0 38px;
    border-bottom: 1px solid var(--rule);
}

.site-header.compact { padding-top: 44px; }

.eyebrow {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-weight: 500;
    line-height: 1.18;
    text-wrap: balance;
}

h1 {
    margin: 0;
    font-size: clamp(2.5rem, 7vw, 4.6rem);
    letter-spacing: -0.035em;
}

h2 {
    margin: 0 0 20px;
    font-size: clamp(1.55rem, 4vw, 2rem);
}

h3 {
    margin: 0;
    font-size: 1.25rem;
}

.lede {
    max-width: 650px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.08rem;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

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

main { padding: 42px 0 68px; }

.collection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.card,
.program-card {
    display: block;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 10px;
    box-shadow: var(--shadow);
    color: inherit;
    text-decoration: none;
    transition: transform 120ms ease, border-color 120ms ease;
}

.card:hover,
.program-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    color: inherit;
}

.card .meta,
.program-card .meta,
.meta {
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.92rem;
}

.card p,
.program-card p {
    margin: 14px 0 0;
    color: var(--muted);
}

.section { margin-top: 42px; }

.breadcrumbs {
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 0.9rem;
}

.breadcrumbs a { color: inherit; }

.volume-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 30px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--rule);
}

.volume-meta strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.volume-meta span { color: var(--muted); }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 30px 0 0;
}

.button {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 0.94rem;
    font-weight: 600;
    text-decoration: none;
}

.button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.button.secondary {
    background: transparent;
    color: var(--accent);
}

.button.secondary:hover {
    background: var(--soft);
    color: var(--accent-hover);
}

.lecture-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}

.lecture-list li {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--rule);
}

.lecture-number {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.site-footer {
    padding: 24px 0 38px;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.85rem;
}

.site-footer a { color: inherit; }

@media (max-width: 650px) {
    body { font-size: 16px; }
    .site-header { padding-top: 48px; }
    .collection-grid,
    .volume-meta { grid-template-columns: 1fr; }
    .lecture-list li {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161918;
        --surface: #1d2120;
        --text: #eceeeb;
        --muted: #a6aaa7;
        --rule: #363b39;
        --accent: #91bac4;
        --accent-hover: #b7d3da;
        --soft: #252a28;
        --shadow: none;
    }

    .button { color: #142023; }
    .button:hover { color: #142023; }
}
