:root {
  --content-width: 720px;
  --font: 'Inter', Helvetica, Arial, sans-serif;
  /* Inter is a variable font: any weight from 100 to 900 works. */
  --body-weight: 350;

  --text: #000;
  --accent: #2447d2;
  --award: #007aff;
  --bg: #fff;
  --border: #e2e2e2;
  --underline: #000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-weight: var(--body-weight);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 56px 24px 40px;
}

/* Masthead */

.name {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
}

.email {
  margin-top: 4px;
  font-size: 13px;
}

.bio {
  margin-top: 14px;
}

.bio p + p {
  margin-top: 8px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 18px;
}

.links a {
  color: var(--award);
  text-decoration-color: currentColor;
}

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

/* Research */

.papers {
  margin-top: 32px;
}

.section-head {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.section-head h2 {
  font-size: 20px;
  font-weight: 600;
}

.paper {
  display: grid;
  /* Thumbnail stays beside the text and shrinks with the page instead of stacking. */
  grid-template-columns: min(180px, 30%) minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.paper-thumb {
  display: block;
}

/* Fixed 16:9 frame; the optional hover media fades in over the base on pointer devices. */
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px;
}

.thumb img,
.thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumb video {
  object-fit: cover;
}

/* For media on a white background that should show in full rather than be cropped. */
.thumb .contain {
  object-fit: contain;
}

.thumb-base,
.thumb-hover {
  transition: opacity 0.25s ease;
}

.thumb-hover {
  position: absolute;
  inset: 0;
  opacity: 0;
}

/* Fade the base out too, so it can't peek around a hover image with a different aspect ratio. */
@media (hover: hover) {
  .paper:hover .thumb-hover {
    opacity: 1;
  }

  .paper:hover .thumb:has(.thumb-hover) .thumb-base {
    opacity: 0;
  }
}

.paper-title {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
}

.paper-title a {
  text-decoration: none;
}

.paper-authors {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
}

.paper-authors b {
  font-weight: 600;
}

.paper-meta {
  margin-top: 2px;
  font-size: 12.5px;
}

.venue {
  font-style: italic;
}

.award {
  color: var(--award);
}

.papers-note {
  margin-top: 10px;
  font-size: 12px;
}

.footer {
  margin-top: 32px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .container {
    padding: 40px 16px 28px;
  }

  .name {
    font-size: 26px;
  }

  .paper {
    gap: 12px;
  }
}
