html {
  scroll-behavior: smooth;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 20px;
  text-align: center;
}

.navbar a {
  margin: 0 12px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.navbar .nav-links {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.navbar #nav-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  margin-right: 8px;
}

.navbar a:hover {
  color: #2563eb;
}

section {
  scroll-margin-top: 70px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  background: #ffffff;
  color: #1a1a1a;
}

.container {
  max-width: 900px;
  margin: auto;
  padding: 50px 20px;
}

/* Header */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 40px 0;
  flex-wrap: wrap;
}

.hero-text {
  flex: 1;
  min-width: 260px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-links {
  margin-top: 12px;
}

.hero-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 18px;
}

.hero-links a {
  display: inline-block;
  padding: 8px 12px;
  background: #2a5db0;
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.hero-links a:hover {
  background: #1e4ea0;
}

.hero-photo {
  margin-left: 40px; /* keep photo visually separated from centered text */
}

.hero-photo img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
}

h1 {
  font-size: 38px;
  margin: 0;
}

.subtitle {
  font-size: 18px;
  color: #444;
  margin-top: 5px;
}

.affil {
  font-size: 15px;
  color: #777;
}

/* Sections */
section {
  margin-top: 45px;
}

h2 {
  font-size: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
  margin-bottom: 15px;
}

/* Intro */
.intro p {
  line-height: 1.75;
}

/* Quote */
.mission-statement {
  font-style: italic;
  color: #333;
  margin-bottom: 20px;
}

/* Humor */
.humor {
  color: #555;
  font-style: italic;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card {
  background: #f7f7f9;
  padding: 14px;
  border-radius: 8px;
  font-size: 14px;
}

/* Projects */
.project {
  background: #fafafa;
  border-left: 3px solid #2a5db0;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 6px;
}

.project h3 {
  margin: 0 0 5px;
}

/* Links */
ul {
  padding-left: 20px;
}

a {
  color: #2a5db0;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Publications */
.pub-entry {
  margin-bottom: 10px;
  line-height: 1.4;
  font-size: 15px;
}

.pub-entry strong a {
  color: #1f3f78;
}

.pub-entry em {
  color: #444;
}

/* Academic service two-column on wider screens */
.academic-list {
  list-style: disc;
  padding-left: 20px;
}

@media (min-width: 900px) {
  .academic-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 40px;
  }
}

/* Footer */
footer {
  text-align: center;
  margin-top: 60px;
  font-size: 12px;
  color: #888;
}

/* Responsive: tablet and mobile tweaks */
@media (max-width: 1024px) {
  .container {
    padding: 40px 18px;
  }

  .hero-photo img {
    width: 160px;
    height: 160px;
  }

  h1 {
    font-size: 34px;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 28px 14px;
  }

  .navbar {
    padding: 8px 12px;
  }

  .navbar .nav-links {
    display: none; /* hidden by default on mobile */
    flex-direction: column;
    gap: 8px;
    background: #fff;
    padding: 8px 12px;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    border-bottom: 1px solid #eee;
  }

  .navbar #nav-toggle {
    display: inline-block;
  }

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

  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }

  .hero-text {
    width: 100%;
  }

  .hero-photo img {
    width: 120px;
    height: 120px;
    border-width: 2px;
  }

  h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 15px;
  }

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

  .project {
    padding: 10px;
  }

  .hero-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .hero-links {
    display: flex;
    gap: 28px;
    justify-content: center;
    margin-top: 22px;
  }
    font-size: 18px;
  }
}
