/* ---------- tokens ---------- */
:root {
  --paper: #F6F5F1;
  --ink: #1B1E24;
  --ink-soft: #4A4E57;
  --rule: #DAD7CC;
  --ai: #3450C0;
  --bio: #1F8F63;
  --math: #A9720C;
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

/* ---------- base ---------- */
body {
  background-color: var(--paper) !important;
  color: var(--ink) !important;
  font-family: var(--font-body);
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.quarto-title-block h1.title,
h1.title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 42px;
}

p, li {
  color: var(--ink-soft);
  line-height: 1.75;
}

a { color: var(--ai); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- navbar ---------- */
.navbar {
  background-color: var(--paper) !important;
  border-bottom: 1px solid var(--rule);
  box-shadow: none !important;
}
.navbar-brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  color: var(--ink) !important;
}
.navbar-nav .nav-link {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft) !important;
  padding: 0.5rem 1rem !important;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--ink) !important;
}

/* ---------- main content width ---------- */
main.content {
  max-width: 980px;
  padding-top: 2rem;
}

/* ---------- section divider ---------- */
.section-rule {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 28px;
}
.section-rule .lbl {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.section-rule .line {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ---------- hero (index) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 30px 0 40px;
}
.hero-lattice {
  position: absolute;
  top: -60px;
  right: -140px;
  width: 480px;
  height: 480px;
  opacity: 0.5;
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin: 0 0 16px;
}
.hero h1 {
  font-size: 46px;
  line-height: 1.1;
  margin: 0 0 18px;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--ai);
}
.hero .lede {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 22px;
  max-width: 520px;
}
.hero .role {
  font-size: 15px;
  color: var(--ink);
}
.hero .role b { font-weight: 500; }
.hero .role a { color: var(--ink); border-bottom: 1px solid var(--rule); }

/* ---------- pillar cards (index + research) ---------- */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 8px 0 40px;
}
.pillar-card {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent, var(--ink));
  background: #FFFFFF;
  padding: 24px 22px;
}
.pillar-card.ai { --accent: var(--ai); }
.pillar-card.bio { --accent: var(--bio); }
.pillar-card.math { --accent: var(--math); }
.pillar-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: top;
  margin-bottom: 14px;
  filter: saturate(0.9);
}
.pillar-card h3 {
  font-size: 19px;
  margin: 0 0 10px;
}
.pillar-card p {
  font-size: 14px;
  margin: 0 0 14px;
}
.pillar-card a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent, var(--ai));
  font-weight: 500;
}

/* ---------- research page sections ---------- */
.research-section {
  padding: 30px 0 10px;
  border-top: 1px solid var(--rule);
}
.research-section:first-of-type { border-top: none; }
.research-section h1 {
  font-size: 30px;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.research-section h1::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent, var(--ink));
  display: inline-block;
}
.research-section.ai h1 { --accent: var(--ai); }
.research-section.bio h1 { --accent: var(--bio); }
.research-section.math h1 { --accent: var(--math); }
.research-section img {
  width: 100%;
  max-width: 260px;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: saturate(0.9);
}
.research-section ul { padding-left: 1.1em; }
.research-section li { margin-bottom: 10px; }
.research-section li strong { color: var(--ink); }

/* ---------- experience: timeline ---------- */
.timeline {
  position: relative;
  margin: 0 0 36px;
  padding-left: 28px;
  border-left: 1px solid var(--rule);
}
.timeline-item {
  position: relative;
  padding-bottom: 22px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ai);
}
.timeline-item .years {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 2px;
}
.timeline-item .role {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
}

/* generic simple lists on experience/courses */
.plain-list { padding-left: 1.1em; }
.plain-list li { margin-bottom: 8px; }

/* ---------- publications ---------- */
.pub-section h1 {
  font-size: 26px;
  margin: 34px 0 18px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.pub-section:first-of-type h1 { border-top: none; padding-top: 0; }
.pub-section ul { list-style: none; padding-left: 0; margin: 0; }
.pub-section li {
  font-size: 14.5px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.pub-section li:last-child { border-bottom: none; }
.tag-year, .tag-arxiv {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  background: #FFFFFF;
  border: 1px solid var(--rule);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.tag-arxiv a { color: var(--ink-soft); }

/* ---------- footer ---------- */
.page-footer {
  border-top: 1px solid var(--rule);
  color: var(--ink-soft) !important;
  font-size: 13px;
}

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .pillar-grid { grid-template-columns: 1fr; }
  .hero-lattice { width: 300px; height: 300px; top: -30px; right: -100px; opacity: 0.35; }
  .hero h1 { font-size: 34px; }
  .research-section { display: block; }
  .research-section img { max-width: 200px; margin-top: 16px; }
}
