:root {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-dim: #388bfd;
  --green: #3fb950;
  --orange: #FF8026;
  --border: #30363d;
  --code-bg: #1c2128;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  padding: 1rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.header-text {
  display: block;
  min-height: 3.6rem;
}

.site-title {
  color: var(--orange);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
}

.site-title:hover {
  text-decoration: underline;
}

.typing-text {
  color: var(--orange);
  font-size: 1.1rem;
  font-weight: 600;
}

.blink {
  color: var(--orange);
  animation: blink 1s step-end infinite;
}

/* Faster cursor blink while typing */
.typing-active .blink {
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Layout */
.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  flex: 1;
}

.main-content {
  min-width: 0;
}

/* Sidebar */
.sidebar {
  font-size: 0.85rem;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-title {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-title::before {
  content: '#';
  color: var(--accent-dim);
}

/* Search */
.search-box {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  border-radius: 4px;
}

.search-box:focus {
  outline: none;
  border-color: var(--accent);
}

.search-box::placeholder {
  color: var(--text-muted);
}

/* Tags */
.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-link {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  border-radius: 3px;
  transition: all 0.15s;
}

.tag-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag-link.active {
  border-color: var(--green);
  color: var(--green);
}

.tag-count {
  opacity: 0.6;
  margin-left: 0.25rem;
}

/* Archive */
.archive-list {
  list-style: none;
}

.archive-link {
  display: block;
  padding: 0.25rem 0;
  color: var(--text-muted);
  text-decoration: none;
}

.archive-link:hover {
  color: var(--accent);
}

/* Post List */
.post-list {
  list-style: none;
}

.post-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

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

.post-thumbnail {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}

.post-thumbnail a:hover img {
  opacity: 0.8;
}

.post-content {
  flex: 1;
  min-width: 0;
}

.post-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.post-title-link {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.4;
}

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

.post-excerpt {
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.post-tags {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-tag {
  color: var(--accent-dim);
  text-decoration: none;
  font-size: 0.75rem;
}

.post-tag::before {
  content: '#';
}

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

/* Single Post */
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.post-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.post-content {
  line-height: 1.7;
}

.post-content h2 {
  font-size: 1.2rem;
  margin: 2rem 0 1rem;
  color: var(--text);
}

.post-content h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
}

.post-content p {
  margin-bottom: 1rem;
}

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

.post-content code {
  background: var(--code-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.post-content pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content ul, .post-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  border-left: 3px solid var(--accent-dim);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
}

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

/* Post Footer */
.post-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

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

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

/* Taxonomy Page */
.taxonomy-title {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.taxonomy-title .tag-name {
  color: var(--green);
}

.taxonomy-title .tag-name::before {
  content: '#';
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding-top: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

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

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

.prompt {
  color: var(--green);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

table th,
table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--border);
}

table th {
  background: var(--code-bg);
  color: var(--orange);
  font-weight: bold;
}

table tr:hover {
  background: var(--code-bg);
}

/* Header Search */
.header-search {
  margin-top: 1rem;
  width: 100%;
  max-width: 500px;
}

/* Responsive */
@media (max-width: 768px) {
  .content-wrapper {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 1;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
  }

  .post-thumbnail {
    width: 80px;
    height: 80px;
  }

  .post-item {
    gap: 0.75rem;
  }
}
