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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 0.92rem;
  background: #fafafc;
  color: #1e293b;
  line-height: 1.6;
}
a { color: #4f46e5; text-decoration: none; }
a:hover { color: #4338ca; }

/* ── Nav header ─────────────────────────── */
.nav-header {
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand-icon {
  font-size: 1.6rem;
  color: #4f46e5;
  line-height: 1;
}
.nav-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.nav-brand-tagline {
  font-size: 0.68rem;
  color: #94a3b8;
}
.nav-links {
  display: flex;
  gap: 4px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}
.nav-links a:hover {
  background: #f1f5f9;
  color: #0f172a;
  text-decoration: none;
}
.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Buttons ────────────────────────────── */
.btn-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-pill:hover { background: #4338ca; color: #fff; text-decoration: none; }
.btn-pill-lg { padding: 12px 28px; font-size: 0.92rem; }
.btn-link {
  font-size: 0.84rem;
  font-weight: 500;
  color: #64748b;
  padding: 6px 12px;
  cursor: pointer;
}
.btn-link:hover { color: #0f172a; }

/* ── Hero ───────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  padding: 60px 24px;
  text-align: center;
}
.hero-inner {
  max-width: 600px;
  margin: 0 auto;
}
.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 24px;
}
.hero-search {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin: 0 auto;
}
.hero-search-input {
  flex: 1;
  padding: 12px 18px;
  border: none;
  border-radius: 100px;
  font-size: 0.92rem;
  font-family: inherit;
  background: rgba(255,255,255,0.15);
  color: #fff;
  backdrop-filter: blur(8px);
}
.hero-search-input::placeholder { color: rgba(255,255,255,0.6); }
.hero-search-input:focus { outline: none; background: rgba(255,255,255,0.22); }

/* ── Sections ───────────────────────────── */
.section { padding: 48px 24px; }
.section-alt { background: #fff; }
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

/* ── Category grid (homepage) ───────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.cat-tile {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 14px;
  padding: 20px;
  display: block;
  transition: all 0.2s;
  text-decoration: none;
}
.cat-tile:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transform: translateY(-2px);
  text-decoration: none;
}
.cat-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 12px;
}
.cat-tile-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #0f172a;
  margin-bottom: 4px;
}
.cat-tile-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 8px;
}
.cat-tile-stat {
  font-size: 0.72rem;
  color: #4f46e5;
  font-weight: 600;
}

/* ── Discussion feed ────────────────────── */
.discussion-feed {
  display: flex;
  flex-direction: column;
}
.discussion-item {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #f1f5f9;
}
.discussion-item:last-child { border-bottom: none; }
.discussion-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
  padding-top: 4px;
}
.replies-badge {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}
.replies-label {
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}
.discussion-main {
  flex: 1;
  min-width: 0;
}
.discussion-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  display: block;
  margin-bottom: 4px;
}
.discussion-title:hover { color: #4f46e5; }
.discussion-excerpt {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.5;
}
.discussion-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #94a3b8;
  flex-wrap: wrap;
}
.discussion-tags {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

/* ── Avatars ────────────────────────────── */
.avatar-xs {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ── Tags ───────────────────────────────── */
.tag-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 600;
  background: #eef2ff;
  color: #4f46e5;
}
.op-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 700;
  background: #4f46e5;
  color: #fff;
}

/* ── Category page ──────────────────────── */
.category-hero {
  margin: 16px 0 20px;
}
.cat-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}
.cat-hero-desc {
  font-size: 0.9rem;
  color: #64748b;
}
.category-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.cat-stat {
  font-size: 0.84rem;
  color: #94a3b8;
  font-weight: 500;
}

/* ── Thread page ────────────────────────── */
.thread-header {
  margin: 16px 0 24px;
}
.thread-tags {
  margin-bottom: 8px;
  display: flex;
  gap: 6px;
}
.thread-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.3;
  letter-spacing: -0.3px;
}
.thread-stats {
  display: flex;
  gap: 12px;
  font-size: 0.84rem;
  color: #94a3b8;
}

/* ── Reply cards ────────────────────────── */
.reply-thread {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.reply-card {
  display: flex;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid #f1f5f9;
}
.reply-card.is-op {
  background: linear-gradient(90deg, #eef2ff 0%, transparent 100%);
  margin: 0 -24px;
  padding: 20px 24px;
  border-radius: 12px;
  border-bottom: none;
}
.reply-body { flex: 1; min-width: 0; }
.reply-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.reply-header strong {
  font-size: 0.9rem;
  color: #0f172a;
}
.reply-username {
  font-size: 0.75rem;
  color: #94a3b8;
}
.reply-time {
  font-size: 0.75rem;
  color: #94a3b8;
}
.reply-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #334155;
  white-space: pre-wrap;
}
.reply-actions {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}
.reply-actions span {
  font-size: 0.78rem;
  color: #94a3b8;
  cursor: pointer;
  font-weight: 500;
}
.reply-actions span:hover { color: #4f46e5; }
.reply-cta {
  text-align: center;
  padding: 32px 0;
}
.reply-cta p {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 10px;
}

/* ── Breadcrumb ─────────────────────────── */
.breadcrumb {
  font-size: 0.78rem;
  color: #94a3b8;
}
.breadcrumb a { color: #64748b; }
.breadcrumb a:hover { color: #4f46e5; }
.breadcrumb-sep { color: #cbd5e1; }
.breadcrumb-curr { color: #0f172a; font-weight: 600; }

/* ── User grid (homepage) ───────────────── */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
}
.user-pill-name { font-size: 0.88rem; font-weight: 600; color: #0f172a; }
.user-pill-meta { font-size: 0.72rem; color: #94a3b8; }

/* ── Empty state ────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-icon {
  font-size: 2.5rem;
  color: #cbd5e1;
  margin-bottom: 12px;
}
.empty-state h3 { font-size: 1rem; color: #64748b; margin-bottom: 4px; }
.empty-state p { font-size: 0.84rem; color: #94a3b8; margin-bottom: 16px; }

/* ── Footer ─────────────────────────────── */
.site-footer {
  border-top: 1px solid #f1f5f9;
  padding: 32px 24px;
  margin-top: 24px;
  font-size: 0.82rem;
  color: #94a3b8;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: #64748b; font-size: 0.82rem; }
.footer-links a:hover { color: #0f172a; }

/* ── Auth Modal ─────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-card {
  background: #fff;
  border-radius: 18px;
  width: 400px;
  max-width: 95vw;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  overflow: hidden;
}
.modal-tabs {
  display: flex;
  align-items: center;
  background: #fafafc;
  border-bottom: 1px solid #f1f5f9;
  padding: 0;
}
.modal-tab {
  flex: 1;
  padding: 16px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: #94a3b8;
  text-align: center;
  border-bottom: 2px solid transparent;
}
.modal-tab:hover { color: #64748b; }
.modal-tab.active { color: #4f46e5; border-bottom-color: #4f46e5; }
.modal-close {
  padding: 16px 20px;
  cursor: pointer;
  font-size: 1.3rem;
  color: #94a3b8;
}
.modal-close:hover { color: #ef4444; }
.modal-body { padding: 24px; }
.modal-body label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin: 12px 0 4px;
}
.modal-body input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
}
.modal-body input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

/* ── Responsive ─────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-title { font-size: 1.6rem; }
  .hero-search { flex-direction: column; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 32px 16px; }
  .section-inner { padding: 0; }
}
