:root {
  color-scheme: light;
  --background: #f8f7f3;
  --surface: #ffffff;
  --text: #202124;
  --muted: #666b73;
  --line: #d9d7cf;
  --accent: #0b6bcb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.65;
}

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

img {
  height: auto;
  max-width: 100%;
}

.site-header,
.site-main,
.site-footer {
  margin: 0 auto;
  max-width: 920px;
  padding: 24px;
}

.site-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.site-title {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

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

.site-main {
  min-height: 70vh;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.post,
.archive {
  max-width: 760px;
}

.post-header h1,
.archive h1 {
  font-size: clamp(32px, 7vw, 56px);
  letter-spacing: 0;
  line-height: 1.1;
  margin: 24px 0 12px;
}

.post-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.post-feature-image {
  border-radius: 6px;
  margin: 8px 0 32px;
}

.post-content :where(pre, table) {
  overflow-x: auto;
}

.post-content code {
  font-size: 0.9em;
}

.post-content pre {
  background: #1f2933;
  border-radius: 6px;
  color: #f7f9fb;
  padding: 16px;
}

.post-content blockquote {
  border-left: 4px solid var(--line);
  color: var(--muted);
  margin: 24px 0;
  padding-left: 18px;
}

.kg-card {
  margin: 28px 0;
}

.kg-image-card img,
.kg-bookmark-thumbnail img {
  border-radius: 6px;
}

.kg-card figcaption {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
  text-align: center;
}

.kg-bookmark-container {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 160px;
  overflow: hidden;
  padding: 16px;
  text-decoration: none;
}

.kg-bookmark-title {
  font-weight: 700;
  line-height: 1.3;
}

.kg-bookmark-description {
  color: var(--muted);
  font-size: 15px;
  margin-top: 6px;
}

.kg-bookmark-metadata {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 6px;
  margin-top: 12px;
}

.kg-bookmark-icon {
  height: 18px;
  width: 18px;
}

.kg-bookmark-thumbnail img {
  aspect-ratio: 4 / 3;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.post-tags {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
  padding-top: 20px;
}

.post-tags a,
.tag-list a {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: inline-block;
  font-size: 14px;
  padding: 4px 10px;
  text-decoration: none;
}

.post-list,
.tag-list {
  list-style: none;
  margin: 24px 0;
  padding: 0;
}

.post-list li,
.tag-list li {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 0;
}

.post-list time,
.tag-list span {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 14px;
}

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

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-list li,
  .tag-list li {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .kg-bookmark-container {
    grid-template-columns: 1fr;
  }
}
