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

:root {
  --color-primary: #1a365d;
  --color-primary-light: #2b6cb0;
  --color-accent: #3182ce;
  --color-accent-hover: #2c5282;
  --color-text: #2d3748;
  --color-text-light: #718096;
  --color-bg: #ffffff;
  --color-bg-alt: #f7fafc;
  --color-border: #e2e8f0;
  --color-card-bg: #ffffff;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Lora', Georgia, serif;
  --max-width: 1100px;
  --nav-height: 70px;
}

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

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

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

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

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

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

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: transparent;
  backdrop-filter: none;
  border-bottom: none;
  z-index: 1000;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-bottom 0.3s ease;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.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-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.5px;
  transition: color 0.3s ease;
}

.navbar.scrolled .nav-logo {
  color: var(--color-primary);
}

.nav-logo:hover {
  color: #93c5fd;
}

.navbar.scrolled .nav-logo:hover {
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s ease;
  position: relative;
}

.navbar.scrolled .nav-links a {
  color: var(--color-text-light);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #3b82f6;
  transition: width 0.3s ease;
}

.navbar.scrolled .nav-links a::after {
  background: var(--color-accent);
}

.nav-links a:hover,
.nav-links a.active {
  color: #f1f5f9;
}

.navbar.scrolled .nav-links a:hover,
.navbar.scrolled .nav-links a.active {
  color: var(--color-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #f1f5f9;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.navbar.scrolled .nav-toggle span {
  background: var(--color-text);
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  padding-top: var(--nav-height);
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  overflow: hidden;
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.12) 1px, transparent 0);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-bg-pattern::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(49, 130, 206, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  animation: heroPulse 8s ease-in-out infinite;
}

.hero-bg-pattern::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  animation: heroPulse 10s ease-in-out infinite reverse;
}

@keyframes heroPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
}

.hero-text {
  flex: 1;
}

.hero-greeting {
  font-size: 1rem;
  color: #94a3b8;
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: heroFadeIn 0.6s ease forwards;
  opacity: 0;
}

.hero-name {
  font-family: var(--font-heading);
  font-size: 3.8rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -1.5px;
  animation: heroFadeIn 0.6s ease 0.15s forwards;
  opacity: 0;
}

.hero-title {
  font-size: 1.3rem;
  color: #cbd5e1;
  font-weight: 400;
  margin-bottom: 4px;
  animation: heroFadeIn 0.6s ease 0.3s forwards;
  opacity: 0;
}

.hero-affiliation {
  font-size: 1.05rem;
  color: #64748b;
  margin-bottom: 8px;
  animation: heroFadeIn 0.6s ease 0.4s forwards;
  opacity: 0;
}

.hero-focus {
  font-size: 1rem;
  color: #94a3b8;
  margin-bottom: 28px;
  max-width: 520px;
  line-height: 1.6;
  animation: heroFadeIn 0.6s ease 0.5s forwards;
  opacity: 0;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
  animation: heroFadeIn 0.6s ease 0.6s forwards;
  opacity: 0;
}

.hero-tag {
  display: inline-block;
  padding: 5px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.hero-tag:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.hero-buttons {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  animation: heroFadeIn 0.6s ease 0.7s forwards;
  opacity: 0;
}

.btn-hero-primary {
  background: #3b82f6;
  color: #fff;
  padding: 13px 30px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.btn-hero-primary:hover {
  background: #2563eb;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.btn-hero-outline {
  background: transparent;
  color: #cbd5e1;
  padding: 13px 30px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1.5px solid #334155;
  transition: all 0.25s ease;
}

.btn-hero-outline:hover {
  border-color: #94a3b8;
  color: #f1f5f9;
  transform: translateY(-2px);
}

.hero-socials {
  display: flex;
  align-items: center;
  gap: 16px;
  animation: heroFadeIn 0.6s ease 0.8s forwards;
  opacity: 0;
}

.hero-social-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: #64748b;
  transition: color 0.2s ease;
  letter-spacing: 0.3px;
}

.hero-social-link:hover {
  color: #93c5fd;
}

.hero-social-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #334155;
}

/* Hero Visual / Avatar */
.hero-visual {
  flex-shrink: 0;
  animation: heroFadeIn 0.8s ease 0.4s forwards;
  opacity: 0;
}

.hero-avatar-ring {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(
    from 0deg,
    #3b82f6,
    #8b5cf6,
    #06b6d4,
    #3b82f6
  );
  animation: ringRotate 6s linear infinite;
}

@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-avatar span {
  font-family: var(--font-heading);
  font-size: 4.5rem;
  font-weight: 700;
  color: #3b82f6;
  letter-spacing: -2px;
  opacity: 0.8;
}

/* Scroll Indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: heroFadeIn 0.6s ease 1s forwards;
  opacity: 0;
}

.hero-scroll-indicator span {
  font-size: 0.7rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, #475569, transparent);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(0.5); opacity: 0.4; }
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background: var(--color-primary-light);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 54, 93, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-border);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

/* ===== Sections ===== */
.section {
  padding: 100px 0;
}

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

/* ===== Dark Sections ===== */
.section-dark {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

.section-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.07) 1px, transparent 0);
  background-size: 40px 40px;
  pointer-events: none;
}

.section-dark .container {
  position: relative;
  z-index: 1;
}

.section-dark h2 {
  color: #f1f5f9;
}

.section-dark p,
.section-dark li {
  color: #94a3b8;
}

.section-dark a {
  color: #93c5fd;
}

.section-dark a:hover {
  color: #bfdbfe;
}

/* Dark Research Cards */
.section-dark .research-card {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.6);
  backdrop-filter: blur(4px);
}

.section-dark .research-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(59, 130, 246, 0.3);
}

.section-dark .research-card h3 {
  color: #e2e8f0;
}

.section-dark .research-card p {
  color: #94a3b8;
}

/* Dark Project Cards */
.section-dark .project-card {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(51, 65, 85, 0.6);
  backdrop-filter: blur(4px);
}

.section-dark .project-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(59, 130, 246, 0.3);
}

.section-dark .project-card h3 {
  color: #e2e8f0;
}

.section-dark .project-card p {
  color: #94a3b8;
}

.section-dark .project-tag {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
}

.section-dark .pub-link {
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}

.section-dark .pub-link:hover {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

/* Dark Contact */
.section-dark .contact-label {
  color: #cbd5e1;
}

.section-dark .contact-item span {
  color: #94a3b8;
}

.section-dark .contact-links a {
  color: #93c5fd;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.section-subtitle {
  color: var(--color-text-light);
  font-size: 1rem;
  margin-bottom: 40px;
}

/* ===== About Section ===== */
.about-content p {
  margin-bottom: 16px;
  font-size: 1.05rem;
  max-width: 780px;
}

.about-highlights {
  display: flex;
  gap: 48px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.highlight-item {
  text-align: center;
}

.highlight-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.highlight-label {
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== Research Section ===== */
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.research-card {
  background: var(--color-card-bg);
  padding: 32px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.research-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.research-icon {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 16px;
  opacity: 0.7;
}

.research-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.research-card p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ===== Publications Section ===== */
.publications-list {
  margin-top: 20px;
}

.pub-year-group {
  margin-bottom: 40px;
}

.pub-year {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

.pub-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

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

.pub-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

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

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

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

.pub-link {
  display: inline-block;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 20px;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.pub-link:hover {
  background: var(--color-accent);
  color: #fff;
}

/* ===== Projects Section ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.project-card {
  background: var(--color-card-bg);
  padding: 28px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.project-tag {
  display: inline-block;
  padding: 3px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  background: rgba(49, 130, 206, 0.08);
  border-radius: 20px;
  margin-bottom: 16px;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.project-card p {
  color: var(--color-text-light);
  font-size: 0.93rem;
  line-height: 1.6;
  flex: 1;
}

.project-links {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ===== Teaching Section ===== */
.teaching-list {
  margin-top: 40px;
}

.teaching-item {
  display: flex;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--color-border);
  align-items: flex-start;
}

.teaching-item:last-child {
  border-bottom: none;
}

.teaching-role {
  flex-shrink: 0;
  width: 160px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 4px;
}

.teaching-details h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.teaching-semester {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: 8px;
  font-weight: 500;
}

.teaching-details p:last-child {
  color: var(--color-text);
  font-size: 0.95rem;
}

/* ===== Contact Section ===== */
.contact-content {
  margin-top: 40px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.contact-label {
  flex-shrink: 0;
  width: 80px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 2px;
}

.contact-item a,
.contact-item span {
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.6;
}

.contact-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-links a {
  font-weight: 500;
}

/* ===== Footer ===== */
.footer {
  padding: 40px 0;
  text-align: center;
  background: #0f172a;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
}

.footer p {
  font-size: 0.9rem;
  color: #64748b;
}

.footer-note {
  margin-top: 4px;
  font-size: 0.82rem !important;
  opacity: 0.7;
}

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

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

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

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

  .hero-focus {
    max-width: 100%;
  }

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

  .hero-avatar-ring {
    width: 200px;
    height: 200px;
  }

  .hero-avatar span {
    font-size: 3.2rem;
  }

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

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

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

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

  .teaching-role {
    width: auto;
  }

  .contact-item {
    flex-direction: column;
    gap: 6px;
  }

  .contact-label {
    width: auto;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  }

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

  .nav-toggle {
    display: flex;
  }

  .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 {
    padding-top: var(--nav-height);
    padding-bottom: 40px;
    min-height: auto;
  }

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

  .hero-avatar-ring {
    width: 160px;
    height: 160px;
  }

  .hero-avatar span {
    font-size: 2.5rem;
  }

  .hero-scroll-indicator {
    display: none;
  }

  .section {
    padding: 60px 0;
  }

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

  .about-highlights {
    gap: 24px;
    flex-wrap: wrap;
  }

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

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

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

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