:root {
  color-scheme: dark;
  --bg: #101010;
  --panel: #20211f;
  --line: #2b2b2a;
  --line-soft: #242424;
  --text: #d8d3ca;
  --strong: #f0eee8;
  --muted: #77736d;
  --soft: #aaa49b;
  --link: #9ecbd8;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3efe7;
  --panel: #e7e0d6;
  --line: #d5cbbd;
  --line-soft: #ddd4c7;
  --text: #2e2b27;
  --strong: #151310;
  --muted: #81786d;
  --soft: #5e574f;
  --link: #3b7184;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 17px;
  line-height: 1.7;
}

body { margin: 0; }

::selection { background: #9ecbd8; color: #111; }

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

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 22px 96px;
}

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

.brand {
  color: var(--strong);
  font-weight: 800;
  letter-spacing: .04em;
}

.site-header nav {
  display: flex;
  gap: clamp(18px, 5vw, 54px);
  color: var(--muted);
  font-weight: 700;
}

.theme-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  padding: 0;
}

.theme-toggle:hover { color: var(--strong); }

.hero {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 28px;
}

.section-heading {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .22em;
  margin: 0 0 18px;
  padding-top: 28px;
}

.section-heading span { letter-spacing: 0; margin-right: 14px; }

.post-list { border-top: 1px dashed var(--line-soft); }

.post-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-bottom: 1px dashed var(--line-soft);
  padding: 22px 0;
}

.post-row:hover .post-title { color: var(--strong); }
.post-accent { align-self: stretch; background: var(--accent); opacity: .85; }
.post-main { min-width: 0; }
.post-title { display: block; color: var(--strong); font-size: 1.22rem; font-weight: 800; line-height: 1.35; }
.post-description { display: block; color: var(--muted); font-size: .86rem; line-height: 1.45; margin-top: 6px; }
.post-meta { color: var(--muted); font-size: .9rem; font-weight: 700; white-space: nowrap; }

.article {
  font-size: .94rem;
  max-width: 820px;
  margin: 0 auto;
}

.article.compact { max-width: 720px; }
.article-header { margin-bottom: 48px; }
.article-meta { color: var(--muted); font-weight: 800; margin: 0 0 16px; }

h1 {
  color: var(--strong);
  font-size: clamp(2rem, 6vw, 3.7rem);
  line-height: 1.08;
  margin: 0;
  letter-spacing: -.055em;
}

.article-description {
  color: var(--soft);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.65;
  margin: 22px 0 0;
}

.prose { color: var(--text); }
.prose h2, .prose h3 { color: var(--strong); line-height: 1.25; margin: 2.3em 0 .75em; }
.prose h2 { font-size: 1.48rem; }
.prose h3 { font-size: 1.14rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.45rem; }
.prose a { color: var(--link); border-bottom: 1px solid currentColor; }
.prose a:hover { background: var(--link); color: #111; }
.prose blockquote { border-left: 4px solid #c7b7ff; color: var(--soft); margin: 2rem 0; padding-left: 1rem; }
.prose img { border: 1px solid var(--line); border-radius: 8px; display: block; height: auto; max-width: 100%; }
.prose code { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; color: var(--strong); padding: .1em .3em; }
.prose pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid #c7b7ff;
  border-radius: 7px;
  margin: 2rem 0;
  overflow-x: auto;
  padding: 1rem;
}
.prose pre code { background: transparent; border: 0; color: inherit; padding: 0; }

.hljs-keyword, .hljs-built_in, .hljs-name { color: #c7b7ff; }
.hljs-string, .hljs-title { color: #a7d7b9; }
.hljs-number, .hljs-literal { color: #d9b27d; }
.hljs-comment { color: #77736d; }

@media (max-width: 720px) {
  .shell { padding: 22px 16px 72px; }
  .site-header { align-items: flex-start; flex-direction: column; margin-bottom: 52px; }
  .post-row { grid-template-columns: 6px 1fr; }
  .post-meta { grid-column: 2; white-space: normal; }
}
