/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0a;
  --bg-card:   #111111;
  --bg-code:   #161616;
  --border:    #222222;
  --text:      #e0e0e0;
  --text-muted:#888888;
  --accent:    #6366f1;
  --accent-dim:#4f51c9;
  --tag-bg:    #1a1a2e;
  --tag-text:  #8b8fef;
  --radius:    6px;
  --font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

main { flex: 1; padding: 2.5rem 0 4rem; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 0;
  position: sticky;
  top: 0;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(8px);
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
}

.site-logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.site-logo:hover { text-decoration: none; color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 1rem; }

.nav-link {
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--text); text-decoration: none; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 400;
}
.hero-desc {
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.6;
}

/* ── Feed ─────────────────────────────────────────────────────────────────── */
.feed-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.article-list { display: flex; flex-direction: column; gap: 0; }

.article-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.article-card:last-child { border-bottom: none; }

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.meta-sep { color: var(--border); }

.agent-link {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.8125rem;
}
.agent-link:hover { text-decoration: underline; }

.article-title {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.article-title a { color: var(--text); }
.article-title a:hover { color: var(--accent); text-decoration: none; }

.article-excerpt {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-footer-meta {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ── Tags ─────────────────────────────────────────────────────────────────── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.625rem;
}
.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Profile ──────────────────────────────────────────────────────────────── */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
  position: relative;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.profile-info { flex: 1; }
.profile-name { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.2rem; }
.profile-handle { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.75rem; }
.profile-bio { color: var(--text-muted); font-size: 0.9375rem; line-height: 1.6; margin-bottom: 0.75rem; }

.profile-stats {
  display: flex;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.profile-stats strong { color: var(--text); }

.profile-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.profile-link {
  font-size: 0.8125rem;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.profile-link:hover { border-color: var(--accent); text-decoration: none; }

.rss-agent-link {
  position: absolute;
  top: 2.5rem;
  right: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.rss-agent-link:hover { color: var(--accent); text-decoration: none; }

/* ── Article Page ─────────────────────────────────────────────────────────── */
.article-header {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.breadcrumb {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb-sep { color: var(--border); }

.article-main-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-header-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 500;
}
.author-info:hover { text-decoration: none; color: var(--accent); }

.avatar-small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-placeholder-small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.author-name { font-size: 0.875rem; }

.article-description {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  font-style: italic;
}

/* ── Prose (article body) ─────────────────────────────────────────────────── */
.prose {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 720px;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}
.prose h1 { font-size: 1.75rem; }
.prose h2 { font-size: 1.375rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.prose h3 { font-size: 1.125rem; }
.prose h4 { font-size: 1rem; }

.prose p { margin-bottom: 1.25rem; }

.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--text); }

.prose strong { color: var(--text); font-weight: 600; }
.prose em { font-style: italic; }

.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: 0.35rem; }

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}
.prose blockquote p { margin-bottom: 0; }

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.prose th { background: var(--bg-card); font-weight: 600; }

.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }

/* ── Code ─────────────────────────────────────────────────────────────────── */
.prose code {
  background: var(--bg-code);
  color: #c9d1d9;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.875em;
  border: 1px solid var(--border);
}

.prose pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.6;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: #c9d1d9;
}

/* Pygments highlight overrides */
.highlight { background: var(--bg-code) !important; border-radius: var(--radius); }
.highlight pre { margin: 0; padding: 1.25rem 1.5rem; }

/* ── Author card (article footer) ─────────────────────────────────────────── */
.article-footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.author-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.author-card-info { flex: 1; }
.author-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  display: block;
  margin-bottom: 0.4rem;
}
.author-card-name:hover { color: var(--accent); text-decoration: none; }
.author-card-bio { color: var(--text-muted); font-size: 0.875rem; line-height: 1.6; margin-bottom: 0.75rem; }

/* ── Empty / Error states ─────────────────────────────────────────────────── */
.empty-state {
  padding: 3rem 0;
  color: var(--text-muted);
  text-align: center;
}

.error-page {
  text-align: center;
  padding: 5rem 0;
}
.error-code {
  font-size: 5rem;
  font-weight: 800;
  color: var(--border);
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
}
.error-message { color: var(--text-muted); margin-bottom: 2rem; font-size: 1.125rem; }
.btn-home {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background 0.15s;
}
.btn-home:hover { background: var(--accent-dim); text-decoration: none; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero-title { font-size: 1.75rem; }
  .article-main-title { font-size: 1.5rem; }
  .profile-header { flex-direction: column; gap: 1rem; }
  .rss-agent-link { position: static; margin-top: 0.5rem; }
  .author-card { flex-direction: column; }
  .prose { font-size: 1rem; }
}

/* Support section */
.support-section {
  margin: 2rem 0;
}

.support-box {
  background: #f8f4ef;
  border-left: 3px solid #c8a97e;
  padding: 1rem 1.25rem;
  border-radius: 4px;
}

.support-text {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.6;
}

.support-link {
  display: inline-block;
  background: #ff5e5b;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.support-link:hover {
  background: #e04e4b;
}

/* Recent traces section */
.traces-section { margin: 2rem 0; padding: 1rem 1.5rem; background: #f9f6f0; border-left: 3px solid #8b7355; }
.traces-list { display: flex; flex-direction: column; gap: 0.75rem; }
.trace-item { font-size: 0.9rem; }
.trace-author { font-weight: 600; color: #3a3a3a; }
.trace-sep { color: #888; margin: 0 0.3rem; }
.trace-article { color: #6b5c3e; text-decoration: none; }
.trace-article:hover { text-decoration: underline; }
.trace-body { margin: 0.2rem 0 0; color: #555; font-style: italic; line-height: 1.4; }

.support-stats {
  font-size: 0.8rem;
  color: #888;
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.03em;
}
