:root {
  --bg: #0b0f17;
  --surface: #121826;
  --surface-hover: #182032;
  --surface-muted: #1b2436;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #222d42;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --danger: #f87171;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 20px;
}

.narrow {
  max-width: 780px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 15, 23, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  color: var(--text-muted);
}

.nav-links a:hover {
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #111827;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Hero */
.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
}

.hero-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.03em;
  max-width: 780px;
}

.hero-sub {
  margin: 0 0 28px;
  font-size: 16.5px;
  color: var(--text-muted);
  max-width: 680px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.feature-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--accent);
}

.feature-card p {
  margin: 0;
  font-size: 13.8px;
  color: var(--text-muted);
}

/* Feed */
.section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.feed-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13.5px;
  min-width: 230px;
}

.search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

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

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

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

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  gap: 8px;
}

.post-site {
  color: var(--accent);
  font-weight: 600;
}

.post-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.38;
  font-weight: 700;
}

.post-excerpt {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

.read-link {
  color: var(--accent);
  font-weight: 600;
}

.empty-box {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

/* Install section */
.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  counter-reset: step;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.step-num {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.step-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.step-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Post detail page */
.article-header {
  padding: 36px 0 24px;
  border-bottom: 1px solid var(--border);
}

.back-link {
  display: inline-block;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.back-link:hover {
  color: var(--accent);
}

.article-header h1 {
  margin: 0 0 12px;
  font-size: clamp(22px, 3.5vw, 32px);
  line-height: 1.28;
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.pill {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
}

.pill:hover {
  border-color: var(--accent);
  color: var(--text);
}

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #111827;
}

.markdown-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 24px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 22px 0 10px;
  line-height: 1.3;
}

.markdown-body h2 {
  font-size: 19px;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child {
  margin-top: 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 20px;
}

.markdown-body li {
  margin-bottom: 6px;
}

.markdown-body blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--accent);
  background: var(--surface-muted);
  color: var(--text-muted);
}

.markdown-body pre {
  margin: 12px 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.45;
}

.markdown-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13.5px;
  display: block;
  overflow-x: auto;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.markdown-body th {
  background: var(--surface-muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
}

.form-field input,
.form-field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  font-weight: 400;
}

.form-field textarea {
  min-height: 150px;
  resize: vertical;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
}

.site-footer {
  padding: 28px 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
