/* ===== Theme Variables ===== */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-secondary: #f7f8fa;
  --text: #2c3e50;
  --text-secondary: #5a6a7a;
  --accent: #1a5276;
  --accent-hover: #1a6ea0;
  --link: #1a5276;
  --border: #e2e6ea;
  --avatar-bg: #1a5276;
  --avatar-text: #ffffff;
  --code-bg: #f0f2f5;
  --toggle-bg: #e2e6ea;
  --toggle-text: #2c3e50;
}

[data-theme="dark"] {
  --bg: #1a1a2e;
  --bg-secondary: #22223a;
  --text: #e0e0e0;
  --text-secondary: #a0a8b4;
  --accent: #6db3f2;
  --accent-hover: #8fc5f7;
  --link: #6db3f2;
  --border: #2e2e48;
  --avatar-bg: #6db3f2;
  --avatar-text: #1a1a2e;
  --code-bg: #2a2a42;
  --toggle-bg: #2e2e48;
  --toggle-text: #e0e0e0;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
}

/* ===== Layout ===== */
.container {
  max-width: 750px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ===== Typography ===== */
h1, h2, h3 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
  transition: border-color 0.3s;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.3s;
}

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

p {
  margin-bottom: 1rem;
}

em {
  font-style: italic;
}

/* ===== Hero ===== */
.hero {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 2rem 0 2.5rem;
}

.hero-text {
  flex: 1;
}

.subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.affiliation {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Social Links */
.social-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text);
  transition: background-color 0.3s, color 0.3s, transform 0.2s;
}

.social-links a:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Avatar */
.hero-photo {
  flex-shrink: 0;
}

.avatar-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--avatar-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  transition: background-color 0.3s, color 0.3s;
}

.avatar-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
}

/* ===== Sections ===== */
.section {
  padding: 1.75rem 0;
}

/* ===== News ===== */
.news-box {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem 0;
  transition: border-color 0.3s;
}

.news-box::-webkit-scrollbar {
  width: 6px;
}

.news-box::-webkit-scrollbar-track {
  background: transparent;
}

.news-box::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.news-box::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.news-list {
  list-style: none;
}

.news-list li {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s;
  font-size: 0.97rem;
}

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

.news-date {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--accent);
  margin-right: 0.75rem;
  font-size: 0.88rem;
  transition: color 0.3s;
}

/* ===== Publications ===== */
.pub-list {
  list-style: none;
}

.pub-item {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.3s;
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 90px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.pub-title {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.pub-authors {
  display: block;
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.pub-venue {
  display: block;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.pub-links a {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  margin-right: 0.5rem;
}

.pub-blurb {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  margin-bottom: 0;
  line-height: 1.55;
}

/* ===== Footer ===== */
.site-footer {
  padding: 2rem 0 1rem;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--toggle-bg);
  color: var(--toggle-text);
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* Show sun in dark mode, moon in light mode */
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    gap: 1.5rem;
  }

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

  h1 {
    font-size: 1.8rem;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  .pub-item {
    flex-direction: column;
    gap: 0.75rem;
  }

  .pub-thumb {
    width: 100%;
    height: 160px;
  }
}
