:root {
  color-scheme: dark;
  --bg: #07080b;
  --panel: #10131a;
  --panel-2: #151921;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f7fb;
  --muted: #aeb7c8;
  --cyan: #47d7ff;
  --green: #5df5a4;
  --amber: #ffc857;
  --magenta: #f26df9;
  --red: #ff6978;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 6%, rgba(71, 215, 255, 0.16), transparent 28rem),
    radial-gradient(circle at 86% 18%, rgba(255, 200, 87, 0.13), transparent 26rem),
    linear-gradient(180deg, #07080b 0%, #0d0f14 46%, #07080b 100%);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 11, 0.82);
  backdrop-filter: blur(18px);
}

.brand,
.topbar nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  font-weight: 750;
}

.brand img {
  width: 2rem;
  height: 2rem;
}

.topbar nav a {
  color: var(--muted);
  font-size: 0.92rem;
}

.topbar nav a:hover {
  color: var(--text);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 28rem);
  gap: clamp(1rem, 4vw, 3rem);
  min-height: 88vh;
  padding: clamp(3rem, 8vw, 7rem) clamp(1rem, 5vw, 5rem) 4rem;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(71, 215, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(71, 215, 255, 0.10) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 82%);
}

.hero-content,
.telemetry-panel,
.section,
.status-strip,
.article-shell,
.footer {
  position: relative;
  z-index: 1;
}

.hero-logo {
  width: min(24rem, 70vw);
  margin-bottom: 2.25rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 58rem;
  margin-bottom: 1.2rem;
  font-size: clamp(2.6rem, 6vw, 5.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 44rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.hero-actions,
.status-strip,
.badge-row,
.topic-row,
.package-row,
.article-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.topic-row {
  gap: 0.45rem;
  margin: 0.55rem 0 0.85rem;
}

.hero-actions a {
  min-height: 2.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(71, 215, 255, 0.36);
  border-radius: 6px;
  padding: 0.58rem 0.9rem;
  background: rgba(71, 215, 255, 0.08);
  color: var(--text);
  font-weight: 720;
}

.hero-actions a:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(71, 215, 255, 0.12);
}

.hero-actions img,
.status-strip img,
.badge-row img {
  display: block;
  height: 20px;
}

.telemetry-panel {
  align-self: end;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.telemetry-panel div {
  min-height: 8rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(21, 25, 33, 0.94), rgba(8, 10, 14, 0.82));
  box-shadow: var(--shadow);
}

.telemetry-panel span {
  display: block;
  color: var(--amber);
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  font-weight: 850;
  line-height: 1;
}

.telemetry-panel strong {
  display: block;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
}

.status-strip {
  padding: 1rem clamp(1rem, 5vw, 5rem);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 19, 26, 0.78);
}

.section {
  padding: clamp(3rem, 7vw, 5rem) clamp(1rem, 5vw, 5rem);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  letter-spacing: 0;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.search-box {
  display: grid;
  gap: 0.35rem;
  width: min(100%, 34rem);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem 0.85rem;
  background: rgba(5, 6, 9, 0.72);
  color: var(--text);
  font: inherit;
  text-transform: none;
}

.search-box input:focus {
  outline: 2px solid rgba(71, 215, 255, 0.55);
  outline-offset: 2px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 6, 9, 0.52);
}

.segmented button {
  min-height: 2.25rem;
  border: 0;
  border-radius: 5px;
  padding: 0.45rem 0.75rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 720;
}

.segmented button.active {
  background: var(--cyan);
  color: #061017;
}

.repo-grid,
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
}

.repo-card,
.doc-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(16, 19, 26, 0.86);
  box-shadow: var(--shadow);
}

.repo-card[hidden],
.doc-card[hidden] {
  display: none;
}

.repo-banner {
  display: block;
  width: 100%;
  aspect-ratio: 7 / 2;
  object-fit: cover;
  background: #0d1117;
  border-bottom: 1px solid var(--line);
}

.text-banner {
  display: flex;
  align-items: center;
  padding: 1rem;
  color: var(--cyan);
  font-weight: 850;
}

.repo-card-body,
.doc-card {
  padding: 1rem;
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.repo-meta span,
.repo-meta a.docs-count,
.topic-row span,
.doc-card-tags span {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  padding: 0.18rem 0.48rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
}

.repo-meta a.docs-count {
  color: var(--cyan);
  border-color: rgba(71, 215, 255, 0.35);
}

.doc-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.docs-controls {
  align-items: end;
}

.docs-controls select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  background: rgba(7, 8, 11, 0.72);
  color: var(--text);
  font: inherit;
}

.repo-tagline,
.article-tagline {
  margin: 0 0 0.45rem;
  color: var(--cyan);
  font-size: 0.92rem;
  font-weight: 760;
}

.article-tagline {
  margin-top: 0.35rem;
  font-size: 1rem;
}

.repo-card h3,
.doc-card h3 {
  margin-bottom: 0.45rem;
  color: var(--text);
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.doc-card h3 a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.repo-card h3 a {
  color: var(--text);
}

.repo-card h3 a:hover,
.doc-card h3 a:hover,
.package-row a:hover,
.markdown-body a:hover,
.footer a:hover,
.btn-secondary:hover {
  color: var(--cyan);
}

.card-actions,
.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: auto;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.btn-primary {
  border: 1px solid rgba(71, 215, 255, 0.45);
  background: rgba(71, 215, 255, 0.16);
  color: var(--cyan);
}

.btn-primary:hover {
  background: rgba(71, 215, 255, 0.28);
}

.btn-secondary {
  border: 1px solid var(--line);
  color: var(--muted);
}

.docs-hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.repo-card p,
.doc-card p {
  color: var(--muted);
}

.package-row {
  align-items: stretch;
  margin-top: 0.8rem;
}

.package-row a {
  border: 1px solid rgba(93, 245, 164, 0.25);
  border-radius: 5px;
  padding: 0.24rem 0.45rem;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.quiet {
  color: var(--muted);
  font-size: 0.86rem;
}

.docs-section {
  background: linear-gradient(180deg, rgba(21, 25, 33, 0.38), transparent);
}

.doc-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.doc-card h3,
.doc-card p {
  margin-bottom: 0;
}

.article-shell {
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 1rem;
}

.article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 19, 26, 0.9);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 4vw, 3rem);
}

.article-kicker {
  margin-bottom: 0.65rem;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.article h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.article-actions {
  margin-bottom: 2rem;
}

.markdown-body {
  color: #e7ebf4;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin-top: 1.6em;
  line-height: 1.15;
}

.markdown-body a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.markdown-body code,
.markdown-body pre {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.markdown-body code {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 0.08rem 0.25rem;
  background: rgba(0, 0, 0, 0.34);
}

.markdown-body pre {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #050609;
}

.markdown-body pre code {
  border: 0;
  padding: 0;
  background: transparent;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  margin: 1rem 0;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  vertical-align: top;
}

.markdown-body th {
  color: var(--amber);
  background: rgba(255, 200, 87, 0.08);
}

.markdown-body blockquote {
  margin: 1rem 0;
  border-left: 3px solid var(--magenta);
  padding-left: 1rem;
  color: var(--muted);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1.2rem clamp(1rem, 5vw, 5rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .hero,
  .controls,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

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

  .controls,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

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

  .telemetry-panel {
    grid-template-columns: 1fr;
  }

  .segmented button {
    flex: 1 1 auto;
  }
}

/* Multi-page docs site layout */
.hero-compact {
  min-height: auto;
  padding-bottom: 2.5rem;
}

.docs-site .docs-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
  gap: 0;
  max-width: 96rem;
  margin: 0 auto;
  min-height: calc(100vh - 8rem);
}

.docs-nav {
  position: sticky;
  top: 3.6rem;
  align-self: start;
  max-height: calc(100vh - 3.6rem);
  overflow: auto;
  padding: 1.25rem 1rem 2rem;
  border-right: 1px solid var(--line);
  background: rgba(10, 12, 18, 0.72);
}

.docs-nav-repo {
  margin-bottom: 1rem;
  font-weight: 800;
  font-size: 1.05rem;
}

.docs-nav-repo a {
  color: var(--cyan);
}

.docs-nav-section {
  margin-bottom: 1.25rem;
}

.docs-nav-section h2 {
  margin: 0 0 0.45rem;
  color: var(--amber);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-nav li {
  margin: 0.15rem 0;
}

.docs-nav li a {
  display: block;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.docs-nav li a:hover,
.docs-nav li.active a {
  background: rgba(71, 215, 255, 0.12);
  color: var(--cyan);
}

.docs-nav li.missing span {
  display: block;
  padding: 0.35rem 0.5rem;
  color: rgba(174, 183, 200, 0.45);
  font-size: 0.88rem;
  text-decoration: line-through;
}

.docs-nav li.folder > span {
  display: block;
  margin-top: 0.55rem;
  padding: 0.2rem 0.5rem;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.docs-nav li.folder ul {
  margin-left: 0.35rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 0.35rem;
}

.docs-nav-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 1.25rem;
}

.docs-main {
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.docs-main .article {
  max-width: 56rem;
}

.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.docs-pager a {
  color: var(--cyan);
  font-weight: 700;
}

.docs-pager a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .docs-site .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-nav {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
