:root {
    --bg: #f4ede0;
    --paper: #fbf6ec;
    --ink: #1a1614;
    --muted: #6b5e51;
    --rule: #d8cdb6;
    --accent: #b04510;
    --accent-soft: #f3e2d2;
    --recording: #c0392b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); }
body { font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif; color: var(--ink); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
a:hover { color: var(--ink); }

.serif { font-family: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif; font-weight: 500; letter-spacing: -0.01em; }
.mono { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace; }

/* Site header & footer (shared, layout-specific widths set per layout) */
header.site { display: flex; align-items: baseline; justify-content: space-between; gap: 2rem; padding: 1.75rem 2rem 1rem; max-width: 1100px; margin: 0 auto; border-bottom: 1px solid var(--rule); }
header.site .name { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
header.site .name a { color: var(--ink); text-decoration: none; }
header.site .name a:hover { color: var(--accent); }
header.site .role { font-size: 0.85rem; color: var(--muted); }
header.site a { color: var(--muted); text-decoration: none; font-size: 0.85rem; letter-spacing: 0.02em; }
header.site a:hover { color: var(--accent); }
header.site .nav { display: flex; gap: 1.5rem; }
header.site .nav a { font-weight: 500; }

main { max-width: 1100px; margin: 0 auto; padding: 2.5rem 2rem 4rem; }

footer.site { text-align: center; padding: 2.5rem 2rem; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--rule); max-width: 1100px; margin: 0 auto; }
footer.site a { color: var(--accent); text-decoration: none; }

/* Talk detail layout (narrower content) */
.talk-layout header.site,
.talk-layout main,
.talk-layout footer.site { max-width: 760px; }
.talk-layout body { line-height: 1.65; }
.talk-layout header.site { display: block; }

.talk-header { padding-bottom: 2rem; border-bottom: 1px solid var(--rule); margin-bottom: 2rem; }
.conference-badge { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; }
.conference-badge a { color: var(--accent); font-weight: 600; text-decoration: none; }
.conference-badge a:hover { text-decoration: underline; }
.conference-badge .name { color: var(--accent); font-weight: 600; }
h1 { font-family: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif; font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.15; letter-spacing: -0.01em; font-weight: 500; margin-bottom: 1.25rem; }
.meta { display: flex; flex-wrap: wrap; gap: 1.5rem; color: var(--muted); font-size: 0.85rem; margin-bottom: 1.5rem; }
.meta .label { display: block; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.15rem; }
.meta .value { color: var(--ink); }
.links { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.55rem 1.1rem; font-size: 0.85rem; font-weight: 600; text-decoration: none; border: 1px solid var(--ink); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-secondary { background: transparent; color: var(--ink); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.abstract { color: var(--ink); }
.abstract h2 { font-family: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 1rem; }
.abstract p { font-size: 1.05rem; line-height: 1.7; max-width: 65ch; }
.abstract p + p { margin-top: 1rem; }

/* Hero (home) */
.hero { display: grid; gap: 2rem; align-items: end; margin-bottom: 2.5rem; }
@media (min-width: 800px) { .hero { grid-template-columns: 1.1fr 1fr; gap: 3rem; } }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); line-height: 1.05; margin-bottom: 1rem; }
.hero p { font-size: 1.05rem; color: var(--muted); max-width: 38ch; }
.hero .count { display: inline-block; margin-top: 1rem; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 0.6rem; }
.hero .count strong { color: var(--ink); font-weight: 600; }

/* Map (home only, harmless on talk pages) */
#map { height: 320px; border: 1px solid var(--rule); background: var(--paper); }
#map .leaflet-control-attribution { background: rgba(251,246,236,0.8); }
#map .leaflet-popup-content { font-family: inherit; font-size: 0.85rem; line-height: 1.5; margin: 0.6rem 0.75rem; }
#map .leaflet-popup-content .city { font-weight: 600; margin-bottom: 0.35rem; }
#map .leaflet-popup-content a { display: block; color: var(--ink); text-decoration: none; padding: 0.15rem 0; }
#map .leaflet-popup-content a:hover { color: var(--accent); }
#map .leaflet-popup-content .yr { color: var(--muted); margin-right: 0.4rem; }

/* Talks grid (home) */
.talks-section h2 { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.25rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--rule); }
.talks-grid { display: grid; gap: 0; grid-template-columns: 1fr; }
@media (min-width: 720px) { .talks-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .talks-grid { grid-template-columns: repeat(3, 1fr); } }
.talk-card { display: flex; flex-direction: column; padding: 1.25rem 1.25rem 1.5rem; text-decoration: none; color: inherit; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); transition: background 0.15s; }
.talk-card:hover { background: var(--paper); }
.talks-grid .talk-card:nth-child(3n) { border-right: none; }
@media (max-width: 999px) and (min-width: 720px) { .talks-grid .talk-card:nth-child(3n) { border-right: 1px solid var(--rule); } .talks-grid .talk-card:nth-child(2n) { border-right: none; } }
@media (max-width: 719px) { .talks-grid .talk-card { border-right: none; } }
.talk-card .conference { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.talk-card .conference .name { color: var(--accent); font-weight: 600; }
.talk-card h3 { font-size: 1.15rem; line-height: 1.3; margin-bottom: 0.85rem; flex-grow: 1; }
.talk-card .meta { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); }
.talk-card .meta .recording { color: var(--recording); font-weight: 600; letter-spacing: 0.02em; }

/* About page */
.about { max-width: 720px; }
.about-intro { display: flex; flex-direction: column; gap: 1.5rem; align-items: flex-start; margin-bottom: 2.25rem; padding-bottom: 2.25rem; border-bottom: 1px solid var(--rule); }
@media (min-width: 600px) { .about-intro { flex-direction: row; align-items: center; gap: 2rem; } }
.about-photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; filter: contrast(1.02); flex-shrink: 0; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
@media (min-width: 600px) { .about-photo { width: 200px; height: 200px; } }
.about h1 { font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.1; margin-bottom: 0.5rem; }
.about .lede { font-size: 1.1rem; color: var(--muted); line-height: 1.55; }
.about-prose p { font-size: 1.05rem; line-height: 1.7; margin-bottom: 1.1rem; max-width: 65ch; }
.about-heading { font-family: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 2.75rem 0 1rem; }
.socials { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 0; grid-template-columns: 1fr; border-top: 1px solid var(--rule); }
@media (min-width: 600px) { .socials { grid-template-columns: 1fr 1fr; } }
.socials li { border-bottom: 1px solid var(--rule); }
@media (min-width: 600px) { .socials li:nth-child(odd) { border-right: 1px solid var(--rule); } }
.socials a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.85rem 1rem; color: var(--ink); text-decoration: none; transition: background 0.15s; }
.socials a:hover { background: var(--paper); color: var(--accent); }
.socials .handle { font-weight: 600; font-size: 0.95rem; }
.socials .at { color: var(--muted); font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace; font-size: 0.82rem; }
.socials a:hover .at { color: var(--accent); }
.about .cta { color: var(--muted); font-size: 0.95rem; max-width: 65ch; }

/* Tags (shared) */
.tag { display: inline-block; font-size: 0.65rem; letter-spacing: 0.08em; padding: 0.1rem 0.45rem; border: 1px solid currentColor; }
.tag.talk { color: var(--muted); }
.tag.deepdive { color: #1d4ed8; }
.tag.workshop { color: #6d28d9; }
.tag.podcast { color: #047857; }
.tag.techtalk { color: #b45309; }
