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

:root {
  --color-bg: #fafafa;
  --color-text: #2c2c2c;
  --color-muted: #6b6b6b;
  --color-accent: #a51c30; /* Harvard crimson */
  --color-accent-hover: #7a1424;
  --color-accent-light: rgba(165, 28, 48, 0.08);
  --color-border: #e0e0e0;
  --color-card-bg: #ffffff;
  --color-warm-bg: #f5f3f0;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --max-width: 860px;
  --nav-height: 60px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

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

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

h3 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

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

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

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

li {
  margin-bottom: 0.35rem;
}

/* ===== Navigation ===== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-card-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
}

nav .nav-inner {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

nav .site-title:hover {
  color: var(--color-accent);
}

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

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

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

/* Mobile nav toggle */
nav .menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

nav .menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: transform 0.2s;
}

/* ===== Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ===== Page Headers ===== */
.container > h1 {
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--color-accent);
  margin-bottom: 2rem;
  display: inline-block;
}

/* ===== Home / Bio ===== */
.hero {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  background: var(--color-card-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.hero-photo {
  width: 180px;
  min-width: 180px;
  border-radius: 8px;
  object-fit: cover;
}

.hero-text .subtitle {
  font-size: 1.05rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.contact-info a {
  color: var(--color-muted);
}

.contact-info a:hover {
  color: var(--color-accent);
}

/* Links grid on home page */
.link-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.link-cards a {
  display: block;
  padding: 0.85rem 1.15rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--color-text);
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.link-cards a:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
  color: var(--color-accent);
}

.link-cards a::before {
  content: "\2192\00a0";
  color: var(--color-accent);
  font-weight: 400;
}

/* ===== Research ===== */
.research-area {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.research-area:last-child {
  border-bottom: none;
}

.research-area h2 {
  padding-left: 0.75rem;
  border-left: 3px solid var(--color-accent);
  margin-top: 0;
}

.research-area p {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.paper-list {
  list-style: none;
  padding-left: 0;
  margin-top: 1rem;
}

.paper-list li {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
  border-radius: 4px;
  transition: background-color 0.15s;
}

.paper-list li:hover {
  background-color: var(--color-accent-light);
}

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

.paper-title {
  font-weight: 500;
}

.paper-meta {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.research-img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1rem 0;
}

/* ===== Talks ===== */
.container > .paper-list {
  margin-top: 0;
}

/* ===== Teaching ===== */
.course {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.course:last-child {
  border-bottom: none;
}

.course h2 {
  padding-left: 0.75rem;
  border-left: 3px solid var(--color-accent);
  margin-top: 0;
}

.course h3 {
  margin-top: 0;
}

.course-number {
  color: var(--color-accent);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.course p {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.course-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.lecture-list {
  color: var(--color-muted);
  font-size: 0.92rem;
  columns: 2;
  column-gap: 2rem;
}

.lecture-list li {
  margin-bottom: 0.2rem;
}

/* ===== People ===== */
.people-section {
  margin-bottom: 2.5rem;
}

.people-section h2 {
  padding-left: 0.75rem;
  border-left: 3px solid var(--color-accent);
}

.people-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.person {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  border-radius: 4px;
  transition: background-color 0.15s;
}

.person:hover {
  background-color: var(--color-accent-light);
}

.person:last-child {
  border-bottom: none;
}

.person-name {
  font-weight: 500;
}

.person-info {
  color: var(--color-muted);
  font-size: 0.9rem;
  text-align: right;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--color-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-warm-bg);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  h1 {
    font-size: 1.6rem;
  }

  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
  }

  .hero-photo {
    width: 150px;
    min-width: 150px;
  }

  .contact-info {
    justify-content: center;
  }

  .link-cards {
    grid-template-columns: 1fr;
  }

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

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

  nav .menu-toggle {
    display: block;
  }

  .person {
    flex-direction: column;
    gap: 0.15rem;
  }

  .person-info {
    text-align: left;
  }

  .lecture-list {
    columns: 1;
  }
}
