:root {
  --bg: #fdfcfa;
  --fg: #1f2328;
  --muted: #5c636b;
  --rule: #e4e1dc;
  --accent: #8a2c2c;
  --tag-bg: #f3efe9;
  --footer-bg: #f5f3ef;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181b;
    --fg: #e6e4e0;
    --muted: #9ba1a8;
    --rule: #2c3035;
    --accent: #e08b7b;
    --tag-bg: #23272b;
    --footer-bg: #1c1f22;
  }
}
:root[data-theme="dark"] {
  --bg: #16181b;
  --fg: #e6e4e0;
  --muted: #9ba1a8;
  --rule: #2c3035;
  --accent: #e08b7b;
  --tag-bg: #23272b;
  --footer-bg: #1c1f22;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.sans { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }

/* Top navigation */
nav.top {
  border-bottom: 1px solid var(--rule);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
nav.top .inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px;
}
nav.top .brand { font-weight: 600; color: var(--fg); margin-right: 20px; }
nav.top a.item { color: var(--fg); font-size: 0.95rem; }
nav.top a.item[aria-current="page"] { color: var(--accent); }
nav.top button.theme {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  padding: 4px; display: inline-flex; margin-left: auto;
}
nav.top button.theme svg { width: 18px; height: 18px; }

/* Two-column body */
.layout {
  max-width: 1100px; width: 100%; margin: 0 auto; padding: 40px 24px 64px;
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px;
  flex: 1;
}
aside.profile img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block;
}
aside.profile .name { font-size: 1.25rem; font-weight: 600; margin: 16px 0 2px; }
aside.profile .pronouns {
  font-size: 0.8rem; font-weight: 400; color: var(--muted);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
aside.profile .title { color: var(--muted); font-size: 0.95rem; margin: 0 0 16px; }
aside.profile ul {
  list-style: none; padding: 0; margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 0.85rem;
}
aside.profile li { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; color: var(--muted); }
aside.profile li svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Content */
article h1 { font-size: 1.9rem; font-weight: 600; margin: 0 0 18px; letter-spacing: -0.01em; }
article h2 {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--rule); padding-bottom: 6px; margin: 40px 0 18px;
}
article h1 + h2 { margin-top: 8px; }
article p { margin: 0 0 14px; }
article ul.bullets { padding-left: 1.2em; margin: 0 0 14px; }

.paper { margin: 0 0 24px; }
.paper .ptitle { font-weight: 600; }
.paper .meta { color: var(--muted); font-size: 0.95rem; }
.paper .tags {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 0.8rem;
  margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px;
}
.paper .tags span { background: var(--tag-bg); padding: 1px 8px; border-radius: 3px; }
details summary { cursor: pointer; color: var(--accent); list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+ "; }
details[open] summary::before { content: "− "; }
details p { margin: 6px 0 0; font-size: 0.95rem; }

article p.note {
  color: var(--muted); font-size: 0.8rem; margin-top: 18px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

ul.dated { list-style: none; padding: 0; margin: 0; }
ul.dated li { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
ul.dated .when { color: var(--muted); white-space: nowrap; font-size: 0.95rem; }
ul.dated .sub { display: block; color: var(--muted); font-size: 0.95rem; }

footer {
  background: var(--footer-bg); border-top: 1px solid var(--rule);
  color: var(--muted); font-size: 0.8rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
footer .inner { max-width: 1100px; margin: 0 auto; padding: 18px 24px; }

@media (max-width: 760px) {
  nav.top .inner { padding: 12px 16px; gap: 6px 18px; }
  nav.top .brand { width: 100%; margin-right: 0; }
  nav.top .inner { position: relative; }
  nav.top button.theme { position: absolute; top: 10px; right: 12px; }
  .layout { grid-template-columns: 1fr; gap: 28px; padding: 24px 16px 48px; }
  aside.profile {
    display: grid; grid-template-columns: 110px 1fr; gap: 0 18px; align-items: start;
    border-bottom: 1px solid var(--rule); padding-bottom: 20px;
  }
  aside.profile img { grid-row: span 3; }
  aside.profile .name { margin-top: 0; }
  aside.profile .title { margin-bottom: 10px; }
  aside.profile ul { grid-column: 2; }
  aside.profile li { margin-bottom: 6px; }
  footer .inner { padding: 16px; }
}
