:root {
  --ink: #1b1a16;
  --ink-soft: #3a3329;
  --paper: #f7f1e8;
  --sand: #efe2cf;
  --sun: #f0a74b;
  --sea: #2a6b5f;
  --copper: #b8683d;
  --slate: #2f3a42;
  --line: rgba(27, 26, 22, 0.12);
  --shadow: rgba(27, 26, 22, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Candara", "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px circle at 12% 10%, rgba(240, 167, 75, 0.2), transparent 55%),
    radial-gradient(900px circle at 88% 0%, rgba(42, 107, 95, 0.18), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--sand) 100%);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(120deg, rgba(27, 26, 22, 0.05) 1px, transparent 1px),
    linear-gradient(30deg, rgba(27, 26, 22, 0.04) 1px, transparent 1px);
  background-size: 140px 140px, 220px 220px;
  opacity: 0.22;
  pointer-events: none;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  margin: 0 0 12px;
  letter-spacing: 0.2px;
}

h1 {
  font-size: clamp(32px, 4vw, 52px);
}

h2 {
  font-size: clamp(22px, 3vw, 32px);
}

h3 {
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h4 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

p {
  margin: 0 0 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}

code {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  background: rgba(27, 26, 22, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

pre {
  position: relative;
  margin: 12px 0 0;
  padding: 14px 16px;
  background: rgba(27, 26, 22, 0.08);
  border-radius: 12px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 24px 20px;
  background: rgba(255, 255, 255, 0.8);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.brand {
  display: grid;
  gap: 6px;
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--copper);
}

.brand-subtitle {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.nav {
  margin-top: 18px;
  display: grid;
  gap: 6px;
}

.nav-section {
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 11px;
  color: var(--ink-soft);
}

.nav-link {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  display: block;
}

.nav-link:hover {
  background: rgba(27, 26, 22, 0.06);
  text-decoration: none;
}

.nav-link.active {
  background: var(--ink);
  color: var(--paper);
}

.sidebar-footer {
  margin-top: 20px;
  font-size: 12px;
  color: var(--ink-soft);
  display: grid;
  gap: 8px;
}

.content {
  padding: 36px 48px 90px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 12px;
  font-weight: 700;
  color: var(--copper);
  margin-bottom: 8px;
}

.lead {
  font-size: 16px;
}

.section {
  margin: 32px 0;
}

.card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 12px 26px var(--shadow);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.7);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

.table th {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  color: var(--ink-soft);
}

.endpoint {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  padding: 18px;
  box-shadow: 0 10px 22px rgba(27, 26, 22, 0.08);
}

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

.endpoint-path {
  font-weight: 600;
  font-size: 15px;
}

.method {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}

.method.post {
  background: var(--sun);
  color: #3a2a0c;
}

.method.get {
  background: var(--sea);
}

.method.put {
  background: var(--copper);
}

.method.ws {
  background: var(--slate);
}

.method.hook {
  background: #7a4b2f;
}

.tag {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  background: rgba(27, 26, 22, 0.08);
}

.note {
  border-left: 3px solid var(--copper);
  padding-left: 12px;
  margin: 12px 0;
  color: var(--ink-soft);
}

.muted {
  color: var(--ink-soft);
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: rgba(27, 26, 22, 0.12);
  color: var(--ink);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.copy-btn:hover {
  background: rgba(27, 26, 22, 0.2);
}

.filter-input {
  width: min(420px, 100%);
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 6px;
}

.label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.input,
.textarea,
.select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  color: var(--ink);
}

.textarea {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.5;
  min-height: 130px;
  resize: vertical;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.7);
}

.status-pill.ok {
  color: var(--sea);
}

.status-pill.err {
  color: var(--copper);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: rgba(27, 26, 22, 0.04);
}

.fade-in {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

body.loaded .fade-in {
  opacity: 1;
  transform: translateY(0);
}

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

  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .content {
    padding: 24px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}