/* Getting Started — landing page.
 *
 * Tokens are lifted from the product's own defaults (theme accent #E5352B,
 * dark surfaces, 14px radius), so the site and the widget look like one thing.
 * No web fonts on purpose: the page makes no third-party request, matching the
 * zero-dependency claim it makes about the SDK. Hierarchy is carried by weight,
 * size, tracking and hairlines instead.
 */
:root {
  --bg: #0b0b0c;
  --panel: #131316;
  --panel-2: #17171b;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f3f1;
  --muted: rgba(244, 243, 241, 0.56);
  --muted-2: rgba(244, 243, 241, 0.38);
  --accent: #e5352b;
  --accent-soft: rgba(229, 53, 43, 0.14);
  --radius: 14px;
  --maxw: 1180px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.15; letter-spacing: -0.022em; }
p { margin: 0; }
a { color: inherit; }
code, pre { font-family: var(--mono); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ header */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  /* Match the content edge of the bands below: they are max-width --maxw with
   * their own 20px gutter, so the header's padding has to add the same gutter
   * on top of the centred column, or the logo sits 20px left of every headline. */
  padding: 12px calc(max(0px, (100% - var(--maxw)) / 2) + 20px);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { display: block; height: 28px; width: auto; }
.site-nav { display: flex; gap: 22px; margin-left: auto; font-size: 14px; color: var(--muted); }
.site-nav a { text-decoration: none; padding: 6px 0; }
.site-nav a:hover { color: var(--text); }
.head-actions { display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.26); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #cf2c23; border-color: #cf2c23; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }

/* --------------------------------------------------------------------- hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 48px;
  align-items: start;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 20px 40px;
}
.eyebrow {
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.hero h1 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 640; }
.lede { margin-top: 18px; max-width: 46ch; color: var(--muted); font-size: 17px; }
.lede code { font-size: 15px; color: var(--text); }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 26px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
}
/* The separator trails its item, so a wrapped line never starts with a floating dot. */
.facts span:not(:last-child)::after { content: "·"; margin-left: 12px; color: var(--accent); }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ------------------------------------------------------------------ snippets */
.snippet {
  margin-top: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.snippet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  font-size: 12px;
  color: var(--muted);
}
.snippet pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.7;
  color: #e9e7e4;
}

/* --------------------------------------------------------------- demo frames */
.hero-demo {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  padding: 16px;
}
/* On wide screens the demo surface runs out to the edge of the viewport, which
 * is where a docked product panel actually lives. Capped so it cannot stretch
 * into a decorative slab on a very wide display. */
@media (min-width: 1240px) {
  .hero-demo { margin-right: calc(-1 * min(140px, (100vw - var(--maxw)) / 2)); }
}
.demo-head h2 { font-size: 17px; font-weight: 600; }
.demo-note { margin-top: 6px; font-size: 13px; color: var(--muted); max-width: 52ch; }
.demo-controls { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.demo-status { font-family: var(--mono); font-size: 12px; color: var(--muted-2); }

.frame { margin: 16px 0 0; display: grid; gap: 8px; }
.frame figcaption { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); }
.frame iframe {
  display: block;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #0e0e11;
}
.frame.desktop { width: 100%; }
.frame.desktop iframe { width: 100%; height: 430px; }
.frame.mobile { width: 240px; }
.frame.mobile iframe { width: 240px; height: 400px; }

/* -------------------------------------------------------------------- bands */
.band {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 20px;
  border-top: 1px solid var(--border);
}
.band h2 { font-size: clamp(1.35rem, 2vw, 1.7rem); font-weight: 640; }
.band-lede { margin-top: 14px; max-width: 62ch; color: var(--muted); }
.band > .cta-row { margin-top: 26px; }

/* The number is positioned, not a grid cell: with a grid, every child of the
 * <li> (heading, paragraph, snippet) becomes its own item and the paragraph
 * lands in the narrow number column. */
.steps { list-style: none; counter-reset: step; margin: 34px 0 0; padding: 0; display: grid; gap: 34px; }
.steps > li { counter-increment: step; position: relative; padding-left: 64px; }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 3px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}
.steps h3 { font-size: 16px; font-weight: 600; }
.steps p { margin-top: 8px; max-width: 60ch; color: var(--muted); }
.steps code { color: var(--text); font-size: 14px; }
.steps .aside a { font-size: 14px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.steps .aside a:hover { border-bottom-color: var(--accent); }
.steps .snippet { margin-top: 16px; }

.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 40px; margin: 34px 0 0; }
.specs > div { border-top: 1px solid var(--border); padding-top: 18px; }
.specs dt { font-weight: 600; font-size: 15px; }
.specs dd { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; }
.specs code, .band-lede code, .plain code { color: var(--text); font-size: 13.5px; }

.table-wrap { margin-top: 26px; border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-2); font-weight: 600; background: var(--panel-2); }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; }
td code { font-size: 13px; color: var(--text); }
td:last-child { color: var(--muted); }

.plain { margin: 26px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.plain li { position: relative; padding-left: 22px; color: var(--muted); }
.plain li::before { content: "—"; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); }

.price { padding-bottom: 84px; }
.price p { margin-top: 14px; max-width: 58ch; color: var(--muted); }

/* ------------------------------------------------------------------- footer */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 22px max(20px, calc((100% - var(--maxw)) / 2));
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted-2);
}
.site-foot > div { display: flex; align-items: center; gap: 10px; }
.foot-mark { display: block; height: 20px; width: auto; }

/* 404 — the same furniture as the rest of the site, so a mistyped URL still
 * looks like us rather than like a JSON error. */
.notfound { max-width: 620px; margin: 0 auto; padding: 104px 20px 120px; }
.notfound-mark { display: block; margin-bottom: 22px; }
.notfound h1 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); font-weight: 640; letter-spacing: -0.024em; }
.notfound p { margin-top: 14px; max-width: 46ch; }
.site-foot nav { display: flex; gap: 20px; }
.site-foot a { text-decoration: none; color: var(--muted); }
.site-foot a:hover { color: var(--text); }

/* ------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; }
  .site-nav { display: none; }
  .specs { grid-template-columns: 1fr; }
  /* A scrollbar hides code on a phone; wrapping is only safe this narrow. */
  .snippet pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}
@media (max-width: 560px) {
  .frame.mobile, .frame.mobile iframe { width: 100%; }
  .frame.mobile iframe { height: 420px; }
  .band { padding: 48px 20px; }
  .steps > li { padding-left: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* ------------------------------------------------- AI prompt cards
 * Shared partial (web/partials/ai-prompts.html), so these rules are duplicated
 * in web/docs/styles.css by design: the two pages carry separate stylesheets and
 * neither inherits the other's. */
.prompt-grid { display: grid; gap: 18px; margin-top: 30px; }
@media (min-width: 1000px) { .prompt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.prompt {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.prompt .snippet-head { background: var(--panel-2); font-weight: 500; }
.prompt pre { flex: 1; margin: 0; padding: 14px; overflow: auto; max-height: 400px; font-size: 11.5px; line-height: 1.7; }
/* Prompts are read in a third of the page, so they wrap rather than scroll
 * sideways — indentation still carries the structure. */
.prompt pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt-note { margin-top: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
