/* sophiaxt.com/mnema — clean, professional, dark mode default */

:root {
  /* Aligned to sophiaxt.com portal palette
     (Navigation.tsx: #060B14 bg, #00D4FF cyan, #0066FF blue, #FF6B35 orange) */
  --bg: #060B14;
  --bg-alt: #0A1628;
  --bg-card: #0F1A2E;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #d7dde6;
  --text-dim: #8b96a8;
  --text-bright: #ffffff;
  --accent: #00D4FF;
  --accent-hover: #5ce1ff;
  --accent-blue: #0066FF;
  --accent-orange: #FF6B35;
  --accent-yellow: #FFD93D;
  --gradient-brand: linear-gradient(135deg, #00D4FF, #0066FF);
  --success: #4ade80;
  --warning: #FFD93D;
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.container.narrow {
  max-width: 760px;
}

/* TOP NAV */
.topnav {
  position: sticky;
  top: 0;
  background: rgba(6, 11, 20, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
}
.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: filter 0.2s;
}
.logo-link:hover {
  filter: brightness(1.15);
}
.brand-logo {
  display: block;
  height: 32px;
  width: auto;
  filter: drop-shadow(0 0 12px rgba(0, 212, 255, 0.25));
}
.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links .back-to-portal {
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  transition: all 0.2s;
}
.nav-links .back-to-portal:hover {
  color: var(--text-bright);
  border-color: rgba(0, 212, 255, 0.4);
  background: rgba(0, 212, 255, 0.06);
}

/* HERO */
.hero {
  position: relative;
  padding: 110px 0 90px;
  background:
    radial-gradient(circle at 80% 0%, rgba(0, 212, 255, 0.10), transparent 55%),
    radial-gradient(circle at 10% 100%, rgba(0, 102, 255, 0.08), transparent 55%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(0, 212, 255, 0.04) 1px, transparent 0);
  background-size: 28px 28px;
  pointer-events: none;
  opacity: 0.5;
}
.hero > * { position: relative; }
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.25);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-bottom: 24px;
}
.hero-pill .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1.2px;
  color: var(--text-bright);
  margin-bottom: 24px;
}
.accent {
  background-image: var(--gradient-brand);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  font-weight: 800;
}
.hero-sub {
  font-size: 1.2rem;
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 40px;
  line-height: 1.55;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  margin-bottom: 64px;
  flex-wrap: wrap;
}

/* BUTTONS */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--gradient-brand);
  color: #060B14;
  box-shadow: 0 4px 24px rgba(0, 212, 255, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(0, 212, 255, 0.4);
}
.btn-primary:disabled {
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-bright);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.4);
  color: var(--accent);
}

/* HERO STATS */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  max-width: 700px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.stat strong {
  display: block;
  font-size: 1.8rem;
  color: var(--text-bright);
  font-weight: 700;
  margin-bottom: 4px;
}
.stat span {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* SECTIONS */
.section {
  padding: 80px 0;
}
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--text-bright);
  margin-bottom: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.section h3 {
  color: var(--text-bright);
  margin-bottom: 16px;
  font-weight: 600;
}
.section p {
  margin-bottom: 16px;
  color: var(--text);
}
.section .lead {
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 32px;
}
.muted { color: var(--text-dim); }
.link {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
.link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* PILLARS */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}
.pillar {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.pillar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  font-size: 1.4rem;
  border-radius: 10px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.25);
  color: var(--accent);
}
.pillar:nth-child(2) .pillar-icon {
  background: rgba(0, 102, 255, 0.08);
  border-color: rgba(0, 102, 255, 0.3);
  color: var(--accent-blue);
}
.pillar:nth-child(3) .pillar-icon {
  background: rgba(255, 217, 61, 0.08);
  border-color: rgba(255, 217, 61, 0.3);
  color: var(--accent-yellow);
}
.pillar h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.pillar p {
  color: var(--text-dim);
  margin-bottom: 0;
}

/* DEMO */
.demo-video {
  margin: 32px 0;
}
.video-frame {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  background:
    linear-gradient(135deg, rgba(110, 231, 255, 0.04), transparent),
    var(--bg-card);
}
.video-placeholder p { margin: 4px 0; }

/* TRANSCRIPT */
.transcript {
  margin-top: 48px;
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.transcript h3 {
  margin-bottom: 8px;
}
.qa {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.qa:first-of-type {
  margin-top: 24px;
  padding-top: 0;
  border-top: none;
}
.qa-prompt {
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
}
.qa-prompt::before {
  content: "Q ";
  color: var(--accent);
  font-weight: 700;
}
.qa-routing {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
  background: var(--bg);
  padding: 8px 14px;
  border-radius: 4px;
  margin-bottom: 8px;
  border-left: 2px solid var(--accent);
}
.qa-routing strong {
  color: var(--accent);
}
.qa-answer {
  color: var(--text);
  line-height: 1.65;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

/* INTERACTIVE */
.interactive {
  margin-top: 48px;
  background: linear-gradient(180deg, var(--bg-card), rgba(7, 17, 31, 0.6));
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.interactive h3 { margin-bottom: 8px; }

/* CHAT history + turn cards */
.chat-history {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 24px 0;
  max-height: 60vh;
  overflow-y: auto;
}
.chat-turn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-prompt {
  font-weight: 600;
  color: var(--text-bright);
  font-size: 1rem;
  line-height: 1.45;
}
.chat-prompt::first-letter { color: var(--accent); }
.chat-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
  letter-spacing: 0.3px;
}
.chat-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}
.chat-status[data-state="connecting"]::before { background: #fbbf24; animation: pulse 1s infinite; }
.chat-status[data-state="routing"]::before { background: var(--accent); animation: pulse 1s infinite; }
.chat-status[data-state="generating"]::before { background: var(--accent-blue); animation: pulse 1s infinite; }
.chat-status[data-state="done"]::before { background: #4ade80; }
.chat-status[data-state="error"]::before { background: #ef4444; }
.chat-status[data-state="done"] { color: #4ade80; border-color: rgba(74, 222, 128, 0.3); }
.chat-status[data-state="error"] { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.chat-elapsed, .chat-tokens {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.chat-route {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
  background: rgba(0, 212, 255, 0.05);
  padding: 10px 14px;
  border-radius: 6px;
  border-left: 2px solid var(--accent);
}
.chat-route strong { color: var(--accent); }
.chat-route .scores {
  color: var(--text-dim);
  margin-left: 8px;
  font-size: 0.78rem;
}
.chat-route .route-time {
  color: #4ade80;
  margin-left: 6px;
  font-size: 0.78rem;
}
.chat-reply {
  color: var(--text);
  line-height: 1.65;
  font-size: 0.95rem;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 1.5em;
}
.chat-reply:empty::before {
  content: "generating...";
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.85rem;
}
.chat-error {
  font-size: 0.85rem;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #fca5a5;
}
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
  vertical-align: middle;
  margin-left: 8px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.badge.live {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
}
.prompt-box {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.prompt-box input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
.prompt-box input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* RESEARCH */
.research-card {
  background: var(--bg-card);
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.research-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}
.research-card p { margin-bottom: 8px; }

/* COMPARE TABLE */
.compare-table {
  overflow-x: auto;
  margin-top: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.compare-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 700px;
}
.compare-table th,
.compare-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.compare-table thead {
  background: var(--bg-card);
}
.compare-table th {
  color: var(--text-bright);
  font-weight: 600;
  font-size: 0.9rem;
}
.compare-table th small {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.78rem;
}
.compare-table td {
  color: var(--text-dim);
}
.compare-table tr td:last-child {
  color: var(--text);
}
.compare-table tbody tr:hover {
  background: var(--bg-card);
}

/* CONTACT */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.contact-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.contact-card h4 {
  color: var(--text-bright);
  font-size: 0.92rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.contact-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 14px;
  line-height: 1.55;
}

/* FOOTER */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  background: var(--bg-alt);
}
.footer p {
  color: var(--text-dim);
  font-size: 0.88rem;
  text-align: center;
}
.footer a {
  margin: 0 4px;
}

/* MOBILE */
@media (max-width: 768px) {
  .nav-links { gap: 14px; font-size: 0.84rem; }
  .nav-links a { font-size: 0.84rem; }
  .hero { padding: 60px 0 40px; }
  .section { padding: 60px 0; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; text-align: center; }
  .prompt-box { flex-direction: column; }
  .prompt-box .btn { width: 100%; }
}
