:root {
  --text-primary: #1c1b1a;
  --text-secondary: #44423e;
  --text-tertiary: #82807a;
  --background: #f7f5f1;
  --rule: #1c1b1a;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--background);
}

.container {
  max-width: 620px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

h2 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--text-primary);
  text-underline-offset: 2px;
}

a:hover {
  background: var(--text-primary);
  color: var(--background);
  text-decoration: none;
}

p {
  margin-bottom: 0.75rem;
}

/* Profile */
.profile {
  margin-bottom: 0;
}

.profile h1 {
  margin-bottom: 1rem;
}

.profile-row {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
}

.profile-photo {
  flex: none;
  display: block;
  width: 140px;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.intro {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0;
}

/* Nav */
.nav-links {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.nav-links .sep {
  color: var(--text-tertiary);
  margin: 0 0.4rem;
  user-select: none;
}

/* Entries */
.entry {
  margin-bottom: 1.75rem;
}

.entry:last-child {
  margin-bottom: 0;
}

.meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.authors {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.entry-body p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.entry-body ul {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0 0;
}

.entry-body ul li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.2rem;
}

.entry-body ul li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--text-primary);
}

.entry-body .links-row {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  margin-bottom: 0;
}

/* Blog: back link */
.back {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Blog: post list */
.post-list {
  list-style: none;
}

.post-list li {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.post-list time {
  flex: none;
  width: 4.5rem;
  font-size: 0.75rem;
  line-height: 1.85;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.empty,
.archive-note {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.archive-note {
  margin-top: 3rem;
}

/* Home: blog section */
.section-link {
  text-decoration: none;
}

.post-list.recent li:nth-child(n+6) {
  display: none;
}

.post-list.recent time {
  width: 6.5rem;
}

/* Blog: post body */
.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  font-size: 1.625rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post {
  font-size: 1rem;
  line-height: 1.75;
}

.post p,
.post ul,
.post ol,
.post blockquote,
.post pre,
.post figure {
  margin-bottom: 1.25rem;
}

.post h2 {
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-transform: none;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-top: 0;
  border-top: none;
}

.post h3 {
  font-size: 1rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.post ul,
.post ol {
  padding-left: 1.4rem;
}

.post li {
  margin-bottom: 0.3rem;
}

.post blockquote {
  padding-left: 1rem;
  border-left: 2px solid var(--text-tertiary);
  color: var(--text-secondary);
}

.post img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.post figcaption {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 0.5rem;
}

.post code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: #ece9e3;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.post pre {
  background: #ece9e3;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  border-radius: 4px;
  line-height: 1.5;
}

.post pre code {
  background: none;
  padding: 0;
  font-size: 0.8125rem;
}

.post .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
}

/* Footer */
footer {
  max-width: 620px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

footer p {
  margin-bottom: 0;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  text-align: center;
}

footer a {
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .container {
    padding: 2.5rem 1.25rem 2.5rem;
  }

  .profile-row {
    flex-direction: column;
    gap: 1.25rem;
  }

  .profile-photo {
    width: 120px;
  }

  h1 {
    font-size: 1.375rem;
  }

  h2 {
    margin-top: 2.5rem;
  }

  footer {
    padding: 1rem 1.25rem 2.5rem;
  }
}
