/* ==========================================================
   API reference: the platforms page's language (quiet filled
   surfaces, no hairlines, no glows) in a reference layout:
   sidebar, prose on the left, code on the right.
   ========================================================== */

.px-bg--api { height: min(62vh, 600px); background-position: center, center 70%; opacity: 0.6; }

.ax { position: relative; z-index: 1; max-width: calc(1280px + 2 * var(--g)); margin: 0 auto; padding: 0 var(--g); }
.ax a:not(.px-btn) { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3); text-underline-offset: 3px; transition: text-decoration-color 0.25s; }
.ax a:not(.px-btn):hover { text-decoration-color: #fff; }
.ax code { font-family: var(--mono); }

/* ---------- head: centred, with the main call as the centrepiece ---------- */
.ax-hero { padding: calc(70px + clamp(40px, 8vh, 84px)) 0 clamp(64px, 10vh, 112px); text-align: center; }
.ax-hero .px-eyebrow { justify-content: center; }
.ax-hero h1 { font-size: clamp(38px, 4.8vw, 70px); font-weight: 600; letter-spacing: -0.05em; line-height: 1.03; color: #fff; }
.ax-hero h1 .mute { color: #6e737c; }
.ax-lede { margin: 22px auto 0; max-width: 34em; font-size: clamp(15px, 1.1vw, 17px); line-height: 1.6; color: #b9bdc5; }
.ax-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 900px; margin: 20px auto 0; text-align: left; }
.ax-facts div { padding: 18px 20px; border-radius: 12px; background: rgba(13, 14, 16, 0.86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.ax-facts dt { font-size: 12.5px; color: var(--txt-2); }
.ax-facts dd { margin: 6px 0 0; font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: #fff; }

.ax-call { max-width: 1120px; margin: clamp(40px, 6vh, 60px) auto 0; text-align: left; }
.ax-call-pick { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 14px; }
.ax-call-pick button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 150px; padding: 11px 16px 12px; border: 0; border-radius: 11px;
  background: rgba(13, 14, 16, 0.78); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: #e4e6ea; font: 600 14px/1.2 var(--sans, inherit); letter-spacing: -0.02em; text-align: left; cursor: pointer; transition: background 0.25s, color 0.25s; }
.ax-call-pick button small { font-size: 12.5px; font-weight: 400; letter-spacing: 0; color: var(--txt-2); transition: color 0.25s; }
.ax-call-pick button:hover { background: rgba(24, 26, 31, 0.9); }
.ax-call-pick button[aria-selected="true"] { background: #fff; color: #0a0a0a; }
.ax-call-pick button[aria-selected="true"] small { color: #55595f; }

.ax-call-grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 12px; align-items: stretch; }
.ax-call .ax-code { display: flex; flex-direction: column; background: rgba(13, 14, 16, 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.ax-call .ax-bar { background: rgba(18, 19, 22, 0.92); }
.ax-call pre { font-size: 13px; }
.ax-call-res pre { min-height: 400px; }
.ax-call-see { flex: 1; display: flex; flex-direction: column; justify-content: center; margin: 4px 12px 12px; padding: 22px 22px 24px; border-radius: 10px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(47, 107, 255, 0.09), transparent 55%), #08090a; }
.ax-call-see-t { display: block; margin-bottom: 16px; font-size: 12.5px; font-weight: 500; color: var(--txt-2); }
.ax-call-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; min-height: 92px; }
.ax-call-row .px-coin { grid-row: span 2; }
.ax-call-row b { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: #fff; }
.ax-call-row b small { margin-left: 6px; font-size: 13px; font-weight: 400; color: var(--txt-2); }
.ax-call-row .ax-call-why { grid-column: 2 / -1; font-size: 13px; line-height: 1.5; color: var(--txt); }
.ax-call-row--none { grid-template-columns: minmax(0, 1fr); color: var(--txt-2); font-size: 13.5px; line-height: 1.55; }
.ax-call-note { margin: 16px auto 0; max-width: 46em; font-size: 12.5px; line-height: 1.6; text-align: center; color: var(--txt-2); }

/* switching tokens: the request writes itself in, then the answer arrives */
@keyframes axIn { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes axDown { from { clip-path: inset(0 0 100% 0); opacity: 0.4; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes axFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ax-call.run pre[data-call] { animation: axIn 0.55s cubic-bezier(0.3, 0.7, 0.2, 1) both; }
.ax-call.run pre[data-res] { animation: axDown 0.8s cubic-bezier(0.3, 0.7, 0.2, 1) 0.35s both; }
.ax-call.run [data-see] { animation: axFade 0.5s ease 0.75s both; }
@media (prefers-reduced-motion: reduce) { .ax-call.run pre, .ax-call.run [data-see] { animation: none; } }

/* ---------- quickstart ---------- */
.ax-qs { display: grid; gap: clamp(36px, 5vh, 52px); margin: 36px 0 0; padding: 0; list-style: none; counter-reset: qs; }
.ax-qs > li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 3.6vw, 56px); align-items: start; }
.ax-qs-text { position: relative; padding-left: 52px; }
.ax-qs-text::before { counter-increment: qs; content: counter(qs); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 9px; background: var(--surf); font: 500 13px var(--mono); color: var(--accent-2); }
.ax-qs-text h3 { margin: 2px 0 10px; font-size: 17px; font-weight: 600; letter-spacing: -0.03em; color: #fff; }
.ax-qs-text p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--txt); }
.ax-qs-text code { padding: 2px 6px; border-radius: 5px; background: #15161a; font-size: 0.86em; color: #e4e6ea; }
.ax-try { display: grid; gap: 2px; padding: 8px; }
.ax-try div { display: grid; gap: 3px; padding: 11px 12px; border-radius: 8px; background: var(--surf-2); }
.ax-try code { font: 400 12px var(--mono); color: #e4e6ea; overflow-wrap: anywhere; }
.ax-try span { font-size: 12.5px; color: var(--txt-2); }

/* ---------- layout ---------- */
.ax-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); align-items: start; }

/* sidebar (page.js highlights the section being read through .m-toc) */
.ax .ax-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.ax-side p { margin: 22px 0 6px 10px; font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; color: #fff; }
.ax-side p:first-child { margin-top: 0; }
.ax .ax-side a { display: flex; align-items: center; padding: 6px 10px; border-radius: 7px; font-size: 13.5px; color: var(--txt-2); text-decoration: none; transition: color 0.25s, background 0.25s; }
.ax .ax-side a:hover { color: #e4e6ea; }
.ax .ax-side a.on { color: #fff; background: var(--surf); }
.ax-side .ax-verb { margin-right: 8px; }

/* ---------- sections ---------- */
.ax-sec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 3.6vw, 56px); align-items: start; padding-top: clamp(72px, 10vh, 104px); }
.ax-sec:first-child { padding-top: 0; }
.ax-sec--full { display: block; }
.ax-aside { position: sticky; top: 96px; display: grid; gap: 12px; }

.ax-text h2 { font-size: clamp(24px, 2.2vw, 32px); font-weight: 600; letter-spacing: -0.045em; line-height: 1.1; color: #fff; }
.ax-text h3 { margin: 32px 0 12px; font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: #fff; }
.ax-text p { margin: 16px 0 0; font-size: 15px; line-height: 1.7; color: var(--txt); }
.ax-text h3 + p { margin-top: 0; }
.ax-sec--full .ax-text { max-width: 680px; }
.ax-text code, .ax-rules code, .ax-foot code, .ax-do code, .ax-table code { padding: 2px 6px; border-radius: 5px; background: #15161a; font-size: 0.86em; color: #e4e6ea; }

.ax-endpoint { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px !important; padding: 7px 12px; border-radius: 8px; background: var(--surf); }
.ax-endpoint code { padding: 0 !important; background: none !important; font-size: 13px !important; color: #fff !important; }
.ax-verb { flex: none; font: 600 11px var(--mono); letter-spacing: 0.02em; color: var(--accent-2); }

.ax-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ax-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 13px 16px; border-radius: 10px; background: var(--surf); }
.ax-list b { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; color: #fff; }
.ax-list span { font-size: 14px; line-height: 1.55; color: var(--txt); }

.ax-more { font-weight: 500; }

/* ---------- attributes ---------- */
.ax-attrs { display: grid; gap: 4px; margin-top: 4px; }
.ax-attr { padding: 14px 16px 15px; border-radius: 10px; background: var(--surf); }
.ax-attr-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.ax-attr-h code { padding: 0 !important; background: none !important; font-size: 13.5px !important; font-weight: 500; color: #fff !important; }
.ax-attr-h i { font: normal 400 12px var(--mono); color: var(--txt-2); }
.ax-attr-h em { font-size: 12px; font-style: normal; font-weight: 600; color: var(--accent-2); }
.ax-attr > p { margin: 6px 0 0 !important; font-size: 14px !important; line-height: 1.6 !important; }
.ax-child { display: grid; gap: 2px; margin-top: 14px; }
.ax-child .ax-attr { padding: 11px 14px 12px; border-radius: 8px; background: var(--surf-2); }
.ax-child .ax-attr-h code { font-size: 13px !important; }

/* ---------- tables ---------- */
.ax-table { width: 100%; margin-top: 18px; border-collapse: separate; border-spacing: 0 4px; font-size: 14px; }
.ax-table th { padding: 0 14px 4px; font-size: 12.5px; font-weight: 500; text-align: left; color: var(--txt-2); }
.ax-table td { padding: 12px 14px; background: var(--surf); line-height: 1.55; color: var(--txt); vertical-align: top; }
.ax-table td:first-child { border-radius: 10px 0 0 10px; color: #fff; font-weight: 500; white-space: nowrap; }
.ax-table td:last-child { border-radius: 0 10px 10px 0; }

/* labels and rules */
.ax-rules { display: grid; gap: 4px; margin-top: 28px; }
.ax-rule { display: grid; grid-template-columns: 170px 128px minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; padding: 16px 20px; border-radius: 10px; background: var(--surf); font-size: 14px; line-height: 1.55; color: var(--txt); }
.ax-rule--head { padding-top: 0; padding-bottom: 6px; background: none; font-size: 12.5px; font-weight: 500; color: var(--txt-2); }
.ax-rule--none { background: var(--surf-2); }
.ax-rule em { display: block; margin-top: 6px; font-style: normal; color: var(--txt-2); }
.ax-rule > span:last-child { color: #d5d8de; }
.ax-plain { font-size: 13.5px; font-weight: 600; letter-spacing: -0.015em; color: #fff; }
.ax-none { font-size: 13.5px; font-weight: 600; color: var(--txt-2); }
.ax-rule .pf-badge { vertical-align: middle; }
.ax-foot { margin: 16px 0 0; max-width: 760px; font-size: 13.5px; line-height: 1.6; color: var(--txt-2); }

/* ---------- code ---------- */
.ax-code { border-radius: 12px; background: var(--surf); overflow: hidden; }
.ax-bar { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px 6px 18px; background: #121316; }
.ax-bar-t { font-size: 12.5px; font-weight: 500; color: var(--txt); }
.ax-tabs { display: flex; gap: 2px; margin-left: -10px; }
.ax-tabs button, .ax-copy { height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--txt-2); font: 500 12.5px var(--sans, inherit); cursor: pointer; transition: color 0.2s, background 0.2s; }
.ax-tabs button:hover, .ax-copy:hover { color: #e4e6ea; }
.ax-tabs button[aria-selected="true"] { background: #1c1e23; color: #fff; }
.ax-copy { margin-left: auto; }
.ax-copy.done { color: var(--accent-2); }
.ax-status { margin-left: auto; margin-right: 8px; padding: 3px 8px; border-radius: 6px; background: #1c1e23; font: 500 12px var(--mono); color: #e4e6ea; }
.ax-status--err { background: rgba(255, 77, 94, 0.1); color: #ff7d8a; }
.ax-code pre { margin: 0; padding: 18px 20px; white-space: pre-wrap; overflow-wrap: anywhere; font: 400 12.5px/1.75 var(--mono); color: #c9ccd3; -webkit-user-select: text; user-select: text; }
.ax-code pre[hidden] { display: none; }
.ax-code .c { color: #5d626b; }
.ax-code .k { color: #9fb6ff; }
.ax-code .s { color: #e4e6ea; }
.ax-code .n { color: #f2c66d; }
.ax-code-note { margin: 0; padding: 0 20px 16px; font-size: 12px; line-height: 1.5; color: #5d626b; }
.ax-code-note code { font-size: 0.95em; color: #8b9099; }

/* ---------- small stacks beside the prose ---------- */
.ax-steps, .ax-sched { display: grid; gap: 4px; }
.ax-steps div, .ax-sched div, .ax-split div, .ax-do li { padding: 16px 18px; border-radius: 10px; background: var(--surf); }
.ax-steps b, .ax-sched b, .ax-split b, .ax-do b { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: -0.02em; color: #fff; }
.ax-steps span, .ax-sched span, .ax-split span, .ax-do span { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.55; color: var(--txt-2); }
.ax-steps { counter-reset: step; }
.ax-steps div { position: relative; padding-left: 52px; }
.ax-steps div::before { counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 16px; font: 500 13px var(--mono); color: var(--accent-2); }
.ax-split { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ax-split code { display: block; margin: 10px 0 2px; font-size: 17px; font-weight: 500; color: #fff; }
.ax-do { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; counter-reset: rule; }
.ax-do li { position: relative; padding-left: 52px; }
.ax-do li::before { counter-increment: rule; content: counter(rule); position: absolute; left: 18px; top: 16px; font: 500 13px var(--mono); color: var(--accent-2); }

.ax-cta { margin-top: clamp(96px, 13vh, 132px); }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .ax-layout { grid-template-columns: minmax(0, 1fr); }
  .ax .ax-side { display: none; }
}
@media (max-width: 900px) {
  .ax-sec { grid-template-columns: minmax(0, 1fr); }
  .ax-call-grid, .ax-qs > li { grid-template-columns: minmax(0, 1fr); }
  .ax-call-res pre { min-height: 0; }
  .ax-call-pick button { min-width: 0; flex: 1 1 40%; }
  .ax-aside { position: static; }
  .ax-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ax-rule { grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; }
  .ax-rule > span:nth-child(3), .ax-rule > span:nth-child(4) { grid-column: 1 / -1; }
  .ax-rule--head { display: none; }
  .ax-rule--none > span:first-child:empty { display: none; }
}
@media (max-width: 520px) {
  .ax-list li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ax-split { grid-template-columns: minmax(0, 1fr); }
  .ax-table td:first-child { white-space: normal; }
}
