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

:root {
  --bg: #fff;
  --text: #111;
  --muted: #5a6477;
  --link: #1772d0;
  --hover: #d97706;
  --border: #e5e7eb;
  --badge-conf: #eff6ff;
  --badge-conf-text: #1d4ed8;
  --badge-ws: #f0fdf4;
  --badge-ws-text: #166534;
  --badge-pre: #fefce8;
  --badge-pre-text: #92400e;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  margin: 0 -1.25rem;
  padding: 0 1.25rem;
}

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

.nav-name {
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--text);
  text-decoration: none;
}
.nav-name:hover { color: var(--link); text-decoration: none; }

nav ul { list-style: none; display: flex; gap: 1.75rem; }
nav ul a { text-decoration: none; color: var(--muted); font-size: 0.88rem; }
nav ul a:hover { color: var(--link); }

/* ── Links ── */
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--hover); text-decoration: underline; }

/* ── Hero ── */
.hero {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  padding: 1.75rem 0 2rem;
  position: relative;
  overflow: hidden;
}

.hero-text {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  animation: fade-up 0.55s ease-out both;
}

.hero-photo {
  position: relative;
  z-index: 1;
  animation: fade-up 0.55s ease-out 0.12s both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Particle canvas */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

#heroCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.subtitle {
  font-size: 0.93rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

.bio {
  font-size: 0.94rem;
  color: #222;
  margin-bottom: 0.6rem;
}

.hero-links {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.1rem;
  align-items: center;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow-x: auto;
}
.hero-links a {
  color: var(--link);
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}
.hero-links a:hover { color: var(--hover); text-decoration: underline; }
.hero-links a svg { flex-shrink: 0; opacity: 0.85; }
.hero-links .sep { color: #ccc; margin: 0 0.35rem; user-select: none; }

.hero-photo img {
  width: 200px;
  height: 260px;
  border-radius: 12px;
  object-fit: cover;
  object-position: top center;
  display: block;
  box-shadow: 0 8px 30px rgba(0,0,0,0.10);
}

/* ── Sections ── */
.section { padding: 2.2rem 0; border-top: 1px solid var(--border); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0;
}

.section-link { font-size: 0.82rem; }

/* ── News Feed ── */
.news-feed {
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #dde1e7 transparent;
}

.news-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid #f3f4f6;
  line-height: 1.5;
}
.news-item:last-child { border-bottom: none; }

[data-theme="dark"] .news-item { border-bottom-color: var(--border); }

.news-meta { display: contents; }

.news-date {
  font-size: 0.8rem;
  color: #6b8cba;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

.news-tag { display: none; }

.news-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
}

/* ── Education ── */
.edu-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.edu-left strong { font-size: 0.95rem; font-weight: 600; }
.edu-left p { font-size: 0.88rem; color: var(--muted); margin-top: 0.15rem; }
.edu-right { font-size: 0.86rem; color: var(--muted); white-space: nowrap; text-align: right; }

/* ── Achievements ── */
.ach-list { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.ach-list li {
  font-size: 0.91rem;
  color: #333;
  padding-left: 1.1rem;
  position: relative;
}
.ach-list li::before { content: '–'; position: absolute; left: 0; color: var(--muted); }

/* ── Logo Strip ── */
.logo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  align-items: flex-start;
}

.logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  text-decoration: none;
  max-width: 120px;
}

.logo-item:hover .logo-name { color: var(--link); }

.logo-box {
  width: 80px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.logo-box img {
  max-width: 80px;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(20%);
  transition: filter 0.2s;
}

.logo-item:hover .logo-box img { filter: grayscale(0%); }

.logo-name {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.logo-role {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.logo-date {
  font-size: 0.72rem;
  color: var(--link);
}

/* ── Experience Timeline ── */
.exp-timeline { display: flex; flex-direction: column; gap: 1.4rem; }

.exp-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.75rem;
}

.exp-date {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 0.12rem;
  line-height: 1.5;
}

.exp-role {
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.12rem;
}

.exp-org {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.exp-desc {
  font-size: 0.87rem;
  color: var(--text);
  line-height: 1.6;
}

.exp-tag {
  display: inline-block;
  font-size: 0.72rem;
  background: var(--badge-ws);
  color: var(--badge-ws-text);
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  font-weight: 500;
  vertical-align: middle;
}

/* ── Publications ── */
.pub-year-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 2rem 0 1.1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

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

.pub-title {
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 0.3rem;
}
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--link); text-decoration: none; }

.pub-authors {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  line-height: 1.5;
}
.pub-authors strong { color: var(--link); font-weight: 600; }

.venue {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.venue-conf { background: var(--badge-conf); color: var(--badge-conf-text); }
.venue-ws   { background: var(--badge-ws);   color: var(--badge-ws-text); }
.venue-pre  { background: var(--badge-pre);  color: var(--badge-pre-text); }

.pub-links { display: flex; gap: 0.7rem; margin-top: 0.35rem; flex-wrap: wrap; }
.pub-links a {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pub-links a:hover { color: var(--link); }

/* ── Mentoring ── */
.mentee-group-label {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 1rem 0 0.65rem;
}

.mentee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.7rem;
}

.mentee-card {
  border: 1px solid var(--border);
  border-top: 3px solid var(--link);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background: #fff;
  transition: box-shadow 0.18s, transform 0.18s;
}

.mentee-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.mentee-card.alumni {
  border-top-color: #9ca3af;
  background: #fafafa;
}

.mentee-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.mentee-affil {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.mentee-now {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.55rem;
  font-size: 0.73rem;
  font-weight: 500;
  color: #065f46;
  background: #d1fae5;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
}

.mentee-now::before { content: '→'; opacity: 0.7; }

/* ── Blog ── */
.post-list { display: flex; flex-direction: column; }
.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.post-item:first-child { border-top: 1px solid var(--border); }
.post-item a { color: var(--text); font-size: 0.93rem; }
.post-item a:hover { color: var(--link); text-decoration: none; }
.post-date { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }

.blog-coming {
  font-size: 0.93rem;
  color: var(--muted);
  padding: 2rem 0 1rem;
}

/* ── Publication filter ── */
.pub-filter-wrap {
  margin: 0.25rem 0 0.5rem;
}

.pub-filter {
  width: 100%;
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pub-filter::placeholder { color: #aab; }
.pub-filter:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(23, 114, 208, 0.1);
  background: #fff;
}

.pub-no-results {
  display: none;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 1.5rem 0;
}

/* ── Stats strip ── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.stat-item {
  padding: 1.3rem 1rem;
  text-align: center;
  border-right: 1px solid var(--border);
  transition: background 0.2s;
}
.stat-item:last-child { border-right: none; }
.stat-item:hover { background: #f9fafb; }
[data-theme="dark"] .stat-item:hover { background: #161923; }

.stat-number {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--link);
  line-height: 1;
  letter-spacing: -0.03em;
  display: block;
}

.stat-suffix {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--link);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  display: block;
}

@media (max-width: 600px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(1),
  .stat-item:nth-child(2) { border-bottom: 1px solid var(--border); }
}

/* ── Connect CTA ── */
.connect-section {
  border-radius: 14px;
  padding: 2.5rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 50%, #ecfdf5 100%);
  border: 1px solid #e0e7ff;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .connect-section {
  background: linear-gradient(135deg, #0f1f3d 0%, #1a1040 50%, #0a2218 100%);
  border-color: #1e2433;
}

.connect-section h3 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.connect-section p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.connect-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--link);
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s;
  margin-bottom: 1.2rem;
}
.connect-email:hover {
  box-shadow: 0 4px 14px rgba(23,114,208,0.15);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--link);
}

[data-theme="dark"] .connect-email {
  background: #111827;
  border-color: #1e3a5f;
}

.connect-socials {
  display: flex;
  justify-content: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.connect-socials a {
  font-size: 0.82rem;
  color: var(--muted);
}
.connect-socials a:hover { color: var(--link); text-decoration: none; }

/* ── Page header (sub-pages) ── */
.page-header { padding: 2.5rem 0 1.8rem; }
.page-header h1 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.page-header p { font-size: 0.91rem; color: var(--muted); margin-top: 0.4rem; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2.5rem;
  margin-top: 1rem;
  font-size: 0.83rem;
  color: var(--muted);
  text-align: center;
}

/* ── Theme toggle button ── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.1rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.theme-toggle:hover { color: var(--link); background: var(--border); }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── Dark theme ── */
[data-theme="dark"] {
  --bg: #0f1117;
  --text: #e8eaf0;
  --muted: #8b9ab5;
  --link: #60a5fa;
  --hover: #fbbf24;
  --border: #1e2433;
  --badge-conf: #1e3a5f;
  --badge-conf-text: #93c5fd;
  --badge-ws: #14352a;
  --badge-ws-text: #6ee7b7;
  --badge-pre: #3b2a10;
  --badge-pre-text: #fcd34d;
}

[data-theme="dark"] body { background: var(--bg); }

[data-theme="dark"] nav {
  background: rgba(15, 17, 23, 0.96);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .bio { color: #c9cdd8; }

[data-theme="dark"] .pub-title a { color: var(--text); }

[data-theme="dark"] .mentee-card,
[data-theme="dark"] .news-item {
  background: #161923;
  border-color: var(--border);
}

[data-theme="dark"] .mentee-card.alumni { background: #111318; }

[data-theme="dark"] .news-item:hover,
[data-theme="dark"] .mentee-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.4); }

[data-theme="dark"] .news-tag-paper   { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .news-tag-career  { background: #2d1f5e; color: #c4b5fd; }
[data-theme="dark"] .news-tag-service { background: #14352a; color: #6ee7b7; }
[data-theme="dark"] .news-tag-travel  { background: #3b2a10; color: #fcd34d; }

[data-theme="dark"] .mentee-now { background: #14352a; color: #6ee7b7; }

[data-theme="dark"] .timeline li,
[data-theme="dark"] .news-item { border-bottom-color: #1e2433; }

[data-theme="dark"] .pub-filter {
  background: #161923;
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .pub-filter:focus { background: #1a1e2a; }
[data-theme="dark"] .pub-filter::placeholder { color: #4a5568; }

[data-theme="dark"] .logo-box img { filter: grayscale(20%) brightness(1.15); }
[data-theme="dark"] .logo-item:hover .logo-box img { filter: grayscale(0%) brightness(1.2); }

[data-theme="dark"] .hero-photo img { box-shadow: 0 0 0 2px var(--border); }

[data-theme="dark"] footer { border-top-color: var(--border); }

[data-theme="dark"] .section { border-top-color: var(--border); }

[data-theme="dark"] .post-item { border-color: var(--border); }
[data-theme="dark"] .post-item:first-child { border-top-color: var(--border); }

/* ── Mobile ── */
@media (max-width: 600px) {
  .hero { flex-direction: column-reverse; gap: 1.25rem; padding-top: 2rem; }
  .hero-photo img { width: 110px; height: 140px; }
  #heroCanvas { display: none; }          /* no hover on touch → skip canvas */
  .edu-item { flex-direction: column; gap: 0.15rem; }
  .edu-right { text-align: left; }
  nav ul { gap: 0.85rem; }
  nav ul a { font-size: 0.82rem; }
  .nav-name { display: none; }
  .li-about { display: none; }            /* "About" redundant — hero is above the fold */
  .exp-item { grid-template-columns: 1fr; gap: 0.2rem; }
  .exp-date { font-size: 0.78rem; }
  .news-feed { grid-template-columns: 1fr; }
  .mentee-grid { grid-template-columns: 1fr; }
}
