:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-strong: #eef3fb;
  --text: #172033;
  --muted: #536178;
  --line: #dbe4f0;
  --accent: #18b7d9;
  --accent-strong: #0f7bdc;
  --code-bg: #edf2ff;
  --shadow: 0 18px 60px rgba(26, 37, 58, 0.1);
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
  --bg: #050814;
  --surface: #0d1424;
  --surface-strong: #121c31;
  --text: #eef6ff;
  --muted: #aab8cf;
  --line: #26344f;
  --accent: #18d7ff;
  --accent-strong: #69e9ff;
  --code-bg: #101b31;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 15% 0%, rgba(24, 215, 255, 0.12), transparent 26%),
    radial-gradient(circle at 88% 4%, rgba(127, 92, 255, 0.1), transparent 25%),
    var(--bg);
  margin: 0;
  min-width: 320px;
}

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

button {
  font: inherit;
}

code {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-strong);
  padding: 2px 6px;
}

pre {
  background: #080d19;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #e7edf8;
  margin: 10px 0 0;
  overflow-x: auto;
  padding: 16px;
}

pre code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

.docs-header {
  align-items: center;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px max(20px, calc((100vw - 1180px) / 2));
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand,
.docs-header nav,
.hero-actions,
.header-actions {
  align-items: center;
  display: flex;
}

.brand {
  gap: 10px;
  font-weight: 950;
  white-space: nowrap;
}

.brand img {
  border-radius: 8px;
  height: 36px;
  width: 36px;
}

.docs-header nav {
  gap: 3px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.docs-header nav::-webkit-scrollbar {
  display: none;
}

.docs-header nav a,
.app-link,
.primary-action,
.secondary-action,
#themeToggle {
  border-radius: 8px;
  font-weight: 850;
  min-height: 38px;
  padding: 10px 12px;
}

.docs-header nav a {
  color: var(--muted);
  white-space: nowrap;
}

.docs-header nav a:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.header-actions {
  gap: 8px;
}

#themeToggle {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
}

.app-link,
.primary-action {
  background: var(--accent);
  color: #06111e;
}

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

main,
footer {
  margin: 0 auto;
  width: min(1180px, calc(100% - 40px));
}

.hero {
  align-items: center;
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  min-height: 560px;
  padding: 56px 0 42px;
}

.eyebrow,
.section-label,
.network-panel > span,
.command-block > span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

h1 {
  color: var(--text);
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: 0;
  line-height: 0.98;
  margin-bottom: 20px;
  max-width: 860px;
}

h2 {
  color: var(--text);
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  letter-spacing: 0;
  line-height: 1.05;
  margin-bottom: 18px;
}

h3 {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 8px;
}

.hero p,
.section-body p,
.section-body li {
  color: var(--muted);
  line-height: 1.72;
}

.hero p {
  font-size: 1.08rem;
  max-width: 720px;
}

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

.network-panel,
.quick-grid a,
.timeline article,
.two-column article,
.feature-grid article,
.command-block,
.reference-grid a,
.reference-table article,
.note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.network-panel {
  box-shadow: var(--shadow);
  padding: 22px;
}

dl {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

dl div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

dd {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.quick-grid,
.timeline,
.two-column,
.reference-grid,
.feature-grid,
.reference-table {
  display: grid;
  gap: 14px;
}

.quick-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 34px;
}

.quick-grid a {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.quick-grid span {
  color: var(--accent);
  font-weight: 950;
}

.quick-grid small {
  color: var(--muted);
  line-height: 1.5;
}

.docs-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 32px;
  grid-template-columns: 190px minmax(0, 1fr);
  padding: 58px 0;
}

.section-body {
  min-width: 0;
}

.section-body a {
  color: var(--accent-strong);
  font-weight: 850;
}

ol,
ul {
  margin-bottom: 0;
  padding-left: 20px;
}

.note {
  color: var(--muted);
  margin-top: 18px;
  padding: 14px 16px;
}

.feature-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.feature-grid article,
.two-column article,
.command-block {
  padding: 18px;
}

.timeline {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.timeline article {
  padding: 18px;
}

.timeline span {
  align-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  font-weight: 950;
  height: 28px;
  justify-content: center;
  margin-bottom: 12px;
  width: 28px;
}

.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.flow-diagram {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 18px 0;
}

.flow-diagram div {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-weight: 850;
  min-height: 76px;
  padding: 18px 12px;
  text-align: center;
}

.reference-table {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.reference-table article {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.reference-table span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.reference-table strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.domain-table {
  grid-template-columns: 1fr;
}

.reference-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reference-grid a {
  color: var(--text);
  font-weight: 850;
  padding: 16px;
}

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 28px 0 40px;
}

@media (max-width: 1000px) {
  .docs-header {
    align-items: stretch;
    display: grid;
  }

  .docs-header nav {
    width: 100%;
  }

  .hero,
  .docs-section {
    grid-template-columns: 1fr;
  }

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

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

  .flow-diagram {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  :root {
    font-size: 14px;
  }

  main,
  footer {
    width: min(100% - 28px, 1180px);
  }

  .docs-header {
    padding: 12px 14px;
    position: static;
  }

  .header-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: clamp(2.2rem, 11vw, 3rem);
    line-height: 1.02;
  }

  h2 {
    font-size: clamp(1.8rem, 8vw, 2.35rem);
  }

  .quick-grid,
  .timeline,
  .two-column,
  .reference-grid,
  .feature-grid,
  .reference-table,
  .flow-diagram {
    grid-template-columns: 1fr;
  }

  .docs-section {
    gap: 16px;
    padding: 42px 0;
  }
}
