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

body {
  font-family: 'Space Grotesk', 'Monaco', 'Menlo', 'Courier New', monospace;
  background: #0a0a0a;
  color: #e4e4e7;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
}

/* Canvas only on homepage */
#canvas-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.3;
}

/* Hide canvas on post pages */
body.post-page #canvas-bg {
  display: none;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* Wider container for post pages with TOC */
body.post-page .container {
  max-width: 1200px;
}

.ascii-art {
  color: #10b981;
  font-size: 0.4rem;
  line-height: 1;
  margin-bottom: 20px;
  overflow-x: visible;
  white-space: pre;
}

header {
  margin-bottom: 50px;
}

.tagline {
  color: #10b981;
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.tagline-sub {
  color: #71717a;
  font-size: 0.95rem;
}

/* Philosophy Quote Section */
.philosophy-quote {
  background: rgba(39, 39, 42, 0.4);
  border: 1px solid #3f3f46;
  padding: 30px 40px;
  margin: 40px 0 50px;
  position: relative;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.philosophy-quote::before {
  content: '┌─';
  position: absolute;
  top: -1px;
  left: -1px;
  color: #10b981;
  font-size: 1rem;
  line-height: 1;
}

.philosophy-quote::after {
  content: '─┘';
  position: absolute;
  bottom: -1px;
  right: -1px;
  color: #10b981;
  font-size: 1rem;
  line-height: 1;
}

.philosophy-quote blockquote {
  border: none;
  padding: 0;
  margin: 0;
  font-style: italic;
  color: #d4d4d8;
  font-size: 1.3rem;
  line-height: 1.6;
  font-weight: 300;
  text-align: center;
}

.philosophy-quote cite {
  display: block;
  text-align: right;
  margin-top: 15px;
  color: #71717a;
  font-size: 0.9rem;
  font-style: normal;
}

.philosophy-quote cite::before {
  content: '— ';
}

/* Section Divider */
.section-divider {
  text-align: center;
  color: #3f3f46;
  margin: 50px 0;
  font-size: 0.9rem;
  letter-spacing: 2px;
}

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: #10b981;
  width: 0%;
  z-index: 1000;
  transition: width 0.1s ease;
}

.posts {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.post-card {
  background: rgba(39, 39, 42, 0.4);
  border: 1px solid #3f3f46;
  border-left: 3px solid #10b981;
  padding: 25px;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
  position: relative;
}

.post-card::before {
  content: '>';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #10b981;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.post-card:hover {
  border-color: #10b981;
  background: rgba(39, 39, 42, 0.7);
  padding-left: 40px;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.post-card:hover::before {
  opacity: 1;
}

.post-title {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: #e4e4e7;
}

.post-card:hover .post-title {
  color: #10b981;
}

.post-meta {
  color: #71717a;
  font-size: 0.8rem;
  margin-bottom: 12px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.post-excerpt {
  color: #a1a1aa;
  line-height: 1.6;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

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

.tag {
  background: #27272a;
  color: #10b981;
  padding: 3px 8px;
  font-size: 0.75rem;
  border: 1px solid #3f3f46;
  transition: all 0.2s;
}

.tag:hover {
  transform: scale(1.05);
  border-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.back-btn {
  display: inline-block;
  color: #10b981;
  text-decoration: none;
  margin-bottom: 25px;
  transition: all 0.2s;
  font-size: 0.95rem;
  position: relative;
}

.back-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #10b981;
  transition: width 0.3s;
}

.back-btn:hover::after {
  width: 100%;
}

.back-btn:hover {
  color: #34d399;
}

/* Post Layout - Two Column */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 900px) 250px;
  gap: 40px;
  align-items: start;
  justify-content: center;
  width: 100%;
}

.post-main-content {
  min-width: 0;
  /* Prevent overflow */
  width: 100%;
  max-width: 900px;
}

/* Table of Contents */
.toc-wrapper {
  position: sticky;
  top: 20px;
  background: rgba(39, 39, 42, 0.4);
  border: 1px solid #3f3f46;
  padding: 20px;
  backdrop-filter: blur(10px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.toc-wrapper h3 {
  color: #10b981;
  font-size: 0.9rem;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.toc-wrapper nav li {
  margin-bottom: 8px;
}

.toc-wrapper nav a {
  color: #a1a1aa;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
  display: block;
  line-height: 1.4;
}

.toc-wrapper nav a:hover {
  color: #10b981;
}

.toc-wrapper nav a.active {
  color: #10b981;
  font-weight: 500;
}

/* Nested TOC items */
.toc-wrapper nav ul ul {
  margin-left: 15px;
  margin-top: 5px;
}

.toc-wrapper nav ul ul a {
  font-size: 0.8rem;
  color: #71717a;
}

article {
  background: rgba(39, 39, 42, 0.4);
  border: 1px solid #3f3f46;
  padding: 40px;
  border-radius: 2px;
  backdrop-filter: blur(10px);
  margin-bottom: 30px;
  min-width: 0;
  /* Prevent grid blowout */
}

/* Author info in article */
.post-author {
  color: #71717a;
  font-size: 0.9rem;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #3f3f46;
}

.post-author .author-name {
  color: #10b981;
}

article h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  border-bottom: 2px solid #10b981;
  padding-bottom: 15px;
  color: #10b981;
  scroll-margin-top: 20px;
}

article h2 {
  font-size: 1.6rem;
  margin: 35px 0 15px;
  color: #10b981;
  scroll-margin-top: 20px;
}

article h2::before {
  content: '## ';
  color: #71717a;
}

article h3 {
  font-size: 1.3rem;
  margin: 25px 0 12px;
  color: #34d399;
  scroll-margin-top: 20px;
}

article h3::before {
  content: '### ';
  color: #71717a;
}

article p {
  color: #d4d4d8;
  margin-bottom: 18px;
  line-height: 1.8;
}

article ul,
article ol {
  margin: 15px 0 15px 30px;
  color: #d4d4d8;
}

article li {
  margin-bottom: 8px;
  line-height: 1.7;
}

article pre {
  background: #18181b;
  border: 1px solid #3f3f46;
  border-left: 3px solid #10b981;
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
  line-height: 1.5;
  position: relative;
}

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

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #27272a;
  color: #10b981;
  border: 1px solid #3f3f46;
  padding: 5px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  font-family: 'Space Grotesk', sans-serif;
}

.copy-btn:hover {
  background: #10b981;
  color: #0a0a0a;
}

article code {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.85rem;
  color: #10b981;
  background: rgba(39, 39, 42, 0.6);
  padding: 2px 6px;
  border-radius: 2px;
}

article pre code {
  color: #e4e4e7;
  background: none;
  padding: 0;
}

article img {
  max-width: 100%;
  height: auto;
  margin: 25px 0;
  border: 1px solid #3f3f46;
}

article blockquote {
  border-left: 3px solid #10b981;
  padding-left: 20px;
  margin: 20px 0;
  color: #a1a1aa;
  font-style: italic;
}

/* Callout Boxes */
.callout {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
  border-left: 3px solid #10b981;
  padding: 20px;
  margin: 25px 0;
  position: relative;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.callout::before {
  content: '💡 Key Insight';
  display: block;
  color: #10b981;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.callout-warning {
  background: rgba(251, 191, 36, 0.1);
  border-color: #fbbf24;
}

.callout-warning::before {
  content: '⚠️ Important';
  color: #fbbf24;
}

.post-metadata {
  background: rgba(39, 39, 42, 0.4);
  border: 1px solid #3f3f46;
  padding: 25px;
  backdrop-filter: blur(10px);
  font-size: 0.85rem;
}

.post-metadata h3 {
  color: #10b981;
  margin-bottom: 15px;
  font-size: 1rem;
}

.metadata-section {
  margin-bottom: 20px;
}

.metadata-label {
  color: #71717a;
  display: inline-block;
  width: 120px;
}

.metadata-value {
  color: #e4e4e7;
}

.commit-history {
  margin-top: 15px;
}

.commit {
  padding: 8px 0;
  border-top: 1px solid #3f3f46;
  color: #a1a1aa;
  font-size: 0.8rem;
}

.commit-hash {
  color: #10b981;
  margin-right: 10px;
}

.site-footer {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid #3f3f46;
  text-align: center;
}

.footer-links {
  margin-bottom: 15px;
}

.footer-link {
  color: #71717a;
  text-decoration: none;
  margin: 0 15px;
  transition: color 0.2s;
  font-size: 0.9rem;
  position: relative;
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #10b981;
  transition: width 0.3s;
}

.footer-link:hover::after {
  width: 100%;
}

.footer-link:hover {
  color: #10b981;
}

.footer-meta {
  color: #52525b;
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.footer-products {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #3f3f46;
}

.footer-products p {
  color: #71717a;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.product-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.product-link {
  color: #10b981;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.product-link:hover {
  color: #34d399;
}

.accent {
  color: #10b981;
}

.hidden {
  display: none;
}

/* Canvas diagram support */
.diagram-canvas {
  background: #18181b;
  border: 1px solid #3f3f46;
  margin: 25px 0;
  display: block;
}

/* Mobile responsiveness */
@media (max-width: 1250px) {
  .post-layout {
    grid-template-columns: 1fr;
    max-width: 900px;
    justify-content: center;
  }

  .toc-wrapper {
    display: none;
    /* Hide TOC on mobile */
  }
}

@media (max-width: 768px) {
  .ascii-art {
    font-size: 0.25rem;
  }

  article {
    padding: 25px;
  }

  .philosophy-quote blockquote {
    font-size: 1.1rem;
  }

  .philosophy-quote {
    padding: 20px 25px;
  }

  .post-meta {
    flex-direction: column;
    gap: 5px;
  }

  .callout {
    padding: 15px;
    margin: 20px 0;
  }

  .post-metadata {
    padding: 20px;
  }
}

#error-view {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-container {
  background: rgba(39, 39, 42, 0.4);
  border: 1px solid #3f3f46;
  padding: 40px;
  backdrop-filter: blur(10px);
  max-width: 600px;
  margin: 20px;
}

.error-code {
  font-size: 4rem;
  color: #10b981;
  margin-bottom: 20px;
  font-family: 'Monaco', 'Menlo', monospace;
}

.error-message {
  background: #18181b;
  border: 1px solid #3f3f46;
  border-left: 3px solid #ef4444;
  padding: 20px;
  margin: 20px 0;
  text-align: left;
  color: #ef4444;
  font-size: 0.9rem;
  overflow-x: auto;
}

.error-details {
  margin-top: 30px;
}

.error-text {
  color: #a1a1aa;
  margin-bottom: 20px;
  font-size: 1rem;
}

.error-suggestion {
  color: #71717a;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.error-commands {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin: 10px 0;
  padding: 12px;
  background: rgba(39, 39, 42, 0.6);
  border: 1px solid #3f3f46;
}

.command-link {
  color: #10b981;
  text-decoration: none;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.command-link:hover {
  color: #34d399;
}

.command-desc {
  color: #71717a;
  font-size: 0.85rem;
}