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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: light dark;
}

:root {
  --color-text: #000;
  --color-muted: #525252;
  --color-muted-soft: #a3a3a3;
  --color-hover: #262626;
  --color-background: #fff;
  --color-accent: #1a5fb4;
  --image-filtering: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "avenir next", avenir, "segoe ui", "helvetica neue", "Adwaita Sans", cantarell, ubuntu, roboto, noto, helvetica, arial, sans-serif;
  color: var(--color-text);
  background-color: var(--color-background);
  font-size: 1rem;
  line-height: 1.5rem;
  max-width: 36rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Navigation */
.banner-video {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  object-position: center bottom;
  border-radius: 6px;
  margin: 0 0 2.5rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  margin-left: -8px;
  letter-spacing: -0.025em;
}

nav a {
  padding: 0.25rem 0.5rem;
  margin: 0.25rem;
  transition: color 0.15s;
}

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

nav a.active {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

/* Headings */
h1 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -1.2px;
  margin-bottom: 32px;
}

h1.title {
  margin-bottom: 0;
}

.section-label {
  font-size: 14px;
  color: var(--color-muted);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 2.5rem 0 1rem;
}

.intro {
  margin-bottom: 1rem;
}

/* Article meta */
.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  font-size: 14px;
  color: var(--color-muted);
}

/* Posts / publications list */
.posts {
  margin: 2rem 0;
}

.post-link {
  display: block;
  margin-bottom: 1rem;
}

.post-content {
  display: flex;
  flex-direction: column;
}

.post-date {
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.025em;
  font-size: 14px;
}

.post-title {
  color: #171717;
  letter-spacing: -0.025em;
}

.pub-content {
  margin-bottom: 1.25rem;
}

.pub-title-inline {
  color: #171717;
  letter-spacing: -0.025em;
}

.pub-meta {
  color: var(--color-muted);
  font-size: 14px;
}

.pub-entry {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.pub-badge {
  flex-shrink: 0;
  align-self: flex-start;
  color: var(--color-muted);
  font-size: 12px;
  border: 1px solid var(--color-muted-soft);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  white-space: nowrap;
}

.pub-bibtex {
  margin-top: 0.4rem;
}

.pub-bibtex summary {
  cursor: pointer;
  color: var(--color-muted);
  font-size: 13px;
}

.pub-bibtex pre {
  background-color: #f5f5f5;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  overflow-x: auto;
  font-size: 13px;
  font-family: Menlo, Consolas, Monaco, "Adwaita Mono", "Liberation Mono", "Lucida Console", monospace;
}

.see-all {
  font-size: 14px;
  margin-top: 0.5rem;
}

/* Prose (page/article body) */
.photo-wrap {
  text-align: center;
  margin-bottom: 1rem;
}

.about-photo {
  max-width: 220px;
  width: 100%;
  border-radius: 4px;
}

.prose p {
  margin-top: 1rem;
  margin-bottom: 1rem;
  color: var(--color-hover);
}

.prose p:first-child {
  margin-top: 0;
}

.prose em {
  font-style: italic;
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--color-muted-soft);
  text-underline-offset: 2px;
  text-decoration-thickness: 0.1em;
  transition: all 0.15s;
}

.prose a:hover {
  text-decoration-color: var(--color-muted);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1rem 0;
}

/* Footer */
footer {
  margin-top: 3rem;
  margin-bottom: 4rem;
}

.footer-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
  color: var(--color-muted);
  list-style: none;
}

.footer-link svg {
  width: 24px;
  height: 24px;
}

.footer-link {
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.footer-link:hover {
  color: var(--color-hover);
}

.footer-note {
  margin-top: 1.25rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.footer-note a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s;
  white-space: nowrap;
}

.footer-note a:hover {
  text-decoration-color: var(--color-accent);
}

/* Responsive */
@media (min-width: 768px) {
  .post-content {
    flex-direction: row;
    gap: 0.5rem;
  }

  .talks .post-content {
    flex-direction: column;
    gap: 0;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #fff;
    --color-muted: #a3a3a3;
    --color-muted-soft: #a3a3a3;
    --color-hover: #e5e5e5;
    --color-background: #000;
    --color-accent: #7aa9ff;
    --image-filtering: 1;
  }

  .post-title,
  .pub-title-inline {
    color: #f5f5f5;
  }

  .pub-badge {
    border-color: #404040;
  }

  .pub-bibtex pre {
    background-color: #171717;
    border-color: #262626;
  }

  .footer-links {
    color: #d4d4d4;
  }

  .footer-link:hover {
    color: #f5f5f5;
  }
}
