:root {
  /* Corner radius, Fibonacci, same scale as spacing so that
     inner = outer - padding lands on another step.
     See branding/tokens.css. */
  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius-md: 13px;
  --radius-lg: 21px;
  --radius-pill: 999px;
  --radius-circle: 50%;

  --bg: #fbfbf9;
  --panel: #fcfcfb;
  --border: #dfdbd3;
  --text: #1c1917;
  /* Dấu mark, KHÔNG thuộc bậc chữ: chỉnh màu chữ thì logo phải đứng yên.
     Cùng giá trị ở mọi site d4t0 (branding/tokens.css --logo-color). */
  --logo-color: #293133;
  --muted: #6f6b64;
  --accent: #6440e0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101014;
    --panel: #18181d;
    --border: #34363c;
    --text: #eeeef2;
    --logo-color: #eef0f4; /* branding --logo-color, khối dark */
    --muted: #a2a3a8;
    --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. */
/* 36×36 is the repo-wide size (branding/chrome.css, 22/08/2026). */
.topbar-logo {
  display: block;
  width: 36px;
  height: 36px;
  background-color: var(--logo-color);
  -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");
  /* Không xoay ở đây: logo.svg sinh ra đã xoay 45° sẵn
     (branding/build-icons.py, LOGO_ROTATE). Xoay thêm lần nữa là ra 90°. */
}

.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: var(--radius-sm);
}

.post-content pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  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;
}

/* Centred (22/08/2026, repo-wide — branding/chrome.css), replacing the
   left-aligned rule this comment used to explain. The horizontal padding still
   matches .topbar: it keeps the line off the viewport edge on a narrow screen. */
.footer {
  margin-top: auto;
  background: var(--bg);
  text-align: center;
  padding: 20px 20px;
}

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

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

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