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

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --border: #e5e5e5;
  --tag-bg: #f0f0ee;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  height: 52px;
}

nav .name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

nav ul a {
  text-decoration: none;
  color: var(--muted);
  font-size: 13.5px;
  transition: color 0.15s;
}

nav ul a:hover { color: var(--text); }

/* LAYOUT */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* HERO */
#hero {
  padding: 4rem 0 3rem;
}

.hero-inner {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.hero-photo {
  flex-shrink: 0;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  background: var(--border);
}

.hero-photo-placeholder {
  flex-shrink: 0;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--tag-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 42px;
}

.hero-text h1 {
  margin: 0 0 0.25rem;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero-text .tagline {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 14.5px;
}

.hero-text .bio {
  margin: 0 0 1.2rem;
  font-size: 14.5px;
  color: var(--text);
  max-width: 520px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}

.link-btn:hover {
  border-color: #aaa;
  background: var(--tag-bg);
}

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

.link-btn.primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* SECTIONS */
section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

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

/* CARDS */
.card {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.card:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.15rem;
}

.card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-header h3 a {
  color: var(--text);
  text-decoration: none;
}

.card-header h3 a:hover { color: var(--accent); }

.card-date {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.card-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 0.6rem;
  font-style: italic;
}

.card ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.card ul li {
  font-size: 13.5px;
  color: #3a3a3a;
  margin-bottom: 0.3rem;
}

.card ul li:last-child { margin-bottom: 0; }

/* TAGS */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.7rem;
}

.tag {
  font-size: 11.5px;
  font-family: var(--mono);
  background: var(--tag-bg);
  color: var(--muted);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* PUBLICATIONS */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.pub-item {
  background: var(--surface);
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

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

.pub-venue {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.pub-title {
  margin: 0 0 0.25rem;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.pub-title a {
  color: var(--text);
  text-decoration: none;
}

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

.pub-authors {
  margin: 0 0 0.6rem;
  font-size: 13px;
  color: var(--muted);
}

.pub-abstract {
  margin: 0 0 0.75rem;
  font-size: 13.5px;
  color: #3a3a3a;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .pub-item { padding: 1.1rem 1rem; }
}

/* PROJECTS */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.project-card {
  background: var(--surface);
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.project-card:last-child { border-bottom: none; }
.project-card:hover { background: #fcfcfb; }

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.project-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-research {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-course {
  background: #f0fdf4;
  color: #166534;
}

.badge-teaching {
  background: #faf5ff;
  color: #6b21a8;
}

.project-period {
  font-size: 12px;
  color: var(--muted);
}

.project-card h3 {
  margin: 0 0 0.15rem;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-affil {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}

.project-desc {
  margin: 0 0 0.75rem;
  font-size: 13.5px;
  color: #3a3a3a;
  line-height: 1.6;
}

.project-desc code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--tag-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.project-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-shrink: 0;
}

.proj-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
}

.proj-link:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .project-card { padding: 1.1rem 1rem; }
  .project-card-top { flex-direction: column; gap: 0.5rem; }
  .project-links { flex-direction: row; flex-wrap: wrap; }
}

/* EDU */
.edu-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
}

.edu-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.edu-left h3 {
  margin: 0 0 0.1rem;
  font-size: 15px;
  font-weight: 600;
}

.edu-left .degree {
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
}

.edu-left .gpa {
  font-size: 13px;
  color: var(--muted);
  margin-top: 0.2rem;
}

.edu-right {
  text-align: right;
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* TEACHING */
.teach-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.7rem;
  font-size: 14px;
}

.teach-item .role { flex: 1; }
.teach-item .period { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* TEACH SUBSECTIONS */
.teach-subsection {
  margin-bottom: 1.75rem;
}

.teach-subsection:last-child { margin-bottom: 0; }

.teach-subheader {
  margin: 0 0 0.9rem;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* COURSE CARDS */
.course-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.course-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  background: var(--surface);
}

.course-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.course-card h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}

.course-links {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.course-role {
  margin: 0 0 0.5rem;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.course-desc {
  margin: 0;
  font-size: 13px;
  color: #3a3a3a;
  line-height: 1.55;
}

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

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

/* RESPONSIVE */
@media (max-width: 600px) {
  nav { padding: 0 1rem; }
  nav ul { gap: 1rem; }
  #hero { padding: 2.5rem 0 2rem; }
  .hero-inner { flex-direction: column; gap: 1.5rem; }
  .hero-photo, .hero-photo-placeholder { width: 100px; height: 100px; }
  .hero-text h1 { font-size: 1.5rem; }
  .card-header { flex-direction: column; gap: 0.1rem; }
  .card-date { align-self: flex-start; }
  .edu-item { flex-direction: column; gap: 0.2rem; }
  .edu-right { text-align: left; }
  .teach-item { flex-direction: column; gap: 0.1rem; }
}
