:root {
  --bg: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --accent: #1f5f6b;
  --rule: #e6e6e9;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

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

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header / nav */
header.site {
  padding: 2.5rem 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

header.site .brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

nav.site a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.95rem;
}

nav.site a:hover,
nav.site a[aria-current="page"] {
  color: var(--accent);
}

/* Typography */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.6rem;
}

h1 { font-size: 2.1rem; }
h2 {
  font-size: 1.35rem;
  margin-top: 2.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
h3 { font-size: 1.05rem; margin-top: 1.5rem; }

p { margin: 0 0 1rem; }

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* Interests */
ul.interests {
  padding-left: 1.2rem;
  margin: 0;
  columns: 2;
  column-gap: 2rem;
}
ul.interests li { break-inside: avoid; margin-bottom: 0.25rem; }

/* Research cards */
.project {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
.project:last-child { border-bottom: none; }
.project h3 { margin-top: 0; }
.project .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.project p:last-child { margin-bottom: 0; }

ul.past { padding-left: 1.2rem; }
ul.past li { margin-bottom: 0.5rem; }

/* Publications */
ol.pubs, ul.pubs {
  padding-left: 0;
  list-style: none;
}
.pubs li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.pubs li:last-child { border-bottom: none; }
.pubs .me { font-weight: 600; }
.pubs .note { color: var(--muted); font-size: 0.9rem; }

/* CV */
.cv-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1.5rem;
  margin-bottom: 1.1rem;
}
.cv-entry .title { font-weight: 600; }
.cv-entry .where { color: var(--muted); }
.cv-entry .when { color: var(--muted); font-size: 0.9rem; white-space: nowrap; text-align: right; }
.cv-entry ul { grid-column: 1 / -1; margin: 0.3rem 0 0; padding-left: 1.2rem; }
.cv-entry ul li { margin-bottom: 0.25rem; }

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}
.btn:hover { background: var(--accent); color: #fff; }

dl.skills { margin: 0; }
dl.skills dt { font-weight: 600; margin-top: 0.6rem; }
dl.skills dd { margin: 0; color: var(--text); }

/* Footer */
footer.site {
  margin: 4rem 0 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

@media (max-width: 600px) {
  html { font-size: 16px; }
  ul.interests { columns: 1; }
  .cv-entry { grid-template-columns: 1fr; }
  .cv-entry .when { text-align: left; }
  nav.site a { margin-left: 0; margin-right: 1.25rem; }
}

/* Sidebar layout */
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
  margin-top: 1rem;
}
.side {
  position: sticky;
  top: 2rem;
}
.side .avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 1rem;
}
.side-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}
.side-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.6rem; }
.side-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 1rem; }
.side-links { list-style: none; padding: 0; margin: 0; font-size: 0.92rem; }
.side-links li { margin-bottom: 0.45rem; }
.side-links a { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text); text-decoration: none; }
.side-links a:hover { color: var(--accent); }
.side-links svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--muted); }
.side-links a:hover svg { color: var(--accent); }

main > section:first-child h1 { margin-top: 0.25rem; }
main h1 { font-size: 1.9rem; }

.contact { margin-top: 1rem; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .side { position: static; display: grid; grid-template-columns: 84px 1fr; column-gap: 1rem; align-items: center; }
  .side .avatar { width: 84px; height: 84px; margin: 0; grid-row: 1 / span 3; }
  .side-desc { grid-column: 2; margin-bottom: 0.5rem; }
  .side-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.3rem 1.25rem; margin-top: 0.5rem; }
  .side-links li { margin: 0; }
}
