@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/Inter-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/Inter-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/Inter-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/Inter-ExtraBold.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/JetBrainsMono-Bold.woff2") format("woff2");
}

:root {
  --black: #000000;
  --text: #f5f5f5;
  --muted: #a0a5aa;
  --green: #0aeb17;
  --line: #1c1c1c;
  --panel: #0c0c0c;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --header-h: 3.5rem;
  --sidebar: 15.75rem;
  --content: 46rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.85rem);
}

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

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.975rem;
  line-height: 1.65;
  font-weight: 400;
}

a { color: var(--green); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

code, kbd, pre, .mono, .endpoint-path, .badge, .method {
  font-family: var(--mono);
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  padding: 0.4rem 0.65rem;
  background: var(--black);
  color: var(--green);
  z-index: 40;
}
.skip:focus { top: 0.75rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--header-h);
  height: auto;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  max-width: 86rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.ascii-logo {
  margin: 0;
  font-size: 0.48rem;
  line-height: 1.15;
  font-weight: 700;
  color: var(--green);
  font-family: var(--mono);
  flex: none;
}

.wordmark {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.header-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.header-links {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.2rem 1rem;
  font-size: 0.85rem;
}

.header-links a { color: var(--muted); text-decoration: none; }
.header-links a:hover,
.header-links a[aria-current="page"] { color: var(--green); text-decoration: underline; }

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  max-width: 86rem;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow: auto;
  padding: 1.4rem 1rem 2.5rem 1.25rem;
  border-right: 1px solid var(--line);
}

.sidebar p {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.32rem 0.6rem;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
}

.sidebar a:hover { color: var(--text); }
.sidebar a[aria-current="true"],
.sidebar a.is-active {
  color: var(--green);
  border-left-color: var(--green);
}

.content {
  padding: 2.25rem 2rem 4.5rem;
}

.content-inner { max-width: var(--content); }

h1 {
  margin: 0 0 0.85rem;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
  text-wrap: balance;
}

h2 {
  margin: 0 0 0.85rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

h3 {
  margin: 1.4rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.lede {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--text);
  max-width: 40rem;
}

.muted, .meta { color: var(--muted); }
.meta { margin: 0 0 0.4rem; font-size: 0.9rem; }

section.doc {
  padding: 2.1rem 0 2.35rem;
  border-top: 1px solid var(--line);
}

section.doc:first-of-type { border-top: 0; padding-top: 0.25rem; }

.endpoint {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.endpoint-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
}

.method {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
}

.endpoint-path {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}

.badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
}

.badge-price {
  color: var(--green);
  border-color: var(--green);
}

.endpoint p { margin: 0.65rem 0 0; color: var(--muted); font-size: 0.9rem; }

.two-col {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .two-col.cards { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.95rem 1rem;
}

.card h3 { margin: 0 0 0.4rem; }
.card p { margin: 0; color: var(--text); }
.card p + p { margin-top: 0.55rem; }

.list {
  margin: 0;
  padding: 0 0 0 1.15rem;
  color: var(--text);
}

.list li + li { margin-top: 0.4rem; }

.code-block {
  position: relative;
  margin: 0.7rem 0 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-family: var(--mono);
}

.copy {
  appearance: none;
  background: transparent;
  color: var(--muted);
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
}
.copy:hover,
.copy[data-copied="true"] { color: var(--green); border-color: var(--green); }

.code-block pre {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text);
}

.code-block code { font-family: inherit; }

.discovery-links {
  display: grid;
  gap: 0.55rem;
}

.discovery-links a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.8rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.discovery-links a strong { color: var(--text); font-weight: 600; }
.discovery-links a span { color: var(--muted); font-size: 0.88rem; }
.discovery-links a:hover { border-color: var(--green); }

.note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

p code, li code, .endpoint p code, .note code {
  font-size: 0.9em;
}

@media (max-width: 860px) {
  :root { --header-h: 4.35rem; }
  .layout {
    display: block;
  }
  .site-header { min-height: 0; }
  .header-inner {
    flex-wrap: wrap;
    padding: 0.4rem 0.85rem 0.3rem;
    row-gap: 0.15rem;
  }
  .wordmark { white-space: nowrap; }
  .header-links {
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: flex-start;
    gap: 0.15rem 0.85rem;
  }
  .sidebar {
    position: sticky;
    top: var(--header-h);
    height: auto;
    overflow: auto;
    padding: 0.55rem 0.85rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.94);
    z-index: 20;
  }
  .sidebar p { display: none; }
  .sidebar ol {
    display: flex;
    gap: 0.15rem;
    overflow-x: auto;
  }
  .sidebar a {
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    padding: 0.4rem 0.55rem;
    border-radius: 0;
  }
  .sidebar a[aria-current="true"],
  .sidebar a.is-active {
    border-left-color: transparent;
    border-bottom-color: var(--green);
  }
  .content { padding: 1.4rem 1rem 3rem; }
  h1 { font-size: 1.55rem; }
  .header-note { display: none; }
  .ascii-logo { font-size: 0.44rem; }
}
