/*
 * Styles for the demo host page (dist/index.html).
 *
 * Kept in /public/ so Vite copies it verbatim to dist/ without trying to
 * tree-shake or rename it. The demo page is hand-written HTML — not part of
 * the React module graph — so this is the cleanest way to share styles.
 *
 * Visual style is a faithful nod to https://www.circuit.ai/ — same palette
 * (#f8f8f8 background, Inter, Circuit green #30a46c), same layout cadence
 * (sticky nav, large hero h1, single CTA, customer-logo row, 3-up feature
 * grid, footer). Hand-rolled — no scraped HTML, no hotlinked assets.
 */

:root {
  --circuit-green: #30a46c;
  --circuit-green-hover: #2b8c5c;
  --ink: #171717;
  --ink-muted: #525252;
  --bg: #f8f8f8;
  --surface: #ffffff;
  --border: #e5e5e5;
  --font-stack: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-stack);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- Sticky announcement bar --- */
.announce {
  background: #0a0a0a;
  color: #fafafa;
  font-size: 14px;
  text-align: center;
  padding: 10px 16px;
}
.announce a {
  color: #fafafa;
  text-decoration: underline;
}

/* --- Nav --- */
.nav {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  text-decoration: none;
}
.nav-brand svg {
  width: 24px;
  height: 24px;
}
.nav-links {
  display: flex;
  gap: 32px;
}
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
}
.nav-cta {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 120ms ease;
}
.btn-primary {
  background: var(--circuit-green);
  color: white;
  border-color: var(--circuit-green);
}
.btn-primary:hover {
  background: var(--circuit-green-hover);
}
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

/* --- Hero --- */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 96px 32px 64px;
  text-align: center;
}
.hero h1 {
  font-size: 72px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 32px;
}
.hero p {
  font-size: 18px;
  color: var(--ink-muted);
  max-width: 720px;
  margin: 0 auto 36px;
}
.hero .btn {
  padding: 14px 28px;
  font-size: 16px;
}

/* --- Customer-logo row (text placeholders) --- */
.customers {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.customers span {
  color: #a3a3a3;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --- Feature row --- */
.features {
  max-width: 1100px;
  margin: 0 auto;
  padding: 96px 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
}
.feature h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}
.feature p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
}

/* --- Floating postMessage debug panel ---
 * Bottom-left so it doesn't collide with the chat bubble (bottom-right).
 * Collapsible — most of the time visitors don't need to see the protocol traffic.
 */
.debug {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 380px;
  max-height: 60vh;
  background: #0d1117;
  color: #c9d1d9;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  z-index: 2147483640; /* below the bubble + iframe */
  overflow: hidden;
}
.debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #161b22;
  font-weight: 600;
  color: #f0f6fc;
  cursor: pointer;
  user-select: none;
}
.debug-header::before {
  content: '🔍 postMessage log';
}
.debug-toggle {
  background: transparent;
  border: none;
  color: #c9d1d9;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}
.debug-body {
  padding: 10px 14px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.debug-body:empty::before {
  content: 'No postMessages yet — click the chat bubble bottom-right.';
  color: #6e7681;
  font-style: italic;
}
.debug.collapsed .debug-body {
  display: none;
}
.debug-line {
  padding: 4px 0;
  border-bottom: 1px solid #21262d;
}
.debug-line:last-child {
  border-bottom: none;
}
.debug-meta {
  color: #8b949e;
  font-size: 11px;
}

/* --- Mobile --- */
@media (max-width: 720px) {
  .hero h1 {
    font-size: 40px;
  }
  .nav-links {
    display: none;
  }
  .features {
    grid-template-columns: 1fr;
  }
  .debug {
    width: calc(100vw - 48px);
  }
}

/* --- API key form (demo only) --- */
.apikey {
  position: fixed;
  top: 60px;
  right: 16px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 13px;
}
.apikey label {
  color: var(--ink-muted);
  font-weight: 500;
}
.apikey input {
  width: 180px;
  padding: 6px 8px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
}
.apikey input:focus {
  border-color: var(--circuit-green);
}
.apikey button {
  padding: 6px 12px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--circuit-green);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.apikey button:hover {
  background: var(--circuit-green-hover);
}
