/* ===== Variables ===== */
:root {
  --bg: #0a0a0f;
  --bg-card: rgba(255,255,255,0.03);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-input: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.08);
  --border-focus: rgba(99,102,241,0.5);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --primary: #6366f1;
  --primary-glow: rgba(99,102,241,0.3);
  --green: #22c55e;
  --green-glow: rgba(34,197,94,0.3);
  --red: #ef4444;
  --yellow: #eab308;
  --orange: #f97316;
  --gradient-1: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --gradient-2: linear-gradient(135deg, #06b6d4, #3b82f6, #6366f1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: #818cf8; }
code { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.875em; }
::selection { background: var(--primary); color: white; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ===== Layout ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; }
.section-dark { background: rgba(255,255,255,0.01); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-header { text-align: center; margin-bottom: 64px; }
.section-tag {
  display: inline-block;
  padding: 6px 16px;
  background: var(--primary-glow);
  color: var(--primary);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 2.5rem; font-weight: 700; margin-bottom: 12px; }
.section-header p { color: var(--text-dim); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
  backdrop-filter: blur(20px);
  background: rgba(10,10,15,0.8);
  border-bottom: 1px solid transparent;
}
.navbar.scrolled { border-bottom-color: var(--border); padding: 12px 0; }
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; font-weight: 700; color: var(--text); }
.logo-icon { font-size: 1.4rem; }
.nav-links { display: flex; gap: 32px; }
.nav-links a { color: var(--text-dim); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  animation: pulse 2s infinite;
}
.status-dot.online { background: var(--green); }
.status-dot.offline { background: var(--red); animation: none; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-primary { background: var(--gradient-1); color: white; box-shadow: 0 4px 16px var(--primary-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--primary-glow); color: white; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg-card); border-color: var(--primary); color: var(--text); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 120px 24px 80px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
}
.orb-1 { width: 600px; height: 600px; background: #6366f1; top: -200px; right: -100px; animation: float 20s infinite; }
.orb-2 { width: 400px; height: 400px; background: #8b5cf6; bottom: -100px; left: -50px; animation: float 15s infinite reverse; }
.orb-3 { width: 300px; height: 300px; background: #06b6d4; top: 50%; left: 50%; animation: float 25s infinite; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}
.hero-content { position: relative; text-align: center; max-width: 800px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 32px;
  backdrop-filter: blur(10px);
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.hero-title { font-size: 4rem; font-weight: 800; line-height: 1.1; margin-bottom: 24px; letter-spacing: -1px; }
.gradient-text {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cursor {
  -webkit-text-fill-color: var(--primary);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-subtitle { font-size: 1.2rem; color: var(--text-dim); max-width: 600px; margin: 0 auto 40px; line-height: 1.7; }
.hero-actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 48px; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-divider { width: 1px; height: 32px; background: var(--border); }
.hero-url {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(10px);
}
.hero-url code { color: var(--text-dim); font-size: 0.9rem; }

/* ===== Buttons (shared) ===== */
.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
  display: inline-flex;
}
.copy-btn:hover { color: var(--text); background: var(--bg-card); }
.copy-btn.copied { color: var(--green); }

/* ===== Features ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.feature-card {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(20px);
}
.feature-card.visible { opacity: 1; transform: translateY(0); }
.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99,102,241,0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.feature-icon { font-size: 2rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.feature-card p { color: var(--text-dim); font-size: 0.9rem; line-height: 1.6; }

/* ===== Endpoints ===== */
.endpoint-group { margin-bottom: 40px; }
.endpoint-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.endpoint-group-header code { color: var(--primary); }
.method-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.method-public { background: rgba(34,197,94,0.15); color: var(--green); }
.method-protected { background: rgba(99,102,241,0.15); color: var(--primary); }
.endpoint-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  transition: var(--transition);
}
.endpoint-card:hover { background: var(--bg-card); border-color: rgba(99,102,241,0.2); }
.endpoint-method {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(34,197,94,0.15);
  color: var(--green);
  min-width: 60px;
  text-align: center;
}
.endpoint-method.post { background: rgba(59,130,246,0.15); color: #3b82f6; }
.endpoint-method.delete { background: rgba(239,68,68,0.15); color: var(--red); }
.endpoint-info { flex: 1; }
.endpoint-path { color: var(--text); font-weight: 600; }
.endpoint-desc { color: var(--text-dim); font-size: 0.85rem; margin-left: 12px; }
.endpoint-try { margin-left: auto; }

/* ===== Playground ===== */
.playground-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.playground-form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; gap: 12px; }
.form-select {
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.form-select option { background: var(--bg); }
.form-input-group { flex: 1; display: flex; gap: 0; }
.form-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'SF Mono', monospace;
  outline: none;
  transition: var(--transition);
}
.form-input:focus { border-color: var(--border-focus); }
.form-input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; white-space: nowrap; }
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-family: 'SF Mono', monospace;
  outline: none;
  resize: vertical;
  transition: var(--transition);
}
.form-textarea:focus { border-color: var(--border-focus); }
.playground-response {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.response-status { font-weight: 600; color: var(--text-dim); }
.response-status.success { color: var(--green); }
.response-status.error { color: var(--red); }
.response-status.loading { color: var(--yellow); }
.response-time { color: var(--text-muted); font-family: monospace; }
.response-body {
  padding: 16px;
  font-size: 0.8rem;
  line-height: 1.5;
  overflow: auto;
  flex: 1;
  max-height: 400px;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}
.playground-shortcuts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.shortcut-label { font-size: 0.8rem; color: var(--text-muted); }
.shortcut-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-family: monospace;
  cursor: pointer;
  transition: var(--transition);
}
.shortcut-btn:hover { background: var(--bg-card-hover); border-color: var(--primary); color: var(--text); }

/* ===== Code Examples ===== */
.code-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}
.code-tab {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.code-tab.active { background: var(--bg); color: var(--text); border-color: var(--border); }
.code-tab:hover:not(.active) { color: var(--text-dim); }
.code-panels { position: relative; }
.code-panel { display: none; }
.code-panel.active { display: block; }
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  overflow: hidden;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.code-lang { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.code-block pre {
  padding: 20px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-dim);
}
.code-keyword { color: #c084fc; }
.code-string { color: #34d399; }
.code-comment { color: #64748b; }
.code-number { color: #fb923c; }

/* ===== Response Format ===== */
.response-format { margin-top: 64px; }
.response-format h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 24px; text-align: center; }
.format-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.format-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.format-badge {
  display: block;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.format-badge.success { background: rgba(34,197,94,0.1); color: var(--green); border-bottom: 1px solid rgba(34,197,94,0.2); }
.format-badge.error { background: rgba(239,68,68,0.1); color: var(--red); border-bottom: 1px solid rgba(239,68,68,0.2); }
.format-code {
  padding: 16px;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-dim);
  overflow-x: auto;
}

/* ===== Footer ===== */
.footer {
  padding: 64px 0 32px;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand p { color: var(--text-dim); font-size: 0.9rem; margin-top: 12px; }
.footer-links h4 { font-size: 0.85rem; font-weight: 600; margin-bottom: 16px; color: var(--text); }
.footer-links a { display: block; color: var(--text-dim); font-size: 0.85rem; margin-bottom: 8px; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links, .nav-right .btn { display: none; }
  .hamburger { display: flex; }
  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10,10,15,0.95);
    backdrop-filter: blur(20px);
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .hero-title { font-size: 2.5rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero-stats { gap: 16px; }
  .stat-divider { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .playground-layout { grid-template-columns: 1fr; }
  .format-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .section { padding: 64px 0; }
  .section-header h2 { font-size: 1.8rem; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .form-row { flex-direction: column; }
  .form-select { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-content > * {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}
.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-content > *:nth-child(3) { animation-delay: 0.3s; }
.hero-content > *:nth-child(4) { animation-delay: 0.4s; }
.hero-content > *:nth-child(5) { animation-delay: 0.5s; }
.hero-content > *:nth-child(6) { animation-delay: 0.6s; }

/* JSON syntax in response */
.json-key { color: #7dd3fc; }
.json-string { color: #34d399; }
.json-number { color: #fb923c; }
.json-bool { color: #c084fc; }
.json-null { color: #94a3b8; }
