html {
  overflow-y: scroll;
  background: #000;
}

body {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 16px;
  font: 14px/1.6 'JetBrains Mono', monospace;
  color: #fff;
  background: #000;
  font-family: 'JetBrains Mono', monospace !important;
}

a:link {
  color: #fff !important;
  transition: color 0.2s ease;
}

a:visited {
  color: #ccc !important;
}

a:hover {
  color: #aaa !important;
}

h1, h2, h3 {
  line-height: 1.3;
  color: #fff;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

p>code, code {
  color: #fff;
  background: #000;
  padding: 2px 4px;
  font-size: 0.9em;
}

pre {
  color: #fff;
  background: #1a1a1a;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.85em;
  margin: 16px 0;
  border-radius: 4px;
}

pre code {
  color: #fff;
  background: transparent;
}

.chroma {
  background-color: #1a1a1a !important;
  border-radius: 4px;
  padding: 16px;
  margin: 16px 0;
}

.chroma code {
  background: transparent !important;
}

article {
  background: #000;
  padding: 12px 0;
  margin-bottom: 0;
  border-bottom: 1px solid #1a1a1a;
}

article:last-of-type {
  border-bottom: none;
}

article h1 {
  font-size: 1.3rem;
  margin: 0 0 8px 0;
}

.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

figcaption {
  color: #fff;
  opacity: 0.5;
  font: 12px/1.5 monospace;
  text-align: center;
}

figure {
  margin: auto;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
}

header img {
  display: inline !important;
  margin: 0 8px 0 0 !important;
  width: 40px !important;
  height: 40px !important;
}

header {
  color: #fff;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

header > span {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

header > span > a {
  color: #fff !important;
  font-size: 1.4rem;
}

header > div {
  color: #fff;
  opacity: 0.6;
  font-size: 0.85rem;
  margin-top: 4px;
}

.links {
  margin: 8px 0;
}

.links a {
  display: inline-block;
  margin-right: 12px;
  color: #fff !important;
  transition: opacity 0.2s ease;
}

.links a:hover {
  opacity: 0.6;
  text-decoration: none !important;
}

.links a svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

nav a {
  color: #fff !important;
  font-size: 0.85rem;
  padding: 6px 10px;
  background: #1a1a1a;
  border-radius: 4px;
}

nav a:hover {
  background: #333;
  text-decoration: none !important;
}

.github-link {
  display: inline-block;
  margin-left: 0;
}

.github-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #333;
  color: #fff !important;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.github-link a svg {
  fill: #fff;
}

.github-link a:hover {
  background: #555;
  text-decoration: none !important;
}

.note {
  background: #1a1a1a !important;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.6;
}

.note-label {
  font-weight: 700;
  margin-right: 10px;
  color: #fff !important;
}

.note-text {
  color: #ccc !important;
}

.note-text a {
  color: #fff !important;
  text-decoration: underline !important;
}

article .meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  opacity: 0.5;
  color: #fff;
}

article .meta .tag {
  display: inline-block;
  padding: 1px 5px;
  background: #222;
  border-radius: 3px;
  font-size: 0.68rem;
  color: #fff !important;
  opacity: 1;
}

article .meta .tag:hover {
  background: #444;
  text-decoration: none !important;
}

article .tags {
  margin-bottom: 8px;
}

article .tags a {
  display: inline-block;
  padding: 2px 6px;
  background: #222;
  border-radius: 4px;
  font-size: 0.7rem;
  margin-right: 4px;
  color: #fff !important;
}

article .tags a:hover {
  background: #444;
  text-decoration: none !important;
}

article .read-more {
  display: inline-block;
  margin-top: 8px;
  font-weight: 500;
}

.hero {
  background: #000;
  padding: 20px 0;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  color: #fff;
}

.hero .highlight {
  color: #fff;
}

.hero-description {
  margin: 12px 0;
  line-height: 1.6;
  color: #fff;
  font-size: 0.95rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #333;
  color: #fff !important;
}

.btn-primary:hover {
  background: #555;
}

.btn-secondary {
  background: transparent;
  color: #fff !important;
  border: 1px solid #444;
}

.btn-secondary:hover {
  border-color: #888;
  color: #ccc !important;
}

.recent-posts h2 {
  margin: 24px 0 16px;
  color: #fff;
  font-size: 1.2rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pagination a {
  display: inline-block;
  padding: 8px 16px;
  background: #222;
  border-radius: 4px;
  color: #fff !important;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.pagination a:hover {
  background: #333;
  opacity: 0.8;
}

.pagination .page-info {
  font-size: 0.85rem;
  opacity: 0.5;
  color: #fff;
}

.view-all {
  display: inline-block;
  padding: 8px 16px;
  background: #222;
  border-radius: 6px;
  color: #fff !important;
}

.view-all:hover {
  background: #444;
  text-decoration: none !important;
}

footer {
  margin-top: 32px;
  padding-top: 16px;
  color: #fff;
  opacity: 0.5;
  font-size: 0.8rem;
  text-align: center;
}

blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  background: #1a1a1a;
  color: #fff;
}

hr {
  border: none;
  border-top: 1px solid #333;
  margin: 24px 0;
}

main {
  padding-top: 16px;
}

main > div:first-child {
  margin-bottom: 32px;
}

main > div:first-child h1 {
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #333;
}

main > div:first-child .description,
main > div:first-child p {
  color: #fff;
  opacity: 0.7;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

main ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

main li {
  padding: 12px 0;
  border-bottom: 1px solid #222;
}

main li:last-child {
  border-bottom: none;
}

main .post-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

main .post-title a {
  color: #fff !important;
  font-size: 1rem;
  transition: opacity 0.2s ease;
}

main .post-title a:hover {
  color: #888 !important;
  opacity: 0.8;
}

main .post-title span.date,
main .post-title .date {
  font-size: 0.8rem;
  opacity: 0.5;
  font-family: 'JetBrains Mono', monospace;
}

main h2 {
  margin: 24px 0 16px;
  font-size: 1.1rem;
  color: #fff;
}

main .content > p {
  margin: 8px 0 16px;
  color: #fff;
  opacity: 0.7;
  line-height: 1.6;
}

main .content ul {
  list-style: disc;
  padding-left: 20px;
  margin: 16px 0;
}

main .content ul li {
  padding: 4px 0;
  border-bottom: none;
  color: #ccc;
}

main .content ul li a {
  color: #fff !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

main .content ul li a:hover {
  opacity: 0.7;
}

main .content a:not(.btn) {
  color: #fff !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

main .content a:not(.btn):hover {
  opacity: 0.7;
}

main li .post-title a {
  color: #fff !important;
  transition: color 0.2s ease, opacity 0.2s ease;
}

/* Search Page */
.search-page #search-form {
  display: flex;
  gap: 10px;
  margin: 16px 0 24px;
}

.search-page #search-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 1rem;
  font-family: 'JetBrains Mono', monospace;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #fff;
}

.search-page #search-input:focus {
  outline: none;
  border-color: #555;
}

.search-page button {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  background: #333;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-page button:hover {
  background: #555;
}

#search-results .no-results {
  color: #888;
  font-style: italic;
}

.search-results-list {
  list-style: none;
  padding: 0;
}

.search-results-list li {
  padding: 16px 0;
  border-bottom: 1px solid #222;
}

.search-results-list li:last-child {
  border-bottom: none;
}

.search-results-list h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.search-results-list .search-meta {
  font-size: 0.8rem;
  opacity: 0.5;
  color: #fff;
  margin: 0;
}

article .article-link {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

article .article-link.no-thumb {
  border-left: 2px solid #222;
  padding-left: 12px;
}

article .article-thumb {
  flex: 0 0 140px;
  width: 140px;
  height: 100px;
  overflow: hidden;
  border-radius: 4px;
  display: block;
}

article .article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
}

article .article-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

a.article-title {
  text-decoration: none !important;
}

a.article-title h1 {
  font-size: 1rem;
  margin: 0;
  color: #fff;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

a.article-title:hover h1 {
  opacity: 0.7;
}

article .summary-text {
  font-size: 0.82rem;
  color: #ccc;
  opacity: 0.7;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Single post page */
.post-hero-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 4px;
  margin: 0 0 20px 0;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  opacity: 0.5;
  margin-bottom: 24px;
  color: #fff;
}

.post-meta .tag {
  display: inline-block;
  padding: 1px 5px;
  background: #222;
  border-radius: 3px;
  font-size: 0.68rem;
  color: #fff !important;
  opacity: 1;
}

.post-meta .tag:hover {
  background: #444;
  text-decoration: none !important;
}

.term-line {
  font-size: 0.82rem;
  color: #555;
  margin-bottom: 4px;
}

.term-path { color: #555; }
.term-prompt { color: #fff; }

.term-output {
  margin: 0 0 16px 0;
  padding-left: 0;
}

.term-output p {
  font-size: 0.85rem;
  color: #888;
  margin: 2px 0;
  line-height: 1.6;
}

.term-output p strong {
  color: #fff;
  font-weight: 400;
}

.term-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.term-tag {
  font-size: 0.72rem;
  padding: 2px 7px;
  background: #1a1a1a;
  color: #888;
  border-radius: 3px;
}

.term-cursor {
  display: inline-block;
  width: 8px;
  height: 13px;
  background: #fff;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.list-content {
  margin: 12px 0 24px 0;
  font-size: 0.85rem;
  color: #888;
  line-height: 1.8;
}

.list-content h2 {
  font-size: 0.78rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 16px 0 8px 0;
}

.list-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.list-content ul li {
  border: none;
  padding: 0;
}

.list-content ul li a {
  display: inline-block;
  padding: 3px 10px;
  background: #1a1a1a;
  border-radius: 3px;
  font-size: 0.78rem;
  color: #888 !important;
  text-decoration: none !important;
}

.list-content ul li a:hover {
  background: #333;
  color: #fff !important;
}

.taxonomy-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.taxonomy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #1a1a1a;
  border-radius: 3px;
  font-size: 0.82rem;
  color: #888 !important;
  text-decoration: none !important;
  transition: background 0.2s ease, color 0.2s ease;
}

.taxonomy-pill:hover {
  background: #333;
  color: #fff !important;
}

.taxonomy-count {
  font-size: 0.68rem;
  color: #555;
}

.taxonomy-pill:hover .taxonomy-count {
  color: #aaa;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  color: #fff !important;
  text-decoration: none !important;
  line-height: 1;
}

.header-title img {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50%;
  object-fit: cover;
  display: inline !important;
  margin: 0 !important;
}

.header-subtitle {
  font-size: 0.78rem;
  color: #fff;
  opacity: 0.4;
  white-space: nowrap;
}

.header-handle {
  font-size: 0.72rem;
  opacity: 0.4;
  margin-left: 4px;
  font-weight: 400;
}

@media (max-width: 480px) {
  body {
    padding: 16px 12px;
  }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }

  header img {
    width: 36px !important;
    height: 36px !important;
  }

  header > span > a {
    font-size: 1.2rem;
  }

  nav a {
    font-size: 0.8rem;
    padding: 5px 8px;
  }

  .hero h1 {
    font-size: 1.3rem;
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn {
    text-align: center;
    width: 100%;
    box-sizing: border-box;
  }

  pre {
    padding: 12px;
    font-size: 0.8em;
  }

  main .post-title {
    flex-direction: column;
    gap: 4px;
  }

  main .post-title .date {
    order: -1;
  }

  .post-hero-image {
    height: 200px;
    border-radius: 4px;
  }

  article .article-link {
    flex-direction: column;
  }

  article .article-thumb {
    width: 100% !important;
    height: 180px;
    order: 1;
  }

  article .article-body {
    order: 0;
  }
}
