/* Social Scrapers: one stylesheet, no web fonts, no scripts. Brand gradient #4f46e5 → #7c3aed. */
:root {
  --brand-1: #4f46e5;
  --brand-2: #7c3aed;
  --link: #4338ca;
  --text: #0f172a;
  --muted: #475569;
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #eef2ff;
  --border: #e2e8f0;
  --code-bg: #f1f5f9;
  --radius: 16px;
  --wrap: 1080px;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 6%);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --link: #a5b4fc;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --bg: #0b1020;
    --surface: #111827;
    --surface-2: #1e1b4b;
    --border: #1f2937;
    --code-bg: #0f172a;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

code {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

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

pre code {
  background: none;
  padding: 0;
  overflow-wrap: normal;
}

.wrap {
  width: min(100% - 40px, var(--wrap));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 10;
  background: var(--bg);
  padding: 8px 12px;
}

/* ---------- header and footer ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: saturate(160%) blur(8px);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
}

.header-inner {
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
}

.brand img {
  border-radius: 8px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 0;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 72px;
  padding: 24px 0 32px;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
}

/* ---------- landing ---------- */

.hero {
  background:
    radial-gradient(60% 80% at 85% 0%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 70%),
    radial-gradient(50% 70% at 0% 10%, color-mix(in srgb, var(--brand-1) 14%, transparent), transparent 70%);
  padding: 72px 0 56px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--brand-1);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

@media (prefers-color-scheme: dark) {
  .eyebrow {
    color: #a5b4fc;
  }
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  margin: 0 0 16px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (prefers-color-scheme: dark) {
  .gradient-text {
    background-image: linear-gradient(90deg, #818cf8, #a78bfa);
  }
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 38rem;
  margin: 0 0 28px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button-primary {
  color: #fff;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 6px 18px rgb(79 70 229 / 30%);
}

.button-secondary {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg);
}

.button:hover {
  transform: translateY(-1px);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  justify-items: center;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.icon-grid img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.section {
  padding: 56px 0 8px;
}

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 8px;
}

.section .intro {
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 44rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.card p:last-child {
  margin-bottom: 0;
}

.pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 10px;
}

.pill-soon {
  color: #6d28d9;
  background: #ede9fe;
}

.pill-live {
  color: #047857;
  background: #d1fae5;
}

@media (prefers-color-scheme: dark) {
  .pill-soon {
    color: #ddd6fe;
    background: #3b0764;
  }

  .pill-live {
    color: #a7f3d0;
    background: #064e3b;
  }
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.principles div {
  border-top: 3px solid var(--brand-1);
  padding-top: 14px;
}

.principles h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.principles p {
  margin: 0;
  color: var(--muted);
}

/* ---------- inner pages ---------- */

.page {
  padding: 48px 0 0;
}

.page h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin: 0 0 8px;
}

.prose {
  max-width: 72ch;
}

.prose h2 {
  font-size: 1.35rem;
  margin: 36px 0 8px;
}

.prose ul {
  padding-left: 1.2em;
}

.prose li {
  margin: 4px 0;
}

.effective {
  color: var(--muted);
  margin: 0 0 24px;
}

.contact-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 1.1rem;
}

/* ---------- API docs ---------- */

.docs {
  max-width: 900px;
}

.docs h2 {
  font-size: 1.5rem;
  margin: 44px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.docs .toc h2 {
  border-top: none;
  margin-top: 28px;
}

.toc ul {
  list-style: none;
  padding-left: 0;
}

.toc ul ul {
  padding-left: 0.4em;
  margin: 6px 0 14px;
}

.toc li {
  margin: 6px 0;
}

.endpoint {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 24px 20px;
  margin: 18px 0;
  scroll-margin-top: 80px;
}

.endpoint h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 1.2rem;
}

.endpoint h3 code {
  background: none;
  padding: 0;
  font-size: 1.05rem;
}

.endpoint h4 {
  margin: 20px 0 8px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.endpoint .lead {
  font-weight: 600;
  margin-top: 0;
}

.method {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  border-radius: 6px;
  padding: 3px 8px;
}

.responses {
  list-style: none;
  padding: 0;
}

.responses li {
  margin: 6px 0;
}

details {
  margin-top: 14px;
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--link);
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- small screens ---------- */

@media (max-width: 820px) {
  .site-header {
    position: static;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .hero-inner,
  .cards,
  .principles {
    grid-template-columns: 1fr;
  }

  .icon-grid {
    max-width: 360px;
  }

  .endpoint {
    padding: 4px 16px 16px;
  }

  /* Parameter tables become one labelled block per parameter. */
  table.stack thead {
    display: none;
  }

  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack td {
    display: block;
  }

  table.stack tr {
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }

  table.stack td {
    border: none;
    padding: 2px 0;
  }

  table.stack td::before {
    content: attr(data-label) ": ";
    color: var(--muted);
    font-weight: 600;
  }
}

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

  .button {
    transition: none;
  }

  .button:hover {
    transform: none;
  }
}
