:root {
  --ink: #18181b;
  --muted: #66666f;
  --faint: #8a8a93;
  --line: #dedee3;
  --soft-line: #ececf0;
  --paper: #ffffff;
  --code: #f5f5f7;
  --link: #2457a6;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  max-width: 960px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.brand-prompt { color: var(--faint); }
.brand-dot { color: inherit; font-weight: inherit; }
.wheel-mark { display: none; }
.site-header nav { display: flex; gap: 22px; }
.site-header nav a {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
}
.site-header nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

.home-shell { max-width: 880px; margin: 0 auto; padding: 76px 24px 96px; }
.intro { max-width: 680px; margin-bottom: 88px; }
.section-label {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.intro h1 {
  margin: 0 0 20px;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.12;
  letter-spacing: -.035em;
}
.intro > p:last-child {
  margin: 0;
  max-width: 620px;
  color: #46464e;
  font-size: 18px;
  line-height: 1.65;
}

.posts-section { padding: 0; }
.posts-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 20px;
}
.posts-header h2, .mission h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -.02em;
}
.posts-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.search input {
  width: 190px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  padding: 9px 10px;
  color: var(--ink);
  font: 12px var(--mono);
  outline: none;
}
.search input:focus { border-color: #9b9ba4; box-shadow: 0 0 0 3px #f1f1f4; }
.post-list { border-top: 1px solid var(--line); }
.post-card { border-bottom: 1px solid var(--soft-line); }
.post-card[hidden] { display: none; }
.card-link {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 150px;
  gap: 22px;
  align-items: start;
  padding: 23px 0 24px;
  text-decoration: none;
}
.card-link time, .card-link .undated, .tags {
  padding-top: 4px;
  color: var(--faint);
  font: 11px/1.5 var(--mono);
}
.card-link .undated { padding-top: 4px; }
.tags { text-align: right; }
.post-card h3 {
  margin: 0 0 7px;
  font-size: 17px;
  line-height: 1.42;
  letter-spacing: -.01em;
}
.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.post-card:hover h3 { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.empty-state { margin: 0; padding: 28px 0; color: var(--muted); font: 12px var(--mono); }

.mission {
  display: grid;
  grid-template-columns: 112px minmax(0, 560px);
  gap: 22px;
  margin-top: 88px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.mission-copy p { margin: 0 0 16px; color: #46464e; font-size: 15px; line-height: 1.7; }
.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font: 11px var(--mono);
}
.site-footer p { display: none; }
.site-footer a { color: var(--muted); text-underline-offset: 3px; }
.footer-links { display: flex; gap: 20px; }

.article-shell { max-width: 800px; margin: 0 auto; padding: 54px 24px 100px; }
.back-link {
  color: var(--muted);
  font: 12px var(--mono);
  text-decoration: none;
}
.back-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.article-header { padding: 46px 0 38px; border-bottom: 1px solid var(--line); }
.post-tags { display: flex; gap: 12px; flex-wrap: wrap; }
.post-tags span { color: var(--muted); font: 11px var(--mono); }
.post-tags span + span::before { content: "/ "; color: #aaaab1; }
.article-header h1 {
  margin: 20px 0 18px;
  font-size: clamp(34px, 6vw, 48px);
  line-height: 1.13;
  letter-spacing: -.035em;
}
.article-deck { max-width: 700px; margin: 0; color: #51515a; font-size: 18px; line-height: 1.6; }
.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
  color: var(--faint);
  font: 11px var(--mono);
}
.post-content { padding-top: 42px; font-size: 17px; line-height: 1.78; }
.post-content > p,
.post-content > ul,
.post-content > ol,
.post-content > h2,
.post-content > h3,
.post-content > h4,
.post-content > blockquote,
.post-content > hr { max-width: 720px; margin-left: auto; margin-right: auto; }
.post-content h2 { margin-top: 2.2em; margin-bottom: .7em; font-size: 28px; line-height: 1.3; letter-spacing: -.025em; }
.post-content h3 { margin-top: 1.9em; margin-bottom: .6em; font-size: 21px; line-height: 1.35; }
.post-content h4 { margin-top: 1.7em; font-size: 17px; }
.post-content p { margin-top: 0; margin-bottom: 1.45em; }
.post-content li { margin: .45em 0; }
.post-content a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-content code { padding: .12em .3em; border-radius: 3px; background: var(--code); font-family: var(--mono); font-size: .86em; }
.post-content pre {
  max-width: 800px;
  margin: 28px 0;
  padding: 20px 22px;
  overflow: auto;
  border: 1px solid #e1e1e6;
  border-radius: 5px;
  background: var(--code);
  color: #25252b;
  font: 13px/1.65 var(--mono);
}
.post-content pre code { padding: 0; background: transparent; font-size: inherit; }
.post-content blockquote { margin-top: 28px; margin-bottom: 28px; padding-left: 20px; border-left: 3px solid #b7b7be; color: #4c4c55; }
.post-content img { display: block; max-width: 100%; height: auto; margin: 32px auto; }
.post-content figure, .post-content .kg-card { max-width: 800px; margin: 36px auto; }
.post-content table {
  width: 100%;
  max-width: 800px;
  margin: 30px auto;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
}
.post-content th,
.post-content td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.post-content th { background: var(--code); font-weight: 600; }
.post-content hr { margin-top: 48px; margin-bottom: 32px; border: 0; border-top: 1px solid var(--line); }
.content-note {
  margin-top: 36px !important;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

@media (max-width: 720px) {
  .site-header { min-height: 58px; padding: 0 18px; }
  .site-header nav { gap: 14px; }
  .site-header nav a { font-size: 11px; }
  .site-header nav a:nth-child(2) { display: none; }
  .home-shell { padding: 56px 18px 76px; }
  .intro { margin-bottom: 68px; }
  .posts-header { align-items: stretch; flex-direction: column; }
  .search input { width: 100%; }
  .card-link { grid-template-columns: 1fr; gap: 7px; padding: 20px 0; }
  .card-link time, .card-link .undated, .tags { padding: 0; }
  .tags { text-align: left; order: 3; }
  .mission { grid-template-columns: 1fr; gap: 16px; margin-top: 68px; }
  .article-shell { padding: 42px 18px 76px; }
  .article-header { padding: 36px 0 30px; }
  .article-header h1 { font-size: 36px; }
  .article-deck { font-size: 17px; }
  .post-content { padding-top: 34px; font-size: 16.5px; }
  .post-content h2 { font-size: 25px; }
  .post-content pre { margin-left: -18px; margin-right: -18px; padding: 18px; border-left: 0; border-right: 0; border-radius: 0; }
  .post-content table { display: block; overflow-x: auto; white-space: nowrap; }
  .site-footer { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
