:root {
  color-scheme: dark;
  --font-body: Lato, Verdana, Helvetica, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --font-ui: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --bg-color: #000000;
  --text-color: #ffffff;
  --text-secondary: #d4d4d8;
  --link-color: #7db8c9;
  --link-hover: #ffcb05;
  --border-color: rgba(255, 255, 255, 0.12);
  --panel-bg: rgba(255, 255, 255, 0.05);
  --section-title-bg: rgba(255, 255, 255, 0.08);
  --section-title-bar: #7db8c9;
  --tab-bg: rgba(255, 255, 255, 0.08);
  --tab-active: #ffffff;
  --tab-active-text: #000000;
  --portrait-bg: #151515;
  --portrait-highlight: rgba(255, 255, 255, 0.18);
  --portrait-text: rgba(255, 255, 255, 0.76);
  --bg-stripe: rgba(255, 255, 255, 0.08);
  --bg-wash: rgba(0, 0, 0, 0.72);
  --overlay: rgba(0, 0, 0, 0.16);
  --toggle-bg: #ffffff;
  --toggle-text: #000000;
  --osu: #ffb3b3;
  --umich: #ffcb05;
  --upenn: #9ecbff;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-color: #f5f5f0;
  --text-color: #1f2933;
  --text-secondary: #334155;
  --link-color: #4a90a4;
  --link-hover: #ffcb05;
  --border-color: rgba(15, 23, 42, 0.1);
  --panel-bg: rgba(255, 255, 255, 0.42);
  --section-title-bg: rgba(31, 41, 51, 0.06);
  --section-title-bar: #4a90a4;
  --tab-bg: rgba(255, 255, 255, 0.58);
  --tab-active: #1f2933;
  --tab-active-text: #ffffff;
  --portrait-bg: #eef0ee;
  --portrait-highlight: rgba(255, 255, 255, 0.9);
  --portrait-text: rgba(31, 41, 51, 0.74);
  --bg-stripe: rgba(31, 41, 51, 0.08);
  --bg-wash: rgba(245, 245, 240, 0.72);
  --overlay: rgba(255, 255, 255, 0.25);
  --toggle-bg: #1f2933;
  --toggle-text: #ffffff;
  --osu: #bb0000;
  --umich: #00274c;
  --upenn: #011f5b;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 15px;
}

body,
td,
th,
tr,
p {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-color);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.lightbox-open {
  overflow: hidden;
}

body.lightbox-open .contact-widget {
  display: none;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
  font-weight: 500;
}

a:hover,
a:focus {
  color: var(--link-hover);
  text-decoration: none;
  opacity: 0.85;
}

strong {
  font-family: inherit;
  font-weight: 700;
}

p {
  margin: 0 0 14px;
}

h2 {
  margin: 0 0 16px;
  font-weight: normal;
  font-size: 23px;
}

ul {
  margin: 0;
  padding-left: 22px;
}

li {
  margin-bottom: 9px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
}

[data-theme="light"] .site-header {
  background: rgba(245, 245, 240, 0.9);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(100%, 1840px);
  margin: 0 auto;
  padding: 18px 6.4vw;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 34px;
  min-width: 0;
}

.brand {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text-color);
  font-family: var(--font-ui);
  font-size: clamp(1.05rem, 1.8vw, 1.55rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.brand:hover,
.brand:focus {
  color: var(--link-hover);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus {
  opacity: 0.82;
}

.theme-icon {
  display: none;
  width: 18px;
  height: 18px;
}

.theme-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
}

[data-theme="light"] .theme-icon-moon {
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(16px, 2.7vw, 42px);
  min-width: 0;
}

.nav-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text-color);
  padding: 0;
  font-family: var(--font-ui);
  font-size: clamp(0.96rem, 1.34vw, 1.28rem);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
  color: var(--link-hover);
  opacity: 1;
}

.background {
  position: fixed;
  inset: 0 auto 0 0;
  width: 33vw;
  z-index: -2;
  background:
    linear-gradient(var(--bg-wash), var(--bg-wash)),
    repeating-linear-gradient(
      -28deg,
      var(--bg-stripe) 0,
      var(--bg-stripe) 1px,
      transparent 1px,
      transparent 18px
    );
}

.dark-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, var(--overlay), transparent 42%);
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 0 24px;
  border: 0;
  border-spacing: 0;
  border-collapse: separate;
}

.intro-section {
  width: 100%;
  border: 0;
  border-spacing: 0;
  border-collapse: separate;
}

.portrait-cell {
  width: 37%;
  max-width: 37%;
  padding: 2.5%;
  vertical-align: middle;
}

.intro-cell {
  width: 63%;
  padding: 2.5%;
  vertical-align: middle;
}

.profile-photo {
  display: block;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  object-fit: cover;
}

.name {
  padding-top: 16px;
  margin: 0 0 13px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.15;
  font-weight: 500;
}

.profile-links {
  text-align: center;
  margin-bottom: 0;
  font-family: var(--font-mono);
  font-size: 0.98rem;
  letter-spacing: 0;
}

.profile-links a,
.profile-links .pending-link {
  font-family: inherit;
  font-weight: 700;
}

.pending-link {
  color: var(--text-secondary);
}

.a_osu {
  color: var(--osu);
}

.a_umich {
  color: var(--umich);
}

.a_upenn {
  color: var(--upenn);
}

.tab-navigation {
  display: none;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: calc(100% - 32px);
  margin: 12px auto 0;
  padding: 12px 10px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-color);
  min-height: 36px;
  padding: 6px 13px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(0);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.18s ease;
}

.tab-btn:hover,
.tab-btn:focus {
  background: var(--tab-bg);
  color: var(--link-color);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: var(--tab-active);
  color: var(--tab-active-text);
  border-color: var(--tab-active);
}

.tab-btn.is-popping {
  animation: tab-pop 0.34s cubic-bezier(0.2, 0.8, 0.25, 1.25);
}

.tab-btn.is-popping .tab-icon {
  animation: icon-hop 0.34s cubic-bezier(0.2, 0.8, 0.25, 1.25);
}

.tab-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
}

.tab-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes tab-pop {
  0% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(-4px) scale(1.035);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes icon-hop {
  0% {
    transform: rotate(0deg);
  }
  45% {
    transform: rotate(-8deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-btn,
  .tab-btn.is-popping,
  .tab-btn.is-popping .tab-icon {
    animation: none;
    transition: none;
  }
}

.tab-panels {
  width: 100%;
}

.tab-content {
  display: none;
}

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

.panel-table {
  width: 100%;
  margin: 0 auto;
  border: 0;
  border-spacing: 0;
  border-collapse: separate;
}

.panel-table > tbody > tr > td {
  width: 100%;
  padding: 14px;
  vertical-align: middle;
}

.scrollable-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 10px 4px 0;
}

.scrollable-list::-webkit-scrollbar {
  width: 8px;
}

.scrollable-list::-webkit-scrollbar-thumb {
  background: rgba(31, 41, 51, 0.22);
  border-radius: 8px;
}

.home-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.project-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.project-row {
  display: grid;
  grid-template-columns: minmax(150px, 205px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.project-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.project-meta {
  position: sticky;
  left: 0;
  align-self: center;
}

.project-meta h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.04rem;
  line-height: 1.25;
}

.project-gallery {
  position: relative;
  min-width: 0;
}

.project-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 0 46px 10px;
  scrollbar-color: var(--section-title-bar) transparent;
}

.project-strip::-webkit-scrollbar {
  height: 7px;
}

.project-strip::-webkit-scrollbar-thumb {
  background: var(--section-title-bar);
  border-radius: 999px;
}

.project-strip::-webkit-scrollbar-track {
  background: transparent;
}

.project-slide {
  appearance: none;
  display: block;
  flex: 0 0 min(58%, 360px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  scroll-snap-align: start;
}

.project-slide img {
  display: block;
  width: 100%;
  aspect-ratio: 842 / 595;
  object-fit: cover;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--tab-active);
  color: var(--tab-active-text);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.gallery-arrow:hover,
.gallery-arrow:focus {
  opacity: 0.82;
}

.gallery-arrow-left {
  left: 0;
}

.gallery-arrow-right {
  right: 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 42px;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox.open {
  display: grid;
}

.lightbox-figure {
  display: grid;
  gap: 12px;
  margin: 0;
  max-width: min(1120px, calc(100vw - 148px));
}

.lightbox-frame {
  position: relative;
  display: grid;
  justify-self: center;
  place-items: center;
  width: fit-content;
  max-width: 100%;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  object-fit: contain;
}

.lightbox-caption {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.56);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  padding: 0;
}

.lightbox-close {
  top: 0;
  right: -52px;
  width: 34px;
  height: 34px;
}

.lightbox-nav {
  top: 50%;
  width: 38px;
  height: 38px;
  transform: translateY(-50%);
}

.lightbox-close svg,
.lightbox-nav svg {
  display: block;
  fill: none;
  pointer-events: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox-close svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.6;
}

.lightbox-nav svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.8;
}

.lightbox-prev {
  left: -58px;
}

.lightbox-next {
  right: -58px;
}

.lightbox-close:hover,
.lightbox-close:focus,
.lightbox-nav:hover,
.lightbox-nav:focus {
  background: rgba(255, 255, 255, 0.2);
}

.research-list {
  margin-top: 8px;
}

.publication {
  font-size: 0.92rem;
  padding: 0 0 13px;
  margin: 0 0 13px;
  border-bottom: 1px solid var(--border-color);
}

.publication-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 4px 0 18px;
  padding: 9px 13px;
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--section-title-bar);
  border-radius: 4px;
  background: var(--section-title-bg);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.publication + .publication-section-title {
  margin-top: 32px;
}

.publication-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--section-title-bar), transparent);
  opacity: 0.6;
}

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

.papertitle {
  color: var(--text-color);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  font-family: var(--font-display);
  font-size: 1.01rem;
  font-weight: 700;
  line-height: 1.36;
}

a.papertitle {
  display: inline;
  font-weight: 700;
}

a.papertitle:hover,
a.papertitle:focus {
  color: var(--link-hover);
  text-decoration: underline;
}

.education-table {
  border-spacing: 0;
  table-layout: fixed;
}

.education-logo-col {
  width: 28%;
}

.education-text-col {
  width: 72%;
}

.education-table tr {
  background: transparent;
}

.education-table > tbody > tr > td {
  padding-top: 22px !important;
  padding-bottom: 22px !important;
}

.education-table > tbody > tr > .school-logo {
  width: 28% !important;
  max-width: none;
  padding-left: 3% !important;
  padding-right: 3% !important;
  vertical-align: middle;
}

.school-logo img {
  display: block;
  width: min(135px, 84%);
  max-width: 100%;
  max-height: 135px;
  object-fit: contain;
  margin: 0 auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.education-table > tbody > tr > .school-info {
  width: 72% !important;
  padding-left: 4% !important;
  padding-right: 2.5% !important;
  vertical-align: middle;
}

.school-info p {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.45;
  max-width: 640px;
}

.school-info strong {
  display: inline-block;
  margin-bottom: 2px;
  font-family: var(--font-ui);
  font-size: 1.04rem;
  line-height: 1.25;
}

.muted,
footer p {
  color: var(--text-secondary);
}

footer {
  width: calc(100% - 32px);
  margin: 18px auto 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

footer p {
  font-size: 14px;
  margin-bottom: 0;
}

.contact-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  justify-items: end;
  gap: 10px;
  font-family: var(--font-ui);
}

.contact-widget-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--tab-active);
  color: var(--tab-active-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.contact-widget-toggle:hover,
.contact-widget-toggle:focus {
  transform: translateY(-1px);
}

.contact-widget-icon {
  width: 18px;
  height: 18px;
}

.contact-widget-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-widget-card {
  display: none;
  min-width: 245px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.contact-widget.open .contact-widget-card {
  display: block;
}

.contact-widget-title {
  margin-bottom: 6px;
  color: var(--text-color);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 800;
}

@media (max-width: 760px) {
  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px 22px;
  }

  .brand-group {
    width: 100%;
    justify-content: space-between;
    gap: 16px;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 18px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-link {
    font-size: 1rem;
  }

  .container {
    padding-top: 20px;
  }

  .intro-section,
  .intro-section tbody,
  .intro-section tr,
  .portrait-cell,
  .intro-cell {
    display: block;
    width: 100%;
    max-width: none;
  }

  .portrait-cell {
    padding: 22px 22px 4px;
  }

  .intro-cell {
    padding: 8px 22px 18px;
  }

  .profile-photo {
    max-width: 230px;
  }

  .name {
    padding-top: 10px;
  }

  .tab-btn {
    flex: 0 0 auto;
  }

  .school-logo {
    width: 30% !important;
    max-width: none;
  }

  .school-logo img {
    width: min(118px, 90%);
    max-height: 118px;
  }

  .school-info {
    width: 70% !important;
    padding-left: 4% !important;
  }

  .project-row {
    grid-template-columns: 1fr;
  }

  .project-slide {
    flex-basis: min(72%, 340px);
  }
}

@media (max-width: 480px) {
  body,
  td,
  th,
  tr,
  p {
    font-size: 15px;
  }

  .panel-table > tbody > tr > td {
    padding: 14px;
  }

  .education-table,
  .education-table tbody,
  .education-table tr,
  .education-table td {
    display: block;
    width: 100%;
  }

  .education-table colgroup {
    display: none;
  }

  .school-logo {
    padding-bottom: 0 !important;
    max-width: none;
  }

  .school-info {
    padding-top: 10px !important;
    width: 100%;
  }

  .school-logo img {
    width: min(130px, 46vw);
  }

  .contact-widget {
    right: 14px;
    bottom: 14px;
  }

  .contact-widget-toggle span:last-child {
    display: none;
  }

  .contact-widget-toggle {
    width: 44px;
    justify-content: center;
    padding: 0;
  }

  .lightbox {
    padding: 24px 42px;
  }

  .lightbox-figure {
    max-width: calc(100vw - 84px);
  }

  .lightbox-nav {
    width: 38px;
    height: 38px;
  }

  .lightbox-prev {
    left: -42px;
  }

  .lightbox-next {
    right: -42px;
  }

  .lightbox-close {
    right: -38px;
  }
}
