:root {
  color-scheme: dark;
  --bg: #05070d;
  --bg-deep: #03050a;
  --surface: rgba(12, 17, 29, 0.72);
  --surface-solid: #0a0f1a;
  --glass: rgba(255, 255, 255, 0.035);
  --glass-strong: rgba(255, 255, 255, 0.06);
  --line: rgba(151, 171, 209, 0.14);
  --line-soft: rgba(151, 171, 209, 0.08);
  --line-strong: rgba(151, 171, 209, 0.26);
  --text: #e9edf6;
  --text-soft: #c4ccdb;
  --muted: #929db2;
  --dim: #626d84;
  --accent: #6d97ff;
  --accent-strong: #8fb0ff;
  --accent-soft: rgba(109, 151, 255, 0.14);
  --accent-line: rgba(109, 151, 255, 0.38);
  --teal: #56d9c9;
  --teal-soft: rgba(86, 217, 201, 0.12);
  --amber: #e7b36b;
  --danger: #ff7a8a;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --topbar: 64px;
  --sidebar: 282px;
  --toc: 232px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(72, 112, 235, 0.16), transparent 62%),
    radial-gradient(760px 460px at 96% 2%, rgba(65, 205, 190, 0.07), transparent 64%),
    linear-gradient(180deg, #060912 0%, var(--bg) 42%, var(--bg-deep) 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

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

button,
input {
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

::selection {
  background: rgba(109, 151, 255, 0.32);
  color: #fff;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(151, 171, 209, 0.24) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(151, 171, 209, 0.24);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(151, 171, 209, 0.36);
}

body.search-open,
body.sidebar-open {
  overflow: hidden;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.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: 10px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #05070d;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: none;
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 22px;
  height: var(--topbar);
  padding: 0 22px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand img {
  width: 26px;
  height: 26px;
}

.brand-dim {
  color: var(--dim);
  font-weight: 400;
}

.crumbs {
  color: var(--dim);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumbs span {
  margin: 0 6px;
  color: rgba(151, 171, 209, 0.4);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.search-trigger,
.sidebar-search {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.search-trigger:hover,
.sidebar-search:hover {
  border-color: var(--line-strong);
  background: var(--glass-strong);
  color: var(--text-soft);
}

.search-trigger svg,
.sidebar-search svg,
.search-field svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-trigger span {
  font-size: 13px;
}

kbd {
  display: inline-block;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--dim);
  font-size: 10.5px;
  line-height: 1.5;
}

.icon-link {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}

.icon-link:hover {
  color: var(--text);
  background: var(--glass);
}

.icon-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--glass);
  cursor: pointer;
}

.menu-toggle span:not(.sr-only) {
  display: block;
  width: 16px;
  height: 1.5px;
  margin: 4px auto;
  background: var(--text-soft);
}

/* Docs shell */

.shell {
  display: flex;
  align-items: flex-start;
}

.sidebar {
  position: sticky;
  top: var(--topbar);
  flex: 0 0 var(--sidebar);
  width: var(--sidebar);
  height: calc(100vh - var(--topbar));
  border-right: 1px solid var(--line-soft);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 22px 16px 20px;
}

.sidebar-search {
  width: 100%;
  margin-bottom: 22px;
  justify-content: flex-start;
  text-align: left;
}

.sidebar-search span {
  flex: 1;
  font-size: 13px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.nav-label {
  margin: 0 0 8px;
  padding: 0 10px;
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-group ul {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-group a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 33px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.35;
  transition: color 0.18s, background 0.18s;
}

.nav-group a span {
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
  transition: height 0.2s var(--ease);
}

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

.nav-group a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
}

.nav-group a[aria-current="page"] span {
  height: 15px;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 22px 10px 0;
  color: var(--dim);
  font-size: 11.5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
}

.sidebar-backdrop {
  display: none;
}

.content-wrap {
  display: flex;
  align-items: flex-start;
  gap: 44px;
  flex: 1;
  min-width: 0;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}

.article {
  flex: 1;
  min-width: 0;
  max-width: 790px;
  padding: 54px 0 90px;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  color: var(--dim);
  font-size: 12px;
}

.article-meta a {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.article-meta a:hover {
  color: var(--text);
  border-color: var(--accent-line);
}

.article h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.page-lead {
  max-width: 68ch;
  margin: 16px 0 0;
  color: var(--text-soft);
  font-size: 16.5px;
  line-height: 1.65;
}

.toc {
  position: sticky;
  top: calc(var(--topbar) + 40px);
  flex: 0 0 var(--toc);
  width: var(--toc);
  max-height: calc(100vh - var(--topbar) - 70px);
  overflow-y: auto;
  padding: 58px 0 40px;
}

.toc-label {
  margin: 0 0 10px;
  color: var(--dim);
  font-size: 11.5px;
}

.toc-list {
  margin: 0;
  padding: 0 0 0 11px;
  border-left: 1px solid var(--line);
  list-style: none;
}

.toc-list li {
  margin: 0;
}

.toc-list a {
  display: block;
  padding: 4px 0 4px 9px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
  transition: color 0.15s;
}

.toc-list a:hover {
  color: var(--text);
}

.toc-list a.active {
  color: var(--accent-strong);
}

.toc-list .sub a {
  padding-left: 20px;
  font-size: 12px;
  color: var(--dim);
}

.toc-list .sub a:hover {
  color: var(--text-soft);
}

.toc-empty {
  color: var(--dim);
  font-size: 12px;
}

/* Prose */

.prose {
  margin-top: 40px;
  color: var(--text-soft);
  font-size: 15.5px;
  line-height: 1.72;
}

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

.prose h2,
.prose h3,
.prose h4 {
  position: relative;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--topbar) + 24px);
}

.prose h2 {
  margin: 56px 0 16px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
  font-size: 23px;
  line-height: 1.3;
}

.prose h3 {
  margin: 38px 0 12px;
  font-size: 18px;
  line-height: 1.35;
}

.prose h4 {
  margin: 28px 0 10px;
  font-size: 15.5px;
}

.prose .anchor {
  margin-left: 8px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.8em;
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose h4:hover .anchor,
.prose .anchor:focus-visible {
  opacity: 1;
}

.prose .anchor:hover {
  color: var(--accent);
}

.prose p {
  margin: 0 0 16px;
  max-width: 74ch;
}

.prose a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: rgba(109, 151, 255, 0.35);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s, color 0.15s;
}

.prose a:hover {
  color: #b9ccff;
  text-decoration-color: var(--accent);
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose em {
  color: var(--text-soft);
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 24px;
}

.prose li {
  margin: 6px 0;
  padding-left: 2px;
}

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

.prose li::marker {
  color: var(--accent);
}

.prose hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--line-soft);
}

.prose blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
  color: var(--text-soft);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code {
  padding: 2px 5px;
  border: 1px solid rgba(109, 151, 255, 0.16);
  border-radius: 5px;
  background: rgba(109, 151, 255, 0.08);
  color: #cddfff;
  font-size: 0.855em;
  word-break: break-word;
}

.code-block {
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(4, 7, 13, 0.72);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
}

.copy-code {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 11.5px;
  padding: 3px 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.copy-code:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--glass);
}

.copy-code.copied {
  color: var(--teal);
}

.code-block pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-size: 12.8px;
  line-height: 1.68;
  tab-size: 2;
}

.code-block code {
  padding: 0;
  border: 0;
  background: none;
  color: #c8d3e8;
  font-size: inherit;
  word-break: normal;
}

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

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.prose th,
.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

.prose th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

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

.prose tbody tr:hover {
  background: rgba(255, 255, 255, 0.018);
}

.prose td code,
.prose th code {
  white-space: nowrap;
}

.prose img {
  display: block;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Pager and footer */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  transition: border-color 0.2s, background 0.2s;
}

.pager-link:hover {
  border-color: var(--line-strong);
  background: var(--glass-strong);
}

.pager-link span {
  color: var(--dim);
  font-size: 11.5px;
}

.pager-link strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.pager-link.next {
  text-align: right;
  grid-column: 2;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 40px 34px;
  border-top: 1px solid var(--line-soft);
  color: var(--dim);
  font-size: 12px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  margin-left: 16px;
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

/* Search */

.search-layer[hidden] {
  display: none;
}

.search-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10vh 20px 20px;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 4, 9, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: default;
}

.search-dialog {
  position: relative;
  width: min(100%, 680px);
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(17, 24, 40, 0.96), rgba(8, 12, 21, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  animation: dialog-in 0.22s var(--ease);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.search-field svg {
  width: 19px;
  height: 19px;
  color: var(--muted);
  flex-shrink: 0;
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.search-field input::placeholder {
  color: var(--dim);
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.search-empty {
  padding: 28px 18px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.search-result {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.search-result:hover,
.search-result.active {
  background: var(--accent-soft);
  border-color: rgba(109, 151, 255, 0.18);
}

.search-result .result-page {
  display: block;
  margin-bottom: 2px;
  color: var(--dim);
  font-size: 11px;
}

.search-result .result-title {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.search-result .result-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.search-result mark {
  background: rgba(109, 151, 255, 0.22);
  color: var(--accent-strong);
  border-radius: 3px;
  padding: 0 1px;
}

.search-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--dim);
  font-size: 11px;
}

.search-foot span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.search-foot a {
  margin-left: auto;
  color: var(--muted);
}

/* Home */

.home .topbar {
  position: sticky;
  background: rgba(5, 7, 13, 0.55);
  border-bottom-color: transparent;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 700px at 18% -12%, rgba(64, 104, 235, 0.24), transparent 60%),
    radial-gradient(900px 600px at 96% 6%, rgba(65, 205, 190, 0.1), transparent 62%),
    radial-gradient(700px 500px at 55% 45%, rgba(109, 151, 255, 0.05), transparent 70%);
}

.home-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: 14px;
  font-size: 13.5px;
}

.home-nav a {
  color: var(--muted);
  transition: color 0.18s;
}

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

.btn-small {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--glass);
  color: var(--text-soft);
  font-size: 13px;
  transition: border-color 0.2s, background 0.2s;
}

.btn-small:hover {
  border-color: var(--line-strong);
  background: var(--glass-strong);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  align-items: center;
  gap: 64px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 96px 40px 92px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13px;
}

.hero h1 {
  max-width: 12ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 5.6vw, 5.2rem);
  font-weight: 600;
  line-height: 0.99;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero-lead {
  max-width: 52ch;
  margin: 26px 0 0;
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1.66;
}

.hero-lead code {
  padding: 1px 5px;
  border: 1px solid rgba(109, 151, 255, 0.2);
  border-radius: 5px;
  background: rgba(109, 151, 255, 0.09);
  color: #cfe0ff;
  font-family: var(--font-mono);
  font-size: 0.87em;
}

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

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.18s var(--ease), background 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #05070d;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px rgba(50, 90, 220, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.btn-primary svg,
.text-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--text-soft);
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  background: var(--glass-strong);
  transform: translateY(-1px);
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 46px 0 0;
  padding: 0;
}

.hero-facts div {
  padding: 0 26px;
  border-left: 1px solid var(--line);
}

.hero-facts div:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-facts dt {
  color: var(--dim);
  font-size: 11px;
  line-height: 1.6;
}

.hero-facts dd {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 13px;
}

.package-card {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015) 42%),
    rgba(8, 12, 21, 0.7);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  transform: perspective(1400px) rotateY(-3deg) rotateX(1.5deg);
  animation: card-in 0.9s var(--ease) both 0.15s;
}

@keyframes card-in {
  from { opacity: 0; transform: perspective(1400px) rotateY(-3deg) rotateX(1.5deg) translateY(18px) scale(0.98); }
  to { opacity: 1; transform: perspective(1400px) rotateY(-3deg) rotateX(1.5deg); }
}

.package-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.05) 44%, transparent 58%);
}

.package-head,
.package-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.025);
}

.package-head {
  border-bottom: 1px solid var(--line-soft);
}

.traffic {
  display: flex;
  gap: 5px;
}

.traffic i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(151, 171, 209, 0.22);
}

.package-name {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.package-state {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid rgba(86, 217, 201, 0.3);
  border-radius: 99px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 10.5px;
}

.package-tree {
  padding: 10px 10px 12px;
}

.tree-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  animation: row-in 0.5s var(--ease) both;
}

.tree-row:nth-child(1) { animation-delay: 0.32s; }
.tree-row:nth-child(2) { animation-delay: 0.4s; }
.tree-row:nth-child(3) { animation-delay: 0.48s; }
.tree-row:nth-child(4) { animation-delay: 0.56s; }
.tree-row:nth-child(5) { animation-delay: 0.64s; }

@keyframes row-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}

.tree-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.022);
}

.tree-kind {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.tree-kind.manifest { color: #9fb8ff; border-color: rgba(109, 151, 255, 0.3); background: rgba(109, 151, 255, 0.1); }
.tree-kind.script { color: #c8b6ff; border-color: rgba(173, 145, 255, 0.28); background: rgba(173, 145, 255, 0.09); }
.tree-kind.asset { color: #8ee6c8; border-color: rgba(86, 217, 201, 0.28); background: rgba(86, 217, 201, 0.08); }
.tree-kind.sign { color: #f0c987; border-color: rgba(231, 179, 107, 0.28); background: rgba(231, 179, 107, 0.08); }

.tree-name {
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-note {
  color: var(--dim);
  font-size: 11px;
}

.package-foot {
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11.5px;
}

.package-foot svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 84px 40px;
  border-top: 1px solid var(--line-soft);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px 60px;
  align-items: end;
  margin-bottom: 34px;
}

.section-head h2 {
  max-width: 18ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.section-head p {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

.path-list {
  border-top: 1px solid var(--line);
}

.path-row {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 120px;
  gap: 28px;
  align-items: center;
  padding: 24px 16px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.2s, padding 0.2s var(--ease);
}

.path-row:hover {
  padding-left: 22px;
  background: rgba(255, 255, 255, 0.025);
}

.path-name {
  display: flex;
  align-items: center;
  gap: 14px;
}

.path-name strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.path-name small {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
}

.kind-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
}

.kind-mark.ts { color: #9fb8ff; background: rgba(109, 151, 255, 0.09); border-color: rgba(109, 151, 255, 0.28); }
.kind-mark.java { color: #f0c987; background: rgba(231, 179, 107, 0.08); border-color: rgba(231, 179, 107, 0.24); }
.kind-mark.hybrid { color: #c8b6ff; background: rgba(173, 145, 255, 0.08); border-color: rgba(173, 145, 255, 0.24); }

.path-row p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.path-row p code {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.trust {
  justify-self: end;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 11px;
  white-space: nowrap;
}

.trust.sandboxed {
  color: var(--teal);
  border-color: rgba(86, 217, 201, 0.26);
  background: var(--teal-soft);
}

.trust.trusted {
  color: var(--amber);
  border-color: rgba(231, 179, 107, 0.24);
  background: rgba(231, 179, 107, 0.07);
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
}

.capability {
  padding: 22px 0 26px;
  border-top: 1px solid var(--line);
}

.capability h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.capability p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.agents {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  gap: 70px;
  align-items: center;
}

.agents h2 {
  max-width: 16ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.agents-copy > p {
  max-width: 54ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

.agent-list {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.agent-list li {
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.agent-list span {
  display: inline-block;
  min-width: 76px;
  margin-right: 10px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 12px;
}

.agent-list code {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 24px;
  color: var(--accent-strong);
  font-size: 14px;
}

.text-link:hover {
  color: #c3d3ff;
}

.terminal-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(4, 7, 13, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 30px 70px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.terminal-head {
  display: flex;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
}

.terminal-dots {
  letter-spacing: 2px;
}

.terminal-card pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  color: #c8d3e8;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.8;
}

.t-dim {
  color: var(--dim);
}

.home-footer {
  max-width: 1240px;
}

.not-found-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 14vh 32px 80px;
}

.not-found-main .brand {
  margin-bottom: 60px;
}

.not-found-main h1 {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

/* Responsive */

@media (max-width: 1180px) {
  .toc {
    display: none;
  }

  .content-wrap {
    padding: 0 32px;
  }

  .hero {
    gap: 44px;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  }
}

@media (max-width: 980px) {
  .home-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 54px;
    padding-top: 72px;
  }

  .hero h1 {
    max-width: 14ch;
  }

  .package-card {
    width: min(100%, 560px);
    transform: none;
    animation-name: card-in-flat;
  }

  @keyframes card-in-flat {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to { opacity: 1; transform: none; }
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agents {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .path-row {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .trust {
    display: none;
  }
}

@media (max-width: 860px) {
  :root {
    --topbar: 58px;
  }

  .topbar {
    padding: 0 16px;
  }

  .crumbs {
    display: none;
  }

  .search-trigger span,
  .search-trigger kbd {
    display: none;
  }

  .search-trigger {
    padding: 8px;
  }

  .menu-toggle {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: var(--topbar);
    bottom: 0;
    left: 0;
    z-index: 80;
    height: auto;
    background: rgba(6, 9, 16, 0.97);
    backdrop-filter: blur(20px);
    transform: translateX(-100%);
    transition: transform 0.28s var(--ease);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.4);
  }

  body.sidebar-open .sidebar {
    transform: none;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: var(--topbar) 0 0;
    z-index: 70;
    display: block;
    border: 0;
    background: rgba(2, 4, 9, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .content-wrap {
    padding: 0 22px;
  }

  .article {
    padding-top: 40px;
  }

  .home .topbar .btn-small {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero,
  .section {
    padding-left: 20px;
    padding-right: 20px;
  }

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

  .hero h1 {
    font-size: clamp(2.65rem, 11vw, 3.6rem);
  }

  .hero-lead {
    font-size: 15.5px;
  }

  .hero-facts div {
    padding: 0 16px;
  }

  .hero-facts dt {
    font-size: 10px;
  }

  .capability-grid {
    grid-template-columns: 1fr;
  }

  .path-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px 4px;
  }

  .path-row:hover {
    padding-left: 4px;
    background: none;
  }

  .section {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .content-wrap {
    padding: 0 18px;
  }

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

  .prose {
    font-size: 15px;
  }

  .prose h2 {
    font-size: 20px;
  }

  .prose h3 {
    font-size: 17px;
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .pager-link.next {
    grid-column: 1;
    text-align: left;
  }

  .site-footer {
    padding: 22px 20px 30px;
  }

  .site-footer p:last-child a:first-child {
    margin-left: 0;
  }

  .search-layer {
    padding: 4vh 12px 12px;
  }

  .search-dialog {
    max-height: 86vh;
  }

  .search-foot span:nth-child(2) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .topbar,
  .sidebar,
  .toc,
  .pager,
  .site-footer,
  .search-layer {
    display: none;
  }

  body {
    background: #fff;
    color: #111;
  }

  .content-wrap,
  .article {
    max-width: none;
    padding: 0;
  }

  .prose {
    color: #222;
  }
}
