/* Same token values as frontend/src/styles.css (RGB channels). Dark by
   default like the SPA; light when the system asks for it. */
:root {
  color-scheme: dark;
  --bg: 9 9 11;
  --panel: 13 13 15;
  --surface: 19 19 22;
  --fg: 250 250 250;
  --text-primary: 250 250 250;
  --text-muted: 161 161 170;
  --text-subtle: 139 139 148;
  --primary: 47 91 224;
  --primary-hover: 59 102 235;
  --on-primary: 255 255 255;
  --accent: 143 168 255;
  --border-alpha: 0.08;
  --border-strong-alpha: 0.14;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -8px rgb(0 0 0 / 0.5);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: 249 250 251;
    --panel: 243 244 246;
    --surface: 255 255 255;
    --fg: 9 9 11;
    --text-primary: 9 9 11;
    --text-muted: 82 82 91;
    --text-subtle: 107 107 116;
    --primary: 31 75 209;
    --primary-hover: 26 63 176;
    --on-primary: 255 255 255;
    --accent: 29 71 201;
    --border-alpha: 0.09;
    --border-strong-alpha: 0.16;
    --shadow: 0 1px 2px rgb(9 9 11 / 0.05), 0 8px 24px -10px rgb(9 9 11 / 0.12);
  }
}

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

html {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: rgb(var(--bg));
  color: rgb(var(--text-primary));
  font-size: 1rem;
  line-height: 1.6;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: rgb(var(--accent));
  text-underline-offset: 3px;
}

a:focus-visible,
summary:focus-visible,
main:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 3px;
  border-radius: 6px;
}

main:focus {
  outline: none;
}

::selection {
  background: rgb(var(--accent) / 0.28);
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 650;
}

h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.125rem);
  font-weight: 650;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 600;
}

p {
  margin: 0;
}

.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;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: rgb(var(--primary));
  color: rgb(var(--on-primary));
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

.narrow {
  max-width: 48rem;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(var(--bg) / 0.85);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgb(var(--fg) / var(--border-alpha));
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: rgb(var(--text-primary));
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
}

.header-nav {
  display: none;
  gap: 1.5rem;
  margin-left: 1.5rem;
}

.header-nav a {
  color: rgb(var(--text-muted));
  font-size: 0.9375rem;
  text-decoration: none;
}

.header-nav a:hover {
  color: rgb(var(--text-primary));
}

@media (min-width: 900px) {
  .header-nav {
    display: flex;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 2px;
}

.btn-sm {
  min-height: 2.5rem;
  padding: 0 1rem;
}

.btn-primary {
  background: rgb(var(--primary));
  color: rgb(var(--on-primary));
}

.btn-primary:hover {
  background: rgb(var(--primary-hover));
}

.btn-secondary {
  background: rgb(var(--surface));
  border-color: rgb(var(--fg) / var(--border-strong-alpha));
  color: rgb(var(--text-primary));
}

.btn-secondary:hover {
  border-color: rgb(var(--fg) / 0.28);
}

.btn-ghost {
  min-height: 2.5rem;
  padding: 0 0.75rem;
  color: rgb(var(--text-muted));
}

.btn-ghost:hover {
  color: rgb(var(--text-primary));
}

@media (max-width: 420px) {
  .btn-ghost {
    display: none;
  }
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  padding: 4rem 0 3.5rem;
  background: radial-gradient(
    60rem 28rem at 70% -10%,
    rgb(var(--primary) / 0.18),
    transparent 70%
  );
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 960px) {
  .hero {
    padding: 6rem 0 5rem;
  }
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.eyebrow {
  color: rgb(var(--accent));
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.lead {
  margin-top: 1.25rem;
  max-width: 36rem;
  color: rgb(var(--text-muted));
  font-size: 1.125rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-note {
  margin-top: 1rem;
  color: rgb(var(--text-subtle));
  font-size: 0.875rem;
}

/* Illustrative conversation */
.chat-demo {
  margin: 0;
}

.chat-window {
  border: 1px solid rgb(var(--fg) / var(--border-alpha));
  border-radius: 16px;
  background: rgb(var(--panel));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgb(var(--fg) / var(--border-alpha));
  font-size: 0.875rem;
}

.chat-head small {
  display: block;
  color: rgb(var(--text-muted));
  font-size: 0.75rem;
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: rgb(var(--fg) / 0.06);
}

.chat-avatar svg,
.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 0;
  padding: 1.25rem 1rem;
  list-style: none;
}

.msg {
  max-width: 85%;
  padding: 0.5rem 0.875rem;
  border-radius: 16px;
  font-size: 0.9375rem;
}

.msg-user {
  align-self: flex-end;
  background: rgb(var(--primary));
  color: rgb(var(--on-primary));
  border-bottom-right-radius: 4px;
}

.msg-bot {
  align-self: flex-start;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--fg) / var(--border-alpha));
  border-bottom-left-radius: 4px;
}

.msg-system {
  align-self: center;
  max-width: 100%;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgb(var(--accent) / 0.12);
  color: rgb(var(--accent));
  font-size: 0.8125rem;
  text-align: center;
}

.chat-demo figcaption {
  margin-top: 0.75rem;
  color: rgb(var(--text-subtle));
  font-size: 0.8125rem;
  text-align: center;
}

/* ── Sections ───────────────────────────────────────────────────────────── */

.section {
  padding: 4rem 0;
}

@media (min-width: 960px) {
  .section {
    padding: 5.5rem 0;
  }
}

.section-alt {
  background: rgb(var(--panel));
  border-top: 1px solid rgb(var(--fg) / var(--border-alpha));
  border-bottom: 1px solid rgb(var(--fg) / var(--border-alpha));
}

.section-lead {
  margin-top: 0.75rem;
  color: rgb(var(--text-muted));
  font-size: 1.0625rem;
}

.feature-grid,
.usecase-grid,
.steps {
  display: grid;
  gap: 1rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .feature-grid,
  .usecase-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .feature-grid,
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
  .usecase-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  padding: 1.5rem;
  border: 1px solid rgb(var(--fg) / var(--border-alpha));
  border-radius: 14px;
  background: rgb(var(--surface));
}

.card p,
.steps p {
  margin-top: 0.5rem;
  color: rgb(var(--text-muted));
  font-size: 0.9375rem;
}

.icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  background: rgb(var(--accent) / 0.1);
  color: rgb(var(--accent));
}

.steps li {
  padding: 1.5rem;
  border-radius: 14px;
  border: 1px solid rgb(var(--fg) / var(--border-alpha));
  background: rgb(var(--surface));
}

.step-number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: rgb(var(--primary));
  color: rgb(var(--on-primary));
  font-size: 0.875rem;
  font-weight: 700;
}

/* ── FAQ ────────────────────────────────────────────────────────────────── */

.faq {
  margin-top: 2rem;
  border-top: 1px solid rgb(var(--fg) / var(--border-alpha));
}

.faq details {
  border-bottom: 1px solid rgb(var(--fg) / var(--border-alpha));
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: rgb(var(--text-muted));
  font-weight: 400;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  padding-bottom: 1.25rem;
  color: rgb(var(--text-muted));
}

/* ── CTA & footer ───────────────────────────────────────────────────────── */

.cta-inner {
  text-align: center;
}

.cta .hero-actions {
  justify-content: center;
}

.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid rgb(var(--fg) / var(--border-alpha));
  color: rgb(var(--text-subtle));
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand-footer {
  font-size: 0.9375rem;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-links a {
  color: rgb(var(--text-muted));
}

.legal-links a:hover {
  color: rgb(var(--text-primary));
}

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