/* ChatPlot marketing site — self-contained, no framework. Shares tokens with the app. */
:root {
  --font-sans: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --bg: #ffffff;
  --bg-2: #f6f7f9;
  --surface: #ffffff;
  --border: #e2e6ec;
  --border-strong: #c9d0da;
  --text: #16181d;
  --text-2: #4b5563;
  --text-3: #7b8494;
  --accent: #2f5bff;
  --accent-strong: #1f47e0;
  --accent-soft: #e8edff;
  --success: #0f9d58;
  --success-soft: #e3f6ea;
  --warning-soft: #fdf1e0;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-2: 0 8px 24px rgba(16, 24, 40, 0.12);
  --radius-1: 6px;
  --radius-2: 10px;
  --radius-3: 16px;
  --max: 1120px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-sans); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--bg); overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute !important; 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: 8px; top: -48px; z-index: 100; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-1); }
.skip-link:focus { top: 8px; }

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section-alt { background: var(--bg-2); }
.eyebrow { display: inline-block; margin-bottom: 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.h2 { font-size: clamp(28px, 3.6vw, 38px); font-weight: 700; }
.lead { margin-top: 12px; font-size: 18px; color: var(--text-2); max-width: 62ch; }
.muted { color: var(--text-3); }
.small { font-size: 14px; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-2); border: 1px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer; transition: background 120ms, border-color 120ms, transform 120ms; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 17px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.86); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; list-style: none; padding: 0; }
.nav-links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--radius-1); font-weight: 500; color: var(--text-2); text-decoration: none; }
.nav-links a:hover { color: var(--text); background: var(--bg-2); }
.nav-links a.btn-primary { color: #fff; background: var(--accent); }
.nav-links a.btn-primary:hover { background: var(--accent-strong); }
.nav-cta { margin-left: 8px; }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--radius-1); background: var(--surface); }
.nav-toggle svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Hero */
.hero { padding: 64px 0 40px; background: radial-gradient(1200px 500px at 20% -10%, var(--accent-soft), transparent 60%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: 19px; }
.prompt-form { margin-top: 24px; display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-3); background: var(--surface); box-shadow: var(--shadow-1); }
.prompt-form textarea { width: 100%; min-height: 92px; resize: vertical; padding: 8px 6px; border: 0; background: transparent; font-size: 16px; line-height: 1.5; }
.prompt-form textarea:focus { outline: none; }
.prompt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.prompt-hint { font-size: 13px; color: var(--text-3); }
.prompt-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.hero-note { margin-top: 14px; font-size: 14px; color: var(--text-3); }
.hero-figure { margin: 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-3); background: var(--surface); box-shadow: var(--shadow-2); }
.hero-figure img { display: block; width: auto; max-width: 100%; max-height: 440px; margin: 0 auto; }
.hero-figure figcaption { margin-top: 12px; font-size: 13px; color: var(--text-3); }
.hero-figure figcaption q { font-style: italic; color: var(--text-2); }
.hero-chat { display: grid; gap: 8px; margin-bottom: 14px; }
.bubble { max-width: 90%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4; }
.bubble-user { justify-self: end; background: var(--accent-soft); color: var(--text); border-bottom-right-radius: 4px; }
.bubble-bot { justify-self: start; background: var(--bg-2); color: var(--text-2); border-bottom-left-radius: 4px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.step { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-3); background: var(--surface); }
.step-num { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-bottom: 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { color: var(--text-2); font-size: 15px; }

/* Showcase */
.showcase { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.example { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-3); background: var(--surface); }
.example-canvas { display: grid; place-items: center; min-height: 260px; padding: 12px; border-radius: var(--radius-2); background: var(--bg-2); overflow: hidden; }
.example-canvas img { display: block; max-height: 320px; width: auto; max-width: 100%; }
.example-canvas.tall img { max-height: 380px; }
.example h3 { font-size: 16px; }
.example p { font-size: 14px; color: var(--text-2); }
.example p q { font-style: italic; }
.example .tag { align-self: flex-start; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }

/* Types */
.types { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.types li { list-style: none; }
.types { padding: 0; }
.type { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 500; }
.type::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--hue, 210) 70% 55%); }

/* Features */
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.feature { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-3); background: var(--surface); }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--text-2); font-size: 15px; }
.feature ul { margin: 12px 0 0; padding-left: 18px; color: var(--text-2); font-size: 15px; }
.feature li + li { margin-top: 4px; }

/* Pricing */
.billing-toggle { display: inline-flex; align-items: center; gap: 4px; margin-top: 20px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.billing-toggle button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; color: var(--text-2); cursor: pointer; }
.billing-toggle button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 28px; align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-3); background: var(--surface); }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.plan-name { font-size: 18px; font-weight: 700; }
.plan-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; vertical-align: middle; }
.plan-price { margin: 14px 0 4px; font-size: 36px; font-weight: 700; letter-spacing: -0.02em; }
.plan-price small { font-size: 15px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.plan-sub { min-height: 22px; font-size: 14px; color: var(--text-3); }
.plan ul { margin: 18px 0 22px; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15px; color: var(--text-2); }
.plan li { position: relative; padding-left: 24px; }
.plan li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--success); font-weight: 700; }
.plan .btn { margin-top: auto; }
.plans-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.plan-mini { padding: 20px 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius-3); background: transparent; }
.plan-mini h3 { font-size: 16px; }
.plan-mini p { margin-top: 6px; font-size: 14px; color: var(--text-2); }
.plan-mini a { color: var(--accent); font-weight: 600; }
.pricing-note { margin-top: 18px; font-size: 14px; color: var(--text-3); max-width: 70ch; }
[data-billing="yearly"] .price-monthly, [data-billing="monthly"] .price-yearly { display: none; }

/* FAQ */
.faq { display: grid; gap: 10px; margin-top: 28px; max-width: 820px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius-2); background: var(--surface); }
.faq summary { padding: 14px 18px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-3); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 18px 16px; color: var(--text-2); font-size: 15px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-1); background: var(--surface); }
.field textarea { min-height: 120px; resize: vertical; }

/* CTA band */
.cta-band { padding: 56px 0; background: var(--text); color: #fff; }
.cta-band .h2 { color: #fff; }
.cta-band .lead { color: rgba(255, 255, 255, 0.78); }
.cta-band .btn-primary { background: #fff; color: var(--text); }
.cta-band .btn-primary:hover { background: #e9ecf3; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* Footer */
.site-footer { padding: 40px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-3); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; align-items: flex-start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

@media (max-width: 960px) {
  .hero-grid, .contact-grid { grid-template-columns: 1fr; }
  .steps, .plans { grid-template-columns: 1fr; }
  .showcase, .features, .plans-secondary { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 64px; padding: 12px 20px 16px; flex-direction: column; align-items: stretch; gap: 4px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-2); }
  .nav-links.open { display: flex; }
  .nav-links a { min-height: 44px; }
  .nav-cta { margin-left: 0; margin-top: 8px; }
}
@media (max-width: 600px) {
  .section { padding: 52px 0; }
  .hero { padding: 40px 0 24px; }
  .wrap { width: calc(100% - 32px); }
  .hero-figure { padding: 12px; }
  .example-canvas { min-height: 180px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }
