/* Site-wide styles. Colors are tokens on :root, with a dark-mode override below. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c1f26;
  --muted: #5b6270;
  --line: #e6e2da;
  --accent: #7a1f2b;
  --accent-soft: #f5e9ea;
  --chip: #f1eee8;
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 4px 16px rgba(20, 20, 30, .05);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --surface: #1a1d23;
    --ink: #e9e7e2;
    --muted: #a2a7b1;
    --line: #2b2f37;
    --accent: #e39aa3;
    --accent-soft: #2a1d20;
    --chip: #23262d;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

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

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 100; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; line-height: 1.3; color: var(--ink); text-decoration: none; }
.brand small { display: block; font-family: var(--sans); font-weight: 400; font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: .93rem;
  padding: 6px 12px; border-radius: 6px;
}
.nav a:hover { color: var(--ink); background: var(--chip); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink); padding: 6px 10px; font: inherit; font-size: .9rem; cursor: pointer;
}

@media (max-width: 760px) {
  .brand small { display: none; }
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
}

/* Sections */
main { padding-bottom: 32px; }
section { padding: 48px 0; }
section + section { border-top: 1px solid var(--line); }
.page-head { padding: 56px 0 24px; }
.page-head p { color: var(--muted); max-width: 680px; font-size: 1.05rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; font-weight: 600; color: var(--accent); margin-bottom: .6em; }
.muted { color: var(--muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: .92rem; white-space: nowrap; }

/* Hero */
.hero { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start; padding: 64px 0 48px; }
.hero img { width: 240px; height: 240px; object-fit: cover; border-radius: 12px; box-shadow: var(--shadow); }
.hero .role { font-size: 1.05rem; color: var(--muted); margin-bottom: 1.2em; }
.hero .role strong { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 40px; }
  .hero img { width: 160px; height: 160px; }
}

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 8px; font-size: .9rem; font-weight: 500;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.primary:hover { opacity: .9; color: var(--bg); }
.btn svg { width: 16px; height: 16px; flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips li { background: var(--chip); border-radius: 999px; padding: 4px 12px; font-size: .88rem; }

/* Cards */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }
.card a.more { display: inline-block; margin-top: 12px; font-size: .9rem; }
.card .tag { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 600; margin-bottom: 6px; }

/* Research themes */
.theme { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 40px 0; }
.theme + .theme { border-top: 1px solid var(--line); }
.theme h2 { font-size: 1.4rem; }
.theme ul { margin: 0; padding-left: 1.1em; }
.theme li { margin-bottom: .5em; font-size: .95rem; }
.theme .label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
@media (max-width: 760px) { .theme { grid-template-columns: 1fr; gap: 16px; } }

/* Publications */
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub { padding: 14px 0; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; }
.pub .title { font-weight: 600; color: var(--ink); text-decoration: none; }
.pub a.title:hover { color: var(--accent); }
.pub .authors { font-size: .93rem; color: var(--muted); }
.pub .authors b { color: var(--ink); font-weight: 600; }
.pub .venue { font-size: .93rem; }
.pub .venue em { font-style: italic; }
.pub .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge {
  font-size: .72rem; padding: 2px 8px; border-radius: 4px; background: var(--chip);
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
}
.badge.type { background: var(--accent-soft); color: var(--accent); }
.year-head { font-family: var(--serif); font-size: 1.3rem; margin: 32px 0 4px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 8px; }
.filters button {
  font: inherit; font-size: .88rem; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.search {
  font: inherit; font-size: .92rem; padding: 7px 12px; border-radius: 8px; width: 100%; max-width: 360px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.count { font-size: .88rem; color: var(--muted); margin-top: 12px; }

/* News */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.news time { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

/* Tables (teaching) */
.course { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.course code { font-family: var(--sans); font-weight: 600; color: var(--accent); }
.course .term { color: var(--muted); font-size: .9rem; }
@media (max-width: 560px) { .course { grid-template-columns: 1fr; gap: 2px; } }

/* People */
.person { display: flex; gap: 16px; align-items: center; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
  font-family: var(--serif); font-weight: 600; font-size: 1.1rem;
}

.callout { background: var(--accent-soft); border-radius: 12px; padding: 28px; }
.callout h2 { margin-bottom: .4em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: .9rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer address { font-style: normal; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
