:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1b1b1b;
  --muted: #656565;
  --line: #dedbd3;
  --accent: #8c2f1f;
  --accent-soft: #f1e5e0;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.72;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(251,250,247,.96);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}
.brand {
  font-family: "Libre Franklin", sans-serif;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}
nav { display: flex; gap: 22px; align-items: center; }
nav a { color: #343434; font-size: .91rem; font-weight: 500; }
.menu-button { display: none; background: none; border: 0; font-size: 1.4rem; }

.page-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 58px 28px 80px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 72px;
}
.profile-card {
  position: sticky;
  top: 106px;
  align-self: start;
}
.portrait-wrap {
  width: 190px;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.portrait { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-card h1 {
  font-family: "Libre Franklin", sans-serif;
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 22px 0 8px;
}
.role { font-weight: 600; margin: 0 0 6px; }
.affiliation, .location { color: var(--muted); margin: 0 0 2px; font-size: .94rem; }
.profile-links { margin-top: 20px; display: flex; flex-direction: column; gap: 7px; }
.profile-links a { font-size: .94rem; }
.cv-button {
  display: inline-block;
  margin-top: 22px;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-weight: 600;
}

.content-column { min-width: 0; }
.section { padding: 0 0 64px; scroll-margin-top: 92px; }
.hero-section { padding-top: 2px; }
.eyebrow { color: var(--accent); font-weight: 700; margin: 0 0 10px; }
.hero-section h2 {
  font-family: "Libre Franklin", sans-serif;
  max-width: 820px;
  font-size: clamp(2rem, 4vw, 3.55rem);
  line-height: 1.08;
  letter-spacing: -.045em;
  margin: 0 0 28px;
}
.hero-section p { font-size: 1.04rem; max-width: 800px; }
.research-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.research-tags span {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 10px;
  color: #4a4a4a;
  font-size: .85rem;
}
.section-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-heading h2 {
  font-family: "Libre Franklin", sans-serif;
  font-size: 1.65rem;
  letter-spacing: -.025em;
  margin: 0;
}
.section-icon { color: var(--accent); }
.section-intro { color: var(--muted); margin: -6px 0 28px; max-width: 740px; }

.research-grid, .project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}
.research-card, .project-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 22px;
}
.research-card h3, .project-card h3 { margin: 8px 0 8px; font-size: 1.04rem; }
.research-card p, .project-card p { margin: 0; color: var(--muted); font-size: .94rem; }
.card-number, .project-kicker { color: var(--accent) !important; font-weight: 700; font-size: .78rem !important; text-transform: uppercase; letter-spacing: .05em; }

.timeline-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
}
.timeline-row time { color: var(--accent); font-weight: 700; font-size: .9rem; }
.timeline-row p { margin: 0; }

.publication-year { margin-bottom: 30px; }
.publication-year > h3 { color: var(--muted); font-size: 1rem; margin: 0 0 12px; }
.publication { padding: 19px 0 22px; border-bottom: 1px solid var(--line); }
.pub-type {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  font-size: .75rem;
  padding: 2px 7px;
  font-weight: 700;
  margin-bottom: 8px;
}
.publication h4 { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.45; }
.authors, .venue { margin: 3px 0; font-size: .92rem; }
.venue { color: var(--muted); font-style: italic; }
.inline-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: .9rem; font-weight: 600; }

.stack-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 28px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}
.stack-date { color: var(--accent); font-weight: 700; font-size: .9rem; }
.stack-row h3 { margin: 0; font-size: 1rem; }
.stack-row p { margin: 3px 0 0; font-size: .92rem; }
.stack-place { color: var(--muted); font-weight: 500; }

footer { border-top: 1px solid var(--line); padding-top: 24px; color: var(--muted); font-size: .82rem; }
code { background: #f0eee9; padding: 2px 5px; border-radius: 4px; }

@media (max-width: 900px) {
  .page-shell { grid-template-columns: 1fr; gap: 38px; padding-top: 36px; }
  .profile-card { position: static; display: grid; grid-template-columns: 130px 1fr; column-gap: 22px; }
  .portrait-wrap { width: 130px; grid-row: span 6; }
  .profile-card h1 { margin-top: 0; }
  .profile-links { flex-direction: row; flex-wrap: wrap; }
  .cv-button { justify-self: start; }
}

@media (max-width: 720px) {
  .topbar { padding: 0 18px; }
  .menu-button { display: block; }
  nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 16px 22px 22px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  nav.open { display: flex; }
  .page-shell { padding-left: 18px; padding-right: 18px; }
  .profile-card { display: block; }
  .portrait-wrap { width: 150px; }
  .profile-card h1 { margin-top: 18px; }
  .research-grid, .project-grid { grid-template-columns: 1fr; }
  .stack-row { grid-template-columns: 1fr; gap: 4px; }
  .timeline-row { grid-template-columns: 76px 1fr; gap: 12px; }
}
