:root {
  --text: #222;
  --muted: #666;
  --bg: #fff;
  --accent: #7a1f2b;
  --border: #e3e3e3;
  --card-bg: #fafafa;
  --highlight: #f9eff1;
  --pub-title: #114da2;
  --max-width: 1140px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: block;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.tagline {
  color: var(--muted);
  margin: 2px 0 0;
  font-size: 0.95rem;
}

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

.nav-links a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--accent);
  font-weight: 700;
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* ---------- About ---------- */
.about-grid {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.profile-photo-wrap {
  flex: 0 0 300px;
  text-align: center;
}

.profile-photo {
  display: block;
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-info > :first-child {
  margin-top: 0;
}

.contact-line {
  margin: 16px 0 12px;
  font-size: 0.98rem;
}

.contact-line i {
  color: var(--accent);
  margin-right: 6px;
}

.social-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  text-decoration: none;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.bio {
  color: var(--text);
  font-size: 1rem;
}

/* ---------- Research ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.project-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #eee;
}

.project-image-link {
  display: block;
}

.project-image-link:hover img {
  opacity: 0.88;
}

.project-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 4px;
}

.project-title-link {
  color: var(--text);
}

.project-title-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.project-title-link:hover .project-title {
  text-decoration: underline;
}

.project-period {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 10px;
}

.project-description {
  font-size: 0.92rem;
  margin: 0 0 12px;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.project-tag {
  background: #eee;
  color: var(--muted);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
}

.project-link {
  font-size: 0.88rem;
  font-weight: 600;
}

.placeholder-note {
  color: var(--muted);
  font-style: italic;
}

/* ---------- Publications ---------- */
.page-intro {
  color: var(--muted);
  margin: 0 0 8px;
}

.pub-highlight-note {
  background: var(--highlight);
  color: inherit;
  padding: 0 4px;
}

.pub-year {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 36px 0 8px;
}

.pub-year::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.pub-year h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.pub {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin: 0 -16px;
  padding: 16px;
  border-radius: 8px;
}

.pub-first-author {
  background: var(--highlight);
}

.pub-thumb {
  flex: 0 0 240px;
}

.pub-thumb img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.pub-content {
  flex: 1;
  min-width: 0;
}

.pub-title {
  color: var(--pub-title);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 6px;
}

.pub-authors {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.pub-authors strong {
  color: var(--text);
}

.pub-venue {
  margin: 2px 0 0;
  font-size: 0.95rem;
  font-style: italic;
}

.pub-links {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.pub-missing {
  color: #aaa;
}

.pub-abstract-toggle {
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.pub-abstract-toggle:hover {
  text-decoration: underline;
}

.pub-abstract {
  margin: 12px 0 0;
  padding: 8px 16px;
  border-left: 4px solid var(--border);
  font-size: 0.92rem;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .navbar-inner {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .pub {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .pub-thumb {
    flex-basis: auto;
    width: 100%;
  }

  .about-grid {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-photo-wrap {
    flex-basis: auto;
  }

  .profile-photo {
    width: min(280px, 60vw);
    height: min(280px, 60vw);
  }
}
