/* ═══════════════════════════════════════════════════════════════
   HalfHuman Draft — Main Stylesheet
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@400;500&family=Outfit:wght@300;400;500;600&display=swap');

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --bg:          #f5f4f0;
  --bg-card:     #faf9f6;
  --bg-code:     #1e1e2e;
  --border:      rgba(0,0,0,0.10);
  --text:        #1a1a18;
  --text-muted:  #6b6b66;
  --text-dim:    #aaa9a3;
  --accent:      #c8501a;
  --accent-2:    #1a4a8c;
  --check:       rgba(0,0,0,0.055);
  --check-size:  22px;
  --shadow:      0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-hov:  0 2px 8px rgba(0,0,0,0.12), 0 8px 32px rgba(0,0,0,0.10);
  --radius:      10px;
  --font-head:   'DM Serif Display', Georgia, serif;
  --font-body:   'Outfit', system-ui, sans-serif;
  --font-mono:   'DM Mono', monospace;
  --content-w:   700px;
  --sidebar-w:   260px;
  --gap:         40px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #111110;
    --bg-card:    #1a1a18;
    --border:     rgba(255,255,255,0.08);
    --text:       #e8e6e0;
    --text-muted: #8a8880;
    --text-dim:   #4a4a46;
    --check:      rgba(255,255,255,0.04);
    --shadow:     0 1px 3px rgba(0,0,0,0.3),  0 4px 16px rgba(0,0,0,0.25);
    --shadow-hov: 0 2px 8px rgba(0,0,0,0.4),  0 8px 32px rgba(0,0,0,0.35);
  }
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Body & Background ──────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--check) 1px, transparent 1px),
    linear-gradient(90deg, var(--check) 1px, transparent 1px);
  background-size: var(--check-size) var(--check-size);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 35%, transparent 20%, var(--bg) 72%);
  pointer-events: none;
}

/* ── Site wrapper ───────────────────────────────────────────── */
.site-wrapper {
  position: relative;
  z-index: 1;
}

/* ── Navigation ─────────────────────────────────────────────── */
.gh-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.gh-head-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Logo */
.gh-head-logo {
  display: flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none !important;
  flex-shrink: 0;
}

.logo-half   { font-family: var(--font-head); font-size: 20px; color: var(--text); letter-spacing: -0.5px; }
.logo-human  { font-family: var(--font-head); font-size: 20px; color: var(--accent); font-style: italic; }
.logo-draft  {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  align-self: flex-start;
  margin-top: 2px;
  margin-left: 3px;
}

/* Nav links */
.gh-head-menu { display: flex; align-items: center; gap: 4px; }

.gh-head-menu .nav a {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.2px;
}

.gh-head-menu .nav a:hover {
  color: var(--text);
  background: var(--border);
  text-decoration: none;
}

/* Nav actions */
.gh-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.gh-head-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 6px;
  text-decoration: none !important;
  transition: opacity 0.15s;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.gh-head-btn-coffee {
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: transparent;
}

.gh-head-btn-coffee:hover { color: var(--text); background: var(--border); }

.gh-head-btn-subscribe {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.gh-head-btn-subscribe:hover { opacity: 0.85; }

/* ── Page layout ────────────────────────────────────────────── */
.site-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 80px;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: var(--gap);
  align-items: start;
}

.site-content.no-sidebar {
  grid-template-columns: 1fr;
  max-width: 900px;
}

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

/* ── Sidebar ────────────────────────────────────────────────── */
.site-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-section { }

.sidebar-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Recommendations */
.sidebar-recs { display: flex; flex-direction: column; gap: 8px; }

.sidebar-rec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-decoration: none !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sidebar-rec-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.sidebar-rec-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}

.sidebar-rec-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.sidebar-rec-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 1px;
}

/* Sidebar concept mini-cards */
.sidebar-concepts { display: flex; flex-direction: column; gap: 6px; }

.sidebar-concept {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s, color 0.15s;
}

.sidebar-concept:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.sidebar-concept-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

/* ── Post cards (feed / tag pages) ─────────────────────────── */
.post-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.18s;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hov);
  border-color: var(--accent);
}

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

.post-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.post-card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(200,80,26,0.08);
  padding: 2px 8px;
  border-radius: 3px;
  text-decoration: none !important;
}

.post-card-tag:hover { background: rgba(200,80,26,0.15); }

.post-card-title {
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: -0.3px;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 10px;
  text-decoration: none !important;
  display: block;
}

.post-card-title:hover { color: var(--accent); text-decoration: none; }

.post-card-excerpt {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
  margin-top: 4px;
}
.post-card-stat-sep { opacity: 0.4; }
.post-card-word-count:empty { display: none; }
.post-card-word-count:empty + .post-card-stat-sep { display: none; }

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.post-card-date { letter-spacing: 0.3px; }

.post-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-card-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  text-decoration: none !important;
  transition: color 0.15s, opacity 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 0;
}
.post-card-action:hover { color: var(--accent); }
.post-card-action svg { flex-shrink: 0; }

.post-card-read {
  color: var(--accent);
  font-weight: 500;
}
.post-card-read:hover { opacity: 0.75; }

.post-card-comment-count:empty::before { content: '0'; }

/* ── Donation counter ───────────────────────────────────────── */
.donation-total {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  opacity: 0.75;
}

/* ── Domain / subtopic aggregate stats ──────────────────────── */
.domain-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}
.domain-stats span { white-space: nowrap; }
.domain-stat-val { color: var(--accent); font-weight: 500; }

/* ── Concept card stats (home page) ─────────────────────────── */
.card-stats {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 16px;
}
.card-stats:empty { display: none; }
.card-stat-val { color: var(--card-accent, var(--accent)); font-weight: 500; }
.card-stat-sep { opacity: 0.4; }

/* ── Subtopic card stats (domain pages) ─────────────────────── */
.subtopic-stats {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.subtopic-stats:empty { display: none; }
.subtopic-stat-sep { opacity: 0.4; }

/* Featured badge */
.post-card.featured::after {
  content: '★ Featured';
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--accent);
  background: rgba(200,80,26,0.08);
  padding: 2px 8px;
  border-radius: 3px;
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.pagination a {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none !important;
  transition: border-color 0.15s, color 0.15s;
}

.pagination a:hover { border-color: var(--accent); color: var(--accent); }

.pagination .page-number { color: var(--text-dim); }

/* ── Post / Page content ────────────────────────────────────── */
.post-header { margin-bottom: 40px; }

.post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.post-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(200,80,26,0.08);
  padding: 3px 10px;
  border-radius: 3px;
  text-decoration: none !important;
}

.post-tag:hover { background: rgba(200,80,26,0.15); }

.post-title {
  font-family: var(--font-head);
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.post-meta-sep { color: var(--border); }

/* Post feature image */
.post-feature-image {
  margin-bottom: 36px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.post-feature-image img { width: 100%; height: auto; display: block; }

/* ── Post body typography ───────────────────────────────────── */
.gh-content {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  font-weight: 300;
  max-width: var(--content-w);
}

.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4 {
  font-family: var(--font-head);
  color: var(--text);
  margin: 2em 0 0.6em;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.gh-content h1 { font-size: 36px; }
.gh-content h2 { font-size: 28px; }
.gh-content h3 { font-size: 22px; }
.gh-content h4 { font-size: 18px; }

.gh-content p { margin-bottom: 1.4em; }

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

.gh-content strong { font-weight: 600; color: var(--text); }

.gh-content em { font-style: italic; }

.gh-content ul,
.gh-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.4em;
}

.gh-content li { margin-bottom: 0.4em; }

.gh-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 20px;
  margin: 1.5em 0;
  color: var(--text-muted);
  font-style: italic;
}

.gh-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-code);
  color: #d4d4d4;
  padding: 2px 6px;
  border-radius: 3px;
}

.gh-content pre {
  background: var(--bg-code);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 1.4em;
}

.gh-content pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #d4d4d4;
}

.gh-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

.gh-content img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1em 0;
}

.gh-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.4em;
  font-size: 15px;
}

.gh-content th,
.gh-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.gh-content th {
  background: var(--bg-card);
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

/* ── Tag archive header ─────────────────────────────────────── */
.tag-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tag-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.tag-title {
  font-family: var(--font-head);
  font-size: 40px;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 10px;
}

.tag-desc {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.65;
  max-width: 560px;
}

.tag-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ── Homepage concept cards ─────────────────────────────────── */
.home-wrap {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

.hero {
  padding: 64px 0 56px;
  animation: fadeUp 0.5s ease both;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--text);
  margin-bottom: 24px;
}

.hero-title em { color: var(--accent); font-style: italic; }

.hero-sub {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 560px;
  font-weight: 300;
}

.hero-sub strong { color: var(--text); font-weight: 500; }

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeUp 0.5s ease 0.1s both;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.concept-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  text-decoration: none !important;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  position: relative;
  overflow: hidden;
}

.concept-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--card-accent, var(--accent));
  opacity: 0;
  transition: opacity 0.18s;
}

.concept-card:not(.card-empty):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hov);
  border-color: var(--card-accent, var(--accent));
}

.concept-card:not(.card-empty):hover::before { opacity: 1; }

.card-empty {
  cursor: default;
  opacity: 0.42;
  background: transparent;
  border-style: dashed;
}

.card-icon { font-size: 22px; line-height: 1; margin-bottom: 4px; }

.card-title {
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: -0.3px;
  color: var(--text);
  line-height: 1.2;
}

.card-empty .card-title {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.card-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  font-weight: 300;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.card-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.card-count strong { color: var(--card-accent, var(--accent)); font-weight: 500; }
.card-arrow { font-size: 14px; color: var(--text-dim); transition: transform 0.15s, color 0.15s; }
.concept-card:not(.card-empty):hover .card-arrow { transform: translateX(3px); color: var(--card-accent, var(--accent)); }

.card-bni     { --card-accent: #c8501a; }
.card-ai      { --card-accent: #7c3aed; }
.card-math    { --card-accent: #1a4a8c; }
.card-research{ --card-accent: #1a6b3a; }
.card-series { --card-accent: #c8501a; }
.card-phil    { --card-accent: #8b6914; }
.card-biz     { --card-accent: #1a4a8c; }
.card-tools   { --card-accent: #1a6b3a; }

.card-dashboard {
  --card-accent: #26a69a;
  background: linear-gradient(135deg, #0d1b2a 0%, #1a2940 100%);
  border-color: rgba(38,166,154,0.25);
}

.card-dashboard .card-title { color: #e0f0ef; }
.card-dashboard .card-desc  { color: #8ab0ae; }
.card-dashboard .card-count { color: #5a8a88; }
.card-dashboard .card-footer{ border-color: rgba(38,166,154,0.15); }
.card-dashboard .card-arrow { color: #5a8a88; }
.card-dashboard:hover { border-color: rgba(38,166,154,0.6) !important; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.footer-links { display: flex; gap: 20px; }

.footer-links a {
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}

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

/* ── Error page ─────────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 16px;
}

.error-code {
  font-family: var(--font-head);
  font-size: 96px;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -4px;
}

.error-msg {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 300;
}

.error-back {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: 8px 18px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.error-back:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* ── Wide pages (tag: wide) ─────────────────────────────────── */
/* Any page/post tagged "wide" gets full-bleed layout, no sidebar,
   footer hidden. Ghost auto-adds .tag-wide to body_class.         */

.tag-wide .site-content,
.page-template-page-poe-market-dashboard .site-content {
  display: block;
  max-width: 100%;
  padding: 0;
}

.tag-wide .site-footer,
.page-template-page-poe-market-dashboard .site-footer {
  display: none;
}

.tag-wide .sidebar,
.page-template-page-poe-market-dashboard .sidebar {
  display: none;
}

/* ── PoE dashboard shell ───────────────────────────────────── */
.poe-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  background: #0d1117;
}

.poe-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: #111820;
  border-bottom: 1px solid rgba(38,166,154,0.15);
  flex-shrink: 0;
}

.poe-title {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #5a8a88;
}

.poe-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
}

.poe-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #444;
}

.poe-dot.active {
  background: #26a69a;
  box-shadow: 0 0 6px #26a69a;
  animation: pulse 2s infinite;
}

.poe-status-text        { color: #5a8a88; }
.poe-status-text.active { color: #26a69a; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.poe-frame-area {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.poe-frame-area iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Wide content area (generic full-bleed pages) ──────────── */
.wide-content {
  width: 100%;
  max-width: 100%;
  padding: 0;
}

.wide-content .gh-content {
  max-width: 100%;
  padding: 0;
}

/* ── Koenig editor image widths ─────────────────────────────── */
.gh-content .kg-width-wide {
  margin-left: calc(50% - 50vw + 32px);
  margin-right: calc(50% - 50vw + 32px);
  width: auto;
  max-width: 900px;
}

.gh-content .kg-width-full {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
}

.gh-content .kg-image { max-width: 100%; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-card { animation: fadeUp 0.4s ease both; }
.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.10s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.20s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .site-content {
    grid-template-columns: 1fr;
  }
  .site-sidebar { display: none; }
}

@media (max-width: 640px) {
  .gh-head-inner { padding: 0 18px; }
  .gh-head-menu  { display: none; }
  .site-content  { padding: 32px 18px 60px; }
  .home-wrap     { padding: 0 18px 60px; }
  .card-grid     { grid-template-columns: 1fr; }
  .hero-title    { letter-spacing: -1px; }
  .site-footer   { padding: 24px 18px; flex-direction: column; align-items: flex-start; }
}

/* ── New domain card colors ─────────────────────────────────── */
.card-physics  { --card-accent: #0d9488; }
.card-language { --card-accent: #4f46e5; }

/* Dim empty domain cards on homepage (has posts but 0) */
.card-empty-domain {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* ── Subtopic cards (domain tag pages) ──────────────────────── */
.subtopic-section {
  margin-bottom: 40px;
}

.subtopic-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.subtopic-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.subtopic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.subtopic-card {
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.subtopic-active:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.subtopic-empty {
  opacity: 0.38;
  cursor: default;
  border-style: dashed;
}

.subtopic-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.subtopic-empty .subtopic-name {
  color: var(--text-dim);
}

.subtopic-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.subtopic-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
}

.subtopic-empty .subtopic-count {
  color: var(--text-dim);
}

.subtopic-arrow {
  font-size: 12px;
  color: var(--text-dim);
  transition: transform 0.15s, color 0.15s;
}

.subtopic-active:hover .subtopic-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

.subtopic-soon {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Domain posts section label */
.domain-posts-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.domain-posts-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.no-posts-msg {
  font-size: 14px;
  color: var(--text-dim);
  font-style: italic;
  padding: 24px 0;
}

.sidebar-concept-empty {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Homepage card empty state (gray out, no pointer) ───────── */
.concept-card.card-empty {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
  border-style: dashed;
}
.concept-card.card-empty .card-arrow { display: none; }
.card-soon {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Domain subtopic grid (tag pages for domains) ───────────── */
.subtopic-grid-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 48px;
}

.subtopic-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-decoration: none !important;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.subtopic-active:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.subtopic-empty {
  opacity: 0.32;
  cursor: default;
  border-style: dashed;
}

.subtopic-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.subtopic-empty .subtopic-name {
  color: var(--text-dim);
}

.subtopic-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.subtopic-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

.subtopic-empty .subtopic-count {
  color: var(--text-dim);
}

.subtopic-arrow {
  font-size: 14px;
  color: var(--text-dim);
  transition: transform 0.15s, color 0.15s;
}

.subtopic-active:hover .subtopic-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

.subtopic-soon {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Subtopic page breadcrumb ───────────────────────────────── */
.subtopic-page .tag-eyebrow,
.domain-page .tag-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
}

.breadcrumb-home {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb-home:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--text-dim); }
.breadcrumb-domain { color: var(--text-dim); }

/* ── Card colors for physics and language ───────────────────── */
.card-physics  { --card-accent: #0d9488; }
.card-language { --card-accent: #4f46e5; }
