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

:root {
  --color-bg: #fafafa;
  --color-bg-alt: #f0f2f5;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-secondary: #555770;
  --color-accent: #2563eb;
  --color-accent-light: #dbeafe;
  --color-accent-dark: #1d4ed8;
  --color-border: #e2e8f0;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

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

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
}

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

a:hover {
  color: var(--color-accent-dark);
}

/* ===== Layout ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

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

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: all var(--transition);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 10px 0;
}

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

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 28px;
}

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

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

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

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8faff 0%, #eef2ff 50%, #e8edff 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.06) 0%, transparent 70%);
}

.hero-content {
  text-align: center;
  padding: 0 24px;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--color-text) 0%, #3b3b5c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  opacity: 0.8;
  margin-bottom: 32px;
}

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

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  border: 1.5px solid transparent;
}

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

.btn-primary:hover {
  background: var(--color-accent-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ===== About ===== */
.about-content {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  max-width: 720px;
  line-height: 1.8;
}

.about-content strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

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

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

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

.timeline-marker {
  position: absolute;
  left: -32px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 3px solid var(--color-accent);
  z-index: 1;
}

.timeline-content {
  background: var(--color-surface);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.timeline-header h3 {
  font-size: 1.1rem;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 500;
  white-space: nowrap;
}

.timeline-content ul {
  list-style: none;
  padding: 0;
}

.timeline-content li {
  position: relative;
  padding-left: 18px;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.timeline-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent-light);
  border: 1.5px solid var(--color-accent);
}

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

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--color-surface);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

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

.project-icon {
  width: 56px;
  height: 56px;
  background: var(--color-accent-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  margin-bottom: 20px;
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.project-subtitle {
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 12px;
}

.project-card p {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  margin-bottom: 16px;
  line-height: 1.7;
}

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

.project-tags span {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
  border-radius: 20px;
  font-weight: 500;
}

/* ===== Publications ===== */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pub-item {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.pub-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent-light);
}

.pub-year {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-accent);
  min-width: 48px;
  padding-top: 2px;
}

.pub-authors {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

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

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

/* ===== Education ===== */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.edu-card {
  background: var(--color-surface);
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  text-align: center;
  transition: all var(--transition);
}

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

.edu-degree {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.edu-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.edu-school {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.edu-year {
  font-size: 0.82rem;
  color: var(--color-accent);
  font-weight: 500;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.skill-category {
  background: var(--color-surface);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.skill-category h3 {
  font-size: 0.95rem;
  margin-bottom: 14px;
  color: var(--color-text);
}

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

.skill-tags span {
  font-size: 0.8rem;
  padding: 5px 12px;
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  border-radius: 20px;
  font-weight: 500;
}

/* ===== Footer ===== */
.footer {
  padding: 32px 0;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .section {
    padding: 60px 0;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    background: var(--color-surface);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 20px;
    box-shadow: var(--shadow-lg);
    transition: right var(--transition);
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    font-size: 1rem;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .hero-name {
    font-size: 2.5rem;
  }

  .hero-links {
    flex-direction: column;
    align-items: center;
  }

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

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

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

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

  .pub-year {
    min-width: auto;
  }

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

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}
