/* ==========================================================================
   Nexra Destroyer API — design tokens
   Base palette: black / white / gray. Buttons, active states, badges and
   data-viz get one vivid accent (violet) so CTAs and "live" elements pop.
   Type: Space Grotesk (display) + Inter (body) + JetBrains Mono (code/paths)
   ========================================================================== */

:root {
  --black: #0a0a0b;
  --bg: #0a0a0b;
  --bg-raised: #131314;
  --surface: #1a1a1c;
  --surface-hover: #212123;
  --border: #2a2a2d;
  --border-strong: #3a3a3e;

  --white: #f4f4f2;
  --text: #f4f4f2;
  --text-dim: #a3a3a6;
  --text-faint: #67676b;

  /* neutral "accent" kept for things that should stay monochrome */
  --mono-accent: #ffffff;
  --mono-accent-text: #0a0a0b;

  /* vivid accent — buttons, execute/test actions, live badges, charts */
  --accent: #7c5cff;
  --accent-hover: #8f72ff;
  --accent-text: #ffffff;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --accent-soft-strong: rgba(124, 92, 255, 0.32);

  --ok: #3ecf6d;
  --err: #f0556b;
  --warn: #e8b339;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --sidebar-w: 248px;
  --topbar-h: 56px;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

/* ---------- light theme ---------- */
:root[data-theme="light"] {
  --bg: #f6f6f5;
  --bg-raised: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f0f0ef;
  --border: #e4e4e2;
  --border-strong: #d2d2cf;

  --white: #f4f4f2;
  --text: #121214;
  --text-dim: #55555a;
  --text-faint: #8a8a8e;

  --mono-accent: #121214;
  --mono-accent-text: #ffffff;

  /* a slightly different, deeper accent in light mode for contrast on white */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-text: #ffffff;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --accent-soft-strong: rgba(79, 70, 229, 0.22);
}
:root[data-theme="light"] body { background: var(--bg); }
:root[data-theme="light"] .card,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .metric,
:root[data-theme="light"] .recent-item,
:root[data-theme="light"] .feature,
:root[data-theme="light"] .category,
:root[data-theme="light"] .endpoint,
:root[data-theme="light"] .result-box,
:root[data-theme="light"] .field input,
:root[data-theme="light"] .field textarea {
  box-shadow: 0 1px 2px rgba(20,20,20,0.04);
}
:root[data-theme="light"] .hero {
  background:
    radial-gradient(600px 220px at 15% -10%, rgba(79,70,229,0.07), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #f6f6f5 100%);
}
:root[data-theme="light"] .hero::before { opacity: 0.5; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

code, .mono { font-family: var(--font-mono); }

::selection { background: var(--mono-accent); color: var(--mono-accent-text); }

/* ---------- layout shell ---------- */
.shell {
  display: flex;
  min-height: 100vh;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 96px;
  max-width: 980px;
}

@media (max-width: 900px) {
  .content { padding: 24px 20px 80px; }
}

/* ---------- sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px 20px 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .brand-id { display: flex; align-items: center; gap: 10px; min-width: 0; }

.sidebar-brand .mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--mono-accent);
  color: var(--mono-accent-text);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}

.sidebar-brand .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}
.sidebar-brand .name small {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11px;
  color: var(--text-faint);
}

.nav-section { margin-bottom: 18px; }

.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
}

.nav-link:hover { background: var(--surface); color: var(--text); }

.nav-link.active {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-link.active svg { color: var(--accent); opacity: 1; }

.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.9; }

/* close button (X), lives inside the sidebar header, mobile only */
.sidebar-close {
  display: none;
  width: 32px; height: 32px;
  flex-shrink: 0;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}
.sidebar-close:active { transform: scale(0.94); }
.sidebar-close svg { width: 16px; height: 16px; }

/* dim overlay shown behind the sidebar on mobile */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6, 6, 7, 0.6);
  backdrop-filter: blur(1px);
  z-index: 38;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

/* ---------- page header ---------- */
.page-eyebrow {
  color: var(--text-faint);
  font-size: 12.5px;
  margin-bottom: 4px;
}
.page-title { font-size: 28px; margin-bottom: 8px; }
.page-sub { color: var(--text-dim); font-size: 14.5px; max-width: 62ch; margin-bottom: 28px; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 10px 24px rgba(0,0,0,0.18);
}

/* masked API key field with a show/hide toggle */
.key-reveal { position: relative; }
.key-reveal input { padding-right: 42px; }
.key-reveal .eye-btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--text-faint);
  cursor: pointer; border-radius: var(--radius-sm);
}
.key-reveal .eye-btn:hover { color: var(--text); background: var(--surface-hover); }
.key-reveal .eye-btn svg { width: 17px; height: 17px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: border-color 0.15s ease;
}
.stat-card:hover { border-color: var(--border-strong); }
.stat-card .label { font-size: 11.5px; color: var(--text-faint); letter-spacing: 0.05em; margin-bottom: 8px; }
.stat-card .value { font-family: var(--font-display); font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.dot.pulse { box-shadow: 0 0 0 0 rgba(62,207,109,0.5); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(62,207,109,0.45); }
  70% { box-shadow: 0 0 0 8px rgba(62,207,109,0); }
  100% { box-shadow: 0 0 0 0 rgba(62,207,109,0); }
}

/* ---------- buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.field { margin-bottom: 12px; }
.field label {
  display: block; font-size: 12px; color: var(--text-dim);
  margin-bottom: 6px; font-weight: 500;
}
.field input, .field textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 70px; }

/* ---------- endpoint / category accordion ---------- */
.category {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--bg-raised);
  transition: border-color 0.15s ease;
}
.category.open { border-color: var(--border-strong); }
.category-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.category-head:hover { background: var(--surface); }
.category-head .left { display: flex; align-items: center; gap: 12px; }
.category-head .icon-badge {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.category-head .icon-badge svg { width: 18px; height: 18px; }
.category-head h3 { font-size: 15px; margin: 0; }
.category-head .count { font-size: 12px; color: var(--text-faint); }
.chevron { transition: transform 0.18s ease; color: var(--text-faint); }
.category.open .chevron { transform: rotate(180deg); }

.category-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  border-top: 1px solid transparent;
}
.category.open .category-body {
  border-top-color: var(--border);
}

.endpoint {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.endpoint:last-child { border-bottom: none; }

.endpoint-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.method-badge {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(244,244,242,0.1);
  color: var(--white);
  letter-spacing: 0.04em;
}
.endpoint-path { font-family: var(--font-mono); font-size: 13.5px; color: var(--text); }
.endpoint-desc { color: var(--text-dim); font-size: 13.5px; margin-bottom: 14px; }

.try-panel { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .try-panel { grid-template-columns: 1fr; } }
.try-panel .field.full { grid-column: 1 / -1; }

.result-box {
  margin-top: 12px;
  width: 100%;
  max-width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  display: none;
  position: relative;
  overflow: hidden;
}
.result-box.show { display: block; }

.result-scroll {
  max-height: 300px;
  overflow: auto;
  transition: max-height 0.2s ease;
}
.result-box.expanded .result-scroll { max-height: 560px; }
.result-scroll pre { margin: 0; padding: 14px; white-space: pre-wrap; word-break: break-word; }

.result-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34px;
  background: linear-gradient(to bottom, rgba(10,10,11,0), var(--bg));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.result-box.overflowing:not(.expanded) .result-fade { opacity: 1; }

.result-box .result-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
}
.result-bar .result-bar-right { display: flex; align-items: center; gap: 6px; }
.copy-result, .expand-result {
  background: transparent; border: none; color: var(--text-faint);
  cursor: pointer; padding: 4px; display: flex; align-items: center;
  border-radius: var(--radius-sm);
}
.copy-result:hover, .expand-result:hover { color: var(--text); background: var(--surface); }
.copy-result svg, .expand-result svg { width: 14px; height: 14px; transition: transform 0.18s ease; }
.result-box.expanded .expand-result svg { transform: rotate(180deg); }

.badge-status { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.badge-status.s200 { background: rgba(62,207,109,0.15); color: var(--ok); }
.badge-status.s4xx, .badge-status.s5xx { background: rgba(240,85,107,0.15); color: var(--err); }

/* minimal JSON "highlighting" — weight/opacity only, stays monochrome */
.jk { color: var(--white); font-weight: 600; }
.js { color: var(--text-dim); }
.jn { color: var(--white); }
.jb { color: var(--text); font-style: italic; }
.jz { color: var(--text-faint); font-style: italic; }

/* ---------- toast / popup ---------- */
.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  transform: translateY(12px); opacity: 0;
  transition: all 0.2s ease;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ---------- misc pages ---------- */
.legal p, .legal li { color: var(--text-dim); font-size: 14px; }
.legal h2 { font-size: 17px; margin-top: 26px; }

.feedback-form { max-width: 520px; }

.changelog-item {
  border-left: 2px solid var(--border-strong);
  padding: 0 0 24px 20px;
  position: relative;
}
.changelog-item::before {
  content: ''; position: absolute; left: -5px; top: 4px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--white);
}
.changelog-date { font-size: 12px; color: var(--text-faint); margin-bottom: 4px; }

.contact-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }


/* ==========================================================================
   Hero, feature grid, code blocks
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 36px 40px;
  margin-bottom: 24px;
  background:
    radial-gradient(600px 220px at 15% -10%, rgba(255,255,255,0.09), transparent 70%),
    linear-gradient(180deg, var(--surface) 0%, var(--bg-raised) 100%);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse at 30% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}
.hero > * { position: relative; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  font-size: 12px; font-weight: 500; color: var(--text-dim);
  margin-bottom: 18px;
}
.pill svg { width: 14px; height: 14px; flex-shrink: 0; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.12; letter-spacing: -0.025em; margin-bottom: 14px; max-width: 18ch; }
.hero p { color: var(--text-dim); font-size: 15.5px; max-width: 56ch; margin: 0 0 24px; }
.hero .contact-row { margin-top: 0; }
.btn-lg { padding: 12px 20px; font-size: 14px; border-radius: 8px; }

.section-title { font-size: 18px; margin: 34px 0 6px; }
.section-sub { color: var(--text-dim); font-size: 14px; margin: 0 0 18px; max-width: 64ch; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.feature:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.feature .f-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.feature .f-icon svg { width: 18px; height: 18px; }
.feature h3 { font-size: 14.5px; margin-bottom: 4px; }
.feature p { color: var(--text-dim); font-size: 13px; margin: 0; }

.code-block {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 8px 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-faint);
}
.code-block pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: var(--text);
}
.btn-sm { padding: 5px 10px; font-size: 12px; }

.steps { counter-reset: step; display: grid; gap: 12px; }
.step {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 18px;
}
.step::before {
  counter-increment: step; content: counter(step);
  flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.step h3 { font-size: 14.5px; margin-bottom: 2px; }
.step p { margin: 0; color: var(--text-dim); font-size: 13.5px; }

.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  cursor: pointer; list-style: none;
  padding: 15px 18px; font-weight: 500; font-size: 14.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; width: 8px; height: 8px; flex-shrink: 0;
  border-right: 1.8px solid var(--text-faint); border-bottom: 1.8px solid var(--text-faint);
  transform: rotate(45deg); transition: transform 0.18s ease; margin-top: -3px;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq details p { margin: 0; padding: 14px 18px 16px; color: var(--text-dim); font-size: 13.5px; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .about-grid { grid-template-columns: 1fr; } .hero { padding: 32px 22px 28px; } }
.profile {
  display: flex; gap: 16px; align-items: center;
}
.profile .avatar {
  width: 58px; height: 58px; border-radius: 16px; flex-shrink: 0;
  background: var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 26px;
}
.profile h3 { margin: 0; font-size: 17px; }
.profile span { color: var(--text-faint); font-size: 13px; }
.prose p { color: var(--text-dim); font-size: 14.5px; }
.prose strong { color: var(--text); font-weight: 600; }

/* ==========================================================================
   Site footer
   ========================================================================== */
.site-footer {
  margin-top: 64px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    radial-gradient(500px 160px at 0% 0%, rgba(255,255,255,0.05), transparent 70%),
    linear-gradient(180deg, var(--bg-raised), var(--bg));
  overflow: hidden;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1.2fr;
  gap: 32px;
  padding: 34px 32px 28px;
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; padding: 28px 22px 22px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand-row .mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--mono-accent); color: var(--mono-accent-text);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
.footer-brand-row .name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.footer-brand-row .name small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 11.5px; color: var(--text-faint); }
.footer-brand p { color: var(--text-dim); font-size: 13px; max-width: 38ch; margin: 0 0 16px; }

.footer-socials { display: flex; gap: 8px; }
.footer-socials a {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.footer-socials a:hover { color: var(--white); border-color: var(--white); transform: translateY(-2px); }
.footer-socials svg { width: 17px; height: 17px; }

.footer-col-title {
  font-size: 11px; letter-spacing: 0.08em; font-weight: 600;
  color: var(--text-faint); margin-bottom: 12px; text-transform: uppercase;
}
.footer-col a {
  display: block; color: var(--text-dim); font-size: 13.5px; padding: 4px 0;
  transition: color 0.15s ease, transform 0.15s ease;
}
.footer-col a:hover { color: var(--white); transform: translateX(2px); }
.footer-muted { color: var(--text-faint); font-size: 13px; display: block; padding: 4px 0; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 16px 32px;
  border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 12.5px;
}
.footer-bottom .footer-muted { display: inline-flex; align-items: center; gap: 8px; padding: 0; font-size: 12.5px; }
@media (max-width: 860px) { .footer-bottom { padding: 16px 22px; } }

/* ==========================================================================
   About blocks (dashboard section + About page)
   ========================================================================== */
.about-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 40px 0 18px;
  color: var(--text-faint); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}
.about-divider::before, .about-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.about-card h2 { font-size: 18px; margin-bottom: 10px; }
.about-card p { color: var(--text-dim); font-size: 14px; }
.about-card p strong { color: var(--text); font-weight: 600; }
.about-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.about-icon svg { width: 21px; height: 21px; }
.about-points { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.about-points li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-dim); font-size: 13.5px; }
.about-points li svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; color: var(--white); }

/* ==========================================================================
   Preloader
   ========================================================================== */
body.loading { overflow: hidden; }
#preloader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
#preloader.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-mark {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  animation: pl-pulse 1.1s ease-in-out infinite;
}
@keyframes pl-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.88); opacity: 0.75; }
}
.preloader-bar { width: 120px; height: 3px; border-radius: 2px; background: var(--border-strong); overflow: hidden; }
.preloader-bar::after {
  content: ''; display: block; width: 40%; height: 100%; background: var(--accent);
  animation: pl-slide 1s ease-in-out infinite;
}
@keyframes pl-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(350%); }
}

/* ==========================================================================
   Mobile top bar (replaces the old floating hamburger)
   ========================================================================== */
.mobile-topbar {
  display: none;
  position: sticky; top: 0; z-index: 37;
  align-items: center; gap: 12px;
  height: var(--topbar-h);
  padding: 0 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.mobile-topbar .mt-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
}
.mobile-topbar .mt-brand .mark {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--mono-accent); color: var(--mono-accent-text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}

.nav-toggle {
  width: 34px; height: 34px; flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.nav-toggle:active { transform: scale(0.94); }
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 900px) {
  .mobile-topbar { display: flex; }
  .sidebar-close { display: flex; }
  .sidebar-backdrop { display: block; }

  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 39;
    height: 100vh; height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 20px 0 40px rgba(0,0,0,0.45);
  }
  .sidebar.open { transform: translateX(0); }

  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  body.sidebar-open { overflow: hidden; }
}

/* ==========================================================================
   Banner (silent looping video at the top of the dashboard)
   ========================================================================== */
.banner-video {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--bg-raised);
  aspect-ratio: 5 / 1.5;
}
.banner-video video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 700px) { .banner-video { aspect-ratio: 16 / 11; } }

/* ==========================================================================
   Dashboard: System Statistics / Recently Added / Traffic panels
   ========================================================================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.panel-head h3 {
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim); margin: 0;
}
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-strong);
  border-radius: 20px;
  padding: 3px 9px 3px 7px;
}
.live-badge .dot { background: var(--accent); }
.new-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--ok);
  background: rgba(62,207,109,0.14);
  border: 1px solid rgba(62,207,109,0.3);
  border-radius: 20px;
  padding: 3px 9px;
}

.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.metric-row + .metric-row { margin-top: 14px; }
.metric {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  padding: 14px 16px;
}
.metric .m-label { font-size: 11.5px; color: var(--text-faint); margin-bottom: 8px; }
.metric .m-value { font-family: var(--font-display); font-size: 24px; font-weight: 600; display: flex; align-items: center; gap: 8px; }

.recent-list { display: grid; gap: 10px; }
.recent-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  padding: 12px 14px;
}
.recent-item .ri-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.recent-item .method-badge { flex-shrink: 0; }
.recent-item .ri-path { font-family: var(--font-mono); font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .ri-date { font-size: 11.5px; color: var(--text-faint); flex-shrink: 0; }

.traffic-chart-wrap { position: relative; }
.traffic-chart-wrap svg { width: 100%; height: 140px; display: block; }
.traffic-chart-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 12.5px;
}

/* ==========================================================================
   Code example widget — macOS-style terminal window (cURL / Node.js / Python)
   ========================================================================== */
.code-card {
  padding: 0; overflow: hidden;
  background: #0d0d10;
  border-color: #27272b;
}
.code-card-inputs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
@media (max-width: 560px) { .code-card-inputs { grid-template-columns: 1fr; } }
.code-card-inputs .field { margin-bottom: 0; }
.code-card-inputs .req { color: var(--err); font-weight: 600; margin-left: 3px; }

.mac-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 11px 14px;
  background: #151518;
  border-bottom: 1px solid #27272b;
}
.mac-dots { display: flex; gap: 6px; }
.mac-dots span { width: 10px; height: 10px; border-radius: 50%; background: #35353a; }

.tabs { justify-self: center; display: flex; gap: 20px; }
.tab-btn {
  border: none; background: transparent; color: #5b5b62;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  padding: 2px 0; cursor: pointer;
}
.tab-btn.active { color: #f4f4f2; font-weight: 600; }

.mac-copy {
  justify-self: end;
  border: 1px solid #2c2c31; background: #1b1b1f; color: #c8c8cb;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 500;
  padding: 6px 14px; border-radius: 7px; cursor: pointer;
}
.mac-copy:hover { background: #222226; }

.code-card pre {
  margin: 0; padding: 20px 18px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75;
  color: #6ee7b7;
  background: #0d0d10;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* ==========================================================================
   Theme toggle
   ========================================================================== */
body, .sidebar, .mobile-topbar, .card, .panel, .feature, .metric, .stat-card,
.category, .endpoint, .field input, .field textarea, .recent-item {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.theme-toggle {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); background: var(--surface-hover); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
