:root {
  --ink: #1d1d1f;
  --ink-2: #4a4a4f;
  --ink-3: #6e6e73;
  --line: #e4e1dc;
  --paper: #ffffff;
  --paper-2: #f7f5f2;
  --accent: #501214;
  --accent-2: #7a1f22;
  --gold: #8d734a;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --max: 1040px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  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: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 20;
}
.bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.brand { color: var(--ink); line-height: 1.25; }
.brand:hover { text-decoration: none; }
.brand strong { display: block; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.brand span { display: block; font-size: 0.8rem; color: var(--ink-3); letter-spacing: 0.02em; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.nav a {
  color: var(--ink-2);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Layout */
main { max-width: var(--max); margin: 0 auto; padding: 48px 24px 72px; }
.page-title { font-family: var(--serif); font-size: 2.2rem; font-weight: 600; line-height: 1.2; margin: 0 0 10px; }
.lede { color: var(--ink-2); font-size: 1.05rem; max-width: 720px; margin: 0 0 40px; }
section + section { margin-top: 52px; }
h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 6px; line-height: 1.4; }
p { margin: 0 0 14px; }
.muted { color: var(--ink-3); }
.small { font-size: 0.9rem; }

/* Home hero */
.hero { display: grid; grid-template-columns: 240px 1fr; gap: 44px; align-items: start; }
.portrait { width: 240px; height: 240px; object-fit: cover; border-radius: 4px; }
.hero h1 { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; line-height: 1.15; margin: 0 0 8px; }
.role { margin: 0 0 18px; color: var(--ink-2); line-height: 1.5; }
.role strong { color: var(--ink); font-weight: 600; }
.contact { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 22px; padding: 0; list-style: none; }
.contact a {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 12px;
}
.contact a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* Callout */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
  padding: 18px 22px;
  margin: 36px 0 52px;
}
.callout h3 { color: var(--accent); margin-bottom: 6px; }
.callout p:last-child { margin-bottom: 0; }

/* Lists */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.tags li {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 9px;
}
.interests { columns: 2; column-gap: 40px; padding-left: 18px; margin: 0; }
.interests li { margin-bottom: 6px; break-inside: avoid; }

.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 li:last-child { border-bottom: none; }
.news time { color: var(--ink-3); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* Research projects */
.project { display: grid; grid-template-columns: 260px 1fr; gap: 28px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.project:last-child { border-bottom: none; }
.project img { width: 260px; height: 175px; object-fit: cover; border-radius: 3px; background: var(--paper-2); }
.project figcaption { font-size: 0.78rem; color: var(--ink-3); margin-top: 6px; }
.project figure { margin: 0; }
.project p { color: var(--ink-2); }

.current { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.current article { border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: 18px 20px; }
.current p { color: var(--ink-2); font-size: 0.93rem; margin: 0; }

/* Publications */
.pubs { padding-left: 0; list-style: none; counter-reset: pub; margin: 0; }
.pubs li { position: relative; padding: 12px 0 12px 44px; border-bottom: 1px solid var(--line); counter-increment: pub; }
.pubs li:last-child { border-bottom: none; }
.pubs li::before { content: "[" counter(pub) "]"; position: absolute; left: 0; color: var(--ink-3); font-size: 0.85rem; top: 14px; }
.pubs .title { font-weight: 600; color: var(--ink); }
.pubs .venue { font-style: italic; }
.pubs .me { font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.pubs .year { color: var(--ink-3); }

/* Team */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 26px; }
.person { text-align: left; }
.person img, .person .ph {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 3px;
  background: var(--paper-2);
  margin-bottom: 12px;
}
.person .ph { display: flex; align-items: center; justify-content: center; border: 1px dashed #cfc9c0; }
.person .ph svg { width: 42%; height: 42%; color: #c4bdb2; }
.person h3 { margin: 0 0 2px; }
.person .pos { color: var(--accent); font-size: 0.88rem; font-weight: 500; margin: 0 0 4px; }
.person p { font-size: 0.9rem; color: var(--ink-2); margin: 0; }
.pi { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: start; }
.pi img { width: 200px; height: 200px; object-fit: cover; border-radius: 3px; }

/* Cards (teaching, service) */
.course { padding: 16px 0; border-bottom: 1px solid var(--line); }
.course:last-child { border-bottom: none; }
.course h3 { margin-bottom: 2px; }
.course .code { color: var(--ink-3); font-weight: 500; font-size: 0.9rem; margin-left: 6px; }
.course p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }

.entry { display: grid; grid-template-columns: 200px 1fr; gap: 26px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: none; }
.entry.noimg { grid-template-columns: 1fr; }
.entry img { width: 200px; height: 150px; object-fit: cover; border-radius: 3px; }
.entry .where { color: var(--ink-3); font-size: 0.88rem; margin: 0 0 8px; }
.entry p, .entry li { color: var(--ink-2); }
.entry ul { margin: 0; padding-left: 18px; }
.links-row { display: flex; gap: 16px; font-size: 0.9rem; font-weight: 500; margin-top: 6px; }

.plain { padding-left: 18px; margin: 0; }
.plain li { margin-bottom: 8px; color: var(--ink-2); }
.dated { list-style: none; padding: 0; margin: 0; }
.dated li { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.dated li:last-child { border-bottom: none; }
.dated .when { color: var(--ink-3); font-size: 0.9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 9px 18px;
  border-radius: 3px;
}
.button:hover { background: var(--accent-2); text-decoration: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .bar { font-size: 0.85rem; color: var(--ink-3); padding-top: 22px; padding-bottom: 22px; }

/* Responsive */
@media (max-width: 860px) {
  .hero, .pi { grid-template-columns: 1fr; gap: 24px; }
  .portrait { width: 180px; height: 180px; }
  .project, .entry { grid-template-columns: 1fr; gap: 14px; }
  .project img, .entry img { width: 100%; height: 200px; }
  .current { grid-template-columns: 1fr; }
  .interests { columns: 1; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  main { padding: 32px 16px 56px; }
  .bar { padding: 14px 16px; }
  .hero h1, .page-title { font-size: 1.9rem; }
  .news li { grid-template-columns: 1fr; gap: 2px; }
  .dated li { grid-template-columns: 1fr; gap: 0; }
  .pi img { width: 160px; height: 160px; }
}

/* Lab branding */
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; }
.brand-text strong { display: block; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.brand-text span { display: block; font-size: 0.78rem; color: var(--ink-3); letter-spacing: 0.02em; }

.lab-hero { display: grid; grid-template-columns: 1fr 120px; gap: 48px; align-items: center; padding: 8px 0 8px; }
.lab-hero .kicker { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
.lab-hero h1 { font-family: var(--serif); font-size: 2.6rem; font-weight: 600; line-height: 1.15; margin: 0 0 18px; }
.lab-hero .mission { font-size: 1.12rem; color: var(--ink-2); max-width: 640px; margin: 0 0 24px; }
.lab-hero .logo-big { width: 120px; height: 120px; align-self: start; margin-top: 30px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.button.ghost:hover { background: var(--paper-2); }

.areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.areas article { border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: 20px 22px; display: flex; flex-direction: column; }
.areas p { color: var(--ink-2); font-size: 0.94rem; flex: 1; }
.areas a { font-size: 0.9rem; font-weight: 500; }

.join { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.join article { background: var(--paper-2); padding: 22px 24px; }
.join p { color: var(--ink-2); font-size: 0.95rem; }

.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.contact-grid div { border-left: 2px solid var(--line); padding-left: 16px; }
.contact-grid .k { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 4px; }
.contact-grid p { margin: 0; }

.pi-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.92rem; font-weight: 500; margin-top: 4px; }

@media (max-width: 860px) {
  .lab-hero { grid-template-columns: 1fr; gap: 24px; }
  .lab-hero .logo-big { width: 72px; height: 72px; order: -1; margin-top: 0; }
  .areas, .join, .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .lab-hero h1 { font-size: 2rem; }
  .brand img { width: 34px; height: 34px; }
}

/* PI profile details */
.pi-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 40px; margin-top: 34px; }
.pi-details h3 { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; }
.pi-details .dated li { padding: 7px 0; font-size: 0.94rem; }
.pi-details .plain li { font-size: 0.94rem; margin-bottom: 6px; }
.pi-details .wide { grid-column: 1 / -1; }
@media (max-width: 860px) { .pi-details { grid-template-columns: 1fr; } }
.project.noimg { grid-template-columns: 1fr; }
.project img.fit { object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 6px; }
