/* WispInbox API docs — Bump/Stripe-inspired layout */

:root {
  --paper: #f4f7fb;
  --surface: #ffffff;
  --ink: #0f1c2e;
  --ink-soft: #53657c;
  --rule: #d5e0ec;
  --rule-soft: #e8eef5;
  --blue: #154892;
  --blue-soft: #eaf1fb;
  --blue-mid: #2a63b8;
  --live: #17824f;
  --live-soft: #e6f6ee;
  --warn: #9a6700;
  --warn-soft: #fff7e6;
  --code-bg: #122033;
  --code-fg: #e8eef8;
  --font: "Sora", "Segoe UI", sans-serif;
  --shadow: 0 10px 30px rgba(15, 28, 46, 0.08);
  --radius: 14px;
  --sidebar-w: 250px;
  --rail-w: 380px;
  --topbar-h: 58px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  background: var(--paper);
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
.mono {
  font-family: var(--font);
  font-size: 0.9em;
  font-weight: 500;
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}

.docs-brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.docs-brand img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.docs-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.docs-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.docs-search input:focus {
  outline: 2px solid color-mix(in srgb, var(--blue) 35%, transparent);
  border-color: var(--blue);
}

.docs-search::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  background:
    radial-gradient(circle at 40% 40%, transparent 45%, var(--ink-soft) 47% 68%, transparent 70%),
    linear-gradient(135deg, transparent 58%, var(--ink-soft) 59% 72%, transparent 73%);
  opacity: 0.7;
  pointer-events: none;
}

.docs-top-links {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  font-size: 0.9rem;
}

.docs-top-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
}

.docs-top-links a:hover {
  color: var(--blue);
}

.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w);
  min-height: calc(100vh - var(--topbar-h));
}

.docs-sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow: auto;
  padding: 20px 14px 32px;
  border-right: 1px solid var(--rule);
  background: var(--surface);
}

.docs-nav-label {
  margin: 18px 10px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.docs-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.docs-nav a:hover {
  background: var(--blue-soft);
  text-decoration: none;
}

.docs-nav a.is-active {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.method-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 2px 6px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.method-pill.get {
  background: #e7f3ff;
  color: #0b5cab;
}

.method-pill.post {
  background: var(--live-soft);
  color: var(--live);
}

.method-pill.delete {
  background: #fde8ea;
  color: #c41e2e;
}

.docs-main {
  padding: 28px 32px 64px;
  max-width: 820px;
}

.docs-hero h1 {
  margin: 0 0 10px;
  font-family: var(--font);
  font-size: clamp(1.8rem, 2.4vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.docs-hero p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  max-width: 54ch;
}

.docs-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.chip strong {
  color: var(--ink);
  font-weight: 600;
}

.promo-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 28px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff 0%, var(--blue-soft) 100%);
  box-shadow: var(--shadow);
}

.promo-card h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.promo-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1.5px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  font: 600 0.92rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  text-decoration: none;
  background: var(--hover, #f4f8fc);
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-mid);
  border-color: var(--blue-mid);
  color: #fff;
}

.docs-section {
  margin: 36px 0;
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}

.docs-section > h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.docs-section > p {
  margin: 0 0 14px;
  color: var(--ink-soft);
}

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

.endpoint-path {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--code-bg);
  color: #dce7f5;
  font-size: 0.75rem;
  font-weight: 600;
}

.auth-badge::before {
  content: "🔒";
  font-size: 0.7rem;
}

.param-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.param-row {
  padding: 14px 16px;
  border-top: 1px solid var(--rule-soft);
}

.param-row:first-child {
  border-top: 0;
}

.param-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.param-name code {
  font-weight: 700;
  color: var(--ink);
  background: transparent;
}

.param-type {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.tag-required {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #c41e2e;
  text-transform: uppercase;
}

.tag-optional {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.param-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.flow-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.flow-steps li {
  margin: 8px 0;
}

.docs-rail {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow: auto;
  padding: 20px 16px 40px;
  border-left: 1px solid var(--rule);
  background: #eef3f9;
}

.rail-card {
  margin-bottom: 14px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.rail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #0d1a2b;
  color: #9eb2c9;
  font-size: 0.78rem;
  font-weight: 600;
}

.rail-card.light .rail-card-head {
  background: #e2eaf3;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
}

.rail-card pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  background: var(--code-bg);
  color: var(--code-fg);
  font: 500 12.5px/1.55 var(--font);
}

.rail-card.light pre {
  background: #f8fbfe;
  color: var(--ink);
  border-top: 0;
}

.copy-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: 600 0.75rem/1 var(--font);
  cursor: pointer;
  opacity: 0.85;
}

.copy-btn:hover {
  opacity: 1;
}

.tok-key { color: #7eb6ff; }
.tok-str { color: #8fd6a8; }
.tok-num { color: #f0a37a; }
.tok-cmd { color: #9ed0ff; }
.tok-flag { color: #c7b5ff; }
.tok-comment { color: #7f93a8; }

.hidden-by-search {
  display: none !important;
}

@media (max-width: 1100px) {
  .docs-layout {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }

  .docs-rail {
    display: none;
  }

  .rail-mobile {
    display: block;
    margin-top: 24px;
  }
}

@media (min-width: 1101px) {
  .rail-mobile {
    display: none;
  }
}

@media (max-width: 800px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: relative;
    top: 0;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    max-height: 220px;
  }

  .docs-main {
    padding: 20px 16px 48px;
  }

  .docs-top-links .hide-sm {
    display: none;
  }

  .docs-search {
    max-width: none;
  }
}
