@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700;800&family=Inter:wght@400;500;600;700;800;900&display=swap');

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

:root {
  --lime: oklch(0.86 0.28 128);
  --surf: oklch(0.07 0 0);
  --bg: oklch(0.03 0 0);
  --fg: oklch(0.93 0 0);
  --muted: oklch(0.52 0 0);
  --border: oklch(0.14 0 0);
  --header-h: 60px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── Header ─────────────────────────────────────────────────────────── */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: oklch(0.04 0 0 / 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 2rem;
}
.docs-header-logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}
.docs-header-logo .ai  { color: var(--lime); }
.docs-header-logo .cod { color: #fff; }
.docs-header-logo .es  { color: var(--lime); }
.docs-header-logo .it  { color: #fff; font-size: 0.65em; margin-left: 2px; opacity: .55; }
.docs-header-nav { display: flex; gap: 1.5rem; margin-left: auto; }
.docs-header-nav a {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.docs-header-nav a:hover { color: var(--fg); }
.docs-header-nav a.active { color: var(--fg); font-weight: 600; }

/* ─── Layout ─────────────────────────────────────────────────────────── */
.docs-layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}
.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: oklch(0.03 0 0);
}
.docs-main {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 1.5rem 5rem;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Sidebar nav ────────────────────────────────────────────────────── */
.sidebar-search-wrap {
  padding: 0.85rem 0.75rem 0.65rem;
  position: sticky;
  top: 0;
  background: oklch(0.03 0 0);
  z-index: 1;
  border-bottom: 1px solid var(--border);
}
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: oklch(0.07 0 0);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  transition: border-color .15s;
}
.sidebar-search:hover { border-color: oklch(0.22 0 0); }
.sidebar-search-text {
  font-size: 0.72rem;
  color: oklch(0.38 0 0);
  flex: 1;
}
.sidebar-search-kbd {
  display: flex;
  gap: 3px;
}
.sidebar-search-kbd kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: oklch(0.38 0 0);
  background: oklch(0.11 0 0);
  border: 1px solid oklch(0.18 0 0);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}

.sidebar-nav { padding: 0.5rem 0 2rem; }

.sidebar-group { margin-bottom: 0.15rem; }

.sidebar-group-label {
  display: block;
  padding: 0.55rem 0.85rem 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color .12s;
}
.sidebar-group-label:hover { color: var(--lime); }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem 0.35rem 0.85rem;
  font-size: 0.73rem;
  line-height: 1.4;
  color: var(--muted);
  text-decoration: none;
  border-radius: 0;
  transition: color .12s, background .12s;
  position: relative;
}
.sidebar-item:hover {
  color: var(--fg);
  background: oklch(0.07 0 0);
}
.sidebar-item.active {
  color: var(--lime);
  background: oklch(0.86 0.28 128 / 0.06);
  font-weight: 500;
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--lime);
  border-radius: 0 2px 2px 0;
}
.sidebar-icon {
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity .12s;
}
.sidebar-item:hover .sidebar-icon,
.sidebar-item.active .sidebar-icon {
  opacity: 1;
}

/* ─── Content typography ─────────────────────────────────────────────── */
.docs-intro { margin-bottom: 2.5rem; }
.docs-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 0.5rem;
}
.docs-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin: 0 0 0.4rem;
}
.docs-subtitle { font-size: 0.82rem; color: var(--muted); }

.docs-h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lime);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-family: 'JetBrains Mono', monospace;
  scroll-margin-top: 80px;
}
.docs-h2:first-child { margin-top: 0; }
.docs-h2-line { flex: 1; height: 1px; background: oklch(0.86 0.28 128 / 0.2); }

.docs-h3 {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  scroll-margin-top: 80px;
}

p { font-size: 0.82rem; color: var(--muted); line-height: 1.8; margin-bottom: 0.75rem; }

ul.docs-list { list-style: none; margin-bottom: 1rem; }
ul.docs-list li {
  display: flex;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  align-items: flex-start;
}
ul.docs-list li::before {
  content: '›';
  color: var(--lime);
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1.6;
}

ol.docs-ordered { list-style: none; margin-bottom: 1rem; }
ol.docs-ordered li {
  display: flex;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: oklch(0.86 0.28 128 / 0.15);
  color: var(--lime);
  font-size: 9px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  background: oklch(0.10 0 0);
  border: 1px solid oklch(0.18 0 0);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  color: var(--lime);
}

.docs-note {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid oklch(0.86 0.28 128 / 0.2);
  background: oklch(0.86 0.28 128 / 0.04);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.7;
}
.docs-note strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--lime);
  display: block;
  margin-bottom: 0.3rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.badge-emerald { background: oklch(0.7 0.18 155 / 0.1); color: oklch(0.75 0.18 155); border: 1px solid oklch(0.7 0.18 155 / 0.25); }

.dns-table {
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 0.75rem 0;
}
.dns-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background: var(--surf);
  border-bottom: 1px solid var(--border);
}
.dns-row:last-child { border-bottom: none; }
.dns-key {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.code-block {
  margin: 0.75rem 0;
  border-radius: 10px;
  background: oklch(0.05 0 0);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--fg);
  line-height: 1.9;
  overflow-x: auto;
}
.code-comment { color: var(--muted); margin-bottom: 4px; display: block; }
.code-indent { padding-left: 1.5rem; display: block; }

strong { color: var(--fg); font-weight: 700; }
em { font-style: italic; }

/* ─── Footer ─────────────────────────────────────────────────────────── */
.docs-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}
.docs-footer a { color: var(--muted); text-decoration: none; }
.docs-footer a:hover { color: var(--fg); }

/* ─── Mobile ─────────────────────────────────────────────────────────── */
.mobile-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.mobile-sidebar-toggle button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 0.45rem;
  border-radius: 8px;
}
.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-h);
  z-index: 50;
}
.mobile-sidebar-overlay.open { display: flex; }
.mobile-overlay-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
}
.mobile-sidebar-drawer {
  position: relative;
  width: 256px;
  background: oklch(0.04 0 0);
  border-right: 1px solid var(--border);
  height: 100%;
  z-index: 10;
  overflow-y: auto;
}
.mobile-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
}

@media (max-width: 1023px) {
  .docs-sidebar { display: none; }
  .mobile-sidebar-toggle { display: flex; }
  .docs-main { padding: 1.5rem 1rem 4rem; }
  .docs-header-nav { display: none; }
}
