:root {
  color-scheme: dark;
  --ink: #07070d;
  --surface: #100e18;
  --surface-2: #17141f;
  --line: #262234;
  --text: #f1eefa;
  --text-2: #c9c3da;
  --muted: #9d97b0;
  --accent: #a78bfa;
  --accent-strong: #7c3aed;
  --ok: #5fd6a2;
  --code-bg: #0c0a13;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; scrollbar-color: #2b2540 var(--ink); }
body {
  margin: 0;
  background:
    radial-gradient(70% 50% at 85% -10%, rgba(124, 58, 237, .22), transparent 60%),
    var(--ink);
  color: var(--text-2);
  font: 16px/1.65 'Archivo', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(167, 139, 250, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: #c4b5fd; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(7, 7, 13, .78);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand img { display: block; height: 32px; width: auto; }
.top nav { display: flex; gap: 8px; align-items: center; }
.top nav a { color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 600; padding: 9px 14px; border-radius: 10px; }
.top nav a:hover { color: #fff; background: var(--surface-2); }
.top nav a.cta { background: var(--accent-strong); color: #fff; }
.top nav a.cta:hover { background: #6d28d9; }

.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.toc { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 72px); overflow: auto; padding: 36px 0 40px; display: grid; gap: 2px; }
.toc p { margin: 18px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.toc p:first-child { margin-top: 0; }
.toc a { color: var(--text-2); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.toc a:hover { background: var(--surface-2); color: #fff; }

.doc { min-width: 0; padding: 40px 0 96px; max-width: 76ch; }
.doc section { padding: 8px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.doc section:last-of-type { border-bottom: 0; }
h1, h2 { font-family: 'Archivo', sans-serif; font-weight: 800; font-variation-settings: 'wdth' 112; color: var(--text); letter-spacing: -.03em; text-wrap: balance; }
h1 { font-size: clamp(36px, 5vw, 52px); line-height: 1.05; margin: 0 0 16px; }
h2 { font-size: 26px; line-height: 1.2; margin: 24px 0 12px; }
.lead { font-size: 18px; color: var(--text-2); margin: 0 0 24px; }
p { margin: 0 0 14px; }
strong { color: var(--text); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0 0 20px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.facts div { background: var(--surface); padding: 14px 16px; }
.facts dt { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.facts dd { margin: 4px 0 0; color: var(--text); font-size: 14.5px; }

.note { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 15px; }

code { font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace; font-size: .88em; color: #e4dcff; background: rgba(167, 139, 250, .1); padding: .12em .38em; border-radius: 6px; }
pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow: auto; margin: 0 0 16px; box-shadow: 0 12px 30px -20px rgba(0, 0, 0, .8); }
pre code { background: none; padding: 0; color: #ddd6f3; font-size: 13.5px; line-height: 1.6; }

table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 0 18px; font-size: 14.5px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: block; overflow-x: auto; }
thead, tbody { display: table; width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 10px 14px; }
td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
td:first-child { white-space: nowrap; width: 1%; }

.endpoint { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 12px; }
.endpoint > code { background: none; padding: 0; font-size: 15px; color: var(--text); }
.verb { font: 700 11.5px/1 'Archivo', sans-serif; letter-spacing: .04em; padding: 6px 8px; border-radius: 6px; }
.verb.post { background: rgba(124, 58, 237, .22); color: #d6c8ff; }
.verb.get { background: rgba(55, 201, 139, .16); color: var(--ok); }
.scope { margin-left: auto; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; }
.doc-foot { color: var(--muted); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .doc { padding-top: 16px; }
}
@media (max-width: 540px) {
  .facts { grid-template-columns: 1fr; }
  .top nav a:not(.cta) { display: none; }
  .scope { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Nenhuma página arrasta para o lado no celular: o que passar da largura é cortado. */
html, body { overflow-x: clip; }
@supports not (overflow: clip) { html { overflow-x: hidden; } }
