/* ===== CSS Variables ===== */
:root {
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #1d4ed8;
  --accent-light: #dbeafe;
  --border: #e5e7eb;
  --card-bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --max-width: 1200px;
  --nav-height: 64px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #60a5fa;
  --accent-light: #1e3a5f;
  --border: #334155;
  --card-bg: #1e293b;
  --nav-bg: rgba(15, 23, 42, 0.95);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.3);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1.08rem;
  transition: background-color var(--transition), color var(--transition);
}

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

a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 30px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.nav-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.logo-text {
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition);
}

.logo-text:hover {
  color: var(--accent);
  opacity: 1;
}

.divider {
  height: 20px;
  width: 1px;
  background-color: var(--border);
  margin: 0 20px;
  flex-shrink: 0;
}

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

.nav-links li {
  margin-right: 20px;
}

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

.nav-links a:hover {
  color: var(--accent);
  opacity: 1;
}

.nav-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Theme dropdown */
.theme-dropdown {
  position: relative;
  display: inline-block;
}

.theme-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: var(--text);
  display: flex;
  align-items: center;
}

.moon-icon {
  width: 22px;
  height: 22px;
  transition: transform 0.3s ease;
}

.theme-icon-btn:hover .moon-icon {
  transform: rotate(-15deg);
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: var(--card-bg);
  min-width: 110px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 1001;
}

.theme-dropdown.open .dropdown-content {
  display: block;
}

.theme-opt {
  color: var(--text);
  padding: 9px 15px;
  display: block;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition);
}

.theme-opt:hover {
  background-color: var(--bg-alt);
}

/* ===== Container & Sections ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
}

section:nth-child(even) {
  background-color: var(--bg-alt);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-size: 0.95rem;
}

/* ===== About Section ===== */
#about {
  padding-top: 4rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 4rem;
  align-items: start;
}

.about-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  justify-content: flex-start;
  width: 100%;
}

.about-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--border);
  margin-bottom: 0.5rem;
}

.about-name {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.about-role {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 400;
  margin: 0.1rem 0 0.5rem;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem;
  margin-top: 0.25rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.6rem;
  width: 2.1rem;
  height: 2.1rem;
  transition: color var(--transition), transform var(--transition);
}

.social-link:hover {
  color: var(--accent);
  transform: translateY(-2px);
  opacity: 1;
}

.about-welcome {
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1rem;
}

.about-bio {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 2rem;
  margin-top: 0;
}

.about-bio a {
  color: var(--accent);
  font-weight: 500;
}

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

.about-subsection h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.interests-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.interests-list li {
  font-size: 1.05rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.interests-list li i {
  color: var(--accent);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.education-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.edu-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.edu-item i {
  color: var(--accent);
  font-size: 0.9rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.edu-degree {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.edu-institution {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== Experience Section ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.35rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: nowrap;
}

.timeline-header > div {
  flex: 1;
  min-width: 0;
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-org {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
}

.timeline-location {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.timeline-dates {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.timeline-desc {
  margin-top: 0.75rem;
  font-size: 0.975rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.timeline-desc a {
  color: var(--accent);
}

.timeline-desc ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* ===== Two-column sections (Experience, Contact) ===== */
.two-col-section {
  padding: 3rem 0;
}

.alt-section {
  background-color: var(--bg-alt);
}

.two-col {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.sec-left {
  flex: 1;
  padding: 0 2.5rem 0 0;
  text-align: right;
}

.sec-left h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sec-right {
  flex: 2;
  padding: 0;
}

.sec-right p {
  line-height: 1.75;
  margin-bottom: 1.2rem;
}

.sec-right p:last-child {
  margin-bottom: 0;
}

/* Contact email line */
.contact-email-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
}

.contact-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.contact-email-line a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.contact-email-line a:hover {
  opacity: 0.8;
}

/* ===== Publication Cards ===== */
.pub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.pub-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.pub-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.pub-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-journal {
  background: #dbeafe;
  color: #1e40af;
}

.badge-conference {
  background: #d1fae5;
  color: #065f46;
}

.badge-preprint {
  background: #fef3c7;
  color: #92400e;
}

.badge-book {
  background: #ede9fe;
  color: #4c1d95;
}

.badge-featured {
  background: var(--accent);
  color: #fff;
}

[data-theme="dark"] .badge-journal { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .badge-conference { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge-preprint { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .badge-book { background: #2e1065; color: #c4b5fd; }

.pub-year {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.pub-authors {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

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

.pub-venue {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.75rem;
}

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

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-sm:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
  opacity: 1;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  opacity: 0.88;
  color: #fff;
  background: var(--accent);
}


/* ===== Publication List Page ===== */
.pub-list-header {
  padding: 3rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.pub-filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pub-list .pub-card {
  margin-bottom: 1rem;
}



/* ===== Mission single-column ===== */
.mission-content {
  padding-top: 3rem;
  padding-bottom: 3rem;
  max-width: 680px;
}

.mission-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.mission-content p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.mission-content p:last-child {
  margin-bottom: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar {
    padding: 10px 20px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .divider {
    display: none;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 0;
  }

  .nav-links li {
    margin-right: 15px;
    margin-bottom: 4px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo-wrap {
    margin: 0 auto;
  }

  .about-welcome {
    font-size: 2.2rem;
  }

  .about-columns {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .about-subsection h3,
  .interests-list li,
  .edu-item {
    justify-content: flex-start;
    text-align: left;
  }

  .two-col {
    flex-direction: column;
    gap: 1rem;
  }

  .sec-left {
    text-align: left;
    padding: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
  }

  .timeline-header {
    flex-direction: column;
    gap: 0.25rem;
  }

  section {
    padding: 3.5rem 0;
  }

  .section-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .about-photo {
    width: 150px;
    height: 150px;
  }
}
