:root {
  color-scheme: dark;
  --bg: #090d14;
  --panel: #111827;
  --panel-soft: #151f2e;
  --text: #eef4ff;
  --muted: #a7b4c7;
  --line: #263244;
  --nav: #f8fafc;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --blue: #60a5fa;
  --gold: #fbbf24;
  --rose: #fb7185;
  --code: #05070d;
  --code-text: #dbeafe;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(45, 212, 191, 0.12), transparent 32rem),
    linear-gradient(180deg, #090d14 0%, #0b1018 46%, #090d14 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

main a {
  color: var(--accent-strong);
  text-underline-offset: 0.18em;
}

code {
  border: 1px solid #344154;
  border-radius: 5px;
  background: #172233;
  padding: 0.1rem 0.32rem;
  color: #dce8f8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.93em;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 20, 0.92);
  padding: 0 28px;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--accent);
  color: #031412;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
}

.menu-button {
  display: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 9px 12px;
  color: var(--text);
  font: inherit;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  max-width: 1480px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 24px 18px;
}

.search-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

#doc-search {
  width: 100%;
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  padding: 0 12px;
  color: var(--text);
  font: inherit;
}

#doc-search::placeholder {
  color: #7f8fa3;
}

.sidebar a {
  display: block;
  border-radius: 7px;
  padding: 9px 11px;
  color: #cbd5e1;
  text-decoration: none;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(45, 212, 191, 0.12);
  color: var(--accent-strong);
}

main {
  min-width: 0;
  padding: 36px clamp(22px, 5vw, 72px) 72px;
}

.doc-section {
  scroll-margin-top: 96px;
  margin-bottom: 56px;
}

.hero {
  min-height: calc(100vh - 108px);
  display: grid;
  align-content: center;
  gap: 24px;
  padding-bottom: 36px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 900px;
  margin-bottom: 14px;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.lead {
  max-width: 840px;
  color: #c4cfdd;
  font-size: 1.16rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 7px;
  padding: 0 16px;
  font-weight: 750;
  text-decoration: none;
}

.button.primary {
  background: var(--accent);
  color: #031412;
}

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

.architecture {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px;
  align-items: stretch;
  margin-top: 14px;
}

.layer,
.connector,
.feature-card,
.step,
.callout,
.table-wrap,
.checklist {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.layer {
  min-height: 160px;
  padding: 22px;
}

.layer span,
.layer small {
  display: block;
  color: var(--muted);
}

.layer strong {
  display: block;
  margin: 18px 0 12px;
  font-size: 1.3rem;
}

.client-layer {
  border-top: 5px solid var(--blue);
}

.server-layer {
  border-top: 5px solid var(--gold);
}

.service-layer {
  border-top: 5px solid var(--rose);
}

.connector {
  display: none;
}

.section-heading {
  max-width: 900px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

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

.feature-card {
  padding: 22px;
}

.steps {
  display: grid;
  gap: 18px;
}

.step {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(45, 212, 191, 0.14);
  color: var(--accent-strong);
  font-weight: 900;
}

.code-block {
  position: relative;
  overflow-x: auto;
  margin: 16px 0;
  border-radius: 8px;
  background: var(--code);
  color: var(--code-text);
  padding: 20px;
}

.code-block code {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: pre;
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 5px 9px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.copy-button.done {
  background: #16a34a;
  border-color: #16a34a;
}

.plain-list {
  padding-left: 1.25rem;
}

.plain-list li {
  margin-bottom: 9px;
}

.callout {
  margin-top: 20px;
  border-left: 5px solid var(--gold);
  padding: 18px 20px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 15px 16px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel-soft);
  color: #d7e2f0;
}

tr:last-child td {
  border-bottom: 0;
}

.checklist {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checklist input {
  margin-top: 6px;
  accent-color: var(--accent);
}

.hidden-by-search {
  display: none;
}

@media (max-width: 980px) {
  .layout {
    display: block;
  }

  .menu-button {
    display: inline-flex;
  }

  .sidebar {
    display: none;
    position: fixed;
    inset: 72px 0 auto 0;
    height: auto;
    max-height: calc(100vh - 72px);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    display: block;
  }

  .architecture,
  .feature-grid,
  .feature-grid.two {
    grid-template-columns: 1fr;
  }

  .connector {
    display: grid;
    place-items: center;
    min-height: 44px;
    color: var(--muted);
    box-shadow: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 16px;
  }

  .brand small {
    display: none;
  }

  main {
    padding: 28px 16px 52px;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: 2.6rem;
  }

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