:root {
  --bg: #05070b;
  --bg2: #070a10;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.08);
  --stroke: rgba(255, 255, 255, 0.10);
  --stroke2: rgba(255, 255, 255, 0.14);

  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --muted2: rgba(255, 255, 255, 0.48);

  --accent: #23f3ff;   /* neon cyan */
  --accent2: #2b7bff;  /* electric blue */
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.45);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --container: 1100px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 70% 10%, rgba(35, 243, 255, 0.10), transparent 60%),
              radial-gradient(900px 500px at 20% 0%, rgba(43, 123, 255, 0.12), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  overflow-x: hidden;
}

/* Ambient layers */
.bg-aurora {
  position: fixed;
  inset: -30vh -30vw;
  background:
    radial-gradient(600px 420px at 30% 20%, rgba(35, 243, 255, 0.14), transparent 60%),
    radial-gradient(640px 460px at 70% 35%, rgba(43, 123, 255, 0.14), transparent 62%),
    radial-gradient(700px 500px at 55% 80%, rgba(35, 243, 255, 0.10), transparent 65%);
  filter: blur(22px);
  opacity: 0.9;
  pointer-events: none;
  animation: aurora 10s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { transform: translate3d(-1.5%, -0.5%, 0) scale(1.02); }
  to   { transform: translate3d(1.5%, 0.8%, 0) scale(1.05); }
}
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 40% 15%, rgba(0,0,0,0.9), transparent 60%);
  opacity: 0.35;
  pointer-events: none;
}

/* Layout */
.container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
}
.section {
  padding: 96px 0;
}
@media (max-width: 720px) {
  .section { padding: 72px 0; }
  .container { width: min(var(--container), calc(100% - 28px)); }
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 7, 11, 0.55);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  gap: 14px;
}
.topbar__nav {
  display: flex;
  gap: 18px;
}
.navlink {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 10px;
  border-radius: 12px;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}
.navlink:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}
@media (max-width: 860px) {
  .topbar__nav { display: none; }
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  min-width: 220px;
}
.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 35%, rgba(35,243,255,0.95), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(43,123,255,0.95), transparent 60%),
    linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 14px 40px rgba(35, 243, 255, 0.10);
}
.brand__text {
  font-weight: 800;
  letter-spacing: -0.03em;
}
.brand__tag {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted2);
  font-weight: 600;
}
.brand--small .brand__tag { display: none; }
@media (max-width: 720px) {
  .brand__tag { display: none; }
  .brand { min-width: auto; }
}

/* Glass */
.glass {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border 180ms ease, box-shadow 180ms ease;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.08); }
.btn:active { transform: translateY(0px) scale(0.99); }
.btn--primary {
  border: 1px solid rgba(35,243,255,0.35);
  background: linear-gradient(135deg, rgba(35,243,255,0.20), rgba(43,123,255,0.14));
  box-shadow: 0 18px 60px rgba(35, 243, 255, 0.12);
}
.btn--primary:hover {
  border-color: rgba(35,243,255,0.55);
  box-shadow: 0 22px 70px rgba(35, 243, 255, 0.18);
}
.btn--ghost {
  background: rgba(255,255,255,0.04);
}
.btn__shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(500px 200px at 30% 20%, rgba(255,255,255,0.22), transparent 55%);
  opacity: 0.45;
  pointer-events: none;
}

/* Hero */
.hero { padding-top: 56px; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 26px;
  align-items: center;
}
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; }
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.pill__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(35,243,255,0.12);
}
.hero__title {
  margin: 16px 0 10px 0;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}
.txt-glow {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(35,243,255,0.18);
}
.hero__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 58ch;
}
.hero__cta {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.hero__stats {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.stat {
  padding: 12px 14px;
  border-radius: 18px;
  min-width: 140px;
}
.stat__num {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 18px;
}
.stat__label {
  color: var(--muted2);
  font-weight: 600;
  margin-top: 6px;
  font-size: 13px;
}

/* Preview card */
.hero__preview {
  border-radius: var(--radius-xl);
  overflow: hidden;
  transform: translateY(6px);
  animation: floaty 4.5s ease-in-out infinite alternate;
}
@keyframes floaty {
  from { transform: translateY(6px); }
  to { transform: translateY(-6px); }
}
.preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.traffic { display: flex; gap: 8px; }
.t { width: 10px; height: 10px; border-radius: 50%; opacity: 0.85; }
.t--r { background: #ff5a5a; }
.t--y { background: #ffd257; }
.t--g { background: #62ff9a; }
.preview__title { font-weight: 700; font-size: 13px; color: var(--muted); }
.preview__badge {
  font-weight: 700;
  font-size: 12px;
  color: rgba(255,255,255,0.86);
  border: 1px solid rgba(35,243,255,0.22);
  background: rgba(35,243,255,0.10);
  padding: 6px 10px;
  border-radius: 999px;
}
.preview__body {
  padding: 18px 16px 16px 16px;
}
.bubble {
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 10px;
}
.bubble--user {
  background: rgba(43,123,255,0.10);
  border-color: rgba(43,123,255,0.24);
}
.bubble--ai {
  background: rgba(35,243,255,0.07);
  border-color: rgba(35,243,255,0.20);
}
.cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  margin-left: 4px;
  background: rgba(255,255,255,0.78);
  border-radius: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0.2; } }
.preview__chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.chip {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.82);
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
}
.preview__footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: var(--muted2);
  font-size: 13px;
}

/* Section Head */
.section__head {
  margin-bottom: 22px;
}
.section__head--tight { margin-bottom: 14px; }
.section__title {
  margin: 0 0 8px 0;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.04em;
}
.section__subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 70ch;
}

/* Feature cards */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}
@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
}
.card {
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  transition: transform 180ms ease, border 180ms ease, background 180ms ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(35,243,255,0.22);
  background: rgba(255,255,255,0.07);
}
.card__icon {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  overflow: hidden;
}
.icon-ring {
  position: absolute;
  inset: -24px;
  background: radial-gradient(circle at 30% 25%, rgba(35,243,255,0.35), transparent 55%),
              radial-gradient(circle at 70% 75%, rgba(43,123,255,0.28), transparent 60%);
  filter: blur(10px);
  opacity: 0.9;
}
.icon { position: relative; font-size: 18px; }
.card__title { margin: 0 0 8px 0; font-size: 16px; letter-spacing: -0.02em; }
.card__text { margin: 0; color: var(--muted); line-height: 1.6; font-size: 14px; }

/* App shell */
.appShell {
  border-radius: var(--radius-xl);
  padding: 16px;
}
.appShell__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 14px 10px;
}
@media (max-width: 860px) {
  .appShell__top { flex-direction: column; align-items: stretch; }
}

/* Segmented */
.segmented {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
}
.segmented__btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
.segmented__btn:hover { transform: translateY(-1px); color: var(--text); }
.segmented__btn.is-active {
  color: rgba(255,255,255,0.92);
  background: linear-gradient(135deg, rgba(35,243,255,0.18), rgba(43,123,255,0.12));
  border: 1px solid rgba(35,243,255,0.22);
}

/* Presets */
.presets {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 860px) { .presets { justify-content: flex-start; } }
.presetBtn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.86);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: transform 180ms ease, border 180ms ease, background 180ms ease;
}
.presetBtn:hover {
  transform: translateY(-1px);
  border-color: rgba(35,243,255,0.22);
  background: rgba(255,255,255,0.06);
}

/* App body layout */
.appShell__body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 14px;
}
@media (max-width: 980px) {
  .appShell__body { grid-template-columns: 1fr; }
}

/* Input card */
.inputCard {
  border-radius: var(--radius-lg);
  padding: 16px;
}
.label {
  display: block;
  font-weight: 800;
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  margin-bottom: 10px;
}
.textarea {
  width: 100%;
  resize: vertical;
  min-height: 140px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: rgba(255,255,255,0.92);
  padding: 14px 14px;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  transition: border 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.textarea:focus {
  border-color: rgba(35,243,255,0.35);
  box-shadow: 0 0 0 5px rgba(35,243,255,0.10);
}
.inputCard__actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.hint {
  color: var(--muted2);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hint__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(35,243,255,0.85);
  box-shadow: 0 0 0 6px rgba(35,243,255,0.10);
}
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.84);
  font-weight: 800;
  font-size: 12px;
}
.kbd--mini { padding: 4px 8px; border-radius: 10px; }

.error {
  margin-top: 10px;
  color: rgba(255, 120, 120, 0.92);
  font-weight: 700;
  font-size: 13px;
  min-height: 18px;
}

/* Output */
.output { display: flex; flex-direction: column; gap: 12px; }
.output__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 6px;
}
.output__title {
  font-weight: 900;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.output__meta {
  color: var(--muted2);
  font-weight: 700;
  font-size: 12px;
}

/* Status dot */
.dotPulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.30);
  box-shadow: 0 0 0 0 rgba(35,243,255,0.0);
  transition: background 180ms ease;
}
.dotPulse.is-live {
  background: rgba(35,243,255,0.92);
  animation: pulse 1.25s ease-in-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(35,243,255,0.0); }
  40% { box-shadow: 0 0 0 10px rgba(35,243,255,0.10); }
  100% { box-shadow: 0 0 0 18px rgba(35,243,255,0.0); }
}

/* Answer card */
.answerCard {
  border-radius: var(--radius-lg);
  padding: 16px;
}
.answerCard__loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
}
.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: rgba(35,243,255,0.92);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loadingText {
  font-weight: 800;
  color: rgba(255,255,255,0.84);
}
.loadingDots::after {
  content: "…";
  animation: dots 1.4s steps(4) infinite;
}
@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
  100% { content: ""; }
}

.answerCard__content {
  color: rgba(255,255,255,0.90);
  line-height: 1.75;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.placeholder {
  color: rgba(255,255,255,0.55);
  font-weight: 650;
}

/* Sources panel */
.sources {
  border-radius: var(--radius-lg);
  padding: 10px 14px;
}
.sources__summary {
  cursor: pointer;
  user-select: none;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255,255,255,0.88);
  list-style: none;
}
.sources__summary::-webkit-details-marker { display: none; }
.sources__count {
  font-weight: 900;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.82);
}
.sources__body {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}
.sourceItem {
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
}
.sourceTitle {
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 6px;
}
.sourceMeta {
  color: rgba(255,255,255,0.62);
  font-weight: 650;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Footer */
.footer {
  padding: 28px 0 36px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.12);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.footer__tagline {
  color: var(--muted2);
  font-weight: 700;
  margin-top: 6px;
}
.footlink {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 12px;
}
.footlink:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.sep { color: rgba(255,255,255,0.22); font-weight: 800; }
@media (max-width: 720px) {
  .footer__inner { flex-direction: column; align-items: flex-start; }
}


/* ================================
   AI ANSWER MARKDOWN STYLING
   ================================ */

.answerCard__content {
  /* Markdown needs normal whitespace rules (not pre-wrapped everywhere) */
  white-space: normal;
  font-size: 15px;
  line-height: 1.85;
}

.answerCard__content p {
  margin: 0.85em 0;
}

.answerCard__content h1,
.answerCard__content h2,
.answerCard__content h3 {
  margin-top: 1.4em;
  margin-bottom: 0.6em;
  letter-spacing: -0.02em;
}

.answerCard__content strong {
  color: #ffffff;
  font-weight: 800;
}

.answerCard__content ul,
.answerCard__content ol {
  padding-left: 1.3em;
  margin: 0.8em 0;
}

.answerCard__content li {
  margin-bottom: 0.45em;
}

.answerCard__content a {
  color: rgba(35,243,255,0.92);
  text-decoration: none;
  border-bottom: 1px solid rgba(35,243,255,0.30);
}
.answerCard__content a:hover {
  border-bottom-color: rgba(35,243,255,0.55);
}

.answerCard__content code {
  background: rgba(255,255,255,0.08);
  padding: 4px 7px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.answerCard__content pre {
  background: rgba(0,0,0,0.40);
  padding: 16px;
  border-radius: 16px;
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,0.14);
}
.answerCard__content pre code {
  background: transparent;
  padding: 0;
}

.answerCard__content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  color: var(--muted);
  margin: 12px 0;
}

/* KaTeX spacing */
.katex-display {
  margin: 1em 0;
}
