:root {
  --bg-gradient: radial-gradient(circle at 50% -10%, #450a0a 0%, #170304 45%, #050102 100%);
  --surface: #0e0304;
  --surface-soft: #1c080b;
  --surface-card: rgba(22, 8, 11, 0.88);
  --accent: #dc2626;
  --accent-dark: #7f1d1d;
  --navy: #f8fafc;
  --navy-soft: #9ca3af;
  --border-red: rgba(239, 68, 68, 0.2);
}

* {
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  margin: 0;
}

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--navy);
  min-height: 100vh;
}

.blob {
  position: absolute;
  border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
  filter: blur(75px);
  opacity: .3;
  pointer-events: none;
  z-index: 0;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #050102;
}

::-webkit-scrollbar-thumb {
  background: var(--accent-dark);
  border-radius: 20px;
}

/* Cards & Claymorphism */
.clay-card {
  background: var(--surface-card);
  border: 1px solid var(--border-red);
  border-radius: 26px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 8px 0 0 #0b0203, 0 16px 30px rgba(0, 0, 0, .5);
}

.clay-btn {
  --c: var(--accent);
  --s: var(--accent-dark);
  position: relative;
  border: none;
  cursor: pointer;
  font-weight: 800;
  color: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, 0) 60%), var(--c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 5px 0 0 var(--s), 0 10px 18px rgba(0, 0, 0, .4);
  transition: transform .1s ease-out, box-shadow .1s ease-out;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.clay-btn:hover {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 3px 0 0 var(--s), 0 6px 12px rgba(0, 0, 0, .3);
}

.clay-btn:active {
  transform: translateY(5px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 0 var(--s), 0 3px 6px rgba(0, 0, 0, .2);
}

.clay-btn.purple {
  --c: var(--accent);
  --s: var(--accent-dark);
}

.clay-icon-btn {
  --c: var(--surface-soft);
  --s: #0b0203;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: var(--c);
  color: var(--navy);
  border: 1px solid var(--border-red);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 4px 0 0 var(--s), 0 8px 14px rgba(0, 0, 0, .4);
  transition: transform .1s ease-out, box-shadow .1s ease-out;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.clay-icon-btn:hover {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 2px 0 0 var(--s), 0 4px 8px rgba(0, 0, 0, .3);
}

.clay-icon-btn:active {
  transform: translateY(4px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 0 var(--s), 0 2px 4px rgba(0, 0, 0, .2);
}

.clay-input {
  width: 100%;
  border: 1px solid var(--border-red);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  background: var(--surface-soft);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5);
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.clay-input:focus {
  border-color: var(--accent);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5), 0 0 0 3px rgba(220, 38, 38, .25);
}

.ep-card {
  background: var(--surface-card);
  border: 1px solid var(--border-red);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 6px 0 0 #0b0203, 0 12px 22px rgba(0, 0, 0, .4);
}

.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
  box-shadow: 0 3px 0 0 var(--s);
  background: var(--c);
}

.method-badge.get { --c: #059669; --s: #064e3b; }
.method-badge.post { --c: #2563eb; --s: #1e3a8a; }
.method-badge.delete { --c: #dc2626; --s: #7f1d1d; }
.method-badge.other { --c: #d97706; --s: #78350f; }

.clay-console {
  background: var(--surface-soft);
  border: 1px solid var(--border-red);
  border-radius: 26px;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 8px 0 0 #0b0203, 0 16px 30px rgba(0, 0, 0, .5);
}

.clay-console-screen {
  background: #0b0203;
  border-radius: 18px;
  border: 1px solid var(--border-red);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.status-waiting { background: #f59e0b; animation: blink 1.4s infinite; }
.status-success { background: #10b981; }
.status-error { background: #ef4444; }

@keyframes blink { 50% { opacity: .3; } }

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .55s cubic-bezier(.34, 1.4, .64, 1), transform .55s cubic-bezier(.34, 1.4, .64, 1);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.rotate-180 { transform: rotate(180deg); }

/* Syntax Highlighting */
.json-key { color: #f87171; font-weight: 700; }
.json-string { color: #34d399; }
.json-number { color: #60a5fa; font-weight: 700; }
.json-boolean { color: var(--accent); font-weight: 700; }
.json-null { color: var(--navy-soft); font-style: italic; }
.blink-cursor { animation: blink 1s step-end infinite; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(5, 1, 2, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px dashed var(--border-red);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .34s cubic-bezier(.22, 1, .36, 1);
  z-index: 70;
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 86%;
  max-width: 360px;
  background: #120406;
  border-right: 1px solid var(--border-red);
  z-index: 80;
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  transform: translateX(-104%);
  transition: transform .38s cubic-bezier(.22, 1, .36, 1);
  box-shadow: 12px 0 40px rgba(0, 0, 0, .8);
}

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

.folder-btn {
  width: 100%;
  background: var(--surface-soft);
  border: 1px solid var(--border-red);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform .1s ease-out;
}

.folder-btn:active {
  transform: scale(.98);
}

.folder-btn.intro-nav-btn {
  margin-bottom: 2px;
}

.folder-btn.intro-nav-btn.active {
  background: var(--surface-card);
  border-color: var(--accent);
}

.folder-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  flex-shrink: 0;
}

.folder-title {
  flex: 1;
  text-align: left;
  font-weight: 800;
  font-size: 13px;
  color: var(--navy);
}

.folder-count {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
  background: #0b0203;
  color: var(--navy-soft);
  border: 1px solid var(--border-red);
}

.folder-arrow {
  font-size: 11px;
  color: var(--navy-soft);
  transition: transform .25s ease;
}

.folder-files {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0 4px 14px;
  border-left: 2px dashed var(--border-red);
  margin: 4px 0 2px 17px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.file-item:hover {
  background: var(--surface-soft);
  border-color: var(--border-red);
}

.file-item.active {
  background: var(--surface-soft);
  border-color: var(--accent);
}

.file-item .mini-badge {
  font-size: 8.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  color: #fff;
  flex-shrink: 0;
  min-width: 38px;
  text-align: center;
}

.file-item .mini-badge.get { background: #059669; }
.file-item .mini-badge.post { background: #2563eb; }
.file-item .mini-badge.delete { background: #dc2626; }
.file-item .mini-badge.other { background: #d97706; }

.file-item .file-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
  background: var(--surface-soft);
  border: 1px solid var(--border-red);
  padding: 9px 14px;
  border-radius: 12px;
  cursor: pointer;
}

.back-btn:active {
  transform: scale(.97);
}

.intro-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  box-shadow: 0 5px 0 0 #0b0203;
}

.intro-code, .resp-code {
  background: #0b0203;
  border: 1px solid var(--border-red);
  border-radius: 16px;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #f8fafc;
  overflow-x: auto;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  max-width: 100%;
}

.lang-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  margin-bottom: 10px;
  scrollbar-width: none;
}

.lang-tabs::-webkit-scrollbar {
  display: none;
}

.lang-tab {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-red);
  cursor: pointer;
  background: var(--surface-soft);
  color: var(--navy);
}

.lang-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border-color: transparent;
}

#intro-view, #endpoint-view {
  min-width: 0;
}

.resp-examples {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.resp-card {
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border-red);
}

.resp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.resp-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 8px;
  letter-spacing: .3px;
}

.resp-badge.ok { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.resp-badge.err { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.resp-badge.limit { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); }

.resp-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
}

.status-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 22px;
  font-family: 'JetBrains Mono', monospace;
}

.status-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  color: var(--navy-soft);
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border-red);
}

.status-table td {
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  border-bottom: 1px solid var(--border-red);
  vertical-align: top;
}

.status-code {
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px;
  display: inline-block;
}

.status-code.c2xx { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.status-code.c4xx { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.status-code.c429 { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); }
.status-code.c5xx { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }