@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/instrument-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --night: #12173a;
  --night-raised: #1d2452;
  --night-line: #323a73;
  --ink: #1b2040;
  --muted: #565d82;
  --mist: #f6f7fb;
  --paper: #ffffff;
  --sky: #e8edff;
  --line: #d8ddf0;
  --dawn: #ffb52e;
  --dawn-deep: #9a5b00;
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --code: #12173a;
  --code-line: transparent;
  --wide: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  color-scheme: light;
}
/* The dark theme: set by the script in the head of each page, from the visitor's choice
   in the footer or from their system. Swagger UI follows the same class. */
html.dark-mode {
  --ink: #eceeff;
  --muted: #a7aed8;
  --mist: #0b0e24;
  --paper: #141939;
  --sky: #1c2350;
  --line: #2a3166;
  --code: #070919;
  --code-line: #2a3166;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--mist); color: var(--ink); font: 1.0625rem/1.6 var(--body); }
a { color: inherit; text-decoration-color: var(--dawn); text-decoration-thickness: 0.12em; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--dawn); outline-offset: 3px; border-radius: 0.2rem; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; text-wrap: pretty; }
code { font-family: var(--mono); font-size: 0.88em; }
.skip { position: absolute; left: -100rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--dawn); color: var(--night); padding: 0.5rem 0.9rem; border-radius: 0.4rem; }

/* Top bar and footer */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: var(--wide); margin: 0 auto; padding: 1rem var(--gutter); }
.brand { font: 700 1.3rem/1 var(--display); letter-spacing: -0.03em; text-decoration: none; }
.top nav { display: flex; align-items: center; gap: clamp(0.9rem, 3vw, 1.75rem); font-weight: 500; }
.top nav a { text-decoration: none; }
.top nav a:not(.button):hover, .top nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--dawn); text-decoration-thickness: 0.14em; }
.bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; max-width: var(--wide); margin: 0 auto; padding: 2rem var(--gutter) 3rem; color: var(--muted); font-size: 0.95rem; border-top: 1px solid var(--line); }
.bottom { align-items: center; }
.bottom nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-right: auto; }
.theme { display: flex; align-items: center; gap: 0.2rem; margin: 0; padding: 0.2rem; border: 1px solid currentColor; border-radius: 999px; }
.theme legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.theme input { position: absolute; opacity: 0; }
.theme span { display: block; padding: 0.3rem 0.8rem; border-radius: 999px; cursor: pointer; font-size: 0.88rem; }
.theme input:checked + span { background: var(--dawn); color: var(--night); font-weight: 600; }
.theme input:focus-visible + span { outline: 3px solid var(--dawn); outline-offset: 2px; }
.home .bottom { color: #c9cff5; border-top: 0; }

.button { display: inline-block; background: var(--dawn); color: var(--night); font-weight: 650; text-decoration: none; padding: 0.8rem 1.3rem; border-radius: 999px; border: 2px solid var(--dawn); }
.button:hover { background: #ffc65c; border-color: #ffc65c; }
.button.small { padding: 0.45rem 0.95rem; font-size: 0.95rem; }
.button.ghost { background: transparent; color: inherit; border-color: currentColor; }
.button.ghost:hover { background: transparent; border-color: var(--dawn); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Code */
pre { position: relative; margin: 0; background: var(--code); border: 1px solid var(--code-line); color: #e7eaff; border-radius: 0.75rem; padding: 1.1rem 1.25rem; overflow-x: auto; font-size: 0.875rem; line-height: 1.55; }
pre code { font-size: inherit; }
.copy { position: absolute; top: 0.55rem; right: 0.55rem; background: var(--night-raised); color: #cfd5ff; border: 1px solid var(--night-line); border-radius: 0.4rem; font: 500 0.75rem/1 var(--body); padding: 0.4rem 0.6rem; cursor: pointer; opacity: 0; }
pre:hover .copy, .copy:focus-visible { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }
.hljs-keyword, .hljs-built_in { color: #ffb52e; }
.hljs-string, .hljs-attr { color: #a8e6b0; }
.hljs-number, .hljs-literal { color: #ffa7c0; }
.hljs-comment { color: #8089b8; font-style: italic; }
.hljs-title, .hljs-property { color: #a9c7ff; }
.hljs-variable, .hljs-subst { color: #c9b8ff; }

/* Home */
.home { background: var(--night); }
.home .top { color: #ffffff; }
.home main { background: var(--mist); }
.hero { background: var(--night); color: #ffffff; }
.hero, .band, .closing { padding-inline: max(var(--gutter), calc((100vw - var(--wide)) / 2 + var(--gutter))); }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3.5rem, 8vw, 6.5rem); }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.9rem); font-weight: 650; letter-spacing: -0.035em; line-height: 1.04; text-wrap: balance; }
.lead { margin-block: 1.5rem 2.2rem; font-size: 1.2rem; line-height: 1.55; color: #c9cff5; max-width: 34rem; }

.wake { background: var(--night-raised); border: 1px solid var(--night-line); border-radius: 1rem; padding: 1rem; }
.wake-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; background: var(--night); border-radius: 0.6rem; padding: 0.55rem 0.55rem 0.55rem 0.9rem; }
.wake-url { flex: 1 1 12rem; min-width: 0; font: 0.82rem/1.3 var(--mono); color: #c9cff5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wake button { background: var(--dawn); color: var(--night); border: 0; border-radius: 0.45rem; font: 650 0.92rem/1 var(--body); padding: 0.65rem 0.95rem; cursor: pointer; }
.wake button:disabled { opacity: 0.55; cursor: progress; }
.wake-log { list-style: none; margin: 0; padding: 0.9rem 0.4rem 0.4rem; min-height: 13.5rem; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.6rem; font-size: 0.95rem; }
.wake-log li { display: grid; grid-template-columns: 0.7rem 1fr; gap: 0.7rem; align-items: baseline; color: #c9cff5; animation: arrive 0.25s ease-out; }
.wake-log li::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #6b739f; transform: translateY(0.05rem); }
.wake-log li[data-state="waking"]::before, .wake-log li[data-state="ready"]::before { background: var(--dawn); }
.wake-log li[data-state="ready"] { color: var(--dawn); font-weight: 600; }
.wake-log li[data-state="answer"] { color: #ffffff; font-family: var(--mono); font-size: 0.85rem; overflow-wrap: anywhere; }
.wake-log li[data-state="answer"]::before { background: #7be0a2; }
.wake-note { padding: 0.6rem 0.4rem 0; font-size: 0.82rem; color: #8f97c4; border-top: 1px solid var(--night-line); margin-top: 0.6rem; }
@keyframes arrive { from { opacity: 0; transform: translateY(0.4rem); } }
@media (prefers-reduced-motion: reduce) { .wake-log li { animation: none; } }

.band { padding-block: clamp(3rem, 7vw, 5.5rem); border-bottom: 1px solid var(--line); }
.band h2, .closing h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 650; max-width: 30ch; text-wrap: balance; }
.section-lead { margin-top: 1rem; color: var(--muted); max-width: 30rem; }

.steps { list-style: none; counter-reset: step; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 1.75rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.2rem minmax(0, 0.8fr) minmax(0, 1.2fr); column-gap: 1.5rem; align-items: start; }
.steps li::before { content: counter(step); grid-row: span 2; font: 700 1rem/2.2rem var(--display); width: 2.2rem; height: 2.2rem; text-align: center; border-radius: 50%; background: var(--night-raised); color: var(--dawn); }
.steps h3 { font-size: 1.3rem; padding-top: 0.3rem; }
.steps p { grid-column: 2; margin-top: 0.5rem; color: var(--muted); }
.steps pre { grid-column: 3; grid-row: 1 / span 2; }

.uses { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.uses li { border-top: 3px solid var(--ink); padding-top: 1rem; }
.uses h3 { font-size: 1.15rem; }
.uses p { margin-top: 0.5rem; color: var(--muted); }

.split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.features, .specs { margin: 0; }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 2.5rem; }
.features dt, .specs dt { font: 650 1.08rem/1.3 var(--display); }
.features dd { margin: 0.35rem 0 0; color: var(--muted); }
.specs div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid var(--line); }
.specs div:last-child { border-bottom: 1px solid var(--line); }
.specs dd { margin: 0; }

.closing { background: var(--sky); padding-block: clamp(3rem, 7vw, 5rem); }
.closing p { margin-block: 0.9rem 1.8rem; color: var(--muted); max-width: 34rem; }
.closing .actions { margin: 0; color: var(--ink); }

/* Guide */
.docs main, .reference main { max-width: var(--wide); margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) 5rem; }
.docs .top, .reference .top { border-bottom: 1px solid var(--line); max-width: none; padding-inline: max(var(--gutter), calc((100vw - var(--wide)) / 2 + var(--gutter))); background: var(--paper); }
.guide { display: grid; grid-template-columns: 14rem minmax(0, 46rem); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.contents { position: sticky; top: 1.5rem; font-size: 0.95rem; }
.contents p { font: 650 0.95rem/1 var(--display); margin-bottom: 0.9rem; }
.contents ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.contents a { display: block; padding: 0.3rem 0 0.3rem 0.9rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.contents a:hover { color: var(--ink); border-left-color: var(--dawn); }
.prose h1 { font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 650; }
.prose h1 + p { font-size: 1.2rem; color: var(--muted); margin-top: 1rem; }
.prose h3 { font-size: 1.2rem; margin-top: 2rem; }
.prose h2 { font-size: 1.65rem; font-weight: 650; margin-top: 3.25rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.prose p, .prose pre, .prose table, .prose ul { margin-top: 1.1rem; }
.prose :not(pre) > code { background: var(--sky); padding: 0.12em 0.36em; border-radius: 0.3rem; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.6rem 1.1rem 0.6rem 0; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--display); font-weight: 650; }
.prose td:first-child { white-space: nowrap; }
.missing { padding-block: 4rem; }

/* API reference */
.reference-head { max-width: 60rem; }
.reference-head h1 { font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 650; }
.reference-head p { margin-top: 1rem; font-size: 1.15rem; color: var(--muted); }
#swagger { margin-top: 2rem; background: var(--paper); border: 1px solid var(--line); border-radius: 0.9rem; padding: 0.5rem 0 1.5rem; }
#swagger .swagger-ui, #swagger .swagger-ui .opblock-tag, #swagger .swagger-ui .opblock .opblock-summary-description, #swagger .swagger-ui .info .title, #swagger .swagger-ui table thead tr th, #swagger .swagger-ui .response-col_status, #swagger .swagger-ui .parameter__name, #swagger .swagger-ui .btn { font-family: var(--body); color: var(--ink); }
#swagger .swagger-ui .info .title, #swagger .swagger-ui .opblock-tag { font-family: var(--display); }
#swagger .swagger-ui .info { margin: 1.5rem 0 1rem; }
#swagger .swagger-ui .scheme-container { box-shadow: none; padding: 0.5rem 0; background: transparent; }

@media (max-width: 60rem) {
  .hero, .split { grid-template-columns: minmax(0, 1fr); }
  .steps li { grid-template-columns: 2.2rem minmax(0, 1fr); }
  .steps pre { grid-column: 2; grid-row: auto; margin-top: 1rem; }
  .uses, .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide { grid-template-columns: minmax(0, 1fr); }
  .contents { position: static; }
  .contents ol { columns: 2; }
}
@media (max-width: 36rem) {
  .uses, .features { grid-template-columns: minmax(0, 1fr); }
  .specs div { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .top nav a:not(.button) { font-size: 0.95rem; }
}
