:root {
  --bg: #f8f7f4;
  --fg: #26231e;
  --mid: #7a7570;
  --dim: #bbb5ae;
  --line: #e2ddd8;
  --blue: #1a4480;
  --blue-dim: #d6e4f7;
}

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

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 400;
  line-height: 1.75;
  min-height: 100vh;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.8rem;
}

header {
  padding: 3.2rem 0 2rem;
  border-bottom: 1px solid var(--line);
}

.hdr-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
}

h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.6rem;
}

.nav-links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--mid);
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
  text-decoration: none;
}

.hdr-meta {
  margin-top: 1.4rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--mid);
  line-height: 1.9;
}

.hdr-meta a {
  color: var(--mid);
}

.hdr-meta a:hover {
  color: var(--blue);
  text-decoration: none;
}

.hdr-meta .sep {
  margin: 0 0.6em;
  color: var(--dim);
}

section {
  padding: 2.4rem 0;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  animation: appear 0.5s ease forwards;
}

.page-enter {
  opacity: 0;
  animation: appear 0.5s ease forwards;
  animation-delay: 0.15s;
}

section:last-of-type {
  border-bottom: none;
}

section:nth-of-type(1) {
  animation-delay: 0.15s;
}

section:nth-of-type(2) {
  animation-delay: 0.22s;
}

section:nth-of-type(3) {
  animation-delay: 0.29s;
}

section:nth-of-type(4) {
  animation-delay: 0.36s;
}

.sec-head {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 1.4rem;
}

.about-body {
  font-size: 0.975rem;
  color: var(--fg);
}

.about-body p + p {
  margin-top: 0.9em;
}

.interests {
  margin-top: 1.4rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--mid);
  line-height: 2;
}

.interests span {
  display: inline-block;
  margin-right: 0.3em;
  color: var(--dim);
}

.paper {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0 1.2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.paper:first-child {
  border-top: none;
}

.paper-yr {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--dim);
  padding-top: 0.15rem;
}

.paper-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 0.95rem;
  font-weight: 500;
  font-style: italic;
  color: var(--fg);
  line-height: 1.4;
}

.paper-authors {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--mid);
  margin-top: 0.25rem;
}

.paper-venue {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--mid);
}

.paper-venue em {
  font-style: normal;
  color: var(--fg);
}

.paper-links {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.9rem;
}

.paper-links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid var(--blue-dim);
  padding-bottom: 1px;
  transition: border-color 0.15s;
}

.paper-links a:hover {
  border-color: var(--blue);
  text-decoration: none;
}

.blog-list {
  list-style: none;
}

.blog-item {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.blog-item:first-child {
  border-top: none;
}

.blog-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

.blog-meta {
  margin-top: 0.25rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--mid);
}

.blog-summary {
  margin-top: 0.5rem;
  font-size: 0.92rem;
  color: var(--fg);
}

.article-wrap {
  padding: 2.8rem 0 4rem;
}

.article-back {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--mid);
  margin-bottom: 2.4rem;
  display: inline-block;
}

.article-back:hover {
  color: var(--blue);
  text-decoration: none;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.article-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 1.72rem;
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-bottom: 0.45rem;
}

.article-meta {
  font-family: 'IBM Plex Serif', serif;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--mid);
}

.article-body {
  font-size: 0.975rem;
  color: var(--fg);
}

.article-body p {
  margin: 1.1em 0;
}

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

.article-body h2 {
  font-family: 'IBM Plex Serif', serif;
  font-size: 1.28rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--fg);
  margin: 2rem 0 0.65rem;
}

.article-body h3 {
  font-family: 'IBM Plex Serif', serif;
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--fg);
  margin: 1.55rem 0 0.55rem;
}

.article-body h1 {
  font-family: 'IBM Plex Serif', serif;
  font-size: 1.48rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 2.2rem 0 0.75rem;
}

.article-body h4 {
  font-family: 'IBM Plex Serif', serif;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--mid);
  margin: 1.3rem 0 0.45rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4rem;
  margin: 1em 0;
}

.article-body li {
  margin: 0.3em 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.9rem;
}

.article-body th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  text-align: left;
  color: var(--mid);
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.45rem;
}

.article-body td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.45rem;
  vertical-align: top;
}

.article-body img {
  display: block;
  max-width: 100%;
  max-height: min(48vh, 560px);
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 1.4rem auto;
  border: 1px solid var(--line);
}

.article-body a img:hover {
  opacity: 0.92;
}

.article-body blockquote {
  border-left: 2px solid var(--line);
  margin: 1.6rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  color: var(--mid);
  font-style: italic;
}

.article-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.84em;
  background: #efeae3;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
}

.article-body pre {
  background: #efeae3;
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 1.4rem 0;
  border-radius: 2px;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.7;
}

.katex-display {
  margin: 1.6rem 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.footer {
  padding: 1.8rem 0 2.8rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--dim);
  opacity: 0;
  animation: appear 0.5s ease 0.5s forwards;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--line);
}

::selection {
  background: var(--blue-dim);
}

@media (max-width: 560px) {
  .hdr-top {
    flex-direction: column;
    gap: 1rem;
  }

  .article-title {
    font-size: 1.38rem;
  }
}
