:root {
  --bg: #11130f;
  --panel: #171a15;
  --panel-2: #1e221c;
  --line: #32382d;
  --line-strong: #4b5543;
  --text: #e5e7dc;
  --muted: #9da491;
  --green: #69c27d;
  --cyan: #61c3cf;
  --gold: #d8b45d;
  --red: #e66a61;
  --input: #0c0e0b;
  --focus: rgba(97, 195, 207, 0.24);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    linear-gradient(135deg, rgba(97, 195, 207, 0.08), transparent 34rem),
    linear-gradient(215deg, rgba(216, 180, 93, 0.07), transparent 28rem),
    var(--bg);
  color: var(--text);
}

a {
  color: var(--cyan);
}

a:hover {
  color: white;
}

code,
pre {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

code {
  color: var(--gold);
}

.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: 16px;
  padding: 10px 14px;
  background: #151812;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--gold);
  font-weight: 800;
  background: #222016;
}

.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;
  gap: 8px;
}

.doc-button {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-2);
  text-decoration: none;
}

.doc-button:hover {
  border-color: var(--cyan);
}

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

.doc-nav {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 26, 21, 0.92);
}

.doc-nav a {
  display: block;
  padding: 8px 9px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}

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

.doc-nav a.active {
  color: var(--gold);
  background: #242113;
}

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

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

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

.doc-hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.02;
  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: 24px 0;
  border-bottom: 1px solid var(--line);
}

.doc-section h2 {
  margin: 0 0 10px;
  font-size: 22px;
  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: 12px;
  margin-top: 14px;
}

.doc-tile {
  min-height: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 26, 21, 0.78);
  color: var(--text);
  text-decoration: none;
}

.doc-tile:hover {
  border-color: var(--cyan);
  background: rgba(30, 34, 28, 0.95);
}

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

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

.doc-note {
  padding: 12px;
  border-left: 3px solid var(--cyan);
  background: rgba(97, 195, 207, 0.08);
}

.doc-warning {
  padding: 12px;
  border-left: 3px solid var(--gold);
  background: rgba(216, 180, 93, 0.08);
}

.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: 999px;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.28), transparent 24%),
    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: 12px;
  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 {
    flex-wrap: wrap;
  }

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

  .doc-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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