:root {
  --bg: #080a0b;
  --surface: #0d1012;
  --panel: #111518;
  --panel-2: #171c20;
  --panel-3: #1d2428;
  --line: #273038;
  --line-strong: #3a4650;
  --text: #edf2f4;
  --muted: #94a3aa;
  --green: #68d391;
  --cyan: #63d4e6;
  --gold: #e2bf6b;
  --red: #ff746d;
  --input: #07090a;
  --focus: rgba(99, 212, 230, 0.22);
  --shadow: rgba(0, 0, 0, 0.35);
  --scrollbar-track: #07090a;
  --scrollbar-thumb: #34414a;
  --scrollbar-thumb-hover: #50616d;
  --terminal-font-family: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}

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

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid var(--scrollbar-track);
  border-radius: 4px;
  background: var(--scrollbar-thumb);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--surface);
  color: var(--text);
}

a {
  color: var(--cyan);
  text-decoration-color: rgba(99, 212, 230, 0.48);
  text-underline-offset: 3px;
}

a:hover {
  color: white;
  text-decoration-color: currentColor;
}

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

pre {
  overflow: auto;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

code {
  color: var(--gold);
  overflow-wrap: anywhere;
}

pre code {
  color: var(--text);
  overflow-wrap: normal;
}

strong {
  color: white;
}

.doc-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.doc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 18, 0.98);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025), 0 12px 28px rgba(0, 0, 0, 0.24);
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--gold);
  font-weight: 800;
  background: #211d12;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

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

.doc-button {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.018);
  text-decoration: none;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.doc-button:hover {
  border-color: var(--cyan);
  color: white;
  background: var(--panel-2);
}

.doc-layout {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 14px 44px;
}

.doc-sidebar {
  min-height: 100vh;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.doc-sidebar + .doc-main {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 18px 14px 44px;
}

.doc-content {
  min-width: 0;
}

.doc-nav,
[data-doc-nav] {
  position: sticky;
  top: 14px;
  align-self: start;
  display: grid;
  gap: 5px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1012;
}

.doc-search {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  margin-bottom: 4px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--line);
}

.doc-search-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.doc-search input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--input);
  font: inherit;
  outline: none;
}

.doc-search input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--focus);
}

.doc-search-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
}

.doc-search-results {
  display: grid;
  gap: 6px;
}

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

[data-doc-nav].searching > a {
  display: none;
}

.doc-nav .doc-search-result,
[data-doc-nav] .doc-search-result {
  min-height: 0;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-color: var(--line);
  background: #101518;
}

.doc-nav .doc-search-result strong,
[data-doc-nav] .doc-search-result strong {
  color: white;
  font-size: 13px;
}

.doc-nav .doc-search-result span,
[data-doc-nav] .doc-search-result span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.doc-search-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

.doc-sidebar [data-doc-nav] {
  position: static;
  max-height: none;
}

.doc-nav a,
[data-doc-nav] a {
  display: block;
  min-height: 34px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.doc-nav a:hover,
[data-doc-nav] a:hover {
  color: white;
  background: var(--panel-2);
}

.doc-nav a.active,
[data-doc-nav] a.active {
  border-color: rgba(99, 212, 230, 0.22);
  color: white;
  background: #17242a;
  box-shadow: inset 3px 0 0 var(--cyan);
}

.doc-nav .doc-search-results a.doc-search-result,
[data-doc-nav] .doc-search-results a.doc-search-result {
  min-height: 0;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-color: var(--line);
  background: #101518;
}

.doc-main {
  min-width: 0;
}

.doc-hero {
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--line);
}

.doc-eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.doc-hero h1 {
  max-width: 840px;
  margin: 0;
  font-size: clamp(32px, 4.8vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
}

.doc-hero p {
  max-width: 780px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.doc-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.doc-section h2 {
  margin: 0 0 10px;
  font-size: 21px;
  letter-spacing: 0;
}

.doc-section h3 {
  margin: 20px 0 8px;
  color: var(--gold);
  font-size: 16px;
  letter-spacing: 0;
}

.doc-section p,
.doc-section li {
  color: var(--text);
  line-height: 1.65;
}

.doc-section p {
  margin: 10px 0;
}

.doc-section ul,
.doc-section ol {
  margin: 10px 0 0;
  padding-left: 22px;
}

.doc-section li + li {
  margin-top: 7px;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.doc-tile {
  min-height: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101518;
  color: var(--text);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.doc-tile:hover {
  border-color: rgba(99, 212, 230, 0.45);
  background: #132128;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.doc-tile h3 {
  margin-top: 0;
}

.doc-tile p {
  color: var(--muted);
}

.doc-note,
.doc-warning {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
  background: #101518;
}

.doc-note {
  border-left: 3px solid var(--cyan);
}

.doc-warning {
  border-left: 3px solid var(--gold);
}

.color-reference {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}

.color-family h3 {
  margin-bottom: 12px;
}

.color-orbit {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-chip {
  width: 108px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: var(--swatch);
  color: var(--ink, #10120f);
  text-align: center;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

.color-chip code {
  color: inherit;
  font-size: 11px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.echo-syntax-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.doc-footer {
  padding-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 820px) {
  .doc-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .doc-actions {
    justify-content: flex-start;
  }

  .doc-layout {
    grid-template-columns: 1fr;
    padding: 14px 12px 36px;
  }

  .doc-sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .doc-sidebar + .doc-main {
    width: 100%;
    padding: 14px 12px 36px;
  }

  .doc-nav,
  [data-doc-nav] {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .doc-grid,
  .echo-syntax-grid {
    grid-template-columns: 1fr;
  }

  .color-chip {
    width: 94px;
  }
}

@media (max-width: 520px) {
  .doc-nav,
  [data-doc-nav] {
    grid-template-columns: 1fr;
  }

  .doc-hero h1 {
    font-size: 30px;
  }

  .doc-hero p {
    font-size: 16px;
  }
}
