/* ── Variables ── */
:root {
  --navy:       #1e3a5f;
  --blue:       #2563eb;
  --blue-light: #dbeafe;
  --text:       #1f2937;
  --muted:      #6b7280;
  --bg:         #ffffff;
  --bg-alt:     #f9fafb;
  --border:     #e5e7eb;
  --radius:     8px;
  --max-w:      900px;
  --nav-h:      60px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Layout ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
  position: relative;
  padding-bottom: 14px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--blue);
  border-radius: 2px;
}
.section-subtitle {
  color: var(--muted);
  margin-bottom: 36px;
  max-width: 680px;
}
.subsection-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin: 32px 0 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

/* ── Nav ── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: box-shadow 0.2s;
}
#navbar.scrolled { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}
.nav-name:hover { text-decoration: none; color: var(--blue); }

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}
.nav-links a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--blue-light);
  color: var(--blue);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ── Home ── */
#home {
  padding-top: calc(var(--nav-h) + 64px);
  padding-bottom: 80px;
}
.home-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 48px;
  align-items: start;
}
.photo-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.home-title {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 6px;
}
.home-title a { color: var(--muted); font-weight: 500; }
.home-title a:hover { color: var(--blue); }

.home-text {
  margin: 20px 0 20px;
  color: var(--text);
  font-size: 0.97rem;
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.interest-tags span {
  background: var(--blue-light);
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
}

.home-links { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 9px 20px;
  background: var(--blue);
  color: #fff;
  font-size: 0.87rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: background 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--navy); text-decoration: none; color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--blue);
}
.btn-outline:hover { background: var(--blue-light); color: var(--blue); }

/* ── News ── */
.news-list { list-style: none; }
.news-item {
  display: flex;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue);
  min-width: 40px;
  flex-shrink: 0;
}
.news-text { font-size: 0.95rem; line-height: 1.6; }

/* ── Lab ── */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.person-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.15s;
}
.person-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.person-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.person-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.person-degree { font-size: 0.82rem; color: var(--muted); }
.person-year { font-size: 0.82rem; color: var(--muted); }

/* ── Publications ── */
.pub-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.pub-controls input,
.pub-controls select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.pub-controls input { flex: 1; min-width: 200px; }
.pub-controls input:focus,
.pub-controls select:focus { border-color: var(--blue); }

.pub-item {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:last-child { border-bottom: none; }
.pub-number {
  color: var(--muted);
  font-size: 0.85rem;
  min-width: 32px;
  padding-top: 2px;
}
.pub-title {
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.45;
}
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--blue); }
.pub-authors {
  font-size: 0.87rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue {
  font-size: 0.84rem;
  color: var(--muted);
}
.pub-venue em { font-style: normal; color: var(--text); font-weight: 500; }
.pub-citations {
  font-size: 0.8rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1px 8px;
  margin-left: 6px;
}
.pub-meta { font-size: 0.8rem; color: var(--muted); margin-top: 20px; }
.loading { color: var(--muted); font-size: 0.9rem; }
.no-results { color: var(--muted); font-size: 0.9rem; padding: 20px 0; }

/* ── Teaching ── */
.course-list { margin-bottom: 24px; }
.course-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.course-item:last-child { border-bottom: none; }
.course-name { font-weight: 500; font-size: 0.97rem; flex: 1; }
.course-semester { font-size: 0.85rem; color: var(--muted); }
.teaching-note { font-size: 0.9rem; color: var(--muted); margin-top: 12px; }

/* ── Contact ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.contact-block h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 12px;
}
.contact-block p { font-size: 0.95rem; color: var(--text); margin-bottom: 12px; }
.contact-links li { margin-bottom: 10px; }
.contact-links a { font-size: 0.95rem; font-weight: 500; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--blue); }
.form-status {
  margin-top: 10px;
  font-size: 0.88rem;
  min-height: 1.2em;
}
.form-status.success { color: #16a34a; }
.form-status.error   { color: #dc2626; }

/* ── Footer ── */
footer {
  background: var(--navy);
  padding: 24px 0;
  text-align: center;
}
footer p { font-size: 0.85rem; color: rgba(255,255,255,0.7); }
footer a { color: rgba(255,255,255,0.9); }
footer a:hover { color: #fff; }

/* ── Responsive ── */
@media (max-width: 680px) {
  .home-grid { grid-template-columns: 1fr; text-align: center; }
  .home-photo { display: flex; justify-content: center; }
  .section-title::after { left: 50%; transform: translateX(-50%); }
  .section-title { text-align: center; }
  .section-subtitle { text-align: center; }
  .interest-tags { justify-content: center; }
  .home-links { justify-content: center; }

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

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
}
