/* Base */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --text: #1a1a1a;
  --text-muted: #555;
  --bg: #fff;
  --bg-alt: #f7f7f7;
  --accent: #2962ff;
  --border: #e0e0e0;
  --max-width: 860px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e8e8;
    --text-muted: #aaa;
    --bg: #121212;
    --bg-alt: #1e1e1e;
    --accent: #82aaff;
    --border: #333;
  }
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
}

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

/* Layout */
header {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

footer a { color: var(--text-muted); }

/* Section dividers */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

section { margin-bottom: 0.5rem; }

/* Profile block */
.profile {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

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

.profile-info h1 {
  margin: 0 0 0.25rem;
  font-size: 1.8rem;
}

.profile-info .role {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.profile-info .affiliation,
.profile-info .contact {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.social-links a {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Bio body */
.bio-body h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.bio-columns {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

@media (max-width: 600px) {
  .bio-columns { grid-template-columns: 1fr; }
  .profile { flex-direction: column; }
  .profile-photo img { width: 120px; height: 120px; }
}

/* Section headings */
h2 {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.3rem;
  margin-bottom: 1.5rem;
}

/* Publications */
.publication {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.pub-thumb {
  flex-shrink: 0;
}

.pub-thumb img {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: block;
}

.pub-body {
  flex: 1;
}

.pub-body h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.pub-summary {
  margin: 0 0 0.3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pub-authors {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
}

.pub-venue {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pub-links a {
  font-size: 0.8rem;
  border: 1px solid var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-weight: 500;
}

.pub-links a:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.equal-contribution {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .publication { flex-direction: column-reverse; }
  .pub-thumb img { width: 100%; }
}

/* Teaching */
#teaching ul { padding-left: 1.5rem; }
#teaching li { margin-bottom: 0.3rem; }

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  background: var(--bg-alt);
  display: flex;
  flex-direction: column;
}

.project-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.project-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.project-card p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.project-links {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

.project-links a {
  font-size: 0.85rem;
  font-weight: 500;
}
