/* ============================================================
   SPARQ Assistant — public landing page
   Clean modern SaaS · dark navy/indigo gradient hero · soft glow
   Pure CSS, responsive, Inter/system font stack
   ============================================================ */

:root {
  --navy-900: #05081a;
  --navy-800: #070b1f;
  --navy-700: #0b1030;
  --indigo-900: #1e1b4b;
  --indigo-700: #312e81;
  --violet-700: #4c1d95;

  --accent: #6366f1;
  --accent-bright: #818cf8;
  --accent-soft: #a5b4fc;

  --text: #eef1ff;
  --text-muted: #a8b0d4;
  --text-faint: #7b83ad;

  --card-bg: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-border-hover: rgba(129, 140, 248, 0.5);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --max: 1120px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--navy-800);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ---------------- Nav ---------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  background: rgba(7, 11, 31, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--violet-700) 100%);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.brand-name {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  font-size: 0.92rem;
  color: var(--text-muted);
}

.nav-links a { transition: color 0.18s ease; }
.nav-links a:hover { color: #fff; }

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(4rem, 11vh, 8rem) clamp(1.25rem, 4vw, 3rem) clamp(3.5rem, 8vh, 6rem);
  background:
    radial-gradient(1100px 620px at 50% -12%, var(--indigo-700) 0%, transparent 62%),
    linear-gradient(180deg, var(--navy-700) 0%, var(--navy-800) 78%, var(--navy-900) 100%);
  overflow: hidden;
}

/* soft glow */
.hero-glow {
  position: absolute;
  z-index: -1;
  top: -28%;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 130vw);
  height: 620px;
  background:
    radial-gradient(closest-side, rgba(99, 102, 241, 0.42), rgba(99, 102, 241, 0) 72%),
    radial-gradient(closest-side at 70% 40%, rgba(139, 92, 246, 0.30), transparent 70%);
  filter: blur(18px);
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 0%, transparent 78%);
  pointer-events: none;
}

.hero-inner {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-soft);
  background: rgba(99, 102, 241, 0.13);
  border: 1px solid rgba(129, 140, 248, 0.32);
  margin-bottom: 1.6rem;
}

.hero h1 {
  margin: 0 0 1.1rem;
  font-size: clamp(2.4rem, 6.4vw, 4.2rem);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.grad {
  background: linear-gradient(100deg, #c7d2fe 0%, var(--accent-bright) 45%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subhead {
  margin: 0 auto 2.2rem;
  max-width: 620px;
  font-size: clamp(1rem, 2.1vw, 1.16rem);
  color: var(--text-muted);
}

/* ---------------- Notice (key not configured) ---------------- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  max-width: 620px;
  margin: 0 auto 1.6rem;
  padding: 0.85rem 1.1rem;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--accent-bright);
  border-radius: var(--radius-sm);
}

.notice strong { color: var(--text); font-weight: 600; }

.notice-dot {
  flex: none;
  width: 8px; height: 8px;
  margin-top: 0.45rem;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.16);
}

/* ---------------- Ask form ---------------- */

.ask { max-width: 640px; margin: 0 auto; }

.ask-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.45rem 0.45rem 1.1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(3, 6, 20, 0.5);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ask-field:focus-within {
  border-color: rgba(129, 140, 248, 0.65);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16), 0 18px 50px rgba(3, 6, 20, 0.5);
}

.ask-icon {
  flex: none;
  width: 20px; height: 20px;
  color: var(--text-faint);
}

.ask-field input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

.ask-field input::placeholder { color: var(--text-faint); }

.ask-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.72rem 1.35rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.4);
}

.ask-btn svg { width: 17px; height: 17px; }

.ask-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(99, 102, 241, 0.5); }
.ask-btn:active { transform: translateY(0); }

.ask-btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.ask-hint {
  margin: 0.9rem 0 0;
  font-size: 0.83rem;
  color: var(--text-faint);
}

.ask-hint kbd {
  padding: 0.1rem 0.4rem;
  font-family: inherit;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
}

/* ---------------- Answer ---------------- */

.answer {
  max-width: 640px;
  margin: 1.5rem auto 0;
  padding: 1.2rem 1.4rem;
  text-align: left;
  font-size: 0.97rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-md);
  white-space: pre-wrap;
  word-break: break-word;
}

.answer.error { border-left: 3px solid #f87171; }
.answer.loading { color: var(--text-muted); }

/* ---------------- Topics ---------------- */

.topics {
  padding: clamp(3.5rem, 8vh, 6rem) clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
}

.section-head {
  max-width: var(--max);
  margin: 0 auto 2.5rem;
  text-align: center;
}

.section-head h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.section-head p { margin: 0; color: var(--text-muted); }

.cards {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.15rem;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem 1.5rem 1.35rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  background: rgba(99, 102, 241, 0.09);
  border-color: var(--card-border-hover);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  margin-bottom: 1rem;
  border-radius: 12px;
  color: var(--accent-soft);
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.28);
}

.card-icon svg { width: 22px; height: 22px; }

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.06rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.card p {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent-soft);
}

.card-cta svg { width: 15px; height: 15px; transition: transform 0.18s ease; }
.card:hover .card-cta svg { transform: translateX(4px); }

/* ---------------- Footer ---------------- */

.footer {
  margin-top: auto;
  padding: 2.75rem clamp(1.25rem, 4vw, 3rem) 2rem;
  background: var(--navy-900);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.footer-top {
  max-width: var(--max);
  margin: 0 auto 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: clamp(1rem, 3vw, 1.75rem);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links a:hover { color: #fff; }

.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--text-faint);
}

.footer-status { display: inline-flex; align-items: center; gap: 0.5rem; }

.status-pill {
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pill.on { color: #6ee7b7; background: rgba(16, 185, 129, 0.14); border: 1px solid rgba(16, 185, 129, 0.35); }
.status-pill.off { color: #fcd34d; background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.32); }

/* ---------------- Responsive ---------------- */

@media (max-width: 720px) {
  .nav-links { gap: 1rem; font-size: 0.86rem; }
  .hero { padding-top: clamp(3rem, 9vh, 5rem); }
  .subhead { margin-bottom: 1.75rem; }

  .ask-field {
    flex-wrap: wrap;
    padding: 0.6rem;
    border-radius: var(--radius-md);
    gap: 0.5rem;
  }
  .ask-icon { display: none; }
  .ask-field input { width: 100%; padding: 0.6rem 0.55rem; }
  .ask-btn { width: 100%; justify-content: center; padding: 0.8rem; }

  .footer-top, .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .nav-links a:first-child { display: none; }
  .cards { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
