/* Neo Research — Design System */

:root {
  --bg-body:        #0a0e1a;
  --bg-card:        #141b2e;
  --bg-card-hover:  #1a2340;
  --bg-input:       #0f1629;
  --bg-surface:     #1e2744;
  --accent:         #00d4ff;
  --accent-dim:     rgba(0, 212, 255, 0.15);
  --accent-hover:   #33dfff;
  --text-primary:   #e8f0fe;
  --text-secondary: #8899b8;
  --text-muted:     #4a5a7a;
  --tier-proven:      #00e676;
  --tier-convergent:  #42a5f5;
  --tier-contested:   #ffa726;
  --tier-suspect:     #ef5350;
  --success:        #00e676;
  --warning:        #ffa726;
  --error:          #ef5350;
  --info:           #42a5f5;
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-accent:  rgba(0, 212, 255, 0.3);
  --shadow-card:    0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.6);
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-pill: 999px;
  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'IBM Plex Mono', 'JetBrains Mono', 'Consolas', monospace;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

[data-theme="light"] {
  --bg-body:        #f5f7fa;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f0f2f5;
  --bg-input:       #ffffff;
  --bg-surface:     #e8ecf1;
  --accent:         #0099cc;
  --accent-dim:     rgba(0, 153, 204, 0.1);
  --text-primary:   #1a1a2e;
  --text-secondary: #5a6a7a;
  --text-muted:     #9aa5b4;
  --border-subtle:  rgba(0, 0, 0, 0.08);
  --shadow-card:    0 2px 12px rgba(0, 0, 0, 0.08);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ---------- HEADER ---------- */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.2rem; font-weight: 700; color: var(--text-primary);
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #0066ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff;
}

.header-nav { display: flex; align-items: center; gap: 16px; }
.header-nav a { color: var(--text-secondary); font-size: 0.9rem; }
.header-nav a:hover { color: var(--text-primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 20px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; border: none; cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-primary {
  background: var(--accent); color: #0a0e1a;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--accent);
  border: 1px solid var(--border-accent);
}
.btn-outline:hover { background: var(--accent-dim); }
.btn-lg { padding: 14px 36px; font-size: 1.05rem; border-radius: var(--radius-md); }

/* ---------- LANDING ---------- */

.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 80px 24px 60px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(0,212,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800;
  line-height: 1.15; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem); color: var(--text-secondary);
  max-width: 640px; margin-bottom: 36px; line-height: 1.7;
}
.hero .cta-group { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.hero .trial-note { margin-top: 12px; font-size: 0.85rem; color: var(--text-muted); }

/* ---------- SECTIONS ---------- */

section { padding: 80px 24px; }
.section-inner { max-width: 1080px; margin: 0 auto; }
.section-title {
  font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 12px;
}
.section-subtitle {
  text-align: center; color: var(--text-secondary); margin-bottom: 48px;
  max-width: 600px; margin-left: auto; margin-right: auto;
}

/* Stats bar */
.stats-bar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 32px;
  padding: 40px 24px; background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle); margin-bottom: 48px;
}
.stat-item { text-align: center; min-width: 120px; }
.stat-value {
  font-size: 2rem; font-weight: 800; color: var(--accent);
  font-family: var(--font-mono);
}
.stat-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }

/* Problem / Solution */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  align-items: start;
}
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }

.problem-card, .solution-card {
  padding: 32px; border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}
.problem-card { background: rgba(239, 83, 80, 0.05); border-color: rgba(239, 83, 80, 0.2); }
.solution-card { background: rgba(0, 230, 118, 0.05); border-color: rgba(0, 230, 118, 0.2); }
.problem-card h3 { color: var(--error); margin-bottom: 16px; }
.solution-card h3 { color: var(--success); margin-bottom: 16px; }

/* Demo card */
.demo-card {
  max-width: 760px; margin: 0 auto;
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-elevated); overflow: hidden;
}
.demo-question {
  padding: 16px 24px; background: var(--accent-dim);
  border-bottom: 1px solid var(--border-subtle);
  font-style: italic; color: var(--accent);
}
.demo-answer { padding: 24px; }

/* Truth tiers */
.tier-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.tier-card {
  padding: 24px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  text-align: center;
}
.tier-card .tier-icon { font-size: 2rem; margin-bottom: 8px; }
.tier-card h4 { margin-bottom: 8px; }
.tier-card p { font-size: 0.9rem; color: var(--text-secondary); }

/* Domains */
.domain-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.domain-chip {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}
.domain-chip .count { color: var(--accent); font-family: var(--font-mono); font-size: 0.8rem; }

/* Coming soon */
.coming-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.coming-card {
  padding: 24px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  opacity: 0.7; position: relative;
}
.coming-card .lock { position: absolute; top: 16px; right: 16px; color: var(--text-muted); }
.coming-card h4 { margin-bottom: 8px; color: var(--text-secondary); }
.coming-card p { font-size: 0.9rem; color: var(--text-muted); }

/* Pricing */
.pricing-card {
  max-width: 400px; margin: 0 auto; padding: 40px;
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 2px solid var(--accent); text-align: center;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.1);
}
.pricing-card .price {
  font-size: 3rem; font-weight: 800; color: var(--accent);
  font-family: var(--font-mono);
}
.pricing-card .price span { font-size: 1rem; color: var(--text-secondary); }
.pricing-card .features { list-style: none; margin: 24px 0; text-align: left; }
.pricing-card .features li {
  padding: 8px 0; border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary); font-size: 0.95rem;
}
.pricing-card .features li::before { content: '\2713 '; color: var(--success); font-weight: 700; }

/* Footer */
.site-footer {
  padding: 40px 24px; border-top: 1px solid var(--border-subtle);
  text-align: center; color: var(--text-muted); font-size: 0.85rem;
}
.site-footer a { color: var(--text-secondary); }

/* ---------- ANSWER CARD (shared: landing demo + chat) ---------- */

.answer-card {
  background: var(--bg-card); border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 24px; margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.tier-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 14px; border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tier-badge.proven     { background: rgba(0,230,118,0.15); color: var(--tier-proven); }
.tier-badge.convergent { background: rgba(66,165,245,0.15); color: var(--tier-convergent); }
.tier-badge.contested  { background: rgba(255,167,38,0.15); color: var(--tier-contested); }
.tier-badge.suspect    { background: rgba(239,83,80,0.15); color: var(--tier-suspect); }

.tier-badge .badge-icon { font-size: 0.9rem; }

.answer-text {
  margin-top: 16px; line-height: 1.8; color: var(--text-primary);
}

.evidence-summary {
  margin-top: 16px; font-size: 0.85rem; color: var(--text-secondary);
}

.citations-toggle {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 10px 0; cursor: pointer;
  color: var(--accent); font-size: 0.9rem; font-weight: 600;
  border: none; background: none; width: 100%;
}
.citations-toggle:hover { color: var(--accent-hover); }
.citations-toggle .chevron {
  transition: transform var(--transition-base);
  font-size: 0.8rem;
}
.citations-toggle.open .chevron { transform: rotate(180deg); }

.citations-list {
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease;
}
.citations-list.open { max-height: 2000px; }

.citation-card {
  padding: 14px; margin-top: 8px;
  background: var(--bg-input); border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.citation-card .citation-name { font-weight: 600; font-size: 0.9rem; }
.citation-card .citation-meta {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px;
  font-size: 0.8rem; color: var(--text-secondary);
}
.citation-card .citation-meta .domain-tag {
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--accent-dim); color: var(--accent); font-size: 0.75rem;
}

.answer-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem; color: var(--text-muted);
}

/* ---------- CHAT PAGE ---------- */

.chat-layout {
  display: flex; flex-direction: column; height: 100vh;
  padding-top: 56px;
}

.chat-stream {
  flex: 1; overflow-y: auto; padding: 24px;
  max-width: 760px; width: 100%; margin: 0 auto;
}

.chat-welcome {
  text-align: center; padding: 60px 24px; color: var(--text-secondary);
}
.chat-welcome h2 { color: var(--text-primary); margin-bottom: 12px; font-size: 1.5rem; }
.chat-welcome p { max-width: 500px; margin: 0 auto 24px; }

.suggestion-chips {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  max-width: 600px; margin: 0 auto;
}
.suggestion-chip {
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); font-size: 0.85rem; cursor: pointer;
  transition: all var(--transition-fast);
}
.suggestion-chip:hover {
  border-color: var(--accent); color: var(--accent); background: var(--accent-dim);
}

.user-message {
  display: flex; justify-content: flex-end; margin-bottom: 16px;
}
.user-bubble {
  max-width: 80%; padding: 12px 18px; border-radius: var(--radius-md);
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  color: var(--text-primary);
}

.thinking-indicator {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 24px; color: var(--text-muted); font-size: 0.9rem;
}
.thinking-dots { display: flex; gap: 4px; }
.thinking-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); opacity: 0.4;
  animation: pulse 1.4s infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.4; } 40% { opacity: 1; } }

.chat-input-bar {
  padding: 16px 24px; border-top: 1px solid var(--border-subtle);
  background: rgba(10, 14, 26, 0.95); backdrop-filter: blur(12px);
}
.chat-input-wrap {
  max-width: 760px; margin: 0 auto; display: flex; gap: 12px;
}
.chat-input {
  flex: 1; padding: 12px 18px; border-radius: var(--radius-md);
  background: var(--bg-input); border: 1px solid var(--border-subtle);
  color: var(--text-primary); font-family: var(--font-body);
  font-size: 0.95rem; outline: none; resize: none;
  min-height: 44px; max-height: 120px;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-muted); }
.chat-send {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--accent); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #0a0e1a; font-size: 1.2rem; transition: all var(--transition-fast);
}
.chat-send:hover { background: var(--accent-hover); transform: scale(1.05); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ---------- AUTH ---------- */

.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 80px 24px;
}
.auth-card {
  width: 100%; max-width: 400px; padding: 40px;
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle); box-shadow: var(--shadow-elevated);
}
.auth-card h2 { text-align: center; margin-bottom: 8px; }
.auth-card .auth-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 32px; font-size: 0.9rem; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: var(--text-secondary); }
.form-input {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border-subtle);
  color: var(--text-primary); font-size: 0.95rem; font-family: var(--font-body);
  outline: none;
}
.form-input:focus { border-color: var(--accent); }
.form-error { color: var(--error); font-size: 0.85rem; margin-top: 6px; display: none; }
.form-error.visible { display: block; }

.auth-switch { text-align: center; margin-top: 24px; font-size: 0.9rem; color: var(--text-secondary); }

/* ---------- THEME TOGGLE ---------- */
.theme-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 1.1rem; padding: 4px;
}
.theme-toggle:hover { color: var(--text-primary); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .hero { padding: 100px 20px 40px; }
  .stats-bar { gap: 20px; padding: 24px; }
  .stat-value { font-size: 1.5rem; }
  .two-col { grid-template-columns: 1fr; }
  .chat-input-wrap { gap: 8px; }
  section { padding: 48px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- NOISE REPORTING ---------- */
.report-noise-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-muted); font-size: 0.75rem; padding: 3px 10px;
  cursor: pointer; transition: all 0.2s;
}
.report-noise-btn:hover {
  border-color: #C04B2B; color: #C04B2B; background: rgba(192,75,43,0.08);
}
.noise-report-form {
  margin-top: 12px; padding: 14px 16px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 8px;
}
.noise-report-label {
  font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
  margin: 0 0 10px 0;
}
.noise-categories {
  display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px;
}
.noise-categories label {
  font-size: 0.8rem; color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}
.noise-categories input[type=radio] { accent-color: var(--accent); }
.noise-feedback {
  width: 100%; padding: 8px 12px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-primary); font-size: 0.85rem; font-family: inherit;
  resize: vertical; margin-bottom: 10px;
}
.noise-feedback:focus { border-color: var(--accent); outline: none; }
.noise-actions { display: flex; gap: 8px; }
.btn-noise-submit {
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  padding: 6px 16px; font-size: 0.8rem; cursor: pointer; font-weight: 600;
}
.btn-noise-submit:hover { opacity: 0.9; }
.btn-noise-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-noise-cancel {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 16px; font-size: 0.8rem; cursor: pointer;
  color: var(--text-secondary);
}
.btn-noise-cancel:hover { border-color: var(--text-secondary); }
.noise-success {
  text-align: center; font-size: 0.85rem; color: var(--text-secondary);
  padding: 8px 0; line-height: 1.6;
}
.noise-success strong { color: var(--text-primary); }
.noise-progress {
  font-size: 0.8rem; color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
}

/* ---------- STATEMENT VOTING ---------- */
.answer-statements { margin: 12px 0 16px; }
.statement-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border-radius: 6px;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.statement-row:hover { background: rgba(255,255,255,0.03); }
.statement-text { flex: 1; font-size: 0.92rem; line-height: 1.55; color: var(--text-primary); }
.statement-votes { display: flex; gap: 4px; flex-shrink: 0; padding-top: 2px; }
.vote-btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  width: 26px; height: 26px; font-size: 0.8rem; cursor: pointer;
  color: var(--text-muted); transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.vote-btn:hover { border-color: var(--text-secondary); color: var(--text-secondary); }
.vote-up.voted { background: rgba(43,122,75,0.15); border-color: #2B7A4B; color: #2B7A4B; }
.vote-down.voted { background: rgba(192,75,43,0.15); border-color: #C04B2B; color: #C04B2B; }
.marked-good { border-left-color: #2B7A4B; background: rgba(43,122,75,0.05); }
.marked-noise { border-left-color: #C04B2B; background: rgba(192,75,43,0.05); }
.marked-noise .statement-text { text-decoration: line-through; opacity: 0.6; }
.report-bar {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.report-hint { font-size: 0.75rem; color: var(--text-muted); }
.evidence-summary {
  font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 8px;
}
