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

html { font-size: 17.6px; }

body {
  background: #09090b;
  color: #e4e4e7;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: #6b9fff; text-decoration: none; }
a:hover { color: #93b8ff; }

code, pre { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

.container { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* NAV */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #1a1a1e;
  padding: 0 24px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-wordmark {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #c8c8d0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: #a1a1aa;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover { color: #a1a1aa; }
.nav-link.active { color: #fafafa; }

/* BLOG INDEX */
.blog-header {
  padding-top: 96px;
  padding-bottom: 40px;
}

.blog-header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: #fafafa;
  margin-bottom: 8px;
}

.blog-header p {
  color: #a1a1aa;
  font-size: 0.9rem;
}

.post-list { list-style: none; }

.post-item {
  border-top: 1px solid #27272a;
  padding: 24px 0;
}

.post-item a {
  text-decoration: none;
  display: block;
}

.post-item a:hover .post-title { color: #93b8ff; }

.post-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fafafa;
  margin-bottom: 6px;
  transition: color 0.2s;
}

.post-meta {
  font-size: 0.8rem;
  color: #a1a1aa;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 8px;
}

.post-desc {
  font-size: 0.88rem;
  color: #a1a1aa;
  line-height: 1.5;
}

/* ARTICLE */
.article-header {
  padding-top: 96px;
  padding-bottom: 32px;
  border-bottom: 1px solid #27272a;
  margin-bottom: 32px;
}

.article-header h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  color: #fafafa;
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-meta {
  font-size: 0.8rem;
  color: #a1a1aa;
  font-family: 'JetBrains Mono', monospace;
}

.article-meta a { color: #a1a1aa; }
.article-meta a:hover { color: #a1a1aa; }

article h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fafafa;
  margin-top: 40px;
  margin-bottom: 16px;
}

article h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e4e4e7;
  margin-top: 28px;
  margin-bottom: 12px;
}

article p {
  margin-bottom: 16px;
  color: #a1a1aa;
}

article ul, article ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: #a1a1aa;
}

article li { margin-bottom: 8px; }

article strong { color: #e4e4e7; }

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

article code {
  background: #18181b;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88rem;
  color: #e4e4e7;
}

article pre {
  background: #111;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #a1a1aa;
}

article pre code {
  background: none;
  padding: 0;
}

.tldr {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 32px;
}

.tldr-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b9fff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.tldr ul {
  padding-left: 20px;
  color: #a1a1aa;
}

.tldr li {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.85rem;
}

.comparison-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid #27272a;
  color: #fafafa;
  font-weight: 600;
}

.comparison-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1a1a1e;
  color: #a1a1aa;
}

.comparison-table tr:hover td {
  background: rgba(107, 159, 255, 0.03);
}

/* NUMBERED POINTS */
.points-list {
  counter-reset: point-counter;
  list-style: none;
  padding-left: 0;
}

.points-list li {
  counter-increment: point-counter;
  padding: 12px 0 12px 40px;
  border-bottom: 1px solid #1a1a1e;
  position: relative;
}

.points-list li::before {
  content: counter(point-counter);
  position: absolute;
  left: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b9fff;
  background: rgba(107, 159, 255, 0.1);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 14px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #a1a1aa;
  margin-top: 40px;
  transition: color 0.2s;
}

.back-link:hover { color: #a1a1aa; }

/* TABLE OF CONTENTS - LessWrong-style left sidebar */
.toc-sidebar {
  position: fixed;
  top: 96px;
  width: 200px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 16px;
  scrollbar-width: none;
}

.toc-sidebar::-webkit-scrollbar { display: none; }

.toc-sidebar .toc-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.toc-sidebar a {
  display: block;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #a1a1aa;
  text-decoration: none;
  padding: 4px 0 4px 12px;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.toc-sidebar a:hover {
  color: #a1a1aa;
}

.toc-sidebar a.active {
  color: #e4e4e7;
  border-left-color: #6b9fff;
}

.toc-sidebar a.toc-h3 {
  padding-left: 24px;
  font-size: 0.73rem;
}

/* Position the ToC to the left of the content container */
@media (min-width: 1100px) {
  .toc-sidebar {
    left: calc((100vw - 720px) / 2 - 232px);
  }
}

/* Hide ToC on screens too narrow for sidebar */
@media (max-width: 1099px) {
  .toc-sidebar {
    display: none;
  }
}

/* FOOTER */
footer {
  border-top: 1px solid #1a1a1e;
  padding: 32px 0;
  margin-top: 60px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links { display: flex; gap: 24px; }
.footer-links a { color: #a1a1aa; font-size: 0.85rem; }
.footer-links a:hover { color: #a1a1aa; }
.footer-meta { color: #71717a; font-size: 0.8rem; }

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  .comparison-table { font-size: 0.75rem; }
  .comparison-table th, .comparison-table td { padding: 8px 6px; }
}
