:root {
  --page-bg: #f0f0f0;
  --surface-01: #ffffff;
  --surface-02: #f7f7fb;
  --text-01: #1f2937;
  --text-02: #4b5563;
  --brand-primary: #6366f1;
  --brand-secondary: #8b5cf6;
  --border-color: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --shadow: 0 15px 45px rgba(31, 41, 55, 0.2);
}

body.dark {
  --page-bg: #0b1120;
  --surface-01: #111827;
  --surface-02: rgba(15, 23, 42, 0.92);
  --text-01: #f1f5f9;
  --text-02: #cbd5f5;
  --border-color: rgba(148, 163, 184, 0.25);
  --shadow: 0 15px 45px rgba(99, 102, 241, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  background: var(--page-bg);
  color: var(--text-01);
  min-height: 100vh;
  line-height: 1.55;
}

.texture {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.22), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(139, 92, 246, 0.18), transparent 35%),
    radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.12), transparent 45%);
  opacity: 0.65;
  pointer-events: none;
  z-index: 0;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 110px 24px 80px;
  position: relative;
  z-index: 1;
}

nav.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  backdrop-filter: blur(14px);
  background: rgba(240, 240, 240, 0.85);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

body.dark nav.site-nav {
  background: rgba(11, 17, 32, 0.8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.brand span {
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(120deg, #6366f1, #8b5cf6);
  color: white;
  font-size: 0.95rem;
}

.nav-links {
  display: flex;
  gap: 18px;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--text-02);
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text-01);
}

.theme-toggle {
  background: var(--surface-01);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-01);
  font-weight: 600;
}

header.hero {
  background: linear-gradient(125deg, rgba(99, 102, 241, 0.95), rgba(139, 92, 246, 0.95));
  border-radius: 32px;
  padding: 48px;
  color: white;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 4vw, 3.4rem);
  margin: 12px 0;
  font-weight: 700;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.85;
}

.hero-content p {
  margin: 0 0 24px;
  font-size: 1.05rem;
  max-width: 520px;
  color: rgba(255, 255, 255, 0.86);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid transparent;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: white;
  color: #111827;
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
}

.hero-metrics {
  display: grid;
  gap: 16px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 16px 20px;
  backdrop-filter: blur(6px);
}

.metric-card span {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.72);
}

.metric-card strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 6px;
}

section.panel {
  background: var(--surface-01);
  border-radius: 24px;
  padding: 36px;
  margin-bottom: 32px;
  border: 1px solid var(--border-color);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.08);
}

section.panel h2 {
  margin-top: 0;
  font-size: 1.6rem;
}

section.panel p {
  color: var(--text-02);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.detail-card {
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 18px;
  background: var(--surface-02);
}

.detail-card h3 {
  margin-top: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--brand-primary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

ul.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

ul.checklist li::before {
  content: '✔';
  color: var(--success);
  margin-right: 8px;
  font-weight: 700;
}

pre {
  background: #1f2937;
  color: #f8fafc;
  padding: 18px;
  border-radius: 16px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

pre code {
  font-family: 'Space Mono', 'SFMono-Regular', Menlo, monospace;
  font-size: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

th {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-02);
}

.swagger-panel {
  background: var(--surface-01);
  border-radius: 32px;
  padding: 24px;
  margin: 48px auto;
  max-width: 1400px;
  border: 1px solid var(--border-color);
}

#swagger-ui {
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface-01);
}

footer {
  text-align: center;
  padding: 32px;
  color: var(--text-02);
  border-top: 1px solid var(--border-color);
}

footer a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 768px) {
  nav.site-nav {
    flex-direction: column;
    gap: 12px;
  }

  header.hero {
    padding: 32px;
  }

  .hero-actions {
    flex-direction: column;
  }

  section.panel {
    padding: 24px;
  }
}
