/* RoofQuery landing site.
   Tokens below are shared with the dashboard's app.css — keep the two in
   sync. Only the primitives the marketing pages use are included. */

:root {
  --primary: #1668B8;
  --primary-dark: #12558F;
  --primary-darker: #0B3D6B;
  --primary-tint: #E8F1FA;
  --accent: #2FA8E0;

  --text-body: #55606C;
  --text-dark: #1E2530;

  --bg-light: #F1F3F6;
  --bg-white: #ffffff;
  --border: #E2E7ED;
  --border-input: #D3D9E0;

  --green: #27AE60;
  --amber: #E08A2F;
  --red: #C0392B;

  --radius-btn: 10px;
  --radius-card: 12px;

  --font-main: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-heading: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
  /* Landing hero only. */
  --font-hero: 'Poppins', 'Instrument Sans', system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

body {
  font-family: var(--font-main);
  font-size: 15px;
  background: var(--bg-light);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }
.hidden { display: none !important; }

/* ── Typography ─────────────────────────────────────────────── */
.h1 {
  font-family: var(--font-heading);
  font-size: 28px; font-weight: 800; color: var(--text-dark);
  letter-spacing: -.02em;
  margin: 0 0 4px;
}
.h2 {
  font-family: var(--font-heading);
  font-size: 17px; font-weight: 700; color: var(--text-dark);
  letter-spacing: -.01em;
  margin: 0 0 12px;
}
/* Subheading inside a card — the API reference leans on it heavily. */
.h3 {
  font-family: var(--font-main);
  font-size: 13.5px; font-weight: 700; color: var(--text-dark);
  margin: 0 0 8px;
}
.sub { color: var(--text-body); font-size: 13px; margin: 0 0 18px; }
.mono { font-family: var(--mono); font-size: 12.5px; word-break: break-all; color: var(--text-dark); }
.muted { color: var(--text-body); opacity: .85; }
.small { font-size: 12px; }


/* ── Primitives ─────────────────────────────────────────────── */
.brand {
  font-family: var(--font-heading);
  font-size: 23px; font-weight: 800; color: #fff;
  letter-spacing: -.02em;
  padding: 22px 20px 6px;
}

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }

code {
  font-family: var(--mono); font-size: .85em;
  background: var(--bg-light); color: var(--text-dark);
  padding: .12em .4em; border-radius: 4px;
  /* The API reference writes whole paths inline —
     `/api/v1/reports/orders/:id/diagrams/:structure/:type` has nothing a
     browser will break on, so on a phone it pushed the entire page sideways.
     `anywhere` only takes effect when the line can't fit otherwise. */
  overflow-wrap: anywhere;
}
pre {
  background: var(--primary-darker); color: #E6EEF5;
  padding: 14px 16px; border-radius: var(--radius-btn);
  overflow-x: auto; font-size: 12px; line-height: 1.55;
  font-family: var(--mono);
}
pre code { background: transparent; color: inherit; padding: 0; }
/* The API reference stacks request and response as two blocks. With no gap
   they read as one block with a seam in it — and since both are the same dark
   navy, the seam is the only thing telling you where the curl ends and the
   JSON begins. */
pre + pre { margin-top: 14px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 18px;
}

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.stat-label {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .9px; color: var(--text-body);
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 34px; font-weight: 800; color: var(--text-dark);
  letter-spacing: -.03em; line-height: 1; margin-top: 8px;
}
.stat-note { font-size: 12px; color: var(--text-body); margin-top: 7px; }

/* ── Tables ─────────────────────────────────────────────────── */
/* Same rules as the dashboard's app.css — the API reference is one shared
   markup file rendered on both hosts, so its tables have to match. */
table { width: 100%; border-collapse: collapse; }
th {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-body); padding: 0 8px 9px; text-align: left;
  border-bottom: 2px solid var(--bg-light);
}
td {
  padding: 11px 8px; border-bottom: 1px solid var(--bg-light);
  font-size: 13px; vertical-align: middle; color: var(--text-dark);
}
tr:last-child td { border-bottom: none; }


/* ── Controls ───────────────────────────────────────────────── */
.btn {
  font-family: var(--font-main); font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  border: none; border-radius: var(--radius-btn); cursor: pointer;
  padding: 10px 17px; line-height: 1;
  background: var(--primary); color: #fff;
  /* .btn is used on <button> and <a> alike — anchors would otherwise pick up
     the global link underline. */
  display: inline-block; text-decoration: none;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary {
  background: var(--bg-light); color: var(--primary);
  border: 1px solid var(--border-input);
}
.btn.secondary:hover { background: var(--primary-tint); }
/* Text-weight action — used where a third button in a row would compete with
   the two that matter. */
.btn.ghost { background: transparent; color: var(--text-body); }
.btn.ghost:hover { background: var(--bg-light); color: var(--primary); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #A93226; }

/* ── Landing page ───────────────────────────────────────────── */
.landing-nav {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 62px;
  display: flex; align-items: center; justify-content: space-between;
}
.landing-nav .brand { color: var(--primary); padding: 0; font-size: 22px; }

.hero { background: #fff; border-bottom: 1px solid var(--border); }
.hero-inner { max-width: 1000px; margin: 0 auto; padding: 72px 28px 78px; }
/* The hero headline is the one place that runs Poppins — it's geometric and
   wide-set, which reads better at 64px than the display face used for section
   headings. Loaded only on the landing page. */
.hero-title {
  font-family: var(--font-hero);
  font-size: clamp(38px, 6.1vw, 61px); font-weight: 700;
  line-height: 1.08; letter-spacing: -.03em;
  color: var(--text-dark);
  margin: 0 0 20px;
}
.hero-title span { color: var(--primary); }
.hero-sub { font-size: 17px; color: var(--text-body); max-width: 600px; margin: 0 0 28px; }
.hero-preview { font-size: 14px; color: var(--text-body); margin-top: 16px; }
.hero-preview a { font-weight: 700; }
.price-tag { font-size: 14px; color: var(--text-body); margin-top: 22px; }
.price-tag strong {
  font-family: var(--font-heading);
  color: var(--text-dark); font-size: 25px; font-weight: 800; letter-spacing: -.02em;
}

.landing-body { max-width: 1000px; margin: 0 auto; padding: 44px 28px 70px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature h3 {
  font-family: var(--font-heading);
  font-size: 16px; font-weight: 700; color: var(--text-dark);
  letter-spacing: -.01em; margin: 0 0 6px;
}
.feature p { color: var(--text-body); font-size: 13.5px; margin: 0; }


/* ── Landing page sections ──────────────────────────────────── */
.eyebrow {
  display: inline-block; margin-bottom: 18px;
  padding: 5px 12px; border-radius: 9999px;
  background: var(--primary-tint); color: var(--primary);
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
}

.landing-body section { margin-bottom: 56px; }
.landing-body section:last-child { margin-bottom: 0; }

.section-title {
  font-family: var(--font-heading);
  font-size: 30px; font-weight: 800; color: var(--text-dark);
  letter-spacing: -.03em; margin: 0 0 20px;
}

/* Numbered steps */
.step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step { position: relative; padding-top: 22px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; margin-bottom: 12px;
  background: var(--primary); color: #fff;
  font-family: var(--font-heading); font-size: 15px; font-weight: 800;
}
.step h3 {
  font-family: var(--font-heading); font-size: 17px; font-weight: 700;
  color: var(--text-dark); letter-spacing: -.01em; margin: 0 0 6px;
}
.step p { color: var(--text-body); font-size: 13.5px; margin: 0; }

/* Pricing */
.price-card h3 {
  font-family: var(--font-heading); font-size: 18px; font-weight: 700;
  color: var(--text-dark); letter-spacing: -.01em; margin: 0 0 8px;
}
.price-card .price {
  font-family: var(--font-heading); font-size: 42px; font-weight: 800;
  color: var(--primary); letter-spacing: -.04em; line-height: 1;
}
.price-card .price span {
  font-family: var(--font-main); font-size: 14px; font-weight: 500;
  color: var(--text-body); letter-spacing: 0; margin-left: 6px;
}
.price-card ul { margin: 16px 0 0; padding-left: 18px; }
.price-card li { color: var(--text-body); font-size: 13.5px; margin-bottom: 6px; }

/* FAQ */
.faq { padding: 16px 0; border-bottom: 1px solid var(--bg-light); }
.faq:first-child { padding-top: 0; }
.faq:last-child { padding-bottom: 0; border-bottom: none; }
.faq h3 {
  font-family: var(--font-heading); font-size: 15.5px; font-weight: 700;
  color: var(--text-dark); letter-spacing: -.01em; margin: 0 0 6px;
}
.faq p { color: var(--text-body); font-size: 13.5px; margin: 0; }

/* Closing CTA */
.cta-card { background: var(--primary-tint); border-color: var(--primary-tint); }

/* Footer */
.landing-footer { background: var(--primary-darker); color: #fff; padding: 32px 0 36px; }
.landing-footer-inner {
  max-width: 1000px; margin: 0 auto; padding: 0 28px 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
}
.landing-footer a { color: rgba(255,255,255,.8); font-size: 13.5px; text-decoration: none; }
.landing-footer a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 820px) {
  .section-title { font-size: 25px; }
  .landing-body section { margin-bottom: 40px; }
  .landing-footer-inner { padding: 0 20px 14px; }

  /* The bar was a fixed 62px with three buttons in it, so on a phone the row
     wrapped underneath and sat on top of the wordmark. Height follows content
     now, and Pricing drops out — it's a jump link to a section already on the
     page, so nothing is lost by leaving the two account actions. */
  .landing-nav {
    height: auto; min-height: 58px;
    padding: 10px 16px; gap: 10px; flex-wrap: wrap;
  }
  .landing-nav .brand { font-size: 20px; }
  .landing-nav .row { gap: 8px; flex-wrap: nowrap; }
  .landing-nav .btn { padding: 9px 12px; font-size: 11.5px; letter-spacing: .4px; }
  /* Docs stays: it's the only nav item that goes somewhere the page can't. */
  .landing-nav .btn.ghost:not(.nav-docs) { display: none; }

  .hero-inner { padding: 44px 20px 52px; }
  .hero-sub { font-size: 16px; }
  /* Share the width evenly rather than leaving a stub of dead space. */
  .hero .row { gap: 10px; }
  .hero .row .btn { flex: 1 1 0; text-align: center; }

  .landing-body { padding: 32px 20px 52px; }

  /* Wide content scrolls inside its own box instead of widening the page. */
  table, pre { max-width: 100%; overflow-x: auto; display: block; }
}

@media (max-width: 400px) {
  .landing-nav .brand { font-size: 18px; }
  .landing-nav .btn { padding: 8px 10px; font-size: 11px; letter-spacing: .3px; }
  /* Two full-width buttons read better than two cramped ones. */
  .hero .row { flex-direction: column; align-items: stretch; }
}

/* ── Documentation page ─────────────────────────────────────────
   The public copy of the API reference. The markup comes from
   shared/docs/api-reference.html, which is written for the dashboard, so
   everything below is layout around it — the card, table and typography
   primitives it uses are the ones already defined above. */
.docs-head { background: #fff; border-bottom: 1px solid var(--border); }
.docs-head-inner { max-width: 1000px; margin: 0 auto; padding: 46px 28px 40px; }
.docs-title {
  font-family: var(--font-heading);
  font-size: 38px; font-weight: 800; color: var(--text-dark);
  letter-spacing: -.03em; line-height: 1.08; margin: 8px 0 14px;
}
.docs-lede { font-size: 16px; color: var(--text-body); max-width: 640px; margin: 0 0 24px; }

.docs-page { max-width: 1000px; margin: 0 auto; padding: 38px 28px 70px; }
/* The reference's own h1 is "API reference", which would be a second first-
   level heading under the one in the header. Demote it visually; the header
   above already says what the page is. */
.docs-page .h1 { font-size: 21px; }
/* Title and "Copy for AI" on one line — the title block has no width of its
   own, so on a wrapping row it takes everything and the button drops under.
   Only where there's room; the phone rules below let it wrap again. */
@media (min-width: 641px) {
  .docs-page > .row.between { flex-wrap: nowrap; }
}

/* The contents card is the map of a very long page — worth pinning down. */
.docs-page #ep-index { border-color: var(--border-input); }

/* Deep links land on an endpoint block; without this the sticky-free layout
   still puts the heading flush against the top of the window. */
.docs-page .card[id] { scroll-margin-top: 18px; }

.landing-nav .btn.ghost[aria-current] { color: var(--primary); background: var(--bg-light); }

@media (max-width: 640px) {
  .docs-head-inner { padding: 32px 20px 30px; }
  .docs-title { font-size: 29px; }
  .docs-lede { font-size: 15px; }
  .docs-page { padding: 26px 18px 56px; }
  .docs-head .row .btn { flex: 1 1 0; text-align: center; }
}

/* ── Legal pages ────────────────────────────────────────────────
   A long agreement read end to end on a phone or a laptop. Measure is the
   whole design here: 70-ish characters, generous leading, and nothing in the
   margins competing with the text. */
.legal-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
}
.legal-bar .brand { padding: 0; font-size: 19px; text-decoration: none; }
.legal-back { font-size: 13px; color: var(--text-body); text-decoration: none; }
.legal-back:hover { color: var(--primary); }

.legal-page {
  max-width: 760px; margin: 0 auto; padding: 44px 24px 80px;
}

.legal-head { padding-bottom: 22px; border-bottom: 1px solid var(--border); margin-bottom: 30px; }
.legal-head h1 {
  font-family: var(--font-heading);
  font-size: 34px; font-weight: 800; color: var(--text-dark);
  letter-spacing: -.02em; margin: 0 0 6px;
}
.legal-meta { font-size: 13.5px; color: var(--text-body); margin: 0; }

.legal-body { font-size: 15.5px; line-height: 1.7; color: var(--text-dark); }
.legal-body h1 { font-family: var(--font-heading); font-size: 24px; margin: 40px 0 12px; letter-spacing: -.02em; }
.legal-body h2 { font-family: var(--font-heading); font-size: 19px; margin: 36px 0 10px; letter-spacing: -.01em; }
.legal-body h3 { font-size: 16px; font-weight: 700; margin: 26px 0 6px; }
.legal-body h1:first-child, .legal-body h2:first-child { margin-top: 0; }
.legal-body p { margin: 0 0 15px; }
.legal-body ul, .legal-body ol { margin: 0 0 15px; padding-left: 24px; }
.legal-body li { margin-bottom: 7px; }
.legal-body blockquote {
  margin: 0 0 15px; padding: 2px 0 2px 16px;
  border-left: 3px solid var(--border-input); color: var(--text-body);
}
.legal-body hr { border: 0; border-top: 1px solid var(--border); margin: 34px 0; }
.legal-body code {
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 13px; background: var(--bg-light); padding: 1px 5px; border-radius: 4px;
}
.legal-body a { color: var(--primary); }

/* Values that would be filled in per customer. On the public copy nobody has
   filled them, so they read as blanks — which is honest: this is the template,
   not anyone's executed copy. */
.legal-body .ct-var { font-weight: 600; }
.legal-body .ct-var-empty { border-bottom: 1px solid var(--border-input); white-space: pre; }

.legal-foot {
  margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border);
}
.legal-foot p { font-size: 13px; color: var(--text-body); margin: 0 0 8px; }

@media (max-width: 640px) {
  .legal-bar { padding: 14px 18px; }
  .legal-page { padding: 30px 18px 60px; }
  .legal-head h1 { font-size: 27px; }
  .legal-body { font-size: 15px; }
}
