@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0f0f0f;
  color: #d0d0d0;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: #7f6df2; text-decoration: none; transition: color 0.15s; }
a:hover { color: #a78bfa; }

/* Navigation */
.topnav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid #1e1e1e;
  max-width: 960px;
  margin: 0 auto;
}
.logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: -0.02em;
}
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: #666; font-size: 0.9rem; transition: color 0.15s; }
.nav-links a:hover, .nav-links a.active { color: #e0e0e0; }

/* Main content */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
}

/* Home page */
.home-header { margin-bottom: 2rem; }
.home-header h1 { font-size: 1.8rem; color: #fff; margin-bottom: 0.5rem; }
.home-header p { color: #666; }

/* Section list */
.section-header { margin-bottom: 1.5rem; }
.section-header h1 { font-size: 1.6rem; color: #fff; }

/* Post cards */
.post-list { display: flex; flex-direction: column; gap: 0.75rem; }

.post-card {
  background: #1e1e1e;
  border: 1px solid #2a2a2e;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.post-card:hover {
  border-color: #7f6df2;
  box-shadow: 0 2px 16px rgba(127, 109, 242, 0.1);
  transform: translateY(-1px);
}
.post-card.highlighted {
  border-color: #7f6df2;
  box-shadow: 0 0 20px rgba(127, 109, 242, 0.25);
}
.post-card a { color: #e0e0e0; }
.post-card a:hover { color: #fff; }
.post-card h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.3rem; }
.post-card .meta { font-size: 0.78rem; color: #555; margin-bottom: 0.4rem; }
.post-card .summary { font-size: 0.88rem; color: #999; line-height: 1.5; }
.post-card .tags { margin-top: 0.5rem; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.post-card .tag {
  background: #262626;
  color: #7f6df2;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid #333;
}

/* Single post */
.post-single { max-width: 720px; }
.post-single h1 { font-size: 1.5rem; color: #fff; margin-bottom: 0.5rem; line-height: 1.3; }
.post-single .meta { color: #555; font-size: 0.82rem; margin-bottom: 1.5rem; }
.post-single .content { line-height: 1.75; }
.post-single .content h2 { color: #e0e0e0; font-size: 1.15rem; margin: 2rem 0 0.75rem; border-bottom: 1px solid #1e1e1e; padding-bottom: 0.3rem; }
.post-single .content h3 { color: #ccc; font-size: 1rem; margin: 1.5rem 0 0.5rem; }
.post-single .content p { margin-bottom: 1rem; }
.post-single .content ul, .post-single .content ol { margin: 0.5rem 0 1rem 1.5rem; }
.post-single .content li { margin-bottom: 0.3rem; }
.post-single .content blockquote {
  border-left: 3px solid #7f6df2;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #888;
}
.post-single .content code {
  font-family: 'JetBrains Mono', monospace;
  background: #1e1e1e;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.82em;
  color: #c9b4f7;
}
.post-single .content pre {
  background: #1a1a1a;
  border: 1px solid #2a2a2e;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
}
.post-single .content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: #d0d0d0;
}
.post-single .content strong { color: #e0e0e0; }

/* Relevance scores */
.relevance { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.relevance-item { font-size: 0.78rem; color: #666; }
.relevance-bar {
  display: inline-block;
  height: 4px;
  border-radius: 2px;
  background: #7f6df2;
  margin-left: 4px;
  vertical-align: middle;
}

/* --- Graph hero layout --- */
.graph-hero {
  position: sticky;
  top: 0;
  z-index: 0;
  margin: -2rem -2rem 0;
  padding: 2rem 2rem 0;
}

/* --- Graph visualization --- */
.graph-container {
  background: transparent;
  position: relative;
  overflow: hidden;
  margin: 0 -2rem;
  height: 60vh;
  min-height: 350px;
  max-height: 600px;
}
.graph-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(transparent, #0f0f0f);
  pointer-events: none;
  z-index: 5;
}
.graph-container svg {
  width: 100%;
  height: 100%;
  display: block;
}
.graph-tooltip {
  position: absolute;
  background: #1e1e1e;
  border: 1px solid #333;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #ddd;
  pointer-events: none;
  z-index: 10;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.graph-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #444;
  font-size: 0.85rem;
}

/* Cards float above the graph */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
  margin-top: -4rem;
}
.post-card {
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid #2a2a2e;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

/* --- Backlinks --- */
.backlinks {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #1e1e1e;
}
.backlinks h3 {
  font-size: 0.85rem;
  color: #555;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.backlinks-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.backlink-item {
  background: #1e1e1e;
  border: 1px solid #2a2a2e;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: #7f6df2;
  transition: border-color 0.15s;
}
.backlink-item:hover {
  border-color: #7f6df2;
  color: #a78bfa;
}

/* Footer */
.site-footer {
  max-width: 960px;
  margin: 3rem auto 0;
  padding: 1.5rem 2rem;
  border-top: 1px solid #1e1e1e;
  text-align: center;
  color: #333;
  font-size: 0.75rem;
}

@media (max-width: 640px) {
  .topnav { flex-direction: column; gap: 0.75rem; padding: 1rem; }
  main { padding: 1rem; }
  .graph-container { margin-bottom: 1.5rem; }
}
