:root {
  color-scheme: light;
  --bg: #faf8f1;
  --ink: #181716;
  --muted: #68635b;
  --faint: #817b70;
  --border: #d8d2c4;
  --border-soft: #e4ded1;
  --accent: #224f70;
  --accent-hover: #15384f;
  --code-bg: #eee9dd;
  --code-inline: #eee9dd;
  --code-border: #d8d2c4;
  --max-page: 980px;
  --max-post: 700px;
  --pad-x: 32px;
  --font-body: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.56;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgb(34 79 112 / 48%);
  text-underline-offset: 2px;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.site-header,
main {
  width: min(calc(100% - (var(--pad-x) * 2)), var(--max-page));
  margin-inline: auto;
}

.site-header {
  padding: 26px 0 15px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-block;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(34px, 5vw, 40px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.site-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-family: var(--font-ui);
}

.site-nav a {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

main {
  padding-block: 24px 54px;
}

.intro {
  max-width: var(--max-post);
  margin-bottom: 28px;
}

.home-intro {
  margin-bottom: 25px;
}

.intro.compact {
  margin-bottom: 25px;
}

.intro h1,
.post h1 {
  margin: 0 0 8px;
  font-family: var(--font-body);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0;
}

.intro.compact h1 {
  font-size: 34px;
}

.intro p,
.post-summary,
.post-description {
  margin: 0;
  color: var(--muted);
}

.intro p {
  font-size: 16.5px;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--max-post)) minmax(180px, 230px);
  gap: 42px;
  align-items: start;
}

.home-primary,
.post-list {
  max-width: var(--max-post);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 6px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-ui);
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
}

.section-heading a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.section-heading a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-list {
  display: grid;
}

.post-card {
  padding: 23px 0 24px;
  border-bottom: 1px solid var(--border-soft);
}

.post-card:first-child {
  padding-top: 16px;
}

.post-card h2 {
  margin: 0 0 5px;
  font-family: var(--font-body);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0;
}

.post-card h2 a {
  color: var(--ink);
  text-decoration-color: transparent;
}

.post-card h2 a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

.meta {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 7px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.post-summary,
.post-description {
  max-width: 62ch;
  font-size: 16.5px;
}

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-family: var(--font-ui);
}

.tag {
  display: inline-block;
  padding: 1px 6px 2px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: #f5f1e8;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  text-decoration: none;
}

.tag:hover {
  border-color: var(--border);
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.home-sidebar {
  padding-top: 9px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
}

.sidebar-section {
  padding: 12px 0 16px;
  border-top: 1px solid var(--border);
}

.sidebar-section h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.sidebar-section p {
  margin: 0;
}

.sidebar-section .tags {
  margin-top: 0;
}

.tag-list {
  display: grid;
  max-width: var(--max-post);
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  font-family: var(--font-ui);
  list-style: none;
}

.tag-list li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}

.tag-list a {
  color: var(--ink);
  text-decoration: none;
}

.tag-list a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tag-list span {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.post {
  max-width: var(--max-post);
}

.post-header {
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  margin-bottom: 9px;
}

.post-header .meta {
  margin-bottom: 8px;
}

.post-content {
  font-size: 16.5px;
}

.post-content > *:first-child {
  margin-top: 0;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content pre,
.post-content table {
  margin: 0 0 1.05em;
}

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

.post-content li + li {
  margin-top: 0.2em;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: var(--font-body);
  letter-spacing: 0;
}

.post-content h2 {
  margin: 1.9em 0 0.48em;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.25;
}

.post-content h3 {
  margin: 1.65em 0 0.42em;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.28;
}

.post-content h4 {
  margin: 1.45em 0 0.36em;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 3px;
}

.post-content blockquote {
  padding-left: 15px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

.post-content blockquote > *:last-child {
  margin-bottom: 0;
}

.post-content hr {
  height: 1px;
  margin: 1.6rem 0;
  border: 0;
  background: var(--border);
}

.post-content code {
  padding: 0.08em 0.26em;
  border-radius: 3px;
  background: var(--code-inline);
  font-family: var(--font-mono);
  font-size: 0.84em;
}

.post-content pre {
  overflow-x: auto;
  padding: 13px 14px;
  border: 1px solid var(--code-border);
  border-radius: 5px;
  background: var(--code-bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.5;
}

.post-content .mermaid {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  font-family: var(--font-ui);
  text-align: center;
}

.post-content .mermaid svg {
  max-width: 100%;
  height: auto;
}

.post-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.post-content pre .z-source {
  color: #2f2b25;
}

.post-content pre .z-comment {
  color: #7b7569;
  font-style: italic;
}

.post-content pre .z-keyword,
.post-content pre .z-storage {
  color: #704c2f;
  font-weight: 600;
}

.post-content pre .z-string {
  color: #5b4b31;
}

.post-content pre .z-entity,
.post-content pre .z-support {
  color: #224f70;
  font-weight: 600;
}

.post-content pre .z-punctuation,
.post-content pre .z-operator {
  color: #817260;
}

.post-content pre .z-variable,
.post-content pre .z-property {
  color: #2f5d50;
}

.post-content pre .z-constant,
.post-content pre .z-numeric {
  color: #704c2f;
}

.post-content pre .z-invalid,
.post-content pre .z-illegal {
  color: #7a2e24;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.post-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 14px;
}

.post-content th,
.post-content td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
}

.post-content th {
  color: var(--muted);
  font-weight: 650;
}

@media (max-width: 760px) {
  :root {
    --pad-x: 22px;
  }

  body {
    font-size: 16px;
    line-height: 1.55;
  }

  .site-header {
    padding-top: 20px;
  }

  .brand {
    font-size: 34px;
  }

  .site-nav {
    gap: 12px;
    margin-top: 9px;
  }

  .site-nav a {
    font-size: 15px;
  }

  main {
    padding-block: 20px 42px;
  }

  .home-layout {
    display: block;
  }

  .home-sidebar {
    margin-top: 28px;
    padding-top: 0;
  }

  .intro,
  .home-intro,
  .intro.compact {
    margin-bottom: 22px;
  }

  .intro h1,
  .post h1,
  .intro.compact h1 {
    font-size: 30px;
  }

  .post-card {
    padding: 21px 0 22px;
  }

  .post-card:first-child {
    padding-top: 14px;
  }

  .post-card h2 {
    font-size: 20px;
  }

  .post-content,
  .intro p,
  .post-summary,
  .post-description {
    font-size: 16px;
  }

  .post-content h2 {
    font-size: 23px;
  }

  .post-content h3 {
    font-size: 20px;
  }

  .post-content pre {
    font-size: 13px;
  }
}
