body {
  background-color: #000000;
  color: #ffffff;
  font-family: "Andale Mono", Monaco, "Courier New", monospace;
  margin: 0;
  padding: 24px;
  min-height: 100vh;
  box-sizing: border-box;
}

h1 {
  font-weight: normal;
  font-size: 1.5rem;
  margin: 0;
}

p {
  margin: 0 0 8px 0;
}

/* Bottom-left brand badge */
.brand {
  position: fixed;
  left: 24px;
  bottom: 24px;
  margin: 0;
  z-index: 10;
}

.brand-logo {
  display: block;
  height: 28px;
  width: auto;
}

/* Bottom-right transparent text menu */
.menu {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: transparent;
  text-align: right;
  font-size: 0.95rem;
}

.menu a {
  color: #ffffff;
  text-decoration: none;
  margin-left: 16px;
}

.menu a:hover {
  text-decoration: underline;
}

/* Blog list */
#posts {
  margin-top: 24px;
  max-width: 640px;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #333333;
}

.post-item a {
  color: #ffffff;
  text-decoration: none;
}

.post-item a:hover {
  text-decoration: underline;
}

.post-item time {
  color: #888888;
  font-size: 0.85rem;
  white-space: nowrap;
  margin-left: 16px;
}

.empty {
  color: #888888;
}

/* Pagination */
.pager {
  margin-top: 24px;
  max-width: 640px;
  font-size: 0.95rem;
}

.pager a,
.pager span {
  margin-right: 16px;
}

.pager a {
  color: #ffffff;
  text-decoration: none;
}

.pager a:hover {
  text-decoration: underline;
}

/* Individual post */
#post {
  margin-top: 24px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.post-date {
  display: block;
  color: #888888;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

#post h1 {
  font-weight: bold;
  font-size: 1.8rem;
  margin: 0 0 16px 0;
}

#post h2 {
  font-weight: bold;
  font-size: 1.6rem;
  margin: 24px 0 12px 0;
}

#post h3 {
  font-weight: bold;
  font-size: 1.4rem;
  margin: 20px 0 10px 0;
}

#post h4 {
  font-weight: bold;
  font-size: 1.2rem;
  color: #c55050;
  margin: 18px 0 8px 0;
}

#post p,
#post ul,
#post ol {
  line-height: 1.6;
  margin: 0 0 16px 0;
}

#post ul,
#post ol {
  padding-left: 24px;
}

#post li {
  margin-bottom: 6px;
}

#post a {
  color: #ffffff;
  text-decoration: underline;
}

#post img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px 0;
}

#post code {
  font-family: "Andale Mono", Monaco, "Courier New", monospace;
  background: #1a1a1a;
  padding: 2px 6px;
  font-size: 0.9em;
}

#post pre {
  background: #1a1b26;
  padding: 16px;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  position: relative;
}

#post pre code {
  background: transparent;
  padding: 0;
  color: #a9b1d6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* URL coloring inside code blocks (Tokyo Night blue, overrides hljs tokens) */
#post pre code .hljs-url,
.hljs-url {
  color: #7aa2f7 !important;
}

/* Copy-to-clipboard button on code blocks */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  color: #a9b1d6;
  border: 1px solid #333333;
  padding: 2px 8px;
  font-family: "Andale Mono", Monaco, "Courier New", monospace;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}

#post pre:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  color: #ffffff;
  border-color: #7aa2f7;
}

.copy-btn.copied {
  color: #7aa2f7;
  border-color: #7aa2f7;
  opacity: 1;
}

#post blockquote {
  border-left: 2px solid #555555;
  margin: 0 0 16px 0;
  padding: 0 16px;
  color: #aaaaaa;
}

#post hr {
  border: none;
  border-top: 1px solid #333333;
  margin: 24px auto;
}

/* Prev/next post navigation */
.post-nav {
  margin-top: 32px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 16px;
  max-width: 640px;
  border-top: 1px solid #333333;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-nav a {
  color: #ffffff;
  text-decoration: none;
}

.post-nav a:hover {
  text-decoration: underline;
}

/* Sticky table of contents (desktop only) */
.toc {
  position: fixed;
  top: 48px;
  left: 24px;
  max-width: 240px;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  display: none; /* hidden by default, shown on desktop via media query */
}

.toc-title {
  text-align: center;
  font-size: 0.85rem;
  margin: 0 0 12px 0;
  color: #aaaaaa;
}

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

.toc-list .toc-list {
  padding-left: 0;
}

.toc-item {
  margin: 0;
  padding-left: 20px;
  position: relative;
}

.toc-h3 {
  padding-left: 16px;
}

.toc-h2::before,
.toc-h3::before {
  content: "-";
  position: absolute;
  left: 4px;
  color: #888888;
}

.toc-item a {
  color: #888888;
  text-decoration: none;
  display: block;
  padding: 2px 0;
}

.toc-item a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Indent by header level */
.toc-h2 a { font-weight: bold; color: #cccccc; }
.toc-h3 a { color: #999999; }

@media (min-width: 1200px) {
  .toc {
    display: block;
  }
}
