*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: #050510;
  color: #e2e8f0;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a {
  color: #60a5fa;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.9em;
  color: #ffe066; /* AA on #050510 */
}

/* Background */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(55, 118, 171, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 118, 171, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, black 15%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, black 15%, transparent 75%);
  animation: grid-drift 20s linear infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes grid-drift {
  0% { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: #3776ab;
  opacity: 0.2;
  top: -10%;
  left: 15%;
  animation: orb-float 12s ease-in-out infinite;
}

.orb-2 {
  width: 320px;
  height: 320px;
  background: #ffd43b;
  opacity: 0.1;
  bottom: 10%;
  right: 10%;
  animation: orb-float 15s ease-in-out infinite reverse;
}

.orb-3 {
  width: 220px;
  height: 220px;
  background: #1e3a5f;
  opacity: 0.35;
  top: 45%;
  left: 55%;
  animation: orb-float 10s ease-in-out infinite 2s;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.08); }
  66% { transform: translate(-20px, 20px) scale(0.96); }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 48px);
  background: rgba(5, 5, 16, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #f8fafc;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
  color: #60a5fa;
}

.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
}

.nav-links a {
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-links a:hover {
  color: #e2e8f0;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Main */
main {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 24px 80px;
}

.hero {
  padding: clamp(64px, 12vh, 120px) 0 72px;
  text-align: left;
  animation: fade-up 0.8s ease both;
}

.eyebrow {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  color: #64748b;
  margin-bottom: 20px;
}

h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  line-height: 0.98;
  margin-bottom: 22px;
}

h1 .line {
  display: block;
  font-size: clamp(2.8rem, 9vw, 5.2rem);
  letter-spacing: -0.04em;
  color: #f8fafc;
}

h1 .line.accent {
  background: linear-gradient(135deg, #3776ab 0%, #60a5fa 45%, #ffd43b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.for {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: #94a3b8;
  max-width: 36rem;
  margin-bottom: 32px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta {
  display: inline-flex;
  align-items: center;
  padding: 14px 26px;
  background: linear-gradient(135deg, #3776ab, #2d5f8a);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 8px 28px rgba(55, 118, 171, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta:hover {
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 12px 36px rgba(55, 118, 171, 0.45);
}

.cta-ghost {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: none;
  color: #e2e8f0;
}

.cta-ghost:hover {
  border-color: #60a5fa;
  color: #60a5fa;
  box-shadow: none;
}

/* Sections */
.section {
  padding: 56px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  animation: fade-up 0.7s ease both;
}

.section h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.section-lead {
  color: #94a3b8;
  margin-bottom: 28px;
  max-width: 40rem;
}

.section-note {
  margin-top: 18px;
  color: #94a3b8; /* AA on #050510 */
  font-size: 0.95rem;
}

.pkg {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 10px;
}

.badge {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

.badge-live {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
}

.badge-soon {
  color: #fcd34d;
  background: rgba(253, 224, 71, 0.1);
}

/* Packages */
.package-list {
  list-style: none;
  display: grid;
  gap: 14px;
}

.package-list li {
  color: #94a3b8;
  padding-left: 0;
}

.package-list strong {
  color: #f8fafc;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
}

.subsection-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #f8fafc;
  margin: 28px 0 10px;
  letter-spacing: -0.01em;
}

.os-package-table {
  display: grid;
  gap: 0;
  margin: 0 0 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.os-package-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  font-size: 0.95rem;
}

.os-package-row .os-name {
  color: #e2e8f0;
  font-weight: 500;
}

.os-package-row code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  color: #ffe066;
}

/* Code — Django-docs-style caption + body */
.code-block {
  margin: 1.25rem 0 1.75rem;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}

.code-block-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 16px;
  background: rgba(55, 118, 171, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  color: #94a3b8;
}

.code-block-caption > code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 500;
  color: #cbd5e1;
  background: transparent;
}

.code-block-body {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0 0 4px 4px;
  background: rgba(15, 23, 42, 0.92);
  overflow-x: auto;
}

.code-block-body pre {
  margin: 0;
  padding: 14px 18px;
  overflow-x: auto;
}

.code-block-body code,
.code-block-body pre[class*="language-"],
.code-block-body code[class*="language-"] {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.84rem;
  line-height: 1.65;
  color: #c9d1d9;
  white-space: pre;
  background: transparent;
  text-shadow: none;
}

/* Console $ prompt (visual only; not copied) */
.code-block--console .code-block-body code::before {
  content: "$ ";
  color: #a8b0bc;
  font-weight: 700;
}

/* Django dark-theme-like Prism tokens */
.code-block .token.comment,
.code-block .token.prolog,
.code-block .token.doctype,
.code-block .token.cdata {
  color: #a8b0bc; /* AA on code-block bg */
  font-style: italic;
}

.code-block .token.punctuation {
  color: #c9d1d9;
}

.code-block .token.keyword,
.code-block .token.operator,
.code-block .token.boolean,
.code-block .token.null,
.code-block .token.important {
  color: #ff7b72;
}

.code-block .token.builtin {
  color: #ff7b72;
}

.code-block .token.class-name {
  color: #f0883e;
  font-weight: 600;
}

.code-block .token.function {
  color: #d2a8ff;
  font-weight: 600;
}

.code-block .token.string,
.code-block .token.char,
.code-block .token.attr-value {
  color: #a5d6ff;
}

.code-block .token.number {
  color: #a5d6ff;
}

.code-block .token.parameter,
.code-block .token.property,
.code-block .token.variable {
  color: #c9d1d9;
}

.code-block .token.decorator,
.code-block .token.annotation {
  color: #d2a8ff;
}

.code-block .language-bash .token.function {
  color: #ff7b72;
}

.code-block .language-bash .token.string {
  color: #a5d6ff;
}

.copy-btn {
  flex-shrink: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #94a3b8;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 4px;
  padding: 3px 9px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.copy-btn:hover {
  color: #e2e8f0;
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(5, 5, 16, 0.35);
}

.copy-btn.copied {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}

.install-tabs {
  margin-bottom: 8px;
}

.install-tabs > .tab-bar {
  margin-bottom: 10px;
}

.install-tabs .code-block {
  margin-bottom: 12px;
}

/* Tabs */
.tabs {
  margin-top: 8px;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.docs-tabs > .tab-bar {
  gap: 10px;
  margin-bottom: 22px;
  padding-bottom: 4px;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.docs-tabs > .tab-bar .tab-btn {
  flex: 0 0 auto;
  font-size: 0.95rem;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-icon {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: var(--tab-icon) center / contain no-repeat;
  mask: var(--tab-icon) center / contain no-repeat;
}

.tab-icon--python {
  --tab-icon: url("/icons/python.svg");
  color: #3776ab;
}

.tab-icon--django {
  --tab-icon: url("/icons/django.svg");
  color: #44b78b;
}

.tab-icon--fastapi {
  --tab-icon: url("/icons/fastapi.svg");
  color: #009688;
}

.tab-icon--aiohttp {
  --tab-icon: url("/icons/aiohttp.svg");
  color: #2c5bb4;
}

.tab-icon--odoo {
  --tab-icon: url("/icons/odoo.svg");
  color: #a24689;
}

.tab-icon--flask {
  --tab-icon: url("/icons/flask.svg");
  color: #e2e8f0;
}

.tab-btn:not(.active) .tab-icon {
  opacity: 0.85;
}

.nested-tabs {
  margin-top: 4px;
}

.nested-tabs > .tab-bar {
  margin-bottom: 12px;
}

.tab-btn {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}

.tab-btn:hover {
  color: #e2e8f0;
}

.tab-btn.active {
  color: #f8fafc;
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(55, 118, 171, 0.15);
}

.tab-btn .badge {
  pointer-events: none;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel > .section-lead {
  margin-bottom: 20px;
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 28px 20px 40px;
  color: #475569;
  font-size: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.site-footer a {
  color: #64748b;
}

.footer-sep {
  opacity: 0.5;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Docs layout */
body.docs-page main.docs-main {
  width: 100%;
  max-width: none;
  margin: 0;
}

.docs-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  width: min(1280px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - 140px);
}

.docs-sidebar {
  position: sticky;
  top: 65px;
  align-self: start;
  height: calc(100vh - 65px);
  overflow-y: auto;
  padding: 28px 20px 40px 24px;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.docs-search {
  margin-bottom: 24px;
}

.docs-search-input,
#search,
.pagefind-ui__search-input {
  width: 100%;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.9rem;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
}

.docs-search-input::placeholder {
  color: #94a3b8;
}

.docs-search-input:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(55, 118, 171, 0.25);
}

.docs-nav-group {
  margin-bottom: 22px;
}

.docs-nav-label {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 8px;
}

.docs-nav {
  list-style: none;
  display: grid;
  gap: 2px;
}

.docs-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

.docs-nav a:hover {
  color: #f8fafc;
  background: rgba(55, 118, 171, 0.12);
  text-decoration: none;
}

.docs-nav a.active {
  color: #f8fafc;
  background: rgba(55, 118, 171, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.28);
}

.docs-nav a .badge {
  flex-shrink: 0;
}

.docs-nav a .tab-icon {
  width: 1rem;
  height: 1rem;
  margin-right: 2px;
}

.docs-nav-link-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.docs-content {
  padding: 36px clamp(20px, 4vw, 48px) 80px;
  min-width: 0;
}

.docs-prose {
  max-width: min(56rem, 100%);
}

.docs-prose > h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
  line-height: 1.2;
  margin-bottom: 12px;
}

.docs-prose > .section-lead {
  margin-bottom: 28px;
}

.docs-prose h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #f8fafc;
  margin: 2.25rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.docs-prose h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 1.75rem 0 0.6rem;
}

.docs-prose p {
  color: #94a3b8;
  margin-bottom: 1rem;
}

.docs-prose ul {
  margin: 0 0 1.25rem 1.1rem;
  color: #94a3b8;
}

.docs-prose li {
  margin-bottom: 0.4rem;
}

.docs-prose .section-note {
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
}

.docs-prose .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.docs-prose table,
.docs-prose table.docs-table {
  display: table;
  width: 100%;
  min-width: 36rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.docs-prose table.docs-table--compact {
  min-width: 28rem;
}

.docs-prose table.docs-table--wide {
  min-width: 48rem;
}

.docs-prose th,
.docs-prose td,
.docs-prose table.docs-table th,
.docs-prose table.docs-table td {
  display: table-cell;
  text-align: left;
  vertical-align: top;
  padding: 0.8rem 1rem;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

.docs-prose th:last-child,
.docs-prose td:last-child,
.docs-prose table.docs-table th:last-child,
.docs-prose table.docs-table td:last-child {
  border-right: none;
}

.docs-prose th,
.docs-prose table.docs-table th {
  color: #f8fafc;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(55, 118, 171, 0.28);
  white-space: nowrap;
}

.docs-prose tbody tr:nth-child(even) td,
.docs-prose table.docs-table tbody tr:nth-child(even) td {
  background: rgba(148, 163, 184, 0.06);
}

.docs-prose tbody tr:hover td,
.docs-prose table.docs-table tbody tr:hover td {
  background: rgba(55, 118, 171, 0.14);
}

.docs-prose tbody tr:last-child td,
.docs-prose table.docs-table tbody tr:last-child td {
  border-bottom: none;
}

.docs-prose table.docs-table td:first-child {
  color: #f1f5f9;
  font-weight: 500;
}

.docs-prose table.docs-table strong {
  color: #f8fafc;
  font-weight: 600;
}

.docs-prose table.docs-table caption {
  caption-side: top;
  text-align: left;
  padding: 0.75rem 1rem 0.35rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.docs-prose .tabs {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.docs-sidebar-toggle {
  display: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  margin: 16px 20px 0;
  position: relative;
  z-index: 2;
}

.docs-sidebar-backdrop {
  display: none;
}

/* Pagefind overrides for dark theme */
.pagefind-ui {
  --pagefind-ui-primary: #60a5fa;
  --pagefind-ui-text: #e2e8f0;
  --pagefind-ui-background: rgba(15, 23, 42, 0.95);
  --pagefind-ui-border: rgba(148, 163, 184, 0.22);
  --pagefind-ui-tag: rgba(55, 118, 171, 0.25);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 8px;
  --pagefind-ui-font: "Inter", system-ui, sans-serif;
}

.pagefind-ui__search-input {
  background: rgba(15, 23, 42, 0.85) !important;
  color: #e2e8f0 !important;
}

.pagefind-ui__result-link {
  color: #93c5fd !important;
}

.pagefind-ui__result-excerpt {
  color: #94a3b8 !important;
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar-toggle {
    display: inline-flex;
  }

  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    height: 100vh;
    z-index: 30;
    background: rgba(5, 5, 16, 0.98);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    border-right: 1px solid rgba(148, 163, 184, 0.15);
    padding-top: 72px;
  }

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

  .docs-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(0, 0, 0, 0.55);
  }

  .docs-sidebar-backdrop.open {
    display: block;
  }

  .docs-content {
    padding-top: 20px;
  }
}

@media (max-width: 720px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(5, 5, 16, 0.96);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    padding: 8px 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 14px 24px;
  }

  .hero {
    padding-top: 48px;
  }
}
