/* =============================================
   Base & Reset
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent: #3a6ea5;
  --accent-dark: #2a5080;
  --text: #1a1a1a;
  --text-muted: #555;
  --border: #ddd;
  --bg: #fff;
  --bg-alt: #f5f5f5;
  --year-bg: #5a6a7e;
  --year-current-bg: #2d3748;
  --font-body: system-ui, -apple-system, sans-serif;
  --font-heading: system-ui, -apple-system, sans-serif;
  --max-width: 1000px;
  --nav-height: 60px;
}

html {
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
}

body {
  font-family: var(--font-body);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: normal;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: 2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.35rem; margin: 1.75rem 0 0.6rem; }
h3 { font-size: 1.1rem; margin: 1.25rem 0 0.4rem; }

p { margin-bottom: 1rem; }

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

/* =============================================
   Header / Nav
   ============================================= */
.site-header {
  background: var(--year-current-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-name:hover {
  color: #cbd5e0;
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  display: block;
  padding: 0.4rem 0.85rem;
  color: #cbd5e0;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* =============================================
   Main content
   ============================================= */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* =============================================
   About page — two-column grid
   ============================================= */
.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}

.about-photo img {
  border-radius: 40px;
  width: 100%;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.contact-info p {
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.contact-title {
  font-weight: 600;
}

.contact-dept,
.contact-inst {
  color: var(--text-muted);
}

.contact-email {
  margin-top: 0.5rem !important;
}

.about-text section {
  margin-bottom: 2rem;
}

/* =============================================
   Career section (Positions & Education side by side)
   ============================================= */
.career-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2.5rem;
  row-gap: 1rem;
  align-items: center;
}

.career-grid h2 {
  margin: 1.75rem 0 0.6rem;
}

.career-empty {
  /* placeholder for empty grid cells */
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.5rem;
}

.timeline-spaced {
  padding-top: 1.5rem;
}

.timeline-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.timeline-years {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
  width: 70px;
}

.year-to, .year-from {
  display: block;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
}

.year-to {
  background: var(--year-current-bg);
  border-radius: 3px 3px 0 0;
}

.year-from {
  background: var(--year-bg);
  border-radius: 0 0 3px 3px;
}

.year-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: var(--year-current-bg);
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  padding-top: 2px;
  font-size: 0.95rem;
}

.timeline-content strong {
  font-weight: 600;
}

.timeline-content span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* =============================================
   Generic page content (Research, Teaching)
   ============================================= */
.page-content {
  max-width: 760px;
}

.page-content h1 {
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.page-content > ul > li + li {
  margin-top: 0.6rem;
}

/* =============================================
   Publications list
   ============================================= */
.pub-filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.filter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.filter-btn {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--year-current-bg);
  color: #fff;
  border-color: var(--year-current-bg);
}

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pub-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.35;
}

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.pub-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pub-venue {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}

.pub-highlight {
  background: #e8f0fe;
}

.pub-link-btn {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--year-bg);
  color: #fff !important;
  text-decoration: none !important;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.pub-link-btn:hover {
  background: var(--year-current-bg);
}

.pub-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.conf-version-link {
  font-style: italic;
}

.pub-link {
  font-size: 0.88rem;
  font-weight: 500;
}

/* =============================================
   Footer
   ============================================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 640px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-photo {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
  }

  .about-photo img {
    width: 120px;
    flex-shrink: 0;
  }

  .nav-links a {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
  }

  .career-grid {
    grid-template-columns: 1fr;
  }

  .career-empty {
    display: none;
  }
}
