/* ===========================
   Design System & Variables
   =========================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #999999;
  --accent: #222222;
  --accent-light: #444444;
  --accent-bg: rgba(0, 0, 0, 0.04);
  --border: #e0e0e0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  --tag-bg: #f0f0f0;
  --tag-text: #333333;
  --gradient-hero: linear-gradient(135deg, #333 0%, #111 100%);
  --nav-bg: rgba(250, 250, 250, 0.9);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

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

/* ===========================
   Navigation
   =========================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
  border-radius: 1px;
}
.nav-links a:hover {
  color: var(--accent);
}
.nav-links a:hover::after {
  width: 100%;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(20deg);
}

/* Mobile Nav */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-primary);
}
.nav-hamburger svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ===========================
   Hero Section
   =========================== */
.hero {
  padding: 140px 24px 80px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-content {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}

.hero-photo-wrapper {
  flex-shrink: 0;
}

.hero-photo {
  width: 180px;
  height: 180px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--border);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.hero-photo:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.15);
}

.hero-info h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero-info .subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 400;
}

.hero-info .bio {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
  max-width: 540px;
}

.hero-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.25s ease;
}
.hero-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.hero-link svg {
  width: 16px;
  height: 16px;
}

/* ===========================
   Section Common
   =========================== */
.section {
  padding: 64px 24px;
  max-width: 900px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.section-divider {
  border: none;
  height: 1px;
  background: var(--border);
  max-width: 900px;
  margin: 0 auto;
}

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

.interest-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.interest-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-hero);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.interest-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.interest-card:hover::before {
  opacity: 1;
}

.interest-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
  display: block;
}

.interest-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.interest-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===========================
   Publications
   =========================== */
.pub-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.pub-filter-btn {
  padding: 6px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'Inter', sans-serif;
}
.pub-filter-btn.active,
.pub-filter-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pub-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  padding: 16px 20px;
  background: var(--accent-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.pub-stat {
  text-align: center;
}
.pub-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}
.pub-stat .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub-year-header {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 24px 0 4px 0;
  padding: 0;
}
.pub-year-header:first-child {
  margin-top: 0;
}

.pub-item {
  padding: 16px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  transition: none;
  animation: none;
  opacity: 1;
}

/* Thumbnail layout */
.research-item {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}
.research-video {
  width: 320px !important;
  min-width: 320px;
  max-width: 320px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}
.research-text {
  flex: 1;
}
.pub-item.has-thumb {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.pub-thumb {
  width: 200px !important;
  min-width: 200px;
  max-width: 200px;
  max-height: 140px;
  height: auto;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  object-fit: contain;
}
.pub-item.has-thumb .pub-text {
  flex: 1;
}
@media (max-width: 600px) {
  .pub-item.has-thumb {
    flex-direction: column;
  }
  .pub-thumb {
    width: 100%;
    min-width: unset;
    max-height: 180px;
    object-fit: contain;
  }
}
.pub-item:last-child {
  border-bottom: none;
}
.pub-item:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

.pub-item .pub-title {
  font-size: 0.93rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.5;
}
.pub-item .pub-title a {
  color: inherit;
  text-decoration: none;
}
.pub-item .pub-title a:hover {
  text-decoration: underline;
}

/* Type badges (Conference / Journal) */
.pub-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  padding: 2px 6px 3px;
  border-radius: 2.5px;
  margin-right: 6px;
  vertical-align: middle;
  text-transform: capitalize;
}
.pub-type.conference { background-color: #56AFD7; }
.pub-type.journal { background-color: #FF7043; }
.pub-type.registered { background-color: #56AFD7; }
.pub-type.applied { background-color: #FF9800; }

/* Inline [paper] / [code] links */
.pub-link-inline {
  font-size: 0.78rem;
  font-weight: 500;
  color: #56AFD7;
  text-decoration: none;
  margin-left: 2px;
}
.pub-link-inline:hover {
  text-decoration: underline;
}
.pub-link-inline.code {
  color: #555;
}

.pub-item .pub-authors {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.pub-item .pub-authors .me {
  font-weight: 700;
  color: var(--text-primary);
}

.pub-item .pub-venue {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.pub-item .pub-links {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pub-link {
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-weight: 500;
  transition: all 0.2s ease;
}
.pub-link:hover {
  background: var(--accent);
  color: #fff;
}

.pub-year-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  padding: 0;
  border-radius: 0;
  margin-bottom: 4px;
}

.pub-citations {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 8px;
}

/* ===========================
   Experience / Education
   =========================== */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: 28px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.timeline-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-item .role {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.timeline-item .period {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===========================
   Contact
   =========================== */
.contact-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  flex: 1;
  min-width: 200px;
}
.contact-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--accent);
}
.contact-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
}

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

/* ===========================
   Animations
   =========================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 1;
  transform: translateY(0);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
  .hero-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-info h1 {
    font-size: 1.8rem;
  }

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

  .hero-photo {
    width: 140px;
    height: 140px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open {
    display: flex;
  }

  .nav-hamburger {
    display: block;
  }

  .interests-grid {
    grid-template-columns: 1fr;
  }

  .pub-stats {
    flex-wrap: wrap;
    gap: 16px;
  }

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

@media (max-width: 480px) {
  .hero {
    padding: 110px 16px 48px;
  }
  .section {
    padding: 48px 16px;
  }
  .hero-info h1 {
    font-size: 1.5rem;
  }
}

/* Scroll bar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
