:root {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --border: #dcdce2;
  --text: #17171a;
  --muted: #6b6b74;
  --accent: #6440e0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101014;
    --panel: #18181d;
    --border: #2d2d36;
    --text: #eeeef2;
    --muted: #93939e;
    --accent: #9c7bff;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--accent);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

/* The mark is a masked shape, not an <img>, so it takes var(--text) and
   follows light/dark without shipping two files. */
.topbar-logo {
  display: block;
  width: 24px;
  height: 24px;
  background-color: var(--text);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-image: url("/logo.svg");
  mask-image: url("/logo.svg");
}

.topbar-home {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.topbar-home:hover {
  color: var(--text);
}

main {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 8px 20px 24px;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  margin: 60px 0;
}

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

.post-list-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.post-list-item:first-child {
  padding-top: 0;
}

.post-list-title {
  display: block;
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

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

.post-list-excerpt {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.post-list-date {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.post-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.25;
}

.post-date {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.post-content {
  margin-top: 24px;
  font-size: 16px;
  line-height: 1.7;
}

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

.post-content img {
  max-width: 100%;
  border-radius: 8px;
}

.post-content pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
}

.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.post-back {
  margin-top: 32px;
  font-size: 14px;
}

.footer {
  margin-top: auto;
  background: var(--bg);
  text-align: center;
  padding: 20px 16px;
}

.footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  color: var(--muted);
}

.footer a:hover {
  color: var(--text);
}
