/* =====================================================================
   sitetrace-api — styles
   Clean, dev-focused, dark-mode friendly. No external CSS frameworks.
   ===================================================================== */

:root {
  --bg: #0b0d10;
  --bg-soft: #11141a;
  --bg-card: #161a22;
  --border: #232936;
  --text: #e6e9ef;
  --text-soft: #a4abbb;
  --text-mute: #6e7585;
  --brand: #4dd2c0;          /* sitetrace teal */
  --brand-soft: #2a8478;
  --accent: #f7b955;         /* warm accent for CTAs */
  --good: #4ade80;
  --bad: #f87171;
  --warn: #fbbf24;
  --code-bg: #0a0c10;
  --code-border: #1c2030;
  --maxw: 1080px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-soft: #f7f8fa;
    --bg-card: #ffffff;
    --border: #e5e7eb;
    --text: #0b0d10;
    --text-soft: #4b5563;
    --text-mute: #6b7280;
    --code-bg: #f5f7fa;
    --code-border: #e5e7eb;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
  font-family: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}

code {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 16px 18px;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; border: none; padding: 0; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.nav { display: flex; gap: 22px; align-items: center; }
.nav a {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.btn:hover { border-color: var(--text-soft); text-decoration: none; }
.btn-primary {
  background: var(--brand);
  color: #061412;
  border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-soft); border-color: var(--brand-soft); }
.btn-accent {
  background: var(--accent);
  color: #1c1303;
  border-color: var(--accent);
}
.btn-ghost { background: transparent; }

/* ---- Hero ---- */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}
.hero h1 {
  font-size: 48px;
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.hero .lede {
  color: var(--text-soft);
  font-size: 19px;
  max-width: 640px;
  margin: 0 auto 28px;
}
.hero .cta-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero .quick-curl {
  margin: 36px auto 0;
  max-width: 720px;
  text-align: left;
}

/* ---- Sections ---- */
section { padding: 60px 0; border-top: 1px solid var(--border); }
section h2 {
  font-size: 28px;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
section .lede { color: var(--text-soft); font-size: 17px; max-width: 720px; }

/* ---- API grid ---- */
.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.api-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  transition: all .15s ease;
}
.api-card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.api-card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.api-card p { margin: 0; color: var(--text-soft); font-size: 14px; }
.api-card .pill {
  display: inline-block;
  font-size: 11px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text-soft);
  margin-bottom: 10px;
  font-family: "SFMono-Regular", monospace;
}

/* ---- Pricing ---- */
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.price-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
}
.price-card.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.price-card .name { font-size: 13px; color: var(--text-soft); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 6px; font-weight: 600; }
.price-card .price { font-size: 32px; font-weight: 800; margin: 0; }
.price-card .price small { font-size: 14px; color: var(--text-soft); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 16px 0 0; font-size: 14px; color: var(--text-soft); }
.price-card li { padding: 5px 0; }
.price-card li::before { content: "✓"; color: var(--good); margin-right: 8px; font-weight: 600; }
.price-card .btn { margin-top: auto; padding: 10px; text-align: center; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-soft); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }

/* ---- FAQ ---- */
details.faq { border-bottom: 1px solid var(--border); padding: 18px 0; }
details.faq[open] { padding-bottom: 22px; }
details.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 17px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 24px; color: var(--text-mute); font-weight: 300; }
details.faq[open] summary::after { content: "−"; }
details.faq p { margin: 12px 0 0; color: var(--text-soft); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 40px 0;
  color: var(--text-mute);
  font-size: 14px;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer a { color: var(--text-soft); }
.site-footer .links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---- Forms ---- */
input, select, textarea {
  font-family: inherit;
  font-size: 15px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 7px;
  width: 100%;
  outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-soft); }
.form-row { margin-bottom: 18px; }
.form-row .help { color: var(--text-mute); font-size: 13px; margin-top: 4px; }

/* ---- Utilities ---- */
.mono { font-family: "SFMono-Regular", "JetBrains Mono", Consolas, monospace; }
.muted { color: var(--text-mute); }
.center { text-align: center; }
.kbd {
  display: inline-block;
  font-family: "SFMono-Regular", monospace;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
}
.badge {
  display: inline-block;
  background: var(--code-bg);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 500;
  margin-right: 6px;
}

/* ---- Code-tabs / multi-language code blocks ---- */
.code-tabs { margin-top: 12px; }
.code-tabs .tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: -1px; }
.code-tabs .tab {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-mute);
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none; border-left: none; border-right: none;
  font-family: inherit;
}
.code-tabs .tab.active { color: var(--text); border-bottom-color: var(--brand); }
.code-tabs pre { display: none; border-top-left-radius: 0; }
.code-tabs pre.active { display: block; }

/* ---- Status page ---- */
.status-row { display: flex; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 14px; flex-shrink: 0; }
.status-dot.ok { background: var(--good); box-shadow: 0 0 6px var(--good); }
.status-dot.warn { background: var(--warn); }
.status-dot.bad { background: var(--bad); }

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .hero { padding: 50px 0 30px; }
  .hero h1 { font-size: 34px; }
  .nav { gap: 14px; }
  .nav a { font-size: 13px; }
  section { padding: 40px 0; }
  section h2 { font-size: 22px; }
  .site-header .container { height: 54px; }
}
