:root {
  --bg: #0b0e14;
  --bg-soft: #121620;
  --panel: rgba(255, 255, 255, 0.03);
  --panel-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #f0f4f8;
  --text-muted: #94a3b8;
  --primary: #2ecc71;
  --primary-2: #3498db;
  --primary-gradient: linear-gradient(135deg, var(--primary), var(--primary-2));
  --link: #7dd3fc;
  --link-hover: #a7f3d0;
  --link-underline: rgba(125, 211, 252, 0.38);
  --link-underline-hover: rgba(167, 243, 208, 0.55);
  --radius: 18px;
  --shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.5);
  --nav-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(46, 204, 113, 0.09), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  bottom: -25%;
  right: -15%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(52, 152, 219, 0.09), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

.container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

/* Top nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(11, 14, 20, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
}

.logo-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: url("/assets/logo.svg") center / cover no-repeat;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 34px -18px rgba(46, 204, 113, 0.55);
}

.logo-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  background-size: 200% 200%;
  animation: shine 4s infinite;
}

@keyframes shine {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.pill:hover {
  background: rgba(255, 255, 255, 0.07);
  text-decoration: none;
}

/* Page */
.page {
  padding: 44px 0 84px;
}

.hero {
  padding: 12px 0 22px;
}

.hero-topline {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(46, 204, 113, 0.2);
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
  font-size: 13px;
  font-weight: 600;
}

.hero h1 {
  margin-top: 16px;
  font-size: clamp(34px, 4.5vw, 56px);
  line-height: 1.08;
  background: linear-gradient(to right, #fff, #a8b5c7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  margin-top: 14px;
  max-width: 760px;
  color: var(--text-muted);
  font-size: 18px;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--panel-2);
  border-color: var(--border-2);
  text-decoration: none;
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.86));
  color: #0b0e14;
}

.btn-primary:hover {
  background: #fff;
}

/* Docs layout */
.doc-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 220px;
  gap: 26px;
  align-items: start;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 18px);
  padding: 18px;
}

.sidebar .label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
  margin-bottom: 12px;
}

.sidebar a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(240, 244, 248, 0.86);
  border: 1px solid transparent;
}

.sidebar a:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.sidebar a.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.sidebar a .hint {
  display: block;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.92);
  margin-top: 2px;
  font-weight: 500;
}

.sidebar .divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.content {
  padding: 26px;
}

.content > * + * {
  margin-top: 14px;
}

.content h1 {
  font-size: 34px;
  line-height: 1.15;
  margin-top: 6px;
}

.content h2 {
  font-size: 26px;
  margin-top: 34px;
}

.content h3 {
  font-size: 18px;
  margin-top: 22px;
}

.content h1,
.content h2,
.content h3 {
  scroll-margin-top: calc(var(--nav-height) + 18px);
}

.content p {
  color: rgba(240, 244, 248, 0.9);
}

.content .muted {
  color: var(--text-muted);
}

.content ul,
.content ol {
  margin: 10px 0 0;
  padding-left: 20px;
  color: rgba(240, 244, 248, 0.9);
}

.content li {
  margin: 8px 0;
}

.content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 14px auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: zoom-in;
}

body.lightbox-open {
  overflow: hidden;
}

.doc-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(5, 8, 12, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.doc-image-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.doc-image-lightbox-image {
  width: auto;
  height: auto;
  max-width: min(94vw, 1600px);
  max-height: 82vh;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.6);
}

.doc-image-lightbox-caption {
  margin: 0;
  max-width: min(94vw, 960px);
  text-align: center;
  color: rgba(240, 244, 248, 0.95);
  font-size: 14px;
}

.doc-image-lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 16, 24, 0.8);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.doc-image-lightbox-close:hover {
  background: rgba(24, 30, 42, 0.95);
}

/* Make links inside doc content stand out */
.content a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.content a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-underline-hover);
}

.content a.btn {
  text-decoration: none;
}

.content a.btn:not(.btn-primary) {
  color: var(--text);
}

.content a.btn:hover {
  text-decoration: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 2px 8px;
  border-radius: 10px;
}

pre {
  margin: 10px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: auto;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
}

.preview-note {
  margin-bottom: 14px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.25);
  background: rgba(125, 211, 252, 0.1);
  color: #7dd3fc;
  font-size: 13px;
  font-weight: 600;
}

.fix-prompt {
  margin-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85em;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.callout {
  margin-top: 12px;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.callout strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.01em;
}

.callout.tip {
  border-color: rgba(46, 204, 113, 0.22);
  background: rgba(46, 204, 113, 0.06);
}

.callout.warn {
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.08);
}

.callout.danger {
  border-color: rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
}

.toc {
  position: sticky;
  top: calc(var(--nav-height) + 18px);
  padding: 18px;
}

.toc .label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
  margin-bottom: 10px;
}

.toc a {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  color: rgba(240, 244, 248, 0.82);
  border: 1px solid transparent;
}

.toc a:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.toc .small {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.92);
  margin-top: 2px;
}

.grid3 {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mini {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.mini:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.mini .title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  margin-bottom: 6px;
}

.mini .desc {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

details.faq {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 14px 16px;
}

details.faq + details.faq {
  margin-top: 10px;
}

details.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.01em;
  outline: none;
}

details.faq summary::-webkit-details-marker {
  display: none;
}

details.faq[open] {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

details.faq .answer {
  margin-top: 10px;
  color: rgba(240, 244, 248, 0.9);
}

footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: rgba(148, 163, 184, 0.9);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media (max-width: 1050px) {
  .doc-grid {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}

@media (max-width: 820px) {
  .nav-links {
    display: none;
  }
  .doc-grid {
    grid-template-columns: 1fr;
  }
  .sidebar.desktop-only {
    display: none;
  }
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: block;
  }
  .content {
    padding: 20px;
  }
  .doc-image-lightbox {
    padding: 14px;
  }
  .doc-image-lightbox-image {
    max-width: 96vw;
    max-height: 78vh;
  }
  .doc-image-lightbox-close {
    top: 12px;
    right: 12px;
  }
  .grid3 {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn,
  .mini,
  .logo-icon::after {
    animation: none !important;
    transition: none !important;
  }
}
