:root {
  --text: #222;
  --muted: rgba(0, 0, 0, 0.7);
  --line: #eee;
  --line-strong: rgba(0, 0, 0, 0.18);
  --accent: #33c3f0;
  --accent-soft: rgba(51, 195, 240, 0.12);
  --background: #fff;
  --surface: #fff;
  --surface-muted: #f8f8f8;
  --shadow: rgba(0, 0, 0, 0.15);
  --timeline: #33c3f0;
  --timeline-soft: rgba(51, 195, 240, 0.16);
  --timeline-lead: #a51417;
  --yale: #00356b;
  --yale-soft: rgba(0, 53, 107, 0.28);
  --washu: #a51417;
  --washu-soft: rgba(165, 20, 23, 0.28);
  --ghana: #146b3a;
  --ghana-soft: rgba(20, 107, 58, 0.28);
  --brand-github: #181717;
  --brand-linkedin: #0a66c2;
  --brand-scholar: #4285f4;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

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

html[data-theme="dark"] {
  color-scheme: dark;
  --text: #eef2f6;
  --muted: rgba(238, 242, 246, 0.72);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #7fd8ff;
  --accent-soft: rgba(127, 216, 255, 0.12);
  --background: #0f1419;
  --surface: #161d24;
  --surface-muted: #1d252e;
  --shadow: rgba(0, 0, 0, 0.38);
  --timeline: #7fd8ff;
  --timeline-soft: rgba(127, 216, 255, 0.18);
  --timeline-lead: #ec8d90;
  --yale: #6fb1e6;
  --yale-soft: rgba(111, 177, 230, 0.32);
  --washu: #ec8d90;
  --washu-soft: rgba(236, 141, 144, 0.32);
  --ghana: #8bd5a7;
  --ghana-soft: rgba(139, 213, 167, 0.32);
  --brand-github: #f0f6fc;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: "Raleway", sans-serif;
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--accent);
}

.skip-link:focus {
  left: 12px;
}

button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

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

h1,
h2,
h3,
h4,
h5,
p,
ul {
  margin-top: 0;
}

h2 {
  letter-spacing: 0;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 14px;
}

h2::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--accent);
  flex: 0 0 auto;
}

.site-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px 40px;
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  line-height: 1;
}

.theme-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.theme-option svg {
  width: 16px;
  height: 16px;
  display: block;
}

.theme-option:focus {
  outline: none;
}

.theme-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-option:hover {
  color: var(--text);
}

.theme-option.active,
.theme-option.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.site-header {
  margin: 36px 0 48px;
}

.header-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.profile-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
}

.intro-column h1::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin-top: 14px;
  background: var(--accent);
}

.intro-column h1 {
  margin-bottom: 0.6rem;
  font-size: 2.6rem;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: 0;
}

.intro-role,
.intro-column p {
  margin-bottom: 0.4rem;
  font-size: 1.02rem;
}

.intro-note {
  color: var(--muted);
}

.affiliation {
  color: var(--affil, var(--accent));
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--affil-soft, var(--accent-soft));
  transition: border-color 200ms ease;
}

.affiliation:hover {
  border-bottom-color: var(--affil, var(--accent));
}

.affiliation--yale {
  --affil: var(--yale);
  --affil-soft: var(--yale-soft);
}

.affiliation--washu {
  --affil: var(--washu);
  --affil-soft: var(--washu-soft);
}

.affiliation--ghana {
  --affil: var(--ghana);
  --affil-soft: var(--ghana-soft);
}

.social-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand, var(--muted));
  text-decoration: none;
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.social-icon:hover {
  border-color: currentColor;
  background: var(--surface-muted);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.social-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.social-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.social-icon--email { --brand: var(--accent); }
.social-icon--scholar { --brand: var(--brand-scholar); }
.social-icon--github { --brand: var(--brand-github); }
.social-icon--linkedin { --brand: var(--brand-linkedin); }

.footer-links a {
  font-size: 1rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  transition: color 0.2s ease;
}

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

.footer-links span {
  color: var(--muted);
}

.site-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  background: var(--background);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  flex-wrap: wrap;
}

.site-nav .theme-switcher {
  margin-left: auto;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  padding: 6px 0;
  transition: color 200ms ease;
}

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

.site-nav a:focus {
  outline: none;
}

.site-nav a:focus,
.site-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.site-nav a.active {
  color: var(--accent);
  font-weight: 700;
}

.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -19px;
  height: 3px;
  background: var(--accent);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.section {
  border-top: 1px solid var(--line);
  padding: 2.75rem 0;
  scroll-margin-top: 90px;
}

.tabs {
  margin-top: 1.6rem;
}

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 18px;
  padding: 0 0 0 5px;
}

.button {
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  height: 32px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 32px;
  text-transform: none;
  cursor: pointer;
}

.button.active {
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.button.link-button {
  height: 26px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  line-height: 26px;
  text-decoration: none;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.compact-list {
  margin-bottom: 0;
  padding-left: 18px;
}

.compact-list li {
  margin-bottom: 10px;
}

#updates .compact-list li > b:first-child {
  color: var(--accent);
  font-weight: 600;
}

.papers-grid.active {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.paper {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  transition: border-color 200ms ease, background 200ms ease;
}

.paper:hover {
  border-left-color: var(--accent);
  background: var(--surface-muted);
}

.paper .title {
  margin: 0 0 3px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.paper .title a {
  color: inherit;
  text-decoration: none;
  transition: color 200ms ease;
}

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

.paper .title a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 1.4rem;
}

.research-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.research-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.research-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.research-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.research-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}

.research-body {
  padding: 12px 14px 14px;
}

.research-title {
  margin: 0 0 6px;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.research-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 8px;
  padding: 0 8px;
  border: 1px solid var(--washu-soft);
  border-radius: 999px;
  background: var(--washu-soft);
  color: var(--washu);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.research-description {
  margin: 0 0 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}

.research-cta {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0;
}

.research-card:hover .research-cta span {
  transform: translateX(2px);
  display: inline-block;
  transition: transform 200ms ease;
}

.blog-empty {
  color: var(--muted);
  margin-top: 1rem;
}

.paper-meta {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--muted);
}

.paper-meta a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 200ms ease;
}

.paper-meta a:hover {
  color: var(--text);
}

.paper-meta a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.paper-meta i {
  font-style: italic;
}

.post-list {
  display: grid;
  gap: 10px;
}

.post-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

.post-card:hover {
  border-color: var(--accent);
  background: var(--surface-muted);
  transform: translateY(-1px);
}

.post-card-link {
  display: block;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
}

.post-card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.post-card h3 {
  margin-bottom: 4px;
  font-size: 0.98rem;
  line-height: 1.35;
}

.post-card p {
  margin-bottom: 8px;
}

.post-cta {
  display: inline-block;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
}

.post-meta {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.post-header {
  margin: 44px 0 36px;
}

.post-header h1 {
  max-width: 840px;
  margin-bottom: 0.8rem;
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.1;
}

.post-shell {
  max-width: 840px;
}

.post-article {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
}

.post-article h2 {
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

.post-article p,
.post-article li {
  font-size: 1.02rem;
}

.post-article ul {
  padding-left: 1.4rem;
}

.post-back {
  display: inline-block;
  margin-bottom: 1.4rem;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.post-back:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.timeline {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 20px auto 0;
  padding: 1em 0;
  list-style-type: none;
}

.timeline::before {
  position: absolute;
  left: 50%;
  top: 0;
  content: " ";
  display: block;
  width: 6px;
  height: 100%;
  margin-left: -3px;
  background: linear-gradient(to bottom, transparent 0%, var(--timeline-lead) 8%, var(--timeline-lead) 22%, var(--timeline) 34%, var(--timeline) 92%, transparent 100%);
  z-index: 5;
}

.timeline li {
  padding: 1em 0;
}

.timeline li::after {
  content: "";
  display: block;
  clear: both;
}

.direction-l,
.direction-r {
  position: relative;
  width: calc(50% - 30px);
}

.direction-l {
  float: left;
  text-align: right;
}

.direction-r {
  float: right;
}

.flag-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: inherit;
}

.direction-l .flag-wrapper {
  align-items: flex-end;
}

.direction-r .flag-wrapper {
  align-items: flex-start;
}

.flag {
  position: relative;
  display: inline-block;
  border: 1px solid var(--timeline-card-soft, var(--timeline-soft));
  background: linear-gradient(135deg, var(--timeline-card-soft, var(--timeline-soft)), var(--surface-muted) 62%);
  padding: 6px 10px;
  border-radius: 5px;
  color: var(--text);
  font-weight: 600;
  text-align: left;
}

.direction-l .flag {
  box-shadow: -1px 1px 1px var(--shadow), 0 0 0 3px var(--timeline-card-soft, var(--timeline-soft));
}

.direction-r .flag {
  box-shadow: 1px 1px 1px var(--shadow), 0 0 0 3px var(--timeline-card-soft, var(--timeline-soft));
}

.direction-l .flag::before,
.direction-r .flag::before {
  position: absolute;
  top: 50%;
  right: -40px;
  content: " ";
  display: block;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  background: var(--surface);
  border-radius: 10px;
  border: 4px solid var(--timeline-card, var(--timeline));
  z-index: 10;
}

.direction-r .flag::before {
  left: -40px;
}

.direction-l .flag::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -8px;
  border: solid transparent;
  border-left-color: var(--surface-muted);
  border-width: 8px;
}

.direction-r .flag::after {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -8px;
  border: solid transparent;
  border-right-color: var(--surface-muted);
  border-width: 8px;
}

.time-wrapper {
  display: block;
  line-height: 1.2em;
  font-size: 0.67em;
  color: var(--muted);
}

.time {
  display: inline-block;
  padding: 4px 6px;
  border: 1px solid var(--timeline-card-soft, var(--timeline-soft));
  background: var(--timeline-card-soft, var(--accent-soft));
  color: var(--timeline-card, var(--accent));
  font-weight: 700;
}

.timeline-item--washu {
  --timeline-card: var(--washu);
  --timeline-card-soft: var(--washu-soft);
}

.timeline-item--washu .flag {
  border-color: var(--washu-soft);
  background: linear-gradient(135deg, var(--washu-soft), var(--surface-muted) 62%);
}

.timeline-item--washu.direction-l .flag,
.timeline-item--washu .direction-l .flag {
  box-shadow: -1px 1px 1px var(--shadow), 0 0 0 3px var(--washu-soft);
}

.timeline-item--washu.direction-r .flag,
.timeline-item--washu .direction-r .flag {
  box-shadow: 1px 1px 1px var(--shadow), 0 0 0 3px var(--washu-soft);
}

.timeline-item--washu .flag::before {
  border-color: var(--washu);
}

.timeline-item--washu .time {
  border-color: var(--washu-soft);
  background: var(--washu-soft);
  color: var(--washu);
}

.desc {
  margin: 1em 0.75em 0 0;
  font-size: 0.85em;
  line-height: 1.6em;
}

.direction-r .desc {
  margin: 1em 0 0 0.75em;
}

.site-footer {
  position: relative;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
}

.site-footer::before {
  content: "";
  display: block;
  width: 72px;
  height: 2px;
  margin: 0 auto 16px;
  background: var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
  text-align: center;
}

.footer-note {
  font-size: 0.95rem;
  color: var(--muted);
}

@media (min-width: 750px) {
  .site-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 36px;
    padding: 22px 0;
  }

  .site-nav a.active::after {
    bottom: -23px;
  }

  .site-nav + main .page > .section:first-child {
    border-top-width: 0;
  }
}

@media (min-width: 1000px) {
  .research-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .header-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .intro-column {
    order: 1;
  }

  .profile-column {
    display: flex;
    justify-content: center;
    order: 2;
  }

  .profile-photo {
    max-width: 260px;
    margin: 0 auto;
  }
}

@media (max-width: 749px) {
  .site-container {
    padding: 0 16px 32px;
  }

  .site-header {
    margin: 24px 0 32px;
  }

  .header-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .profile-column {
    display: flex;
    justify-content: center;
    order: 2;
  }

  .intro-column {
    order: 1;
  }

  .profile-photo {
    max-width: 240px;
    margin: 0 auto;
  }

  .section {
    padding: 2rem 0;
    scroll-margin-top: 0;
  }

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

@media (max-width: 860px), (pointer: coarse) {
  .timeline {
    --mobile-timeline-axis: 11px;
    width: 100%;
    margin-top: 24px;
    padding: 0;
  }

  .timeline::before {
    left: var(--mobile-timeline-axis);
    width: 2px;
    margin-left: 0;
    transform: translateX(-50%);
  }

  .timeline li {
    position: relative;
    padding: 0 0 1.8em 36px;
  }

  .timeline li::before {
    content: "";
    position: absolute;
    left: var(--mobile-timeline-axis);
    top: 8px;
    width: 18px;
    height: 18px;
    border: 4px solid var(--timeline);
    border-radius: 999px;
    background: var(--background);
    transform: translateX(-50%);
    z-index: 10;
  }

  .timeline .timeline-item--washu::before {
    border-color: var(--washu);
  }

  .direction-l,
  .direction-r {
    float: none;
    width: 100%;
    padding-left: 0;
    text-align: left;
  }

  .direction-l .flag-wrapper,
  .direction-r .flag-wrapper {
    align-items: flex-start;
    text-align: left;
  }

  .direction-l .flag::before,
  .direction-r .flag::before {
    display: none;
  }

  .direction-l .flag::after,
  .direction-r .flag::after {
    display: none;
  }

  .flag {
    max-width: 100%;
    overflow-wrap: break-word;
  }

  .time-wrapper,
  .direction-l .time-wrapper,
  .direction-r .time-wrapper {
    display: block;
    margin-top: 0;
  }

  .desc,
  .direction-r .desc {
    margin: 0.65em 0 0;
    padding: 0;
    text-align: left;
  }

  .desc a {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 660px) {
  h2 {
    font-size: 1.35rem;
    margin-bottom: 1.1rem;
    gap: 12px;
  }

  h2::before {
    width: 22px;
  }

  .intro-column h1 {
    font-size: 2rem;
  }

  .social-links {
    gap: 6px;
  }

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

  .tab-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin-left: -4px;
    margin-right: -4px;
    padding: 0 4px 2px;
    scrollbar-width: none;
  }

  .tab-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-nav .button {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0 14px;
  }
}

@media (max-width: 480px) {
  .site-container {
    padding: 0 14px 26px;
  }

  .theme-option {
    width: 34px;
    height: 30px;
  }

  .intro-column h1 {
    font-size: 1.7rem;
  }

  .button {
    font-size: 12px;
  }
}
