:root {
  --void: #07110A;
  --ink: #0C1A12;
  --panel: #0B1711;
  --fog: #E8F0EA;
  --mist: #B7C8BC;
  --muted: #6B7F72;
  --green: #2DFF7A;
  --green-deep: #12A84A;
  --line: rgba(232, 240, 234, 0.1);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar: 15.5rem;
  --top: 3.75rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--void);
  color: var(--fog);
  font-family: 'Sora', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; }
code, .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 3vw, 1.75rem);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 10, 0.92);
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}
.brand img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  object-fit: contain;
}
.brand span { color: var(--mist); font-weight: 500; font-size: 0.85rem; margin-left: 0.15rem; }
.top-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--mist);
}
.top-links a:hover { color: var(--fog); }
.top-links .cta {
  color: var(--void);
  background: var(--green);
  padding: 0.45rem 0.9rem;
  font-weight: 600;
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}
.menu-btn {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--mist);
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: calc(100svh - var(--top));
}

.sidebar {
  position: sticky;
  top: var(--top);
  height: calc(100svh - var(--top));
  overflow: auto;
  padding: 1.35rem 0.85rem 2rem;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
.nav-group { margin-bottom: 1.35rem; }
.nav-label {
  margin: 0 0.65rem 0.45rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-link {
  display: block;
  padding: 0.48rem 0.65rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--mist);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-link:hover { color: var(--fog); background: rgba(232, 240, 234, 0.04); }
.nav-link.active {
  color: var(--void);
  background: var(--green);
  font-weight: 600;
}

.main {
  min-width: 0;
  padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1.25rem, 5vw, 3.5rem) 4rem;
}
.main-inner { max-width: 48rem; }

.eyebrow {
  margin: 0 0 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}
h1 {
  margin: 0;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}
.lede {
  margin: 0.9rem 0 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--mist);
  max-width: 38rem;
}

h2 {
  margin: 2.4rem 0 0;
  padding-top: 0.35rem;
  font-family: 'Syne', sans-serif;
  font-weight: 750;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}
h3 {
  margin: 1.6rem 0 0;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}
p { margin: 0.7rem 0 0; line-height: 1.65; color: var(--mist); font-size: 0.95rem; }
ul, ol {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  color: var(--mist);
  font-size: 0.95rem;
  line-height: 1.65;
}
li + li { margin-top: 0.35rem; }
strong { color: var(--fog); font-weight: 600; }
a.inline {
  color: var(--green);
  border-bottom: 1px solid rgba(45, 255, 122, 0.35);
}
a.inline:hover { border-bottom-color: var(--green); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem;
  margin-top: 1.75rem;
}
.card {
  display: block;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 23, 17, 0.65);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.card:hover {
  border-color: rgba(45, 255, 122, 0.35);
  transform: translateY(-2px);
}
.card h3 { margin: 0; font-size: 1rem; color: var(--fog); }
.card p { margin: 0.4rem 0 0; font-size: 0.88rem; }

.table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
th, td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(11, 23, 17, 0.8);
}
td { color: var(--mist); }
tr:last-child td { border-bottom: 0; }
td code {
  font-size: 0.8rem;
  color: var(--green);
}

.endpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}
.method {
  display: inline-flex;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.method.get { background: rgba(45, 255, 122, 0.15); color: var(--green); }
.method.post { background: rgba(90, 160, 255, 0.18); color: #8ec5ff; }
.method.put { background: rgba(255, 190, 80, 0.16); color: #ffc96a; }

.code {
  position: relative;
  margin-top: 0.9rem;
}
.code pre {
  margin: 0;
  overflow-x: auto;
  padding: 1rem 1.1rem;
  padding-right: 5.5rem;
  border-radius: 8px;
  background: #050d08;
  border: 1px solid var(--line);
  color: #d7ebe0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.55;
}
.copy {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fog);
  font-size: 0.72rem;
  font-weight: 600;
}
.copy:hover { background: rgba(255, 255, 255, 0.14); }

.callout {
  margin-top: 1.1rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--green);
  background: rgba(45, 255, 122, 0.06);
  border-radius: 0 8px 8px 0;
  color: var(--mist);
  font-size: 0.92rem;
  line-height: 1.55;
}
.callout.warn {
  border-left-color: #ffc96a;
  background: rgba(255, 201, 106, 0.07);
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: min(100%, 12rem);
  transition: border-color 0.2s var(--ease);
}
.pager a:hover { border-color: rgba(45, 255, 122, 0.4); }
.pager a.next { margin-left: auto; text-align: right; }
.pager .dir {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.pager .title { font-weight: 600; color: var(--fog); font-size: 0.92rem; }

.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.5);
}

@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .top-links a:not(.cta) { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--top);
    z-index: 35;
    width: min(18rem, 86vw);
    transform: translateX(-105%);
    transition: transform 0.28s var(--ease);
  }
  .sidebar.open { transform: translateX(0); }
  .backdrop.open { display: block; }
}
