/* ============================================================
   CSS VARIABLES
   ============================================================ */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Colors */
  --color-bg:          #ffffff;
  --color-bg-alt:      #f8f9fa;
  --color-text:        #1a1a2e;
  --color-text-muted:  #6b7280;
  --color-accent:      #2563eb;
  --color-accent-dark: #1d4ed8;
  --color-border:      #e5e7eb;

  /* Tag / badge palettes */
  --color-tag-bg:       #dbeafe;
  --color-tag-text:     #1d4ed8;

  /* Layout */
  --navbar-height: 64px;
  --max-width:     900px;
  --section-pad:   80px;

  /* Misc */
  --radius:       8px;
  --transition:   0.2s ease;
  --shadow-sm:    0 1px 4px rgba(0, 0, 0, 0.07);
  --shadow-md:    0 4px 20px rgba(0, 0, 0, 0.10);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
}

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

/* ============================================================
   NAVBAR
   ============================================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  transition: box-shadow var(--transition);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.nav-links {
  display: flex;
  gap: 2px;
  align-items: center;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-accent);
  background: #eff6ff;
  text-decoration: none;
}

/* Hamburger button (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Animated X state */
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

main {
  padding-top: var(--navbar-height);
}

.section {
  padding: var(--section-pad) 24px;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--color-text);
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--color-accent);
  margin-top: 8px;
  border-radius: 2px;
}

.section-subtitle {
  font-size: 0.975rem;
  color: var(--color-text-muted);
  margin-top: 16px;
  margin-bottom: 32px;
  max-width: 680px;
  line-height: 1.7;
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */

.section-about {
  padding-top: calc(var(--navbar-height) + 48px);
  padding-bottom: var(--section-pad);
}

.about-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.about-photo {
  flex-shrink: 0;
}

.profile-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.profile-placeholder {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #93c5fd);
  color: var(--color-accent);
  font-size: 2.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--color-border);
  box-shadow: var(--shadow-md);
  letter-spacing: 0.02em;
}

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

.about-name {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}

.about-position {
  font-size: 1rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: 20px;
}

.about-bio {
  margin-bottom: 24px;
  font-size: 0.975rem;
  color: var(--color-text);
}

.about-bio p + p {
  margin-top: 12px;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid transparent;
}

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

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

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-border);
}

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

/* ============================================================
   RESEARCH SECTION
   ============================================================ */

.research-interests {
  margin-top: 24px;
}

.research-interests h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--color-text);
}

.interest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.interest-list li {
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.875rem;
  color: var(--color-text);
  transition: border-color var(--transition), color var(--transition),
              background var(--transition);
  cursor: default;
}

.interest-list li:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: #eff6ff;
}

/* ============================================================
   PUBLICATIONS SECTION
   ============================================================ */

.section-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 8px;
  margin-bottom: 28px;
}

.pub-entry {
  display: flex;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--color-border);
}

.pub-entry:last-of-type {
  border-bottom: none;
}

/* Badge */
.pub-badge {
  flex-shrink: 0;
  align-self: flex-start;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 2px;
}

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

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

.pub-badge-workshop {
  background: #ede9fe;
  color: #5b21b6;
}

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

.pub-title {
  font-size: 0.975rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 4px;
  color: var(--color-text);
}

.pub-authors {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

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

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.pub-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-accent);
  background: #eff6ff;
  padding: 2px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.pub-link:hover {
  background: var(--color-accent);
  color: #ffffff;
  text-decoration: none;
}

.pub-tldr {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ============================================================
   PROJECTS SECTION
   ============================================================ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.project-card {
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  transition: box-shadow var(--transition), border-color var(--transition),
              transform var(--transition);
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.project-title {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.project-links {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.project-link {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-accent);
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 4px;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

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

.project-date {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
  align-self: center;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: 14px;
}

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

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  padding: 3px 9px;
  border-radius: 4px;
}

/* ============================================================
   EXPERIENCE / TIMELINE SECTION
   ============================================================ */

.timeline {
  position: relative;
  margin-top: 28px;
  padding-left: 28px;
}

/* Vertical line */
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-border));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

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

/* Dot on the line */
.timeline-marker {
  position: absolute;
  left: -24px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2.5px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-accent);
  z-index: 1;
}

.timeline-content {
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.timeline-content:hover {
  box-shadow: var(--shadow-sm);
  border-color: #d1d5db;
}

.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.timeline-role {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-accent);
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-org {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.timeline-details {
  padding-left: 18px;
  margin-top: 4px;
}

.timeline-details li {
  list-style: disc;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 3px;
  line-height: 1.6;
}

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

.timeline-details a:hover {
  text-decoration: underline;
}

.ta-award {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 1px 7px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */

.contact-container {
  text-align: center;
}

.contact-intro {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-top: 16px;
  margin-bottom: 36px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-decoration: none;
  transition: box-shadow var(--transition), border-color var(--transition),
              transform var(--transition);
  min-width: 190px;
}

.contact-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.contact-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-accent);
  font-style: normal;
}

.contact-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
  text-align: left;
}

.contact-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  word-break: break-all;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  background: var(--color-text);
  color: #9ca3af;
  padding: 28px 24px;
  text-align: center;
  font-size: 0.85rem;
}

.footer a {
  color: #93c5fd;
}

.footer a:hover {
  color: #bfdbfe;
  text-decoration: underline;
}

/* ============================================================
   RESPONSIVE — TABLET & MOBILE
   ============================================================ */

@media (max-width: 768px) {
  :root {
    --section-pad: 56px;
  }

  /* Show hamburger */
  .nav-toggle {
    display: flex;
  }

  /* Nav links collapse into dropdown */
  .nav-links {
    display: none;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 12px 16px 16px;
    gap: 2px;
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding: 10px 12px;
    width: 100%;
    font-size: 0.9rem;
  }

  /* About — stack vertically */
  .about-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-name {
    font-size: 1.75rem;
  }

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

  .profile-img,
  .profile-placeholder {
    width: 140px;
    height: 140px;
  }

  .section-title::after {
    margin-left: auto;
    margin-right: auto;
  }

  .section-subtitle {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }

  /* Timeline */
  .timeline {
    padding-left: 22px;
  }

  .timeline-marker {
    left: -19px;
  }

  .timeline-header {
    flex-direction: column;
    gap: 4px;
  }

  /* Projects — single column */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .contact-card {
    min-width: 160px;
    flex: 1;
  }
}

@media (max-width: 480px) {
  :root {
    --section-pad: 44px;
  }

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

  .about-name {
    font-size: 1.5rem;
  }

  .pub-entry {
    flex-direction: column;
    gap: 8px;
  }

  .pub-badge {
    align-self: flex-start;
  }

  .contact-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-card {
    min-width: auto;
  }

  .interest-list li {
    font-size: 0.82rem;
  }
}
