:root {
  --bg: #ffffff;
  --bg-soft: #f8f9fa;
  --bg-mute: #f1f1ee;
  --bg-deep: #e7e6e0;
  --text: #161616;
  --text-body: #333;
  --text-dim: #555;
  --text-faint: #888;
  --border: #e2e2dd;
  --border-strong: #c3c2bb;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --venue-color: #9A2617;
  --link-bg: #e8e8e8;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
  --ff: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 56px;
  --container-w: 780px;
  --radius: 8px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #1a1a2e;
  --bg-soft: #1f1f35;
  --bg-mute: #2a2a40;
  --bg-deep: #252540;
  --text: #e8e8e8;
  --text-body: #ccc;
  --text-dim: #999;
  --text-faint: #777;
  --border: #3a3a50;
  --border-strong: #4a4a60;
  --accent: #60a5fa;
  --accent-soft: #1e3a5f;
  --venue-color: #e8805a;
  --link-bg: #2a2a40;
  --shadow: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.3);
}

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

body {
  font-family: var(--ff);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  color: var(--text-body);
  background: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}

body *::selection {
  background: var(--accent);
  color: #fff;
}

img { max-width: 100%; height: auto; }

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

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition), border-color var(--transition);
}

.header-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.home-link {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text) !important;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.nav-primary {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}

.nav-primary a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dim);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.nav-primary a:hover,
.nav-primary a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.5rem;
}

.nav-icon {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}
.nav-icon:hover {
  color: var(--text);
  background: var(--bg-mute);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-dim);
  transition: all var(--transition);
}
.theme-toggle:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

[data-theme="light"] .tt-dark { display: none; }
[data-theme="dark"] .tt-light { display: none; }

/* ============ MAIN CONTAINER ============ */
.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  padding-top: 2rem;
}

/* ============ HERO / PROFILE ============ */
.profile-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 25%;
  flex-shrink: 0;
  border: 3px solid var(--border);
  transition: border-color var(--transition);
}

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

.profile-info .role {
  font-size: 1rem;
  color: var(--text-body);
  margin: 0 0 0.25rem;
  line-height: 1.4;
}

.profile-info .affiliation {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0 0 0.4rem;
  line-height: 1.4;
}

.profile-info .email {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin: 0;
}

/* ============ SECTION HEADINGS ============ */
h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
  letter-spacing: -0.01em;
}

h2:first-of-type {
  margin-top: 1rem;
}

/* ============ NEWS ============ */
.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-body);
}

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

.news-list li strong {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.82rem;
  display: inline-block;
  min-width: 70px;
}

.news-list li em { font-style: italic; }

.news-list li a {
  border-bottom: 1px solid var(--border);
}
.news-list li a:hover {
  border-bottom-color: var(--accent);
}

.news-collapsed li:nth-child(n+8) {
  display: none;
}

.read-more-btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.read-more-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ============ BIO ============ */
.bio-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-body);
}

.bio-text a {
  border-bottom: 1px solid var(--border);
}
.bio-text a:hover {
  border-bottom-color: var(--accent);
}

/* Institution timeline */
.timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.timeline-item {
  text-align: center;
  width: 100px;
}

.timeline-item img {
  height: 44px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  margin-bottom: 0.35rem;
  border-radius: 4px;
  background: #fff;
}

.timeline-item .inst-name {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-body);
  line-height: 1.3;
}

.timeline-item .inst-years {
  font-size: 0.68rem;
  color: var(--text-faint);
}

/* ============ PUBLICATIONS ============ */
.pub {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

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

.pub-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.3rem;
  color: var(--text);
}

.pub-title a {
  color: var(--text);
  border-bottom: 1px solid transparent;
}
.pub-title a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.pub-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 0.4rem;
}

.pub-meta .authors { color: var(--text-dim); }
.pub-meta .venue {
  color: var(--venue-color);
  font-weight: 500;
}

.pub-links {
  margin-top: 0.4rem;
}

.pub-links a {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--link-bg);
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 4px;
  margin-bottom: 3px;
  transition: all var(--transition);
}
.pub-links a:hover {
  background: var(--accent);
  color: #fff;
}



/* ============ FOOTER ============ */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.5rem 0;
  transition: border-color var(--transition);
}

.footer-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  text-align: center;
}

.footer-inner p {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin: 0;
  text-align: center;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .profile-section {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .profile-photo {
    width: 100px;
    height: 100px;
  }

  .scholar-stats {
    justify-content: center;
  }

  .nav-primary {
    gap: 0.75rem;
  }

  .nav-primary a {
    font-size: 0.82rem;
  }

  .header-inner {
    gap: 0.75rem;
  }

  .home-link {
    font-size: 1rem;
  }

  .timeline {
    gap: 0.75rem;
  }

  .timeline-item {
    width: 80px;
  }
}

@media (max-width: 480px) {
  .nav-primary {
    gap: 0.5rem;
  }

  .header-tools .nav-icon {
    display: none;
  }

  h2 {
    font-size: 1.2rem;
  }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============ HOVER GUARD ============ */
@media (hover: hover) {
  .nav-primary a:hover { border-bottom-color: var(--accent); }
  .pub-title a:hover { color: var(--accent); }
}

/* ============ POST STYLES (keep for existing pages) ============ */
article.post .content { margin-bottom: 1rem; }

.post section {
  line-height: 1.7;
  font-size: 16px;
  color: var(--text-body);
}
