:root {
  color-scheme: light dark;
  --ink: #17181b;
  --muted: #6b6e76;
  --line: rgba(23, 24, 27, 0.14);
  --surface: rgba(23, 24, 27, 0.04);
  --accent: #2563eb;
  --bg: #fdfdfb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e8ea;
    --muted: #9b9ea6;
    --line: rgba(232, 232, 234, 0.18);
    --surface: rgba(232, 232, 234, 0.07);
    --accent: #7ba3f7;
    --bg: #131417;
  }
}

* {
  box-sizing: border-box;
}

html {
  /* Reserve the scrollbar gutter so page width never shifts between short
     and long pages (classic scrollbars appear when a mouse is connected). */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 18px/1.7 Newsreader, Georgia, "Times New Roman", serif;
}

h1,
h2,
h3,
h4,
header,
.post-list .date,
.byline,
.tag,
.year-divider,
.prompt-box .copy {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

header nav {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 20px;
}

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

header a:hover {
  color: var(--ink);
}

header a.active {
  color: var(--ink);
  font-weight: 650;
}

header .icon {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

header .icon svg {
  width: 17px;
  height: 17px;
}

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

header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 650;
}

header .brand img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

header .spacer {
  flex: 1;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 96px;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
}

h2 {
  font-size: 22px;
  margin: 36px 0 8px;
}

h3 {
  font-size: 18px;
  margin: 28px 0 8px;
}

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

a:hover {
  text-decoration: underline;
}

img,
video {
  max-width: 100%;
  border-radius: 10px;
}

pre {
  overflow-x: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

code {
  font: 0.86em/1.6 ui-monospace, "SFMono-Regular", Menlo, monospace;
}

blockquote {
  margin: 0 0 16px;
  padding: 2px 18px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.byline {
  color: var(--muted);
  font-size: 14px;
  margin-top: -4px;
}

.tag {
  display: inline-block;
  padding: 1px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: none;
}

.year-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 34px 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.year-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--line);
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 7px 0;
}

.post-list .date {
  flex: none;
  width: 64px;
  color: var(--muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.post-list a {
  color: var(--ink);
}

.post-list a:hover {
  color: var(--accent);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-box {
  position: relative;
  margin: 0 0 24px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.prompt-box p {
  margin: 0;
  padding-right: 76px;
}

.prompt-box .copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

footer,
small {
  color: var(--muted);
}

@media (max-width: 600px) {
  header nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .post-list li {
    flex-direction: column;
    gap: 0;
  }
}
