:root {
  color-scheme: dark;
  --bg: #08090b;
  --panel: #101216;
  --line: #252831;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --soft: #d4d4d8;
  --accent: #7dd3fc;
  --green: #86efac;
  --pink: #f0abfc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.65;
}

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

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.92);
  backdrop-filter: blur(18px);
}

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

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  font-size: 24px;
  line-height: 1;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.topnav a {
  color: var(--soft);
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  max-width: 1240px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow: auto;
  padding: 32px 24px 48px;
  border-right: 1px solid var(--line);
}

.nav-section {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.nav-section p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-section a {
  color: var(--soft);
  font-size: 14px;
}

.content {
  min-width: 0;
  max-width: 980px;
  padding: 52px 48px 96px;
}

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

h1,
h2,
h3,
h4 {
  line-height: 1.2;
}

h1 {
  margin: 0 0 18px;
  font-size: 44px;
  letter-spacing: 0;
}

h2 {
  margin-top: 44px;
  padding-top: 8px;
  font-size: 28px;
}

h3 {
  margin-top: 32px;
  font-size: 20px;
}

p,
li {
  color: var(--soft);
}

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

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151820;
  color: var(--green);
  padding: 0.12em 0.35em;
  font-size: 0.9em;
}

pre {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1016;
  padding: 18px;
}

pre code {
  border: 0;
  background: transparent;
  padding: 0;
  color: #e4e4e7;
}

table {
  display: block;
  width: 100%;
  overflow: auto;
  border-collapse: collapse;
  margin: 20px 0;
}

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

th {
  background: var(--panel);
  color: var(--text);
}

td {
  color: var(--soft);
}

blockquote {
  margin: 24px 0;
  border-left: 3px solid var(--pink);
  padding: 8px 0 8px 18px;
  color: var(--soft);
}

.callout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.mermaid {
  margin: 24px 0 30px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 0%, rgba(125, 211, 252, 0.08), transparent 32rem),
    #0d1016;
  padding: 22px;
}

.mermaid svg {
  min-width: min(760px, 100%);
  max-width: none;
  height: auto;
}

.content > .mermaid + p,
.content > .mermaid + ul,
.content > .mermaid + table {
  margin-top: 18px;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 20px;
  }

  .topnav {
    flex-wrap: wrap;
  }

  .shell {
    display: block;
  }

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

  .content {
    padding: 34px 20px 72px;
  }

  h1 {
    font-size: 34px;
  }
}
