:root {
  --bg: #f6f5f2;
  --surface: #eeece7;
  --text: #3c3933;
  --text-muted: #81796b;
  --text-strong: #181612;
  --border: #e4d9c9;
  --accent: #6f5bb8;
  --inline-code-bg: #e8e6e1;
  --code-bg: #f1efea;
  --code-text: #28241d;
  --code-border: #e6dccb;
  --code-keyword: #8b3f1f;
  --code-type: #2f6f73;
  --code-function: #6f5bb8;
  --code-string: #55751c;

  font-family:
    ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  font-size: 18px;
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--text-strong);
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  color: var(--text-strong);
  font-weight: 620;
  line-height: 1.12;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: 0;
  margin-bottom: 22px;
}

h2 {
  font-size: 1.45rem;
  letter-spacing: 0;
}

code {
  border-radius: 5px;
  padding: 0.14em 0.34em;
  color: var(--text-strong);
  background: var(--inline-code-bg);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.86em;
}

pre {
  margin: 0;
  overflow-x: auto;
  border: 1px solid var(--code-border);
  border-radius: 8px;
  padding: 18px;
  color: var(--code-text);
  background: var(--code-bg);
}

pre code {
  display: block;
  padding: 0;
  color: inherit;
  background: transparent;
  line-height: 1.55;
  white-space: pre;
}

.code-figure {
  margin: 20px 0 0;
}

.code-figure pre {
  margin-bottom: 6px;
}

.code-figure figcaption {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.code-figure figcaption code {
  color: var(--text-muted);
}

.token.keyword {
  color: var(--code-keyword);
  font-weight: 650;
}

.token.type {
  color: var(--code-type);
}

.token.function {
  color: var(--code-function);
  font-weight: 650;
}

.token.string {
  color: var(--code-string);
}

::selection {
  color: var(--text-strong);
  background: #dedbd4;
}

.site-shell {
  width: min(100% - 40px, 680px);
  margin: 0 auto;
  padding: 56px 0 72px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 72px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 35%;
}

.site-title {
  color: var(--text-strong);
  font-weight: 650;
}

.site-header nav {
  display: flex;
  gap: 18px;
  font-size: 0.94rem;
}

.site-header a {
  text-underline-offset: 3px;
}

.intro {
  margin-bottom: 48px;
}

.intro p {
  max-width: 58ch;
}

.post-index {
  margin-bottom: 68px;
}

.post-index h2 {
  margin-bottom: 18px;
}

.post-index ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-index li {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
}

.post-index time {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post {
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.post h2 {
  margin-bottom: 18px;
}

.post p + p,
.post pre + p,
.post p + pre,
.post p + .code-figure,
.post .code-figure + p {
  margin-top: 20px;
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .site-shell {
    width: min(100% - 28px, 680px);
    padding-top: 32px;
  }

  .site-header {
    display: grid;
    gap: 10px;
    margin-bottom: 48px;
  }

  .post-index li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
