/* ===== Color Palette: Warm Ivory ===== */
:root {
  --bg: #faf8f5;
  --bg-alt: #f0ede8;
  --text: #2d2d2d;
  --text-muted: #6b6b6b;
  --accent: #2b5797;
  --accent-hover: #1e3f6f;
  --border: #e0dcd6;
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --max-width: 800px;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* ===== Typography ===== */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }

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

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

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li { margin-bottom: 0.35rem; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ===== Navigation ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.nav-brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* ===== Main Content ===== */
main.container {
  flex: 1;
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  font-family: var(--font-sans);
  font-weight: 400;
}

/* ===== About / Home ===== */
.profile-section {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.profile-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  flex-shrink: 0;
}

.profile-info h1 {
  margin-bottom: 0.25rem;
}

.profile-info .affiliation {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

/* ===== Project Cards ===== */
.project-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg);
  transition: box-shadow 0.2s;
}

.project-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.project-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.project-card .tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.project-card .tag {
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
}

/* ===== Publications ===== */
.pub-list {
  list-style: none;
  padding: 0;
}

.pub-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.pub-list li:last-child {
  border-bottom: none;
}

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

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

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

/* ===== CV ===== */
.cv-section {
  margin-bottom: 2.5rem;
}

.cv-entry {
  margin-bottom: 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.cv-entry h3 {
  margin-top: 0;
  margin-bottom: 0.15rem;
}

.cv-entry .cv-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
}

.site-footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  margin: 0;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  html { font-size: 16px; }

  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
  }

  .nav-links.open { display: flex; }

  .site-header { position: relative; }

  .profile-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-photo {
    width: 120px;
    height: 120px;
  }

  main.container {
    padding-top: 2rem;
  }
}
