/* VPT Developer Portal. Tokens mirror the marketing site (website/assets/css/vpt-v2.css):
   dark navy, cyan accent, Inter + JetBrains Mono. Light theme is opt-in via the toggle. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
}

:root {
  --bg-base: #0b1220;
  --bg-panel: #111a2b;
  --bg-surface: #172035;
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.15);
  --text-primary: #e6ecf5;
  --text-muted: #8a95ab;
  --accent: #4fd1e0;
  --accent-dim: rgba(79, 209, 224, 0.15);
  --accent-ink: #0b1220;
  --amber: #f0b26b;
  --amber-dim: rgba(240, 178, 107, 0.14);
  --green: #10b981;
  --code-bg: #0e1628;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Courier New", monospace;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --header-height: 72px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg-base: #f5f7fb;
  --bg-panel: #ffffff;
  --bg-surface: #eaeff7;
  --border: rgba(11, 18, 32, 0.12);
  --border-bright: rgba(11, 18, 32, 0.22);
  --text-primary: #0b1220;
  --text-muted: #4d5a73;
  --accent: #0b7f8e;
  --accent-dim: rgba(11, 127, 142, 0.1);
  --accent-ink: #ffffff;
  --amber: #8a5300;
  --amber-dim: rgba(240, 178, 107, 0.25);
  --green: #047857;
  --code-bg: #eef2f9;
  --shadow-card: 0 4px 24px rgba(11, 18, 32, 0.08);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}
body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ─── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: color-mix(in srgb, var(--bg-base) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1120px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
}
/* The official VPT logo (assets/img/vpt-logo.svg, an unmodified copy of app/assets/img/logos/icon_vpt_text.svg) is a white
   lockup on a 609x235 canvas whose artwork spans x 32-577 and y 32-205. It is drawn as a mask filled with the text colour,
   so it stays visible on the dark and the light theme, and the empty canvas margin is cropped with negative margins. */
.brand-logo {
  --logo-height: 52px; /* height of the visible artwork */
  --u: calc(var(--logo-height) / 172.6);
  display: block;
  flex-shrink: 0;
  width: calc(609 * var(--u));
  height: calc(235 * var(--u));
  margin: calc(-32.2 * var(--u)) calc(-32.2 * var(--u)) calc(-30.2 * var(--u)) calc(-32 * var(--u));
  background: var(--text-primary);
  -webkit-mask: url("/assets/img/vpt-logo.svg") center / 100% 100% no-repeat;
  mask: url("/assets/img/vpt-logo.svg") center / 100% 100% no-repeat;
}
.brand-tag {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
}
.nav a:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}
.nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-dim);
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.icon-button:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
}
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-toggle {
  display: none;
}
.header-actions {
  display: flex;
  gap: 0.5rem;
}
:root[data-theme="light"] .icon-sun,
:root:not([data-theme="light"]) .icon-moon {
  display: none;
}

/* ─── Layout ─────────────────────────────────────────────── */
.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}
.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}
h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 3rem 0 0.75rem;
}
h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
}
p {
  margin: 0 0 1rem;
}
.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 64ch;
}
ul,
ol {
  padding-left: 1.4rem;
  margin: 0 0 1rem;
}
li {
  margin-bottom: 0.35rem;
}

/* ─── Components ──────────────────────────────────────────── */
.method {
  display: inline-block;
  min-width: 3.5em;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
  border: 1px solid transparent;
}
.method-get {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 14%, transparent);
  border-color: color-mix(in srgb, var(--green) 35%, transparent);
}
.endpoint {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}
.endpoint code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font: 600 0.9rem/1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  text-decoration: none;
  filter: brightness(1.08);
}
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-bright);
}
.btn-ghost:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  line-height: 1.6;
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}
.code-block {
  margin: 0 0 1.25rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.code-block pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.code-block-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.4rem 0.3rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-surface) 60%, transparent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.copy-button {
  font: 500 0.72rem/1 var(--font-sans);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  cursor: pointer;
}
.copy-button:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}
th,
td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.table-wrap {
  overflow-x: auto;
}

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-panel);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.callout p:last-child {
  margin-bottom: 0;
}
.callout-title {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.callout-warning {
  border-left-color: var(--amber);
  background: var(--amber-dim);
}
.pill {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  color: var(--accent);
}
.pill-warning {
  border-color: transparent;
  background: var(--amber-dim);
  color: var(--amber);
}
.pill-muted {
  border-color: var(--border-bright);
  background: transparent;
  color: var(--text-muted);
}

/* ─── Documentation layout: content + "On this page" ──────── */
.page.has-toc {
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  column-gap: 4rem;
}
.page.has-toc > * {
  grid-column: 1;
  min-width: 0;
}
.page.has-toc > .toc {
  grid-column: 2;
  grid-row: 1 / span 60;
  align-self: start;
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  font-size: 0.85rem;
  border-left: 1px solid var(--border);
  padding-left: 1rem;
}
.toc-title {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc li {
  margin: 0;
}
.toc a {
  display: block;
  padding: 0.25rem 0;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
}
.toc a:hover,
.toc a[aria-current="true"] {
  color: var(--accent);
}
@media (max-width: 1080px) {
  .page.has-toc {
    display: block;
    max-width: 880px;
  }
  .page.has-toc > .toc {
    display: none;
  }
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
}
.footer-inner p {
  margin: 0;
}

/* ─── API reference page ─────────────────────────────────── */
.reference-bar {
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.reference-bar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}
.reference-bar label,
.reference-bar .bar-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.segmented {
  display: inline-flex;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.segmented button {
  font: 600 0.85rem/1 var(--font-sans);
  padding: 0.6rem 1rem;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  cursor: pointer;
}
.segmented button + button {
  border-left: 1px solid var(--border-bright);
}
.segmented button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.select {
  font: 500 0.85rem var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
}
.api-url {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.bar-note {
  margin: 0 0 0 auto;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.reference-notice {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem 0.85rem;
}
.reference-notice .callout {
  margin: 0;
}
#reference-status {
  max-width: 880px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}
.reference-mount {
  min-height: 60vh;
}

@media (max-width: 800px) {
  .header-actions {
    margin-left: auto;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem 1rem;
    margin: 0;
    display: none;
  }
  .nav[data-open="true"] {
    display: flex;
  }
  .brand-tag {
    display: none;
  }
  .brand-logo {
    --logo-height: 44px;
  }
}
