/* Wasteland Cats Wiki — Pip-Kitty Field Dossier & Vault Feline Sanctuary (Recipe 5: Forest + Vault Brass) */
:root {
  --bg: #f3f6f1;
  --card: #ffffff;
  --ink: #1d2a1f;
  --muted: #5d6e60;
  --primary: #2f7d4f;
  --primary-hover: #23613c;
  --accent: #d9a441;
  --terminal-bg: #172319;
  --terminal-ink: #f3f6f1;
  --line: #d5dfd7;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .08);
  --font-serif: "DM Serif Display", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); color: var(--ink); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--primary);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 100;
}
.skip-link:focus { left: 16px; }

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Telemetry Top Bar */
.telemetry-bar {
  background: var(--terminal-bg);
  color: var(--terminal-ink);
  border-bottom: 2px solid var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 0;
}
.telemetry-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.telemetry-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--accent);
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 125, 79, .35);
}
.telemetry-meta { color: #d5dfd7; }

/* Header & Navigation */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
}
.brand-tag {
  font-size: 12px;
  color: var(--muted);
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius);
  text-decoration: none;
}
.main-nav a:hover {
  background: var(--bg);
  color: var(--primary);
}
.main-nav a.nav-tool-pill {
  background: var(--primary);
  color: #ffffff;
}
.main-nav a.nav-tool-pill:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

/* Typography & Badges */
h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.2;
  margin-top: 0;
}
h1 { font-size: 36px; margin-bottom: 16px; }
h2 { font-size: 28px; margin-bottom: 12px; }
h3 { font-size: 22px; margin-bottom: 8px; }

.badge-tag {
  display: inline-block;
  background: var(--terminal-bg);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
  text-decoration: none;
}
.btn-secondary {
  background: var(--terminal-bg);
  color: var(--terminal-ink);
  border-color: var(--accent);
}
.btn-secondary:hover {
  background: #223325;
  color: #ffffff;
  text-decoration: none;
}
.btn-outline {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

/* Hero Section */
.hero-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.kicker-source {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.hero-lead {
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 24px;
  max-width: 70ch;
}
.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.hero-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.2;
  color: var(--primary);
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.pip-monitor-frame {
  margin: 0;
  background: var(--terminal-bg);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-md);
}
.monitor-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

/* Section Blocks */
.section-block {
  padding-top: 48px;
  padding-bottom: 48px;
}
.section-head {
  margin-bottom: 24px;
}
.section-head h2 {
  margin-top: 8px;
}
.section-sub {
  color: var(--muted);
  font-size: 16px;
  max-width: 70ch;
  margin: 0;
}

/* Data Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 24px 0;
}
.data-table, .prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th, .data-table td, .prose table th, .prose table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table th, .prose table th {
  background: var(--terminal-bg);
  color: var(--terminal-ink);
  font-weight: 700;
}
.data-table tr:last-child td, .prose table tr:last-child td {
  border-bottom: none;
}

/* Bento Hub Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.bento-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none;
}
.bento-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.bento-featured {
  border-top: 4px solid var(--primary);
}
.bento-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.bento-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
}
.bento-cta {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

/* Schematic Card */
.schematic-card {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}
.schematic-text-col h2 {
  margin-top: 8px;
}
.schematic-text-col p {
  max-width: 70ch;
}

/* Inner Dossier Page */
.doc-page {
  padding-top: 32px;
  padding-bottom: 64px;
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}
.crumb-sep { color: var(--muted); }
.doc-header {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 6px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}
.doc-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.doc-verified {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.doc-lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 70ch;
  margin: 0;
}
.key-facts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.fact-chip {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.fact-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.fact-val {
  font-size: 16px;
  color: var(--ink);
}

/* Prose Content */
.prose {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.prose p, .prose li {
  font-size: 16px;
  max-width: 70ch;
}
.prose h2 {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.prose h3 { margin-top: 24px; }
.prose ul, .prose ol {
  padding-left: 24px;
  margin: 16px 0;
}
.prose li { margin-bottom: 8px; }
.prose blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  background: var(--bg);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  max-width: 70ch;
}

/* Posts & Related Cards */
.posts-grid, .related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.post-card, .related-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  text-decoration: none;
}
.related-card:hover {
  border-color: var(--primary);
  text-decoration: none;
}
.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.related-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 8px;
}
.card-link {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
}
.related-section { margin-top: 32px; }
.post-back-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* FAQ */
.faq-section { margin-top: 32px; }
.faq-list {
  display: grid;
  gap: 12px;
}
.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 24px;
  box-shadow: var(--shadow-sm);
}
.faq-q {
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink);
}
.faq-a p {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 70ch;
}

/* Tool Stage */
.tool-stage {
  background: var(--card);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
}

/* Engagement & Comments */
.engage-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 32px;
  box-shadow: var(--shadow-sm);
}
.engage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.engage-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-like, .btn-share, .btn-reply, .btn-cancel-reply {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.btn-like[data-gf-liked], .btn-like[aria-pressed="true"] {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.like-pill {
  background: rgba(0, 0, 0, .08);
  padding: 2px 8px;
  border-radius: var(--radius);
}
.comment-form {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}
.comment-form input, .comment-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 16px;
  background: var(--bg);
  color: var(--ink);
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-cancel-reply { display: none; }
.comment-form[data-gf-replying] .btn-cancel-reply { display: inline-flex; }
.comment-card {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.comment-card[data-gf-owner] {
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
}
.owner-badge {
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius);
}
.empty-comments { display: none; color: var(--muted); font-size: 14px; }
.comments-list[data-gf-empty] .empty-comments { display: block; }

/* Footer */
.site-footer {
  background: var(--terminal-bg);
  color: var(--terminal-ink);
  border-top: 3px solid var(--accent);
  padding: 48px 0 32px;
  margin-top: 64px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.footer-brand .brand-name { color: #ffffff; }
.footer-disclaimer {
  font-size: 14px;
  color: #c7d4c9;
  max-width: 60ch;
  margin-top: 12px;
}
.footer-heading {
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 12px;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.footer-links a {
  color: #f3f6f1;
  font-size: 14px;
}
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  font-size: 12px;
  color: #c7d4c9;
}
.footer-bottom a { color: var(--accent); }

/* Mobile Responsive */
@media (max-width: 900px) {
  .hero-grid, .schematic-card, .bento-grid, .footer-grid, .posts-grid, .related-grid {
    grid-template-columns: 1fr;
  }
  .hero-quick-stats, .key-facts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .shell { padding: 0 16px; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  .hero-section { padding: 32px 0; }
  .hero-cta-row .btn-primary, .hero-cta-row .btn-secondary, .hero-cta-row .btn-outline {
    width: 100%;
  }
  .prose { padding: 24px 16px; }
}