:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #1e1c19;
  --muted: #6a655d;
  --line: #e6e1d8;
  --accent: #2c5f5d;
  --accent-soft: #e3eeec;
  --todo: #fff3c4;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --surface: #1f1e1c;
    --ink: #ebe7e0;
    --muted: #a39d93;
    --line: #34312d;
    --accent: #7fb9b4;
    --accent-soft: #23302f;
    --todo: #4a3f12;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
}

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-top: 1.4rem; padding-bottom: 1.1rem;
}
.site-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-family: var(--sans); font-size: 0.9rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom: 2px solid var(--accent); }
.ext::after { content: " ↗"; font-size: 0.8em; }

main { padding: 2.75rem 0 4rem; }

h1, h2, h3 { line-height: 1.25; font-weight: 600; }
h1 { font-size: 2.1rem; margin: 0 0 0.4rem; letter-spacing: -0.01em; }
h2 {
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin: 3.25rem 0 1.25rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--line);
}
h3 { font-size: 1.15rem; margin: 0 0 0.3rem; }

.lede { color: var(--muted); font-size: 1.05rem; margin: 0 0 2rem; }

/* ---------- about ---------- */
.intro { display: grid; grid-template-columns: 9.5rem 1fr; gap: 2rem; align-items: center; margin-bottom: 2rem; }
/* cut-out portrait: the head rises out of a soft circle */
.portrait { --r: 4.75rem; position: relative; width: calc(var(--r) * 2); height: calc(var(--r) * 2); margin-top: 1rem; }
.portrait::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent-soft); }
.portrait img {
  /* 15% wider than the circle, so the hair rises above it; the bottom follows the circle's curve */
  position: absolute; bottom: 0; left: -7.5%; width: 115%; height: auto; display: block;
  clip-path: inset(-10% 6.52% 0 6.52% round 0 0 var(--r) var(--r));
}
.intro h1 { margin-bottom: 0.25rem; }
.tagline { margin: 0; color: var(--muted); font-size: 1.1rem; }

.links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.9rem 0 0; padding: 0; list-style: none; font-family: var(--sans); font-size: 0.85rem; }
.links a {
  display: inline-block; padding: 0.3rem 0.75rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); text-decoration: none; background: var(--surface);
}
.links a:hover { border-color: var(--accent); color: var(--accent); }

.callout {
  background: var(--accent-soft); border-radius: 0.6rem; padding: 0.9rem 1.15rem; margin: 1.75rem 0;
}
.callout p { margin: 0; }

/* ---------- simple dated lists ---------- */
.dated { list-style: none; margin: 0; padding: 0; }
.dated li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 0.5rem 0; }
.dated .when { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); padding-top: 0.2rem; }
.dated .what { margin: 0; }
.dated .note { display: block; color: var(--muted); font-size: 0.98rem; }

/* ---------- research cards ---------- */
.papers { display: grid; gap: 1.25rem; }
.paper {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.4rem; align-items: start;
  padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.75rem;
}
.cover { display: block; position: relative; }
.cover img {
  width: 100%; aspect-ratio: 210 / 280; object-fit: cover; object-position: top; display: block;
  border: 1px solid var(--line); border-radius: 3px; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 14px -6px rgba(0,0,0,.18);
  transition: transform .18s ease, box-shadow .18s ease;
}
.cover:hover img { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 12px 22px -8px rgba(0,0,0,.28); }
.paper h3 a { color: var(--ink); text-decoration: none; }
.paper h3 a:hover { color: var(--accent); }
.meta { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin: 0 0 0.6rem; }
.paper p.summary { margin: 0 0 0.75rem; font-size: 1.02rem; }
.paper .links { margin-top: 0; }

/* ---------- experience / events ---------- */
.events { display: grid; gap: 1rem; }
.event { padding: 1.1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.75rem; }
.event p { margin: 0; font-size: 1.02rem; }
.event .meta { margin-bottom: 0.35rem; }
.event img { width: 100%; border-radius: 0.5rem; margin-top: 0.8rem; display: block; }

.todo { background: var(--todo); padding: 0 0.25em; border-radius: 3px; font-style: italic; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; padding-top: 1.25rem; padding-bottom: 2rem; }
.site-footer a { color: var(--muted); }

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  body { font-size: 1.05rem; }
  h1 { font-size: 1.75rem; }
  .intro { grid-template-columns: 1fr; gap: 1.1rem; }
  .portrait { --r: 3.75rem; }
  .paper { grid-template-columns: 1fr; gap: 0.9rem; padding: 1rem; }
  .paper .cover { width: 6.5rem; }
  .dated li { grid-template-columns: 1fr; gap: 0; }
}
