/* Marketing site and docs. One external stylesheet: the CSP is style-src 'self' with no inline styles. */

:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f0f1f7;
  --text: #16181f;
  --muted: #555b6e;
  --border: #dfe1ea;
  --accent: #4f46e5;
  --accent-strong: #3f37c9;
  --accent-contrast: #ffffff;
  --accent-soft: #ecebfd;
  --ok: #15803d;
  --warn: #a16207;
  --down: #b91c1c;
  --code-bg: #f0f1f7;
  --draft-bg: #fff4d6;
  --draft-border: #e0a400;
  --draft-text: #4a3500;
  --shadow: 0 1px 2px rgb(16 18 24 / 6%), 0 8px 24px rgb(16 18 24 / 6%);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101218;
    --surface: #171a22;
    --surface-2: #1e222c;
    --text: #e9ebf2;
    --muted: #a3a9ba;
    --border: #2b303c;
    --accent: #8b85ff;
    --accent-strong: #a7a2ff;
    --accent-contrast: #0d0e14;
    --accent-soft: #24233f;
    --ok: #4ade80;
    --warn: #facc15;
    --down: #f87171;
    --code-bg: #1e222c;
    --draft-bg: #3a2e05;
    --draft-border: #c99400;
    --draft-text: #ffe9a8;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 5px; overflow-wrap: anywhere; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.5;
}
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; }
.muted { color: var(--muted); }
.placeholder { background: var(--draft-bg); color: var(--draft-text); padding: 0 0.3em; border-radius: 4px; font-weight: 600; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; }
.main-nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--accent); }
.main-nav a.btn-primary { color: var(--accent-contrast); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-contrast); }
.btn-small { padding: 6px 14px; font-size: 0.95rem; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 8px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; color: var(--accent); margin: 0 0 8px; }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); vertical-align: middle; }

.hero { padding: 72px 0 56px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); margin: 0 0 16px; max-width: 18ch; }
.hero .lead { margin: 0 0 28px; }
.hero-grid { display: grid; gap: 40px; grid-template-columns: 1fr; align-items: center; }
figure { margin: 0; }
.hero-grid > * { min-width: 0; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }
.fine { font-size: 0.9rem; color: var(--muted); margin-top: 14px; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 28px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.section-alt .card { background: var(--bg); box-shadow: none; }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); }
.card a.stretch { text-decoration: none; color: inherit; display: block; }
.card a.stretch:hover h3 { color: var(--accent); }

.steps { list-style: none; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-left: 0; }
.steps li .card::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  margin-bottom: 12px;
}

/* Illustrative chat mock */
.chat { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.chat-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 0.85rem; color: var(--muted); }
.chat-body { padding: 16px; display: grid; gap: 12px; }
.msg { max-width: 100%; overflow-wrap: anywhere; padding: 10px 14px; border-radius: 14px; font-size: 0.95rem; }
.msg p { margin: 0 0 8px; }
.msg p:last-child { margin: 0; }
.msg-user { justify-self: end; background: var(--accent); color: var(--accent-contrast); border-bottom-right-radius: 4px; }
.msg-ai { background: var(--surface-2); border-bottom-left-radius: 4px; }
.tool { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.mini-table { font-size: 0.85rem; margin: 6px 0 8px; }
.mini-table th, .mini-table td { padding: 5px 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-down { background: var(--down); }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--down); font-weight: 600; }
.caption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 10px; }

/* Demo CTA */
.demo { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; }
.faq details p { margin: 10px 0 0; color: var(--muted); max-width: 46rem; }

/* Pricing */
.billing-note { color: var(--muted); }
.plans { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 28px; }
.plan { display: flex; flex-direction: column; }
.plan-featured { border: 2px solid var(--accent); }
.plan h2 { font-size: 1.3rem; margin: 0 0 4px; }
.section-title { margin: 56px 0 0; }
.card p.price { color: var(--text); }
.price { font-size: 2.4rem; font-weight: 800; margin: 12px 0 0; letter-spacing: -0.02em; }
.price small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.plan ul { padding-left: 1.1em; margin: 16px 0 20px; color: var(--muted); flex: 1; }
.plan li { margin: 4px 0; }
.compare-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.compare { min-width: 640px; }
.compare th[scope="row"] { font-weight: 500; color: var(--muted); }
.compare thead th { background: var(--surface-2); }
/* Phones: all four plans fit side by side instead of hiding Pro and Agency behind a sideways scroll. */
@media (max-width: 640px) {
  .compare { min-width: 0; table-layout: fixed; font-size: 0.8rem; }
  .compare th, .compare td { padding: 8px 5px; overflow-wrap: break-word; hyphens: auto; }
  .compare th[scope="row"] { width: 34%; }
}

/* Docs */
.docs { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); padding-top: 32px; padding-bottom: 64px; }
@media (min-width: 900px) { .docs { grid-template-columns: 220px minmax(0, 1fr); } }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.docs-nav li a:hover { color: var(--text); background: var(--surface-2); }
.docs-nav a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); font-weight: 600; }
.docs-nav-title { font-weight: 700; margin: 0 0 6px; }
.docs-nav-title a { color: var(--text); text-decoration: none; }
@media (max-width: 899px) {
  .docs-nav ul { display: flex; flex-wrap: wrap; gap: 4px; }
  .docs-nav li a { border: 1px solid var(--border); padding: 3px 10px; font-size: 0.9rem; }
}
.docs-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); }
.docs-pager a { text-decoration: none; display: grid; }
.docs-pager a.next { text-align: right; margin-left: auto; }

.prose { max-width: 48rem; min-width: 0; }
.prose h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 12px; }
.prose h2 { margin-top: 2.2em; font-size: 1.45rem; }
.prose h3 { margin-top: 1.8em; font-size: 1.15rem; }
.prose table { display: block; overflow-x: auto; font-size: 0.95rem; }
.prose blockquote { margin: 1em 0; padding: 4px 16px; border-left: 4px solid var(--border); color: var(--muted); }
.prose li { margin: 4px 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.callout { background: var(--accent-soft); border-radius: 10px; padding: 12px 16px; margin: 1.2em 0; }
.callout p { margin: 0; }

.draft-banner {
  background: var(--draft-bg);
  border: 2px solid var(--draft-border);
  color: var(--draft-text);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
}


/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 0; padding: 40px 0 24px; font-size: 0.95rem; }
.footer-inner { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-inner ul { list-style: none; padding: 0; margin: 0; }
.footer-inner li { margin: 4px 0; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 0 0 6px; }
.footer-title { font-weight: 700; margin: 0 0 6px; }
.footer-base { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.85rem; }

@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .section { padding: 44px 0; }
  .hero { padding: 44px 0 36px; }
}

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

/* Contact form (D080). Field borders use --muted so they keep 3:1 contrast against the page in both themes. */
.contact-form { display: grid; gap: 18px; max-width: 36rem; margin-top: 24px; }
.contact-form .field { display: grid; gap: 6px; }
.contact-form label { font-weight: 600; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--muted); border-radius: 8px; padding: 9px 12px; width: 100%;
}
.contact-form textarea { resize: vertical; min-height: 9rem; }
.contact-form input:focus-visible, .contact-form select:focus-visible, .contact-form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.contact-form .hint { margin: 0; font-size: 0.9rem; color: var(--muted); }
.contact-form button { justify-self: start; font: inherit; font-weight: 600; }
.contact-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
