:root {
  color-scheme: light dark;
  --bg: #fbfbfc;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --ink: #0e1320;
  --muted: #5a6373;
  --line: #e2e6ec;
  --accent: #1a56db;
  --accent-hover: #1647b8;
  --accent-ink: #ffffff;
  --ok: #0f7b3f;
  --ok-bg: #e5f4ec;
  --code-bg: #0f1422;
  --code-ink: #dfe5f1;
  --code-dim: #8c97ad;
  --render: #f0f0f0;
  --radius: 12px;
  --radius-small: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e15;
    --surface: #121722;
    --surface-2: #161c29;
    --ink: #e7ebf3;
    --muted: #98a2b5;
    --line: #262d3b;
    --accent: #6d9bff;
    --accent-hover: #8fb2ff;
    --accent-ink: #0b0e15;
    --ok: #5fd39a;
    --ok-bg: #12301f;
    --code-bg: #0a0e18;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0 0 1em;
}

code,
pre {
  font-family: var(--mono);
  font-size: 0.86rem;
}

:not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.05em 0.35em;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* Header and footer */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.top-row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.mark {
  width: 26px;
  height: 26px;
}

.mark rect {
  fill: var(--accent);
}

.mark path {
  fill: var(--accent-ink);
}

.brand.small .mark {
  width: 20px;
  height: 20px;
}

.nav {
  display: flex;
  gap: 22px;
  margin-right: auto;
}

.nav a,
.lang {
  color: var(--muted);
  font-size: 0.94rem;
}

.nav a:hover,
.lang:hover {
  color: var(--ink);
  text-decoration: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.foot {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-size: 0.92rem;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.foot nav {
  display: flex;
  gap: 20px;
  margin-right: auto;
}

.foot nav a {
  color: var(--muted);
}

/* Buttons and pills */

.button {
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: var(--radius-small);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 18px;
  font: 600 0.96rem/1.2 var(--font);
  cursor: pointer;
}

.button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  text-decoration: none;
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button.ghost:hover {
  border-color: var(--muted);
}

.button.small {
  padding: 6px 12px;
  font-size: 0.9rem;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font: 700 0.78rem/1.6 var(--mono);
  letter-spacing: 0.04em;
  margin: 0 0 6px;
}

.pill.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

/* Hero */

.hero {
  padding: 72px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}

.eyebrow {
  color: var(--accent);
  font: 600 0.82rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 40em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.build-card {
  margin: 0;
  background: var(--code-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(15, 20, 34, 0.55);
  border: 1px solid var(--line);
}

.build-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  color: var(--code-dim);
  font: 0.8rem/1.4 var(--mono);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5fd39a;
}

.code {
  margin: 0;
  padding: 16px 18px;
  color: var(--code-ink);
  font-size: 0.8rem;
  line-height: 1.55;
  overflow-x: auto;
}

.build-result {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.build-result img {
  width: 132px;
  height: 132px;
  border-radius: var(--radius-small);
  background: var(--render);
}

.build-result p {
  margin: 0 0 4px;
  font-size: 0.9rem;
}

.result-facts {
  font-weight: 600;
}

/* Bands */

.band {
  padding: 72px 0;
}

.band.alt {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-intro {
  color: var(--muted);
  max-width: 44em;
  font-size: 1.04rem;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
}

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 0;
  margin: 28px 0 20px;
}

.steps li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  color: var(--accent);
  font: 600 0.82rem/1 var(--mono);
  margin-bottom: 14px;
}

.steps p {
  color: var(--muted);
  margin: 0;
}

/* Examples */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.example {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.example img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--render);
}

.example-body {
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
}

.example-body > p {
  color: var(--muted);
  font-size: 0.92rem;
}

.facts {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  font-size: 0.88rem;
}

.facts li {
  padding: 3px 0 3px 18px;
  position: relative;
}

.facts li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--ok);
}

.example-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: auto 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}

/* Connect */

.connect-grid,
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
}

.url-label {
  margin: 20px 0 6px;
  font: 600 0.78rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.url code {
  display: inline-block;
  font-size: 0.98rem;
  padding: 8px 12px;
  word-break: break-all;
}

.clients {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-content: start;
}

.client {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.client p {
  margin: 10px 0 0;
  font-size: 0.9rem;
}

.cmd {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius-small);
  padding: 12px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Preview limits */

.limits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
  padding: 0;
  margin: 24px 0;
  list-style: none;
}

.limits li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 14px 16px;
}

/* Contact */

.contact {
  display: grid;
  gap: 14px;
}

.contact label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
}

.contact input,
.contact textarea {
  font: 400 1rem/1.4 var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 10px 12px;
  width: 100%;
}

.contact input:focus,
.contact textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.contact .trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 4px 0 0;
  font-size: 0.88rem;
}

/* Message pages (contact result, 404) */

.message {
  max-width: 720px;
  padding-top: 96px;
  padding-bottom: 120px;
}

.message .brand {
  margin-bottom: 40px;
}

/* Docs */

.docs {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  padding-top: 40px;
  padding-bottom: 80px;
}

.docs-nav {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: 0.92rem;
}

.docs-title {
  font-weight: 700;
}

.docs-title a {
  color: var(--ink);
}

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

.docs-nav li a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--muted);
}

.docs-nav li a:hover {
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}

.docs-nav li a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
}

.prose {
  max-width: 820px;
}

.prose h1 {
  font-size: 2rem;
}

.prose h2 {
  font-size: 1.45rem;
  margin-top: 2em;
}

.prose h3 {
  margin-top: 1.6em;
}

.prose pre {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius-small);
  padding: 14px 16px;
  overflow-x: auto;
}

.prose table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  margin: 0 0 1.2em;
  font-size: 0.92rem;
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--surface-2);
}

.prose blockquote {
  margin: 0 0 1em;
  padding: 2px 16px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

/* Narrow screens */

@media (max-width: 900px) {
  .hero {
    padding-top: 44px;
  }

  .hero-grid,
  .connect-grid,
  .contact-grid,
  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .steps,
  .gallery,
  .limits {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav {
    display: none;
  }

  .top-actions {
    margin-left: auto;
  }

  .docs-nav {
    position: static;
    max-height: none;
  }

  /* The page list repeats the docs index; on one column it would push the text off the screen. */
  .docs-nav ul {
    display: none;
  }
}

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

  .docs {
    padding-top: 28px;
    padding-bottom: 56px;
  }

  .band {
    padding: 52px 0;
  }

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

  .example img {
    aspect-ratio: 4 / 3;
  }

  .build-result {
    grid-template-columns: 96px 1fr;
  }

  .build-result img {
    width: 96px;
    height: 96px;
  }
}
