@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Sans:ital,wght@0,400;0,500;1,400&display=swap');

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

:root {
  --font-mono: 'IBM Plex Mono', monospace;
  --font-sans: 'IBM Plex Sans', sans-serif;
  --accent: #1a7c8a;
  --text: #1c1c1c;
  --muted: #6b6b6b;
  --border: #e2e2e2;
  --max-w: 820px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

/* Mono for structural / UI elements */
nav,
h1, h2,
.pub-year-heading,
.news-date,
.post-entry-meta,
.post-meta,
.profile-links,
.see-all,
a.doi,
.service-year,
.award-year,
.teaching-meta,
.trajectory-dates,
.talk-meta,
.pub-tag,
.post-tag,
.traj-sub,
footer {
  font-family: var(--font-mono);
}

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

/* ── Layout ─────────────────────────────── */

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

/* ── Nav ─────────────────────────────────── */

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

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.nav-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

/* ── Profile header ───────────────────────── */

.profile {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  padding: 48px 0 40px;
}

.profile-photo {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  flex-shrink: 0;
}

.profile-info h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.profile-role {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.profile-bio {
  font-size: 0.95rem;
  margin-bottom: 16px;
  max-width: 580px;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.85rem;
}

.profile-links a { color: var(--muted); }
.profile-links a:hover { color: var(--accent); text-decoration: none; }

/* ── Sections ────────────────────────────── */

section {
  padding: 36px 0;
  border-top: 1px solid var(--border);
}

section h2 {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ── News ────────────────────────────────── */

.news-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-item {
  display: flex;
  gap: 20px;
  font-size: 0.925rem;
}

.news-date {
  min-width: 76px;
  color: var(--muted);
  font-size: 0.83rem;
  padding-top: 2px;
  flex-shrink: 0;
}

/* ── Publications ─────────────────────────── */

.pub-year-heading {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 28px 0 10px;
}

.pub-year-heading:first-child { margin-top: 0; }

.pub-entry {
  margin-bottom: 14px;
  font-size: 0.925rem;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  line-height: 1.5;
  transition: border-color 0.15s;
}

.pub-entry:hover { border-left-color: var(--accent); }

.pub-title { font-weight: 500; }
.pub-venue { color: var(--muted); }

.pub-entry a.doi {
  font-size: 0.8rem;
  margin-left: 4px;
  color: var(--muted);
}

.pub-entry a.doi:hover { color: var(--accent); }

.pub-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 2px;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.pub-tag.preprint { background: #f0f0f0; color: var(--muted); }
.pub-tag.inprep   { background: #fff4e0; color: #a06000; }

/* ── Teaching ────────────────────────────── */

.teaching-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.teaching-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.925rem;
  gap: 16px;
}

.teaching-meta {
  color: var(--muted);
  font-size: 0.83rem;
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Footer ──────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 20px;
}

footer p {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* ── Background wrap + right-margin sidebar ── */

.background-wrap {
  position: relative;
}

.page-sidebar {
  position: absolute;
  left: calc(100% + 28px);
  top: 0;
  width: 220px;
}

.page-sidebar > section {
  padding-top: 36px;
  border-top: none;
}

.page-sidebar .news-item {
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}

.page-sidebar .news-date {
  min-width: auto;
  font-size: 0.78rem;
}

.page-sidebar .see-all {
  margin-top: 4px;
}

/* Hide sidebar when viewport is too narrow to show it */
@media (max-width: 1270px) {
  .page-sidebar {
    display: none;
  }
}

/* ── See-all link ────────────────────────── */

.see-all {
  margin-top: 12px;
  font-size: 0.85rem;
}

/* ── Background / trajectory ─────────────── */

.trajectory-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
  font-size: 0.925rem;
}

.trajectory-body strong {
  display: block;
  font-weight: 500;
}

.trajectory-body .traj-sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 1px;
}

.trajectory-dates {
  color: var(--muted);
  font-size: 0.83rem;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

/* ── Awards & Grants ─────────────────────── */

.award-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  font-size: 0.925rem;
}

.award-year {
  color: var(--muted);
  font-size: 0.83rem;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

/* ── Research areas ───────────────────────── */

.research-area {
  margin-bottom: 24px;
}

.research-area h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.research-area p {
  font-size: 0.925rem;
  max-width: 640px;
}

/* ── Projects ────────────────────────────── */

.project-item {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
  font-size: 0.925rem;
}

.project-logo-wrap {
  width: 150px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.project-logo {
  max-width: 150px;
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.project-item strong {
  display: block;
  font-weight: 500;
  margin-bottom: 2px;
}

.project-item .proj-desc {
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── Academic service ─────────────────────── */

.service-group {
  margin-bottom: 22px;
}

.service-group h3 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.service-list {
  list-style: none;
}

.service-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 5px;
  font-size: 0.925rem;
}

.service-year {
  color: var(--muted);
  font-size: 0.83rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Talks ───────────────────────────────── */

.talk-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
  font-size: 0.925rem;
}

.talk-body strong {
  display: block;
  font-weight: 500;
}

.talk-body .talk-sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 2px;
}

.talk-body .talk-links {
  margin-top: 4px;
  font-size: 0.83rem;
}

.talk-meta {
  color: var(--muted);
  font-size: 0.83rem;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
  text-align: right;
}

/* ── Posts: listing ──────────────────────── */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.post-entry h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.post-entry h3 a { color: var(--text); }
.post-entry h3 a:hover { color: var(--accent); text-decoration: none; }

.post-entry-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.post-entry p { font-size: 0.925rem; }

.post-tag {
  display: inline-block;
  background: #f2f2f2;
  color: var(--muted);
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 2px;
  margin-right: 4px;
}

.empty-state {
  color: var(--muted);
  font-size: 0.925rem;
  font-style: italic;
}

/* ── Posts: post page ────────────────────── */

.post-header { padding: 40px 0 28px; }

.post-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.post-meta {
  font-size: 0.83rem;
  color: var(--muted);
}

.post-body {
  font-size: 0.975rem;
  line-height: 1.75;
  border-top: 1px solid var(--border);
  padding-top: 28px;
  padding-bottom: 60px;
}

.post-body p { margin-bottom: 1.2em; }
.post-body h2 { font-size: 1.1rem; margin: 1.8em 0 0.6em; }
.post-body h3 { font-size: 1rem; margin: 1.5em 0 0.5em; }
.post-body ul, .post-body ol { margin: 0.8em 0 0.8em 1.4em; }
.post-body li { margin-bottom: 0.3em; }
.post-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 16px;
  color: var(--muted);
  margin: 1em 0;
}

/* ── Responsive ──────────────────────────── */

@media (max-width: 580px) {
  .profile { flex-direction: column; gap: 20px; }
  .profile-photo { width: 96px; height: 96px; }
  .nav-links { gap: 16px; }
  .teaching-item { flex-direction: column; gap: 2px; }
  .teaching-meta { text-align: left; }
  .news-item { flex-direction: column; gap: 2px; }
}
