:root {
  color-scheme: light;
  --background: #f5f0e5;
  --text: #25211b;
  --muted: #746b5f;
  --code: #eae2d4;
  --link: #234f79;
  --visited: #68466f;
}

[data-theme='dark'] {
  color-scheme: dark;
  --background: #111;
  --text: #eee;
  --muted: #aaa;
  --code: #222;
  --link: #8ab4df;
  --visited: #c49bd0;
}

html { background: var(--background); }

body {
  max-width: 680px;
  margin: 0;
  padding: 48px 24px 32px;
  background: var(--background);
  color: var(--text);
  font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body.htmx-swapping { opacity: 0; }
body { transition: background-color 120ms, color 120ms, opacity 80ms; }
a { color: var(--link); }
a:visited { color: var(--visited); }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
img { max-width: 100%; height: auto; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 24px; top: 12px; }

.site-header { margin-bottom: 36px; }
.site-name {
  color: var(--text) !important;
  font-family: Fraunces, Georgia, serif;
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}
.site-header nav { margin-top: 8px; }

main > section, .about h2, .career-section, .archive-year { margin-top: 28px; }
h1, h2, h3, h4 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  line-height: 1.1;
}
h1 { margin: 0 0 16px; font-size: 34px; }
h2 { margin: 0 0 16px; font-size: 30px; }
h3 { margin: 0 0 6px; font-size: 24px; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 24px; }
li + li { margin-top: 8px; }
small, time, .archive-entry span { color: var(--muted); font-size: 14px; }

.post-list { list-style: none; padding: 0; }
.post-list small { display: block; margin-top: 1px; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 42px; }

.portrait { float: right; width: 220px; margin: 0 0 24px 32px; }
.portrait img { display: block; width: 100%; height: auto; }

.archive-year > h2 { font-size: 28px; }
.archive-year ol, .career-list { list-style: none; padding: 0; }
.archive-entry { margin-bottom: 22px; }
.archive-entry time { display: block; }
.archive-entry p { margin: 6px 0; }

.career-section + .career-section { margin-top: 48px; }
.career-list { margin-top: 20px; }
.career-group { margin-bottom: 38px; }
.organization { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.organization h3 { margin: 0; font-size: 28px; }
.logo { display: grid; width: 36px; height: 36px; place-items: center; flex: 0 0 36px; }
.logo img { display: block; width: 32px; height: 32px; object-fit: contain; }
.role-list { margin-left: 47px; }
.career-role + .career-role { margin-top: 28px; }
.role-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.role-heading h4 { margin: 0; font-size: 23px; }
.role-heading time { flex: 0 0 auto; text-align: right; }
.career-role .location { margin: 2px 0 10px; color: var(--muted); font-size: 14px; }
.career-role > p:not(.location), .career-role > ul { margin: 8px 0 0; }

.article { max-width: 680px; }
.article-header { margin-bottom: 28px; }
.article-header .kicker { margin-bottom: 8px; color: var(--muted); }
.article-header h1 { font-size: 46px; }
.article-lead { font-size: 18px; }
.byline { margin-top: 12px; color: var(--muted); font-size: 14px; }
.byline > * + *::before { content: ' · '; }
.article-cover { margin: 28px 0; }
.article-body { font-size: 18px; line-height: 1.65; }
.article-body h2, .article-body h3 { margin: 32px 0 12px; }
.article-body blockquote { margin: 24px 0; padding-left: 16px; border-left: 2px solid var(--muted); }
.article-body pre { margin: 24px 0; padding: 16px; overflow-x: auto; background: var(--code); }
.article-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
.article-body figure { margin: 24px 0; }
.article-body figcaption { color: var(--muted); font-size: 14px; }
.article-body hr { margin: 28px 0; border: 0; border-top: 1px solid var(--muted); }
.article-body .callout { margin: 20px 0; padding: 12px; background: var(--code); }
.article-body .bookmark { display: block; margin: 16px 0; overflow-wrap: anywhere; }
.notion-columns { display: flex; gap: 20px; }
.notion-columns > * { flex: 1; }
.next-prev { margin-top: 32px; }
.next-prev a { display: block; margin-top: 12px; }
.next-prev span { display: block; color: var(--muted); font-size: 14px; }
.next-prev strong { font-weight: 400; }

footer { margin-top: 72px; }
.theme-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
[data-theme='dark'] .theme-toggle { color: var(--link); }

@media (max-width: 600px) {
  body { padding: 28px 18px; }
  .site-header { margin-bottom: 30px; }
  .portrait { float: none; width: min(220px, 100%); margin: 0 0 28px; }
  .article-header h1 { font-size: 30px; }
  .role-list { margin-left: 0; }
  .role-heading { display: block; }
  .role-heading time { display: block; margin-top: 2px; text-align: left; }
  .notion-columns { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}
