:root {
  --fg: #1a1a1a;
  --muted: #555;
  --bg: #fdfdfd;
  --rule: #e5e5e5;
  --link: #0b5fae;
  --accent: #b45309;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e8e8;
    --muted: #a0a0a0;
    --bg: #111;
    --rule: #2a2a2a;
    --link: #7ab2ff;
    --accent: #f4a261;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font: 16px/1.6 ui-serif, Georgia, "Times New Roman", serif;
  color: var(--fg);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 38rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

/* Header with avatar */
header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.intro { flex: 1; min-width: 0; }

.avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--rule);
}

h1 {
  font-size: 1.75rem;
  margin: 0 0 0.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0;
  color: var(--muted);
}

section { margin: 2rem 0; }

h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

p { margin: 0 0 0.85rem; }

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

a {
  color: var(--link);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

ul, ol {
  margin: 0;
  padding-left: 1.25rem;
}

li { margin: 0.25rem 0; }

/* Research interests as inline keywords */
.tags {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.tags li { display: inline; margin: 0; }

.tags li:not(:last-child)::after {
  content: " · ";
  color: var(--muted);
}

/* News timeline */
.news {
  list-style: none;
  padding-left: 0;
}

.news li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.6rem;
  margin: 0.5rem 0;
}

.news time {
  color: var(--muted);
  font-variant: small-caps;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
}

.older-news {
  margin-top: 0.4rem;
}

.older-news summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant: small-caps;
  letter-spacing: 0.05em;
  padding: 0.25rem 0;
  list-style: none;
}

.older-news summary::-webkit-details-marker { display: none; }
.older-news summary::marker { content: ''; }

.older-news summary::before {
  content: "▸  ";
  display: inline-block;
  width: 0.9rem;
}

.older-news[open] summary::before {
  content: "▾  ";
}

.older-news .news { margin-top: 0.3rem; }

/* Talks */
.talks {
  list-style: none;
  padding-left: 0;
}

.talks li { margin: 0.75rem 0; }

.talks .title { font-weight: 400; }
.talks .title::before { content: "\201C"; }
.talks .title::after  { content: "\201D"; }

.talks .venue {
  color: var(--muted);
  font-style: italic;
  font-size: 0.95rem;
}

.talks .links {
  margin-left: 0.15rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.talks .links a::before { content: "["; color: var(--muted); }
.talks .links a::after  { content: "]"; color: var(--muted); }

/* Publications */
.profile-links {
  margin: -0.25rem 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.pubs {
  list-style: none;
  padding-left: 0;
}

.pubs li { margin: 0.75rem 0; }

.pub-id {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  font-size: 0.82rem;
  color: var(--muted);
  margin-right: 0.1rem;
}

.pub-id a { color: var(--muted); }

.pubs .title { font-weight: 400; }

.pubs .venue {
  color: var(--muted);
  font-style: italic;
  font-size: 0.95rem;
}

.pubs .note { color: var(--muted); font-size: 0.95rem; }

.pubs .links {
  margin-left: 0.25rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.pubs .links a:hover { text-decoration: underline; }
.pubs .links a::before { content: "["; color: var(--muted); }
.pubs .links a::after  { content: "]"; color: var(--muted); }

/* Contact dl */
dl {
  margin: 0;
  display: grid;
  grid-template-columns: 7rem 1fr;
  row-gap: 0.55rem;
}

dt {
  color: var(--muted);
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

dd { margin: 0; }

#contact dd strong {
  font-weight: 600;
  color: var(--fg);
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  main { padding: 2rem 1rem 3rem; }
  header { gap: 1rem; }
  .avatar { width: 64px; height: 64px; }
  dl { grid-template-columns: 1fr; row-gap: 0; }
  dt { margin-top: 0.5rem; }
  .news li { grid-template-columns: 1fr; gap: 0; }
  .news time { display: block; }
}

@media print {
  :root {
    --fg: #000;
    --muted: #444;
    --bg: #fff;
    --rule: #aaa;
    --link: #000;
  }

  body {
    font: 10.5pt/1.4 ui-serif, Georgia, "Times New Roman", serif;
    background: #fff;
    color: #000;
  }

  main { max-width: 100%; padding: 0; }

  header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
  }

  .avatar { width: 60px; height: 60px; }

  section { margin: 1rem 0; page-break-inside: avoid; }

  h1 { font-size: 16pt; }
  h2 { font-size: 9pt; margin-bottom: 0.4rem; }
  h3 { font-size: 10pt; margin: 0.8rem 0 0.3rem; }

  a { color: #000; text-decoration: none; }

  /* Force the older-news disclosure open in print */
  details.older-news > summary { display: none; }
  details.older-news > *:not(summary) { display: block !important; }

  /* Avoid awkward breaks inside list items */
  .pubs li, .news li, .talks li { page-break-inside: avoid; }

  /* Footer compact */
  footer { margin-top: 1.5rem; padding-top: 0.5rem; font-size: 9pt; }
}
