:root {
  color-scheme: dark;
  --bg: #070b14;
  --surface: #0d1422;
  --surface-2: #111b2d;
  --surface-3: #162238;
  --line: rgba(124, 155, 202, 0.2);
  --line-strong: rgba(55, 215, 255, 0.46);
  --text: #f4f8ff;
  --muted: #9aaac2;
  --cyan: #32d9ff;
  --cyan-soft: rgba(50, 217, 255, 0.12);
  --magenta: #da4dff;
  --orange: #ff9c42;
  --green: #4ee7a8;
  --danger: #ff647c;
  --header-height: 68px;
  font-family: "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(50, 217, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50, 217, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
  color: var(--text);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

code,
kbd {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

.docs-topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  grid-template-columns: minmax(190px, 270px) minmax(260px, 680px) auto;
  min-height: var(--header-height);
  align-items: center;
  gap: 24px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(18px);
}

.docs-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.docs-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.docs-brand span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.docs-brand strong,
.docs-brand small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-brand strong {
  font-size: 0.94rem;
}

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

.docs-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.docs-search:focus-within {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(50, 217, 255, 0.08);
}

.docs-search span {
  color: var(--cyan);
  font-size: 1.5rem;
  line-height: 1;
}

.docs-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.docs-search input::placeholder {
  color: #6f809a;
}

.docs-search kbd {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
}

.docs-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.docs-back-link,
.docs-icon-button {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.docs-back-link {
  padding: 0 15px;
}

.docs-icon-button {
  display: none;
  width: 42px;
  cursor: pointer;
}

.docs-back-link:hover,
.docs-icon-button:hover {
  border-color: var(--line-strong);
}

.docs-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  width: min(100%, 1600px);
  min-height: calc(100vh - var(--header-height));
  margin: 0 auto;
}

.docs-sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow: auto;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(9, 15, 26, 0.76);
  scrollbar-width: thin;
  scrollbar-color: rgba(50, 217, 255, 0.35) transparent;
}

.docs-sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 12px;
  color: #6f809a;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.docs-sidebar-heading button {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 1.6rem;
}

.docs-nav {
  display: grid;
  gap: 3px;
}

.docs-nav p {
  margin: 19px 9px 6px;
  color: #71819a;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-nav a {
  position: relative;
  padding: 9px 11px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.docs-nav a::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 0;
  width: 2px;
  border-radius: 3px;
  background: var(--cyan);
  content: "";
  opacity: 0;
}

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

.docs-nav a.is-active {
  background: var(--cyan-soft);
  color: var(--cyan);
}

.docs-nav a.is-active::before {
  opacity: 1;
}

.docs-sidebar-note {
  display: grid;
  gap: 5px;
  margin-top: 24px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.docs-sidebar-note strong {
  color: var(--cyan);
  font-size: 0.75rem;
}

.docs-sidebar-note span {
  color: var(--muted);
  font-size: 0.7rem;
}

.docs-scrim {
  display: none;
}

.docs-main {
  width: min(100%, 1050px);
  min-width: 0;
  margin: 0 auto;
  padding: 48px clamp(24px, 5vw, 72px) 80px;
}

.docs-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 42px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.docs-kicker {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.docs-intro h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.06;
}

.docs-intro p:not(.docs-kicker) {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.docs-intro-badge {
  display: grid;
  width: 126px;
  aspect-ratio: 1;
  place-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(50, 217, 255, 0.13), rgba(218, 77, 255, 0.12)),
    var(--surface);
  text-align: center;
  box-shadow: inset 0 0 32px rgba(50, 217, 255, 0.08);
}

.docs-intro-badge span {
  color: var(--cyan);
  font-size: 2rem;
  font-weight: 900;
}

.docs-intro-badge small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.docs-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.docs-stat-grid article {
  display: grid;
  gap: 5px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.docs-stat-grid strong {
  color: var(--cyan);
  font-size: 1.18rem;
}

.docs-stat-grid span {
  color: var(--muted);
  font-size: 0.7rem;
}

.docs-callout {
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 6px;
  background: var(--surface);
}

.docs-callout.info {
  border-left-color: var(--cyan);
}

.docs-callout.warning {
  border-left-color: var(--orange);
}

.docs-callout.danger {
  border-left-color: var(--danger);
}

.docs-callout strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.83rem;
}

.docs-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.docs-filter-row {
  position: sticky;
  z-index: 15;
  top: calc(var(--header-height) + 8px);
  display: flex;
  gap: 6px;
  margin: 28px 0 10px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 16, 28, 0.9);
  backdrop-filter: blur(14px);
}

.docs-filter-row button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}

.docs-filter-row button:hover,
.docs-filter-row button.is-active {
  background: var(--surface-3);
  color: var(--text);
}

.docs-filter-row button.is-active {
  box-shadow: inset 0 -2px var(--cyan);
}

.docs-results {
  min-height: 18px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.75rem;
}

.docs-content {
  display: grid;
}

.docs-content > .docs-section {
  min-width: 0;
  padding: 54px 0;
  border-bottom: 1px solid var(--line);
}

.docs-content > .docs-section[hidden] {
  display: none;
}

.docs-section header {
  margin-bottom: 22px;
}

.docs-section h2 {
  margin: 8px 0 9px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.docs-section h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.docs-section header p,
.docs-section > p,
.docs-section li {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.docs-section header p {
  max-width: 760px;
  margin: 0;
}

.docs-section ul,
.docs-section ol {
  display: grid;
  gap: 7px;
  padding-left: 22px;
}

.docs-section :not(pre) > code {
  padding: 2px 6px;
  border: 1px solid rgba(50, 217, 255, 0.14);
  border-radius: 4px;
  background: rgba(50, 217, 255, 0.07);
  color: #8ae9ff;
  font-size: 0.82em;
}

.docs-level {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-level.basic {
  color: var(--green);
}

.docs-level.medium {
  color: var(--cyan);
}

.docs-level.hard {
  color: var(--magenta);
}

pre {
  position: relative;
  overflow: auto;
  margin: 18px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #080d17;
  color: #d7e5f8;
  font-size: 0.79rem;
  line-height: 1.7;
  tab-size: 2;
  scrollbar-width: thin;
}

pre code {
  font-family: inherit;
}

.docs-copy-button {
  position: sticky;
  top: 0;
  float: right;
  min-height: 30px;
  margin: -10px -10px 8px 12px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
}

.docs-copy-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.docs-file-tree {
  display: grid;
  gap: 3px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.docs-file-tree code {
  color: #b9c7db;
  font-size: 0.8rem;
}

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

.docs-two-columns > div,
.docs-check-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.docs-check-grid article {
  display: grid;
  gap: 6px;
}

.docs-check-grid strong {
  color: var(--cyan);
  font-size: 0.86rem;
}

.docs-check-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.docs-checklist {
  display: grid;
  gap: 7px;
}

.docs-checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
}

.docs-checklist input {
  accent-color: var(--cyan);
}

.docs-empty {
  margin-top: 40px;
  padding: 54px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  text-align: center;
}

.docs-empty strong {
  font-size: 1.1rem;
}

.docs-empty p {
  color: var(--muted);
  font-size: 0.84rem;
}

.docs-empty button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--cyan-soft);
  color: var(--cyan);
  cursor: pointer;
  font-weight: 700;
}

.docs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 36px;
  color: var(--muted);
  font-size: 0.72rem;
}

.docs-footer p {
  max-width: 590px;
  margin: 0;
  line-height: 1.6;
}

.docs-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.docs-footer a {
  color: var(--cyan);
  text-decoration: none;
}

.docs-toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.docs-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  :root {
    --header-height: 126px;
  }

  .docs-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding-inline: 14px;
  }

  .docs-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .docs-icon-button {
    display: inline-grid;
  }

  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: fixed;
    z-index: 80;
    top: 0;
    left: 0;
    width: min(320px, 88vw);
    height: 100vh;
    border-right-color: var(--line-strong);
    background: #09101d;
    transform: translateX(-104%);
    transition: transform 220ms ease;
  }

  .docs-sidebar.is-open {
    transform: translateX(0);
  }

  .docs-sidebar-heading button {
    display: block;
  }

  .docs-scrim {
    position: fixed;
    z-index: 70;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.62);
  }

  .docs-scrim.is-visible {
    display: block;
  }

  .docs-main {
    padding-top: 36px;
  }
}

@media (max-width: 680px) {
  .docs-back-link {
    display: none;
  }

  .docs-intro {
    grid-template-columns: 1fr;
  }

  .docs-intro-badge {
    display: none;
  }

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

  .docs-filter-row {
    overflow-x: auto;
  }

  .docs-filter-row button {
    flex: 0 0 auto;
  }

  .docs-two-columns,
  .docs-check-grid {
    grid-template-columns: 1fr;
  }

  .docs-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .docs-main {
    padding-inline: 16px;
  }

  .docs-stat-grid {
    grid-template-columns: 1fr;
  }

  pre {
    margin-inline: -6px;
    padding: 16px;
    font-size: 0.72rem;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
