:root {
  --bg: #0d1117;
  --bg-2: #161b22;
  --bg-3: #1c2128;
  --fg: #e6edf3;
  --fg-muted: #8b949e;
  --accent: #f0b429;
  --accent-dim: rgba(240, 180, 41, 0.12);
  --border: rgba(255,255,255,0.08);
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.nav-tag {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(240,180,41,0.25);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

/* HERO */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 8rem 2rem 5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
}
.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 1.5rem;
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--fg-muted);
  max-width: 520px;
  margin-bottom: 3.5rem;
  line-height: 1.65;
}
.hero-threshold {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.threshold-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.threshold-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.threshold-note {
  font-size: 0.85rem;
  color: var(--fg-muted);
  max-width: 280px;
}
.hero-capabilities {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.cap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
}
.cap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* MANIFESTO */
.manifesto {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6rem 2rem;
}
.manifesto-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}
.manifesto-label, .outcomes-label, .use-cases-label, .process-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-top: 0.25rem;
}
.manifesto-headline {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 1.5rem;
}
.manifesto-body p {
  font-size: 1rem;
  color: var(--fg-muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}
.manifesto-body p:last-child { margin-bottom: 0; }

/* OUTCOMES */
.outcomes { padding: 6rem 2rem; }
.outcomes-inner { max-width: 1100px; margin: 0 auto; }
.outcomes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  margin-top: 2.5rem;
}
.outcome {
  background: var(--bg-2);
  padding: 2rem;
}
.outcome-icon { margin-bottom: 1rem; }
.outcome h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--fg);
}
.outcome p { font-size: 0.9rem; color: var(--fg-muted); line-height: 1.6; }

/* USE CASES */
.use-cases { background: var(--bg-3); padding: 6rem 2rem; }
.use-cases-inner { max-width: 1100px; margin: 0 auto; }
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  margin-top: 2.5rem;
}
.use-case {
  background: var(--bg);
  padding: 1.75rem;
}
.use-case-tag {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.use-case p { font-size: 0.85rem; color: var(--fg-muted); line-height: 1.6; }

/* PROCESS */
.process { padding: 6rem 2rem; }
.process-inner { max-width: 1100px; margin: 0 auto; }
.process-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 2.5rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
}
.step {
  flex: 1;
  padding: 2rem 2.25rem;
}
.step-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-dim);
  -webkit-text-stroke: 1px rgba(240,180,41,0.4);
  margin-bottom: 0.75rem;
  line-height: 1;
}
.step h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--fg);
}
.step p { font-size: 0.85rem; color: var(--fg-muted); line-height: 1.6; }
.step-divider {
  width: 1px;
  height: 80px;
  background: var(--border);
  flex-shrink: 0;
}

/* CLOSING */
.closing {
  padding: 7rem 2rem;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}
.closing-inner { max-width: 1100px; margin: 0 auto; }
.closing-headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--fg);
  margin-bottom: 1.25rem;
}
.closing-body {
  font-size: 1.1rem;
  color: var(--fg-muted);
  max-width: 560px;
  line-height: 1.65;
}

/* FOOTER */
.footer { padding: 3rem 2rem; border-top: 1px solid var(--border); }
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 0.4rem;
}
.footer-tagline {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
  font-style: italic;
}
.footer-meta { font-size: 0.75rem; color: var(--fg-muted); opacity: 0.5; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .manifesto-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .outcomes-grid, .use-cases-grid { grid-template-columns: 1fr; }
  .process-steps { flex-direction: column; }
  .step-divider { width: 40px; height: 1px; }
  .hero-threshold { gap: 1rem; }
  .hero-capabilities { gap: 1rem; }
}

@media (max-width: 480px) {
  .hero { padding: 7rem 1.25rem 3rem; }
  .manifesto, .outcomes, .use-cases, .process, .closing, .footer { padding-left: 1.25rem; padding-right: 1.25rem; }
  .threshold-number { font-size: 2.5rem; }
}

/* ==========================================
   DASHBOARD
   ========================================== */

.dashboard-page {
  min-height: 100vh;
  padding: 7rem 2rem 4rem;
}

.dashboard-container {
  max-width: 780px;
  margin: 0 auto;
}

/* Type selector */
.type-selector-section { margin-bottom: 2.5rem; }
.type-selector-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.85rem;
}
.type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.type-card {
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.type-card:hover { border-color: rgba(240,180,41,0.3); }
.type-card.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.type-icon {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
  display: block;
}
.type-card-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
  text-transform: capitalize;
}

/* Textarea */
.statement-section { margin-bottom: 2rem; }
.statement-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.char-count {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.statement-textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.7;
  resize: vertical;
  min-height: 220px;
  transition: border-color 0.15s;
}
.statement-textarea::placeholder { color: var(--fg-muted); opacity: 0.6; }
.statement-textarea:focus { outline: none; border-color: var(--accent); }

/* Submit */
.analyze-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1rem 2rem;
  background: var(--accent);
  color: #0d1117;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}
.analyze-btn:hover:not(:disabled) { opacity: 0.88; }
.analyze-btn:active:not(:disabled) { transform: scale(0.99); }
.analyze-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.analyze-btn.loading .btn-text { display: none; }
.analyze-btn .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(13,17,23,0.3);
  border-top-color: #0d1117;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.analyze-btn.loading .spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Error */
.error-msg {
  background: rgba(248,81,73,0.12);
  border: 1px solid rgba(248,81,73,0.25);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: #ff6b6b;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  display: none;
}
.error-msg.visible { display: block; }

/* Results */
.results-section {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
  display: none;
}
.results-section.visible { display: block; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.score-ring-wrapper {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.score-ring {
  width: 100px;
  height: 100px;
  position: relative;
  flex-shrink: 0;
}
.score-ring svg { transform: rotate(-90deg); }
.score-ring .track { stroke: var(--bg-3); }
.score-ring .fill { stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.score-ring .pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--fg);
}

.score-meta h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.3rem;
}
.score-meta p { font-size: 0.8rem; color: var(--fg-muted); }

.confidence-badge {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}
.confidence-badge span { color: var(--accent); font-weight: 600; }

.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* Reasoning */
.reasoning-section { margin-bottom: 2rem; }
.section-title {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}
.reasoning-list { display: flex; flex-direction: column; gap: 0.6rem; }
.reasoning-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.9rem 1.1rem;
}
.reasoning-category {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.reasoning-detail { font-size: 0.875rem; color: var(--fg); line-height: 1.5; }

/* Flagged phrases */
.flagged-section { margin-bottom: 2rem; }
.flagged-list { display: flex; flex-direction: column; gap: 0.5rem; }
.flagged-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.7rem 1rem;
}
.flagged-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
}
.flagged-dot.deception { background: #ff6b6b; }
.flagged-dot.truth { background: #4ade80; }
.flagged-phrase { font-size: 0.8rem; font-weight: 600; color: var(--fg); }
.flagged-context { font-size: 0.78rem; color: var(--fg-muted); margin-top: 0.15rem; }

/* Follow-up questions */
.questions-section { margin-bottom: 2rem; }
.questions-list { display: flex; flex-direction: column; gap: 0.5rem; }
.question-item {
  background: var(--bg-2);
  border: 1px solid rgba(240,180,41,0.2);
  border-radius: 0.6rem;
  padding: 1rem 1.1rem;
}
.question-num {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.question-text { font-size: 0.875rem; color: var(--fg); font-weight: 500; margin-bottom: 0.25rem; }
.question-reason { font-size: 0.75rem; color: var(--fg-muted); }

/* No signals message */
.no-signals {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1.25rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.875rem;
}

/* New analysis button */
.new-analysis-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  margin-top: 2rem;
}
.new-analysis-btn:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 600px) {
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-page { padding: 6rem 1.25rem 3rem; }
  .results-header { flex-direction: column; align-items: flex-start; }
}
