:root {
  color-scheme: light;
  --bg: #f6f8f5;
  --panel: #ffffff;
  --ink: #17201b;
  --muted: #5d6a62;
  --line: #dce5dd;
  --green: #3fae4f;
  --green-dark: #217a33;
  --teal: #d7f0ed;
  --amber: #f5c85f;
  --code: #111813;
  --shadow: 0 18px 48px rgba(23, 32, 27, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(215, 240, 237, 0.5), rgba(246, 248, 245, 0) 320px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(220, 229, 221, 0.85);
  background: rgba(246, 248, 245, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 5px 9px rgba(63, 174, 79, 0.2));
}

.brand span {
  display: grid;
  line-height: 1.05;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

nav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

nav a:hover {
  background: var(--teal);
  color: var(--ink);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px clamp(20px, 5vw, 72px) 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 28px;
  align-items: stretch;
  min-height: 440px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 7vw, 72px) 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.85rem, 4vw, 3rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.lead {
  max-width: 690px;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 14px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.button.secondary:hover,
.copy-button:hover {
  background: var(--teal);
}

.api-card,
.section,
.code-panel,
.endpoint,
.steps article,
.metadata-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.api-card {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 28px;
  align-self: center;
}

.api-card code {
  display: block;
  overflow-wrap: anywhere;
  border-radius: 6px;
  padding: 14px;
  background: var(--code);
  color: #d8ffe1;
  font-size: 0.9rem;
}

.card-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

dl {
  display: grid;
  gap: 10px;
  margin: 8px 0 0;
}

dl div,
.metadata-table div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
}

dt,
.metadata-table strong {
  color: var(--muted);
  font-size: 0.9rem;
}

dd {
  margin: 0;
  font-weight: 750;
}

.section {
  margin-top: 28px;
  padding: clamp(24px, 4vw, 42px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
}

.steps,
.endpoint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.steps article,
.endpoint {
  box-shadow: none;
  padding: 18px;
  min-width: 0;
}

.steps span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-weight: 850;
}

.steps p,
.endpoint p,
.code-panel p,
.error-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(320px, 1fr);
  gap: 24px;
}

pre {
  overflow-x: auto;
  margin: 0;
  border-radius: 8px;
  padding: 18px;
  background: var(--code);
  color: #e7fff1;
  font-size: 0.88rem;
}

.endpoint span {
  display: inline-block;
  margin-bottom: 14px;
  border-radius: 999px;
  padding: 4px 9px;
  color: white;
  font-size: 0.76rem;
  font-weight: 850;
}

.endpoint h3 {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.endpoint h3 b {
  font-size: 0.92rem;
  line-height: 1;
}

.endpoint h3 code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.35;
}

.endpoint.public span {
  background: var(--green);
}

.endpoint.protected span {
  background: #3d5870;
}

.examples {
  display: grid;
  gap: 16px;
}

.examples .section-heading {
  margin-bottom: 0;
}

.code-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 18px;
  box-shadow: none;
}

.metadata-table {
  display: grid;
  gap: 12px;
  padding: 20px;
  box-shadow: none;
}

.metadata-table code {
  overflow-wrap: anywhere;
}

.error-list {
  display: grid;
  gap: 10px;
}

.error-list p {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.error-list p:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 900px) {
  main {
    padding-top: 28px;
  }

  .topbar {
    gap: 16px;
  }

  .hero,
  .split,
  .code-panel {
    grid-template-columns: 1fr;
  }

  .steps,
  .endpoint-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    min-height: auto;
  }

  .hero-copy {
    padding: 34px 0 12px;
  }

  .api-card {
    align-self: stretch;
  }
}

@media (max-width: 640px) {
  body {
    background:
      linear-gradient(180deg, rgba(215, 240, 237, 0.7), rgba(246, 248, 245, 0) 240px),
      var(--bg);
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 14px 16px;
  }

  .brand img {
    width: 42px;
    height: 42px;
  }

  nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  nav a {
    display: inline-flex;
    justify-content: center;
    padding: 9px 6px;
    background: rgba(255, 255, 255, 0.75);
    font-size: 0.82rem;
    text-align: center;
  }

  main {
    padding: 24px 14px 52px;
  }

  h1 {
    font-size: clamp(3.2rem, 19vw, 4.5rem);
    line-height: 0.94;
  }

  h2 {
    font-size: clamp(1.75rem, 10vw, 2.35rem);
  }

  .lead {
    font-size: 1.05rem;
  }

  .hero-copy {
    padding: 18px 0 4px;
  }

  .hero-actions,
  .api-card {
    width: 100%;
  }

  .button,
  .copy-button {
    width: 100%;
  }

  .api-card,
  .section {
    padding: 20px;
  }

  .api-card code,
  pre {
    font-size: 0.78rem;
  }

  pre {
    padding: 14px;
  }

  .steps,
  .endpoint-grid {
    grid-template-columns: 1fr;
  }

  dl div,
  .metadata-table div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .code-panel {
    gap: 12px;
  }

  .code-panel .copy-button {
    justify-self: stretch;
  }

  footer {
    flex-direction: column;
    padding: 24px 16px;
  }
}

@media (max-width: 390px) {
  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section {
    margin-top: 18px;
  }
}
