:root {
  /* warm ivory / slate palette */
  --bg: #faf9f5;
  --fg: #1f1e1d;
  --muted: #5e5d59;
  --rule: #e8e6dc;
  --link: #a6522e;
  --link-hover: #8a3f1f;
  --maxw: 760px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1f1e1d;
    --fg: #f0eee6;
    --muted: #b0aea5;
    --rule: #3d3d3a;
    --link: #e0997b;
    --link-hover: #f0b9a0;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- navigation ---------- */

nav {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 24px;
  display: flex;
  align-items: baseline;
  gap: 1.6rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

nav a:hover { color: var(--fg); }

nav a[aria-current="page"] { color: var(--fg); font-weight: 600; }

/* ---------- layout ---------- */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4rem 24px 6rem;
}

h1 {
  font-size: 2.4rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.tagline {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 2.6rem;
}

h2 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 3rem 0 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
}

p { margin: 0 0 1.15rem; }

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

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

/* ---------- about ---------- */

.intro {
  display: flex;
  align-items: center;
  gap: 1.9rem;
  margin-bottom: 2.6rem;
}

.intro-text { min-width: 0; }

.intro h1 { margin-bottom: 0.45rem; }

.intro .iconlinks { margin: 0; }

.portrait {
  flex: 0 0 auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
}

.iconlinks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.4rem;
  margin: 0.2rem 0 2.6rem;
}

.iconlinks a {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.iconlinks a:hover {
  color: var(--fg);
  text-decoration: none;
}

.iconlinks svg { display: block; flex: 0 0 auto; }

.facts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.facts li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.facts li:last-child { border-bottom: none; }

.facts .when {
  color: var(--muted);
  font-size: 0.85rem;
  flex: 0 0 6.5rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- publications ---------- */

.paper {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.8rem;
  padding: 2.2rem 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}

.paper:first-of-type { border-top: none; padding-top: 0.5rem; }

.paper.no-img { grid-template-columns: 1fr; }

.paper-img {
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.paper h3 {
  margin: 0 0 0.35rem;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.authors {
  margin: 0 0 0.2rem;
  font-size: 0.93rem;
  color: var(--muted);
}

.venue {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
}

.tldr {
  margin: 0.8rem 0 0;
  padding-left: 0.85rem;
  border-left: 2px solid var(--rule);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--fg);
}

.abstract {
  margin: 0.9rem 0 0;
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.55;
}

details.abs > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.88rem;
  color: var(--link);
  margin-top: 0.7rem;
  display: inline-block;
}

details.abs > summary::-webkit-details-marker { display: none; }

details.abs > summary::after { content: " ›"; }

details.abs[open] > summary::after { content: " ‹"; }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  main { padding-top: 2.6rem; }
  .intro { gap: 1.2rem; }
  .portrait { width: 104px; height: 104px; }
  .intro h1 { font-size: 1.75rem; }
  h1 { font-size: 2rem; }
  .paper { grid-template-columns: 1fr; gap: 1rem; }
  .paper-img { max-width: 420px; }
  .nav-inner { gap: 1.1rem; padding-left: 20px; padding-right: 20px; }
  .facts li { flex-direction: column; gap: 0.15rem; }
  .facts .when { flex: none; }
}

@media (max-width: 520px) {
  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .portrait { width: 96px; height: 96px; }
  .intro h1 { font-size: 1.9rem; }
}
