:root {
  --bg: #ffffff;
  --bg-soft: #f5f8fb;
  --text: #1c2127;
  --text-muted: #56606b;
  --text-faint: #6e7781;
  --border: #e3e8ee;
  --accent: #1f4e79;
  --link: #1f6fb2;
  --link-hover: #144f86;
  --badge-bg: #e8f0f8;
  --badge-text: #1f4e79;
  --me: #0d1117;
  --glow: rgba(31, 111, 178, 0.1);
  --shadow: 0 18px 40px -18px rgba(18, 48, 84, 0.45);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --maxw: 880px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --bg-soft: #151a21;
    --text: #e6edf3;
    --text-muted: #9da7b3;
    --text-faint: #7d8590;
    --border: #262d37;
    --accent: #8cb8e8;
    --link: #79b0ec;
    --link-hover: #a8cdf5;
    --badge-bg: #172a40;
    --badge-text: #9cc4ef;
    --me: #ffffff;
    --glow: rgba(121, 176, 236, 0.1);
    --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(1100px 480px at 78% -140px, var(--glow), transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 56px;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.topbar nav {
  display: flex;
  gap: 26px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.topbar nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.topbar nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "head photo"
    "bio  photo";
  column-gap: 52px;
  padding: 64px 0 8px;
}

.hero-head {
  grid-area: head;
}

.hero-bio {
  grid-area: bio;
}

.hero-photo {
  grid-area: photo;
  align-self: start;
  margin-top: 6px;
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.role {
  margin: 12px 0 26px;
  color: var(--accent);
  font-size: 1.02rem;
  font-weight: 500;
}

.role .sep {
  margin: 0 0.25em;
  color: var(--text-faint);
}

.hero-bio p {
  margin: 0 0 14px;
}

.hero-bio strong {
  font-weight: 600;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.contact a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.contact a:hover {
  border-color: var(--link);
  color: var(--link);
  text-decoration: none;
}

.contact .icon {
  width: 16px;
  height: 16px;
}

/* Icons */

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sections */

main [id] {
  scroll-margin-top: 76px;
}

h2 {
  margin: 56px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Publications */

.pub {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  column-gap: 20px;
  padding: 16px 0;
}

.pub + .pub {
  border-top: 1px dashed var(--border);
}

.pub-tag {
  padding-top: 2px;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-solid {
  background: var(--accent);
  color: var(--bg);
}

.pub-title {
  margin: 0 0 4px;
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.45;
}

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

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

.pub-body p {
  margin: 0 0 3px;
  font-size: 0.93rem;
}

.pub-authors {
  color: var(--text-muted);
}

.pub-authors strong {
  color: var(--me);
  font-weight: 700;
  white-space: nowrap;
}

.pub-venue {
  color: var(--text-muted);
  font-style: italic;
}

.pub-venue .note {
  color: var(--text-faint);
  font-style: normal;
}

.pub-body .pub-tldr {
  margin-top: 10px;
}

.pub-featured {
  padding: 22px 22px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-soft);
}

/* Link buttons */

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.pub-body .links {
  margin-top: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--link);
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.btn .icon {
  width: 13px;
  height: 13px;
}

a.btn:hover {
  border-color: var(--link);
  background: var(--badge-bg);
  text-decoration: none;
}

.btn.is-disabled {
  border-style: dashed;
  background: transparent;
  color: var(--text-faint);
  cursor: not-allowed;
  user-select: none;
}

.soon {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.6;
  text-transform: uppercase;
}

/* Model contributions */

.section-lead {
  margin: -4px 0 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.models {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.model {
  display: flex;
  flex-direction: column;
  padding: 16px 18px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
}

.model-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.model h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.model-date {
  flex: none;
  color: var(--text-faint);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.model-spec {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.model .links {
  margin-top: auto;
  padding-top: 14px;
}

/* Experience & Education */

.entries {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}

.entry + .entry {
  border-top: 1px dashed var(--border);
}

.entry h3 {
  margin: 0 0 2px;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.45;
}

.entry p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.entry-date {
  flex: none;
  color: var(--text-faint);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Footer */

.footer {
  margin-top: 64px;
  padding-bottom: 40px;
  color: var(--text-faint);
  font-size: 0.85rem;
}

.footer p {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Responsive */

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
      "photo head"
      "bio   bio";
    column-gap: 18px;
    align-items: center;
    padding-top: 36px;
  }

  .hero-photo {
    align-self: center;
    margin-top: 0;
  }

  .hero-photo img {
    aspect-ratio: 1;
    border-radius: 50%;
    box-shadow: none;
  }

  h1 {
    font-size: 1.9rem;
  }

  .role {
    margin: 8px 0 0;
    font-size: 0.93rem;
    line-height: 1.5;
  }

  .role span {
    display: block;
  }

  .role .sep {
    display: none;
  }

  .hero-bio {
    margin-top: 24px;
  }

  h2 {
    margin-top: 44px;
    font-size: 1.35rem;
  }

  .pub {
    grid-template-columns: minmax(0, 1fr);
  }

  .pub-tag {
    padding: 0 0 6px;
  }

  .pub-featured {
    padding: 18px 16px;
  }

  .models {
    grid-template-columns: minmax(0, 1fr);
  }

  .entry {
    flex-direction: column;
    gap: 2px;
  }

  .entry-date {
    order: -1;
    font-size: 0.85rem;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 20px;
  }

  .brand {
    display: none;
  }

  .topbar nav {
    gap: 18px;
    margin: 0 auto;
  }

  .topbar nav a {
    font-size: 0.88rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .topbar {
    display: none;
  }

  body {
    background: none;
  }

  .hero {
    padding-top: 0;
  }

  .hero-photo img {
    box-shadow: none;
  }

  .pub-featured,
  .model {
    background: none;
  }

  a {
    color: inherit;
  }
}
