:root {
  color-scheme: dark;
  --bg: #07110d;
  --bg-raised: #0a1711;
  --surface: #0d1c15;
  --surface-2: #11241b;
  --surface-3: #162c21;
  --text: #e7f4ec;
  --text-soft: #a8bdb0;
  --muted: #71877a;
  --line: rgba(164, 202, 178, 0.13);
  --line-strong: rgba(164, 202, 178, 0.23);
  --green: #5cf29a;
  --green-strong: #27d877;
  --green-soft: rgba(92, 242, 154, 0.1);
  --cyan: #69d5d0;
  --amber: #f3c969;
  --red: #ff786e;
  --code-bg: #050b08;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --sidebar-width: 306px;
  --toc-width: 230px;
  --header-height: 70px;
  --radius: 14px;
  --font-sans: Vazirmatn, Tahoma, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7f4;
  --bg-raised: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef4ef;
  --surface-3: #e4ede6;
  --text: #15251b;
  --text-soft: #475c4e;
  --muted: #708075;
  --line: rgba(24, 61, 37, 0.11);
  --line-strong: rgba(24, 61, 37, 0.2);
  --green: #087e43;
  --green-strong: #096c3c;
  --green-soft: rgba(8, 126, 67, 0.09);
  --cyan: #087b78;
  --amber: #9a6800;
  --red: #c13b33;
  --code-bg: #111d16;
  --shadow: 0 24px 70px rgba(28, 57, 38, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 30px);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 72% -10%, rgba(63, 198, 119, 0.09), transparent 33rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color 180ms ease, color 180ms ease;
}

body.menu-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reading-progress {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto auto;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 12px var(--green);
  transition: width 80ms linear;
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-raised) 86%, transparent);
  backdrop-filter: blur(18px);
}

.brand-wrap,
.topbar-actions,
.brand {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(92, 242, 154, 0.38);
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  font: 700 15px/1 var(--font-mono);
  box-shadow: inset 0 0 20px rgba(92, 242, 154, 0.05);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-copy strong {
  font: 700 16px/1.3 var(--font-mono);
  letter-spacing: -0.3px;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.topbar-actions {
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--green);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button[href] svg {
  fill: currentColor;
  stroke: none;
}

.moon-icon,
body[data-theme="light"] .sun-icon {
  display: none;
}

body[data-theme="light"] .moon-icon {
  display: block;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-left: 4px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: 11px/1 var(--font-mono);
  direction: ltr;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft), 0 0 12px rgba(92, 242, 154, 0.7);
}

.mobile-menu-button {
  display: none;
  margin-left: 8px;
}

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
  min-height: calc(100vh - var(--header-height));
  direction: ltr;
}

.sidebar,
.toc-panel,
.main-content {
  direction: rtl;
}

.sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-raised) 76%, transparent);
}

.sidebar-inner {
  min-height: 0;
  padding: 18px 14px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 45px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.terminal-cursor {
  width: 6px;
  height: 12px;
  background: var(--green);
  animation: blink 1s steps(1) infinite;
}

.search-box {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  height: 44px;
  margin-bottom: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box:focus-within {
  border-color: rgba(92, 242, 154, 0.55);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.search-box svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.search-box input {
  min-width: 0;
  flex: 1;
  padding: 0 9px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-box kbd {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--muted);
  font: 11px/1 var(--font-mono);
}

.search-meta {
  min-height: 21px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 10px;
}

.docs-nav {
  padding-bottom: 24px;
}

.nav-group {
  margin: 2px 0 6px;
}

.nav-group-header {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  text-align: right;
}

.nav-group-header:hover {
  background: var(--green-soft);
  color: var(--text);
}

.nav-group-header svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.nav-group.is-open .nav-group-header svg {
  transform: rotate(90deg);
}

.nav-group-header span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-group-header small {
  color: var(--muted);
  font: 9px/1 var(--font-mono);
}

.nav-items {
  display: none;
  margin: 0 22px 6px 0;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.nav-group.is-open .nav-items {
  display: block;
}

.nav-link {
  position: relative;
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-link.active {
  background: var(--green-soft);
  color: var(--green);
}

.nav-link.active::before {
  position: absolute;
  top: 50%;
  right: -12px;
  width: 3px;
  height: 18px;
  border-radius: 99px;
  background: var(--green);
  content: "";
  transform: translateY(-50%);
}

.sidebar-scrim {
  display: none;
}

.main-content {
  width: 100%;
  min-width: 0;
  max-width: 1080px;
  margin: 0 auto;
  padding: 52px clamp(24px, 4vw, 70px) 90px;
}

.toc-panel {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  padding: 34px 20px;
  border-left: 1px solid var(--line);
}

.toc-panel.is-empty {
  visibility: hidden;
}

.toc-sticky > strong {
  display: block;
  margin-bottom: 12px;
  color: var(--text-soft);
  font-size: 11px;
}

#tocNav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-right: 11px;
  border-right: 1px solid var(--line);
}

#tocNav a {
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease;
}

#tocNav a[data-level="3"] {
  padding-right: 18px;
}

#tocNav a:hover,
#tocNav a.active {
  background: var(--green-soft);
  color: var(--green);
}

.edit-link {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
}

.edit-link:hover {
  color: var(--green);
}

.edit-link svg {
  width: 14px;
  height: 14px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(390px, 1.1fr);
  align-items: center;
  gap: clamp(36px, 6vw, 78px);
  min-height: 465px;
  direction: rtl;
}

.hero-copy {
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font: 11px/1.5 var(--font-mono), var(--font-sans);
}

.eyebrow > span {
  width: 22px;
  height: 1px;
  background: var(--green);
}

.hero-copy h1 {
  margin: 19px 0 20px;
  font-size: clamp(42px, 5.2vw, 72px);
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 1.08;
}

.hero-copy h1 em {
  position: relative;
  color: var(--green);
  font-style: normal;
}

.hero-copy h1 em::after {
  position: absolute;
  right: 3px;
  bottom: 1px;
  width: 88%;
  height: 4px;
  border-radius: 99px;
  background: var(--green);
  content: "";
  opacity: 0.42;
}

.hero-copy > p {
  max-width: 520px;
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  background: var(--green);
  color: #062012;
  box-shadow: 0 10px 28px rgba(50, 218, 119, 0.17);
}

.primary-button:hover {
  background: color-mix(in srgb, var(--green) 88%, white);
  box-shadow: 0 13px 34px rgba(50, 218, 119, 0.25);
  transform: translateY(-2px);
}

.primary-button svg {
  width: 16px;
  height: 16px;
}

.secondary-button {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text-soft);
}

.secondary-button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.terminal-window {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: #050b08;
  box-shadow: var(--shadow), 0 0 0 1px rgba(92, 242, 154, 0.04) inset;
  color: #bfd1c5;
  direction: ltr;
  transform: perspective(1100px) rotateY(-2deg) rotateX(1deg);
  transition: transform 300ms ease;
}

.terminal-window:hover {
  transform: perspective(1100px) rotateY(0) rotateX(0) translateY(-3px);
}

.terminal-titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 42px;
  padding: 0 13px;
  border-bottom: 1px solid #19271f;
  background: #0d1711;
  color: #6f8377;
  font: 10px/1 var(--font-mono);
}

.window-dots {
  display: flex;
  gap: 6px;
}

.window-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff665c;
}

.window-dots i:nth-child(2) {
  background: #f2bd47;
}

.window-dots i:nth-child(3) {
  background: #42cc72;
}

.terminal-body {
  min-height: 335px;
  padding: 25px 25px 30px;
  background:
    linear-gradient(rgba(92, 242, 154, 0.015) 50%, transparent 50%),
    #050b08;
  background-size: 100% 4px;
  font: 12px/1.8 var(--font-mono);
}

.terminal-body p {
  margin: 0 0 8px;
}

.prompt {
  color: #5cf29a;
}

.path {
  color: #69d5d0;
}

.terminal-output {
  padding-left: 14px;
  color: #8fa095;
}

.roadmap-output {
  display: grid;
  gap: 5px;
  margin: 4px 0 15px;
  padding: 13px 14px;
  border-left: 2px solid #1d5233;
  background: #08110c;
}

.roadmap-output span {
  color: #aabbb0;
}

.roadmap-output b {
  margin-right: 10px;
  color: #4d8060;
  font-weight: 400;
}

.typing-command {
  display: inline-block;
  width: 0;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
  animation: typing 2.6s steps(16) 0.5s forwards;
}

.block-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 3px;
  background: #5cf29a;
  vertical-align: -2px;
  animation: blink 0.9s steps(1) infinite;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 34px 0 86px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-card {
  position: relative;
  display: flex;
  min-height: 108px;
  align-items: center;
  gap: 14px;
  padding: 21px 24px;
}

.stat-card + .stat-card {
  border-right: 1px solid var(--line);
}

.stat-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  font: 600 14px/1 var(--font-mono);
}

.stat-copy {
  display: flex;
  flex-direction: column;
}

.stat-copy strong {
  font: 700 24px/1.25 var(--font-mono);
}

.stat-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.topics-section {
  padding-bottom: 50px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 25px;
}

.section-heading h2 {
  margin: 10px 0 0;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -1.2px;
}

.section-command {
  color: var(--muted);
  font: 11px/1 var(--font-mono);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.topic-card {
  position: relative;
  min-height: 138px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: right;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.topic-card::after {
  position: absolute;
  top: -35px;
  left: -35px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--green-soft);
  content: "";
  filter: blur(2px);
  transition: transform 220ms ease;
}

.topic-card:hover {
  border-color: rgba(92, 242, 154, 0.35);
  background: color-mix(in srgb, var(--surface) 82%, var(--green-soft));
  transform: translateY(-3px);
}

.topic-card:hover::after {
  transform: scale(1.25);
}

.topic-index {
  color: var(--green);
  font: 10px/1 var(--font-mono);
}

.topic-card strong {
  display: block;
  margin: 13px 0 5px;
  font-size: 14px;
}

.topic-card small {
  color: var(--muted);
  font-size: 10px;
}

.document-view {
  max-width: 820px;
  margin: 0 auto;
}

.document-toolbar {
  margin-bottom: 35px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--green);
}

.breadcrumbs .separator {
  font-family: var(--font-mono);
  opacity: 0.45;
}

.document-meta {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font: 10px/1 var(--font-mono), var(--font-sans);
}

.markdown-body {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 2.05;
  overflow-wrap: anywhere;
}

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

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  position: relative;
  color: var(--text);
  font-weight: 800;
  line-height: 1.55;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.markdown-body h1 {
  margin: 0 0 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(30px, 4.3vw, 47px);
  letter-spacing: -1.4px;
}

.markdown-body h1::before {
  display: inline-block;
  margin-left: 10px;
  color: var(--green);
  content: "#";
  font-family: var(--font-mono);
  font-weight: 400;
  opacity: 0.65;
}

.markdown-body h2 {
  margin: 52px 0 18px;
  padding: 0 13px 0 0;
  border-right: 3px solid var(--green);
  font-size: 25px;
}

.markdown-body h3 {
  margin: 36px 0 12px;
  font-size: 19px;
}

.markdown-body h4 {
  margin: 28px 0 10px;
  font-size: 16px;
}

.heading-anchor {
  position: absolute;
  top: 50%;
  left: 100%;
  padding: 0 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 14px/1 var(--font-mono);
  opacity: 0;
  transform: translateY(-50%);
}

.markdown-body h1:hover .heading-anchor,
.markdown-body h2:hover .heading-anchor,
.markdown-body h3:hover .heading-anchor {
  opacity: 1;
}

.markdown-body p {
  margin: 14px 0;
}

.markdown-body a {
  color: var(--green);
  text-decoration-color: color-mix(in srgb, var(--green) 40%, transparent);
  text-underline-offset: 4px;
}

.markdown-body strong {
  color: var(--text);
  font-weight: 750;
}

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

.markdown-body blockquote {
  margin: 24px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-right: 3px solid var(--cyan);
  border-radius: 8px 0 0 8px;
  background: color-mix(in srgb, var(--surface) 86%, var(--cyan) 4%);
  color: var(--text-soft);
}

.markdown-body blockquote p {
  margin: 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-right: 23px;
}

.markdown-body li {
  margin: 7px 0;
  padding-right: 5px;
}

.markdown-body li::marker {
  color: var(--green);
}

.markdown-body code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  direction: ltr;
  font: 0.86em/1.7 var(--font-mono);
  unicode-bidi: embed;
}

.code-shell {
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid #1a2c21;
  border-radius: 11px;
  background: var(--code-bg);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.13);
  direction: ltr;
}

.code-toolbar {
  display: flex;
  height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px 0 14px;
  border-bottom: 1px solid #1a2c21;
  background: #0d1711;
  color: #6f8377;
  font: 9px/1 var(--font-mono);
}

.code-language::before {
  margin-right: 7px;
  color: #5cf29a;
  content: "●";
}

.copy-code {
  padding: 5px 8px;
  border: 1px solid #21382a;
  border-radius: 5px;
  background: #111e16;
  color: #819488;
  cursor: pointer;
  font: 9px/1 var(--font-mono);
}

.copy-code:hover {
  border-color: #315a40;
  color: #5cf29a;
}

.markdown-body pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  background: var(--code-bg);
  text-align: left;
  direction: ltr;
  scrollbar-color: #264432 transparent;
}

.markdown-body pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c7d6cc;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre;
}

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

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.markdown-body th,
.markdown-body td {
  min-width: 110px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.markdown-body th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
}

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

.markdown-body tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.markdown-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 28px auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.markdown-body mark {
  padding: 0 4px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--amber) 24%, transparent);
  color: var(--text);
}

.page-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 70px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.page-nav-link {
  display: flex;
  min-width: 0;
  min-height: 86px;
  flex-direction: column;
  justify-content: center;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.page-nav-link:hover {
  border-color: rgba(92, 242, 154, 0.35);
  transform: translateY(-2px);
}

.page-nav-link:last-child {
  text-align: left;
}

.page-nav-link small {
  margin-bottom: 5px;
  color: var(--green);
  font-size: 9px;
}

.page-nav-link strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading-document {
  display: grid;
  min-height: 50vh;
  place-items: center;
}

.loading-document span {
  color: var(--green);
  font: 12px/1 var(--font-mono);
}

.loading-document span::after {
  content: "_";
  animation: blink 0.8s steps(1) infinite;
}

.error-view {
  min-height: 60vh;
  place-items: center;
  align-content: center;
  text-align: center;
}

.error-view:not([hidden]) {
  display: grid;
}

.error-code {
  color: var(--green);
  font: 800 clamp(70px, 12vw, 140px)/1 var(--font-mono);
  opacity: 0.2;
}

.error-view h1 {
  margin: -15px 0 4px;
  font-size: 28px;
}

.error-view p {
  margin: 0 0 25px;
  color: var(--muted);
  font-size: 12px;
}

.back-to-top {
  position: fixed;
  z-index: 40;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--green);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top svg {
  width: 17px;
  height: 17px;
}

.toast {
  position: fixed;
  z-index: 90;
  bottom: 25px;
  left: 50%;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

[hidden] {
  display: none !important;
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes typing {
  to { width: 16ch; }
}

@media (max-width: 1180px) {
  :root {
    --toc-width: 205px;
    --sidebar-width: 285px;
  }

  .main-content {
    padding-right: 36px;
    padding-left: 36px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    max-width: 720px;
    margin: 0 auto;
    padding-top: 20px;
  }

  .hero-copy {
    max-width: 650px;
  }

  .terminal-window {
    transform: none;
  }
}

@media (max-width: 980px) {
  .app-layout {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .toc-panel {
    display: none;
  }

  .main-content {
    max-width: 900px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 62px;
  }

  .topbar {
    padding: 0 13px;
  }

  .mobile-menu-button {
    display: grid;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-copy strong {
    font-size: 13px;
  }

  .brand-copy small,
  .status-pill {
    display: none;
  }

  .app-layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 70;
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;
    width: min(88vw, 330px);
    height: 100vh;
    border: 0;
    border-right: 1px solid var(--line-strong);
    background: var(--bg-raised);
    box-shadow: var(--shadow);
    transform: translateX(-103%);
    transition: transform 220ms ease;
  }

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

  .sidebar-inner {
    padding-top: 18px;
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 60;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

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

  .main-content {
    padding: 34px 18px 75px;
  }

  .hero-grid {
    min-height: auto;
    gap: 38px;
    padding-top: 8px;
  }

  .hero-copy h1 {
    margin-top: 14px;
    font-size: clamp(39px, 13vw, 59px);
    letter-spacing: -2px;
  }

  .hero-copy > p {
    font-size: 13px;
  }

  .terminal-body {
    min-height: 310px;
    padding: 20px 16px 24px;
    font-size: 10px;
  }

  .terminal-titlebar {
    font-size: 9px;
  }

  .stats-row {
    grid-template-columns: 1fr;
    margin: 48px 0 68px;
  }

  .stat-card {
    min-height: 86px;
  }

  .stat-card + .stat-card {
    border-top: 1px solid var(--line);
    border-right: 0;
  }

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

  .section-command {
    display: none;
  }

  .document-toolbar {
    margin-bottom: 27px;
  }

  .markdown-body {
    font-size: 14px;
    line-height: 2;
  }

  .markdown-body h1 {
    font-size: 31px;
  }

  .markdown-body h2 {
    margin-top: 42px;
    font-size: 22px;
  }

  .markdown-body h3 {
    font-size: 18px;
  }

  .heading-anchor {
    display: none;
  }

  .markdown-body pre {
    padding: 16px;
  }

  .markdown-body pre code {
    font-size: 11px;
  }

  .page-navigation {
    grid-template-columns: 1fr;
    margin-top: 55px;
  }

  .page-nav-link:last-child {
    text-align: right;
  }

  .back-to-top {
    right: 15px;
    bottom: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
