@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --bg: #FDFCFC;
  --bg-alt: #F8F7F7;
  --bg-hover: #F1F0EF;
  --bg-code: #EEEDEC;
  --border: #E0DEDE;
  --border-dark: #CFCECD;
  --text: #201D1D;
  --text-secondary: #656363;
  --text-muted: #9E9B9B;
  --text-faint: #B7B1B1;
  --accent: #201D1D;
  --accent-hover: #3A3636;
  --white: #FDFCFC;
  --green: #2D8C4E;
  --red: #C4402F;
  --blue: #2563EB;
  --font: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius: 0px;
  --radius-sm: 2px;
  --radius-md: 4px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--white);
}

/* ============================================
   NAV
   ============================================ */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 52px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-logo .block {
  width: 6px;
  height: 6px;
  background: var(--text);
}
.nav-logo .block.light {
  background: var(--text-muted);
}
.nav-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  padding: 14px 16px;
  transition: color 0.15s;
  border-left: 1px solid var(--border);
  height: 52px;
  display: flex;
  align-items: center;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--bg-alt);
}
.nav-links a.active {
  color: var(--text);
  background: var(--bg-alt);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 24px 60px;
  text-align: center;
  transition: all 0.4s ease;
  border-bottom: 1px solid var(--border);
}
.hero.collapsed {
  padding: 20px 24px 16px;
  border-bottom: none;
}
.hero.collapsed .hero-title,
.hero.collapsed .hero-sub,
.hero.collapsed .hero-badge,
.hero.collapsed .trending-section {
  display: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.hero-badge .dot {
  width: 5px;
  height: 5px;
  background: var(--green);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-title {
  font-size: clamp(28px, 4.5vw, 42px);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
  max-width: 700px;
}
.hero-sub {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 48px;
}

/* ============================================
   SEARCH
   ============================================ */
.search-container {
  width: 100%;
  max-width: 620px;
}
.search-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  transition: border-color 0.2s;
}
.search-box:focus-within {
  border-color: var(--accent);
}
.search-box .search-icon {
  padding: 0 14px;
  color: var(--text-muted);
  display: flex;
  flex-shrink: 0;
}
.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 14px 0;
  min-width: 0;
}
.search-box input::placeholder {
  color: var(--text-faint);
}
.search-btn {
  flex-shrink: 0;
  padding: 14px 20px;
  background: var(--accent);
  border: none;
  color: var(--white);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-btn:hover {
  background: var(--accent-hover);
}
.search-btn.loading {
  pointer-events: none;
  opacity: 0.6;
}
.search-btn .spinner {
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.5s linear infinite;
  display: none;
}
.search-btn.loading .spinner { display: block; }
.search-btn.loading .btn-text { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   TRENDING
   ============================================ */
.trending-section {
  margin-top: 40px;
  text-align: center;
}
.trending-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.trending-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 620px;
}
.trending-chip {
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}
.trending-chip:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-alt);
}

/* ============================================
   RESULTS
   ============================================ */
.results-area {
  flex: 1;
  padding: 0 24px 40px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* User question */
.user-question {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
  margin-top: 24px;
  animation: slideIn 0.25s ease;
}
.user-question-bubble {
  background: var(--accent);
  color: var(--white);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  max-width: 70%;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Answer card */
.answer-card {
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 16px;
  animation: slideIn 0.35s ease;
  position: relative;
}
.answer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--card-accent, var(--accent));
}

.answer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.firm-badge-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  color: white;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.answer-firm-name {
  font-size: 13px;
  font-weight: 600;
}
.answer-question {
  font-size: 11px;
  color: var(--text-muted);
}

.answer-body {
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.answer-body strong {
  color: var(--text);
  font-weight: 600;
}

/* Citation */
.citation-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin: 0 20px 16px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  transition: all 0.15s;
}
.citation-link:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-alt);
}
.citation-link svg { flex-shrink: 0; }

/* Related firms */
.related-firms {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 20px 16px;
}
.related-firm-tag {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font);
  text-decoration: none;
  border: 1px solid;
  color: white;
  transition: opacity 0.15s;
}
.related-firm-tag:hover { opacity: 0.8; }

/* Feedback */
.answer-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
.feedback-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-right: 4px;
}
.feedback-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.feedback-btn:hover {
  border-color: var(--green);
  color: var(--green);
}
.feedback-btn.negative:hover {
  border-color: var(--red);
  color: var(--red);
}

/* Typing */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 20px 24px;
  animation: slideIn 0.2s ease;
}
.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  animation: bounce 1s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* No results */
.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  animation: slideIn 0.35s ease;
}
.no-results .icon {
  font-size: 28px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.no-results p { font-size: 13px; line-height: 1.7; }

/* ============================================
   FIRMS GRID
   ============================================ */
.firms-section {
  padding: 64px 24px;
  border-top: 1px solid var(--border);
}
.firms-section-title {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 32px;
}
.firms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid var(--border);
}
.firm-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 32px;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.firm-card:nth-child(3n) {
  border-right: none;
}
.firm-card:nth-last-child(-n+3) {
  border-bottom: none;
}
.firm-card:hover {
  background: var(--bg-alt);
}
.firm-card .firm-logo-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: white;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.2s;
}
.firm-card:hover .firm-logo-icon {
  filter: grayscale(0%);
  opacity: 1;
}
.firm-card .firm-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s;
}
.firm-card:hover .firm-name {
  color: var(--text);
}

/* ============================================
   STATS BAR (like opencode)
   ============================================ */
.stats-bar {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat-item {
  padding: 24px 40px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
}
.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

/* ============================================
   FAQ PAGE
   ============================================ */
.faq-page { background: var(--bg); }
.faq-nav {
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
}
.faq-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
}
.faq-nav a:hover { color: var(--text); }
.faq-main {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 32px;
}
.faq-main article h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.firm-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--text);
}
.firm-logo-sm { font-weight: 700; font-size: 11px; }
.faq-answer {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.related-questions h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.related-questions ul { list-style: none; }
.related-questions li { margin-bottom: 8px; }
.related-questions a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.5;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.related-questions a:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ============================================
   HONEYPOT
   ============================================ */
.ht-trap {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 32px;
  color: var(--text-muted);
  font-size: 11px;
}
.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-brand .fb-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.footer-brand .fb-desc {
  line-height: 1.6;
  color: var(--text-muted);
}
.footer-col h4 {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  padding: 3px 0;
  transition: color 0.15s;
}
.footer-col a:hover {
  color: var(--text);
}
.footer-bottom {
  max-width: 720px;
  margin: 24px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-faint);
}
.footer-bottom a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 12px;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-dark); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .top-nav { padding: 0 16px; }
  .nav-links a { padding: 14px 10px; font-size: 11px; }
  .hero { padding: 60px 16px 40px; }
  .search-btn .btn-text { display: none; }
  .search-btn { padding: 14px; }
  .faq-main { grid-template-columns: 1fr; }
  .firm-card { min-width: 0; }
  .firms-grid { grid-template-columns: repeat(2, 1fr); }
  .firm-card:nth-child(3n) { border-right: 1px solid var(--border); }
  .firm-card:nth-child(2n) { border-right: none; }
  .stat-item { padding: 16px 20px; }
  .stat-value { font-size: 20px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer { padding: 32px 16px; }
}
