:root{
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel2: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --line: #cbd5e1;
  --accent: #2563eb;
  --shadow: 0 10px 30px rgba(2,6,23,.06);
  --radius: 18px;
}




*{ box-sizing: border-box; }
body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
}




.container{
  width: min(1100px, 92%);
  margin: 0 auto;
}

.topbar{
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}




.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 0;
  gap: 14px;
}

.logo{
  color: var(--text);
  text-decoration:none;
  font-weight: 650;
  letter-spacing: .2px;
}
.home .logo {
  display: none;
}

.home .topbar-inner {
  justify-content: flex-end;
}

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

.nav a{
  color: var(--muted);
  text-decoration:none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: .15s ease;
}

.nav a:hover{
  color: var(--text);
  border-color: var(--line);
  background: transparent;
}

.nav a.active{
  color: var(--text);
  border-color: var(--line);
  background: transparent;
}

.hero{
  display:grid;
  grid-template-columns: 1fr;
  gap: 22px;
  padding: 34px 0 10px;
  align-items: center;
}

@media (min-width: 860px){
  .hero{ grid-template-columns: 320px 1fr; gap: 28px; padding-top: 44px; }
}

.avatar{
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #ffffff;
}

.hero-right h1{
  margin: 0;
  font-size: clamp(28px, 3.2vw, 44px);
  letter-spacing: -0.4px;
}

.subtitle{
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.bio{
  margin: 14px 0 0;
  color: var(--text);
  line-height: 1.6;
  max-width: 70ch;
}

.cta{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  transition: .15s ease;
}

.btn:hover{
  background: #f8fafc;
  transform: translateY(-1px);
}

.btn.primary{
  background: var(--accent);
  border: none;
  color: white;
  box-shadow: 0 6px 14px rgba(37,99,235,.25);
}



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

.social-link{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  text-decoration:none;
  transition: .15s ease;
}

.social-link:hover{
  color: var(--text);
  background: #f8fafc;
}

.social-link svg{
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.section{
  margin-top: 28px;
  padding-top: 8px;
}

.section h2{
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: .2px;
}

.cards{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 860px){
  .cards{ grid-template-columns: repeat(3, 1fr); }
}

.card{
  display:block;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  text-decoration:none;
  transition: .15s ease;
  min-height: 120px;
}

.card:hover{
  background: var(--panel2);
  transform: translateY(-2px);
}



.card h3{
  margin: 0 0 8px;
  color: var(--text);
  font-size: 16px;
}

.card p{
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.updates{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}

.update{
  display:flex;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
}

.update + .update{
  border-top: 1px solid #cbd5e1;
}

.dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 6px;
  background: rgba(126, 255, 214, .7);
}

.footer{
  margin: 26px 0 30px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}


.teaching-list{
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.course{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.course-title{
  font-weight: 600;
  color: var(--text);
}

.course-terms{
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}

.page-title{
  margin: 22px 0 6px;
  font-size: 28px;
  letter-spacing: -0.3px;
}

.page-subtitle{
  margin: 0 0 14px;
  color: var(--muted);
}

.teach-stats{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 14px 0 18px;
}

@media (min-width: 860px){
  .teach-stats{ grid-template-columns: 220px 1fr; }
}

.stat{
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: var(--radius);
  padding: 12px 14px;
}

.stat-num{
  font-size: 18px;
  font-weight: 700;
}

.stat-label{
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.teach-block{
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: var(--radius);
  padding: 14px;
  margin: 14px 0;
}

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

.teach-header h2{
  margin: 0;
  font-size: 18px;
}

.teach-note{
  color: var(--muted);
  font-size: 13px;
}

.teach-table{
  display: grid;
  gap: 10px;
}

.teach-row{
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

@media (min-width: 860px){
  .teach-row{ grid-template-columns: 1.3fr 1fr; align-items: center; }
}

.teach-row-head{
  background: transparent;
  border: none;
  padding: 0 2px 6px;
  color: var(--muted);
  font-size: 13px;
}

.course-name{
  font-weight: 650;
}

.course-code{
  color: var(--muted);
  font-weight: 500;
}

.course-terms{
  color: var(--muted);
  line-height: 1.5;
}

.teach-bullets{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}


.pub-actions{
  margin: 12px 0 18px;
}

.pub-list{
  display: grid;
  gap: 12px;
}

.pub-card{
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: var(--radius);
  padding: 14px;
}

.pub-top{
  display:flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pub-title{
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

.pub-badge{
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 999px;
  padding: 6px 10px;
  margin-top: 1px;
}

.pub-authors{
  margin-top: 8px;
  color: var(--text);
  opacity: .9;
}

.pub-venue{
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.pub-meta{
  margin-top: 10px;
}

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

.edu-list{
  list-style: none;
  padding-left: 0;
  margin: 10px 0 18px;
}

.edu-list li{
  margin-bottom: 16px;
  line-height: 1.6;
}

.muted{
  color: var(--muted);
  font-size: 14px;
}

.interest-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* CV Page - consistent styling */
.cv-card .page-title {
  margin: 0 0 12px;
}

.cv-card .cv-actions {
  margin: 0 0 16px;
}

.cv-card .section-title {
  font-size: 1.45rem;    /* section title size */
  margin: 26px 0 12px;   /* consistent spacing above/below */
}

.cv-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.cv-item {
  padding: 14px 0;
  border-bottom: 1px solid #cbd5e1; /* works on dark */
}

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

.cv-item-head {
  line-height: 1.25;
  margin-bottom: 6px;
}

.cv-item-sub {
  opacity: 0.85;
  margin-bottom: 10px;
  line-height: 1.35;
}

.cv-bullets {
  margin: 0;
  padding-left: 18px;
}

.cv-bullets li {
  margin: 6px 0;         /* consistent row spacing */
  line-height: 1.45;
}

/* Slightly tighter list when needed (optional) */
.cv-list-tight .cv-bullets li {
  margin: 5px 0;
}





/* Improve readability */
.card p,
.pub-venue,
.course-terms,
.stat-label {
  color: #475569;
}

/* Stronger section titles */
.section h2,
.page-title {
  color: #0f172a;
}

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

  .row {
    flex-direction: column;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  body {
    font-size: 16px;
  }

  .card {
    padding: 16px;
  }
}

nav ul {
  display: flex;
  gap: 16px;
  list-style: none;
  padding: 0;
}

@media (max-width: 768px) {

  /* Topbar layout */
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Nav container */
  nav {
    padding: 2px 4px;
  }

  /* Menu (your .nav class) */
  .nav {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;          /* ✅ keep in one row */
    overflow-x: auto;           /* ✅ allow horizontal scroll */
    gap: 4px;

    -webkit-overflow-scrolling: touch;
  }

  /* Hide scrollbar (optional) */
  .nav::-webkit-scrollbar {
    display: none;
  }

  /* Menu items */
  .nav a {
    white-space: nowrap;        /* ✅ prevent text breaking */
    font-size: 14px;
    padding: 2px 4px;
  }
}

