:root {
  --bg: #070b0f;
  --bg-soft: #0a1117;
  --panel: #0e171e;
  --panel-2: #101c24;
  --line: #1c2a35;
  --line-strong: #2b4050;
  --text: #e8f0ea;
  --text-soft: #c3d0d5;
  --muted: #8ea3ad;
  --dim: #617681;
  --lime: #6bd64a;
  --lime-bright: #8df06c;
  --lime-soft: rgba(107, 214, 74, 0.12);
  --cyan: #57c7ff;
  --cyan-soft: rgba(87, 199, 255, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --font-sans: "Segoe UI", Inter, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -8%, rgba(107, 214, 74, 0.09), transparent 34rem),
    radial-gradient(circle at 100% 8%, rgba(87, 199, 255, 0.06), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.68;
}

a {
  color: var(--lime-bright);
  text-decoration: none;
}

a:hover {
  color: #b5ff9d;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 100;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--lime);
  color: #061007;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 10px clamp(18px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 15, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 16px rgba(107, 214, 74, 0.26));
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.source-link {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.btn:hover {
  border-color: var(--lime);
  background: var(--lime-soft);
  color: var(--lime-bright);
}

.wiki-shell {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 clamp(18px, 3vw, 40px);
}

.wiki-sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  height: calc(100vh - 72px);
  padding: 28px 18px 40px 0;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.sidebar-head {
  display: grid;
  gap: 4px;
  padding: 0 4px 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  color: var(--lime);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-head strong {
  font-size: 1.08rem;
}

.sidebar-head small {
  color: var(--dim);
  font-size: 0.74rem;
}

.toc-filter {
  display: block;
  padding: 16px 4px 10px;
}

.toc-filter input {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  outline: none;
}

.toc-filter input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-soft);
}

.toc-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-item a {
  display: block;
  padding: 6px 9px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.toc-item a:hover {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.toc-item a.is-active {
  border-left-color: var(--lime);
  background: var(--lime-soft);
  color: var(--lime-bright);
}

.toc-level-2 a {
  font-weight: 600;
}

.toc-level-3 a {
  padding-left: 22px;
  color: var(--dim);
  font-size: 0.76rem;
}

.wiki-content {
  min-width: 0;
  width: min(920px, 100%);
  padding: 44px 0 80px;
}

.doc-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 0.74rem;
}

.doc-meta > span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(14, 23, 30, 0.72);
}

.doc-meta .doc-tag {
  border-color: rgba(107, 214, 74, 0.36);
  background: var(--lime-soft);
  color: var(--lime-bright);
  font-weight: 700;
}

.markdown {
  max-width: 860px;
  color: var(--text-soft);
}

.markdown > :first-child {
  margin-top: 0;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
  position: relative;
  color: var(--text);
  line-height: 1.22;
  scroll-margin-top: 92px;
}

.markdown h1 {
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.035em;
}

.markdown h1::before {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--cyan));
  box-shadow: 0 0 18px rgba(107, 214, 74, 0.32);
}

.markdown h2 {
  margin: 52px 0 18px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: clamp(1.42rem, 2.6vw, 1.9rem);
  letter-spacing: -0.02em;
}

.markdown h3 {
  margin: 32px 0 12px;
  font-size: 1.14rem;
}

.markdown h4 {
  margin: 24px 0 10px;
  font-size: 1rem;
}

.heading-anchor {
  position: absolute;
  left: -1.2em;
  padding-right: 0.35em;
  color: var(--lime);
  opacity: 0;
  font-weight: 400;
  text-decoration: none;
  transition: opacity 120ms ease;
}

.markdown h1:hover .heading-anchor,
.markdown h2:hover .heading-anchor,
.markdown h3:hover .heading-anchor,
.markdown h4:hover .heading-anchor,
.heading-anchor:focus {
  opacity: 0.8;
}

.markdown p {
  margin: 0 0 16px;
}

.markdown strong {
  color: var(--text);
}

.markdown em {
  color: #d8e7dd;
}

.markdown a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(87, 199, 255, 0.3);
  text-underline-offset: 3px;
}

.markdown a:hover {
  color: #9ee0ff;
  text-decoration-color: currentColor;
}

.markdown ul,
.markdown ol {
  margin: 0 0 18px;
  padding-left: 1.5rem;
}

.markdown li {
  margin: 6px 0;
}

.markdown li > ul,
.markdown li > ol {
  margin: 6px 0 8px;
}

.markdown hr {
  height: 1px;
  margin: 32px 0;
  border: 0;
  background: var(--line);
}

.markdown blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--lime);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--lime-soft);
  color: var(--text-soft);
}

.markdown blockquote > :last-child {
  margin-bottom: 0;
}

.markdown code {
  padding: 0.14em 0.38em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0a1218;
  color: #b9f3a6;
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.markdown pre {
  margin: 18px 0 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #060c11;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  overflow-x: auto;
  line-height: 1.55;
}

.markdown pre code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #c8e8d5;
  font-size: 0.82rem;
  white-space: pre;
}

.table-wrap {
  margin: 20px 0 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}

.markdown table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  line-height: 1.5;
}

.markdown th,
.markdown td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.markdown th {
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.76rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.markdown tr:last-child td {
  border-bottom: 0;
}

.markdown tbody tr:hover {
  background: rgba(255, 255, 255, 0.022);
}

.markdown input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0 6px 0 -1.3rem;
  accent-color: var(--lime);
  vertical-align: -2px;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px clamp(18px, 3vw, 40px) 32px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.78rem;
}

.page-footer a {
  color: var(--muted);
}

.page-footer a:hover {
  color: var(--lime-bright);
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

@media (max-width: 1000px) {
  .wiki-shell {
    display: block;
  }

  .wiki-sidebar {
    position: static;
    height: auto;
    max-height: 44vh;
    padding: 22px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .wiki-content {
    padding-top: 30px;
  }

  .toc-level-3 a {
    padding-left: 12px;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    min-height: 0;
  }

  .brand-copy small,
  .source-link {
    display: none;
  }

  .btn {
    min-height: 34px;
    padding: 6px 10px;
  }

  .markdown h1 {
    font-size: 1.8rem;
  }

  .markdown h2 {
    margin-top: 38px;
  }

  .heading-anchor {
    display: none;
  }

  .table-wrap {
    border-radius: var(--radius-sm);
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .topbar,
  .wiki-sidebar,
  .page-footer,
  .heading-anchor {
    display: none;
  }

  .wiki-shell {
    display: block;
    width: 100%;
    padding: 0;
  }

  .wiki-content {
    width: 100%;
    padding: 0;
  }

  .markdown,
  .markdown h1,
  .markdown h2,
  .markdown h3,
  .markdown h4,
  .markdown strong,
  .markdown em {
    color: #111;
  }

  .markdown a {
    color: #0645ad;
  }

  .markdown pre,
  .markdown code,
  .table-wrap {
    border-color: #bbb;
    background: #f7f7f7;
    color: #111;
  }
}
