/* Malum API Docs — dark, crisp, cyan-accented */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b0b0d;
  --bg-elev: #121216;
  --bg-elev-2: #17171c;
  --border: #23232a;
  --border-dim: #1a1a20;
  --text: #e7e7eb;
  --text-dim: #a1a1aa;
  --text-faint: #6b7280;
  --primary: #18c4da;
  --primary-dim: rgba(24, 196, 218, 0.12);
  --primary-border: rgba(24, 196, 218, 0.35);
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --code-bg: #0a0a0d;
  --method-get: #10b981;
  --method-post: #18c4da;
  --method-delete: #ef4444;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-sans: "Lexend", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated gradient glow in background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 10%, rgba(24, 196, 218, 0.08), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(24, 196, 218, 0.05), transparent 45%);
  z-index: -1;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.15s;
}

a:hover {
  opacity: 0.8;
}

code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--bg-elev);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-dim);
}

pre {
  margin: 0;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 13px;
  line-height: 1.65;
}

/* ───── TOP NAV ───── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 13, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-dim);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topnav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topnav .brand .logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

.topnav .brand b {
  font-weight: 700;
}

.topnav .brand .tag {
  margin-left: 6px;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  color: var(--primary);
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--primary-dim);
}

.topnav .actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topnav .actions a {
  color: var(--text-dim);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}

.topnav .actions a:hover {
  color: var(--text);
  background: var(--bg-elev);
}

.topnav .actions a.primary {
  background: var(--primary);
  color: #000;
  font-weight: 600;
}

.topnav .actions a.primary:hover {
  opacity: 0.9;
}

.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 11px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

/* ───── LAYOUT ───── */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
}

.sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 24px 16px 48px 24px;
  border-right: 1px solid var(--border-dim);
}

.sidebar-section {
  margin-bottom: 22px;
}

.sidebar-section h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 8px;
  padding: 0 8px;
  font-weight: 600;
}

.sidebar-section ul {
  list-style: none;
}

.sidebar-section a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 14px;
  border-left: 2px solid transparent;
}

.sidebar-section a:hover {
  color: var(--text);
  background: var(--bg-elev);
}

.sidebar-section a.active {
  color: var(--primary);
  background: var(--primary-dim);
  border-left-color: var(--primary);
}

/* ───── MAIN ───── */
.main {
  padding: 40px 48px 96px;
  max-width: 960px;
}

.hero {
  padding: 32px 0 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-dim);
}

.hero h1 {
  font-size: 42px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(120deg, #fff 30%, var(--primary) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 640px;
}

.hero .stats {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hero .stats .pill {
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.hero .stats .pill b {
  color: var(--text);
  font-weight: 600;
}

.hero .stats .pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.section {
  margin: 48px 0;
}

.section h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section h2 .em {
  color: var(--primary);
}

.section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 10px;
}

.section p {
  color: var(--text-dim);
  margin-bottom: 14px;
}

/* ───── ENDPOINT ───── */
.endpoint {
  background: linear-gradient(180deg, var(--bg-elev) 0%, var(--bg-elev-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.endpoint::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.35;
}

.endpoint-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.method {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 9px;
  border-radius: 5px;
  color: #000;
  text-transform: uppercase;
}

.method.get { background: var(--method-get); }
.method.post { background: var(--method-post); }
.method.delete { background: var(--method-delete); color: #fff; }
.method.put { background: var(--warn); }

.path {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}

.path .param {
  color: var(--primary);
}

.endpoint h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.endpoint-desc {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 18px;
}

.endpoint-auth {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-dim);
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  margin-left: auto;
}

.endpoint-auth.auth { color: var(--primary); border-color: var(--primary-border); }
.endpoint-auth.public { color: var(--success); border-color: rgba(16, 185, 129, 0.35); }

/* ───── PARAM TABLE ───── */
.params {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 18px;
  font-size: 13px;
}

.params th,
.params td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-dim);
  vertical-align: top;
}

.params th {
  font-weight: 500;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom-color: var(--border);
}

.params td:first-child {
  font-family: var(--font-mono);
  color: var(--primary);
  white-space: nowrap;
  font-weight: 500;
}

.params td:nth-child(2) {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.params td:nth-child(3) {
  color: var(--text-dim);
}

.params .required {
  color: var(--danger);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 6px;
  letter-spacing: 0.05em;
}

.params .optional {
  color: var(--text-faint);
  font-size: 10px;
  text-transform: uppercase;
  margin-left: 6px;
  letter-spacing: 0.05em;
}

/* ───── CODE BLOCKS ───── */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 10px 0 18px;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-dim);
  background: rgba(255, 255, 255, 0.015);
}

.code-tabs {
  display: flex;
  gap: 4px;
}

.code-tab {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--text-faint);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.code-tab:hover {
  color: var(--text-dim);
}

.code-tab.active {
  color: var(--primary);
  background: var(--primary-dim);
}

.copy-btn {
  font-size: 11px;
  color: var(--text-faint);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.15s;
}

.copy-btn:hover {
  color: var(--primary);
  border-color: var(--primary-border);
}

.copy-btn.copied {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.35);
}

.code-body {
  padding: 14px 16px;
  overflow-x: auto;
}

.code-body pre {
  white-space: pre;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #e4e4e7;
}

.code-pane { display: none; }
.code-pane.active { display: block; }

/* syntax highlighting (minimal, custom) */
.tok-keyword { color: #c084fc; }
.tok-string { color: #fca5a5; }
.tok-number { color: #fcd34d; }
.tok-key { color: #7dd3fc; }
.tok-comment { color: #525b6d; font-style: italic; }
.tok-fn { color: #86efac; }
.tok-punct { color: #8b8c92; }
.tok-url { color: #fbbf24; }

/* ───── CALLOUTS ───── */
.callout {
  padding: 12px 14px 12px 16px;
  border-left: 3px solid;
  border-radius: var(--radius-sm);
  margin: 14px 0;
  font-size: 14px;
  background: var(--bg-elev);
}

.callout.info { border-color: var(--primary); color: var(--text); }
.callout.warn { border-color: var(--warn); }
.callout.danger { border-color: var(--danger); }
.callout.success { border-color: var(--success); }

.callout strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--text);
}

.callout p, .callout {
  color: var(--text-dim);
}

/* ───── LISTS ───── */
.section ul.features,
.section ol.features {
  list-style: none;
  padding: 0;
  margin-bottom: 14px;
}

.section ul.features li,
.section ol.features li {
  color: var(--text-dim);
  padding: 6px 0 6px 22px;
  position: relative;
}

.section ul.features li::before {
  content: "→";
  position: absolute;
  left: 2px;
  color: var(--primary);
}

.section ol.features {
  counter-reset: step;
}

.section ol.features li {
  counter-increment: step;
}

.section ol.features li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-dim);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ───── RESPONSE SHAPE ───── */
.response-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 4px;
  margin-top: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
}

.response-label.ok {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.response-label.err {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

/* ───── ANCHOR ───── */
.anchor {
  display: inline-block;
  color: var(--text-faint);
  text-decoration: none;
  margin-left: 10px;
  opacity: 0;
  transition: opacity 0.15s;
  font-size: 16px;
}

h2:hover .anchor,
h3:hover .anchor {
  opacity: 1;
}

/* ───── FOOTER ───── */
.footer {
  border-top: 1px solid var(--border-dim);
  padding: 32px 0 12px;
  margin-top: 64px;
  color: var(--text-faint);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer a {
  color: var(--text-dim);
}

/* ───── MOBILE ───── */
@media (max-width: 900px) {
  .menu-btn { display: inline-block; }
  .topnav { padding: 12px 16px; }
  .topnav .actions a:not(.primary) { display: none; }

  .layout { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 80%;
    max-width: 280px;
    height: calc(100vh - 60px);
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s;
    padding: 18px 12px 48px 16px;
  }

  .sidebar.open { transform: translateX(0); }

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

  .sidebar-backdrop.show { display: block; }

  .main { padding: 24px 16px 80px; }

  .hero h1 { font-size: 32px; }
  .hero p { font-size: 15px; }

  .section h2 { font-size: 22px; }

  .endpoint { padding: 18px 16px 14px; }
  .endpoint-auth { margin-left: 0; }

  .params { font-size: 12px; }
  .params th, .params td { padding: 8px 6px; }

  .code-body { padding: 10px 12px; }
  .code-body pre { font-size: 12px; }

  .params td:nth-child(2) { white-space: normal; }
}

@media (max-width: 500px) {
  .hero h1 { font-size: 26px; }
  .path { font-size: 12px; }

  .params thead { display: none; }
  .params,
  .params tbody,
  .params tr,
  .params td {
    display: block;
    width: 100%;
  }
  .params tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-dim);
  }
  .params td {
    padding: 2px 0;
    border-bottom: none;
  }
  .params td:nth-child(2) { color: var(--text-faint); font-size: 11px; }
}

/* ───── ENDPOINT PATH ───── */
code.endpoint-path {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  word-break: break-all;
}

/* ───── REQUIRED / PILL-SM BADGES ───── */
.req {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--danger);
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.35);
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 4px;
  vertical-align: middle;
}

.pill-sm {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  margin-left: 6px;
  vertical-align: middle;
}
.pill-sm.ok {
  color: var(--success);
  border-color: rgba(70, 200, 120, 0.45);
  background: rgba(70, 200, 120, 0.08);
}

/* ───── DOCS FOOTER ───── */
.docs-footer {
  margin: 60px 0 40px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.docs-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
}
.docs-footer a {
  color: var(--primary);
  text-decoration: none;
}
.docs-footer a:hover {
  text-decoration: underline;
}
.docs-footer .muted {
  color: var(--text-faint);
}

/* ───── SCROLLBAR ───── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-border); }
