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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333;
  background: #fff;
  line-height: 1.6;
  font-size: 1rem;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: #2c3e50;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  font-size: 0.875rem;
}

.skip-link:focus {
  top: 0;
}

/* Navigation */
nav {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  z-index: 100;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  max-width: 50rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

nav a {
  text-decoration: none;
  color: #555;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
}

nav a:hover,
nav a:focus {
  color: #2c3e50;
  background: #f0f0f0;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visibility */
a:focus-visible {
  outline: 2px solid #2c3e50;
  outline-offset: 2px;
  border-radius: 2px;
}

nav a[aria-current="page"] {
  color: #2c3e50;
  font-weight: 600;
}

/* Layout */
.container {
  max-width: 50rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  padding: 3rem 0;
}

/* Page titles */
h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1.5rem;
}

/* Home page — intro */
.intro {
  display: flex;
  gap: 2rem;
  align-items: start;
  padding-bottom: 2rem;
  border-bottom: 1px solid #eee;
}

.intro .portrait {
  width: 220px;
  height: auto;
  border-radius: 8px;
  flex-shrink: 0;
}

.intro-text h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.15rem;
}

.intro-text .subtitle {
  font-size: 1.05rem;
  color: #555;
  margin-bottom: 0.75rem;
}

.intro-text .bio {
  font-size: 1rem;
  color: #444;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.contact-links {
  list-style: none;
  display: flex;
  gap: 0.5rem;
}

.contact-links li + li::before {
  content: "\00b7";
  margin-right: 0.5rem;
  color: #ccc;
}

.contact-links a {
  font-size: 0.9rem;
}

/* Home page — columns / cards */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding-top: 0.5rem;
}

.card {
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.75rem;
}

.card ul {
  list-style: disc;
  padding-left: 1.25rem;
  font-size: 0.95rem;
}

.card li {
  margin-bottom: 0.3rem;
}

/* Links */
a {
  color: #2c3e50;
}

a:hover {
  color: #1a252f;
}

/* Publications list */
.publications {
  list-style: none;
  counter-reset: pub-counter 20;
  padding-left: 0;
}

.publications li {
  counter-increment: pub-counter -1;
  padding: 1rem 0 1rem 3rem;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
  position: relative;
}

.publications li::before {
  content: counter(pub-counter) ".";
  position: absolute;
  left: 0;
  color: #999;
  font-size: 0.875rem;
}

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

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

.pub-journal {
  display: block;
  color: #555;
  margin-top: 0.15rem;
}

.publications a {
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.25rem;
  display: inline-block;
}

/* Teaching page */
.award {
  background: #f8f9fa;
  border-left: 3px solid #2c3e50;
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.course {
  margin-bottom: 2rem;
}

.course h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.course p {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.course .eval-link {
  font-size: 0.875rem;
  color: #555;
}

/* Footer */
footer {
  border-top: 1px solid #e0e0e0;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: #666;
}

/* Responsive */
@media (max-width: 700px) {
  .intro {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .intro .portrait {
    width: 180px;
  }

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

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

  nav ul {
    gap: 0;
  }

  nav a {
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
  }
}
