:root {
  color-scheme: dark;
  --paper: #111016;
  --paper-deep: #1a1822;
  --surface: #17151e;
  --ink: #f4f1fb;
  --muted: #aaa4b5;
  --purple: #8054ff;
  --purple-readable: #ad98ff;
  --coral: #ff665f;
  --coral-hover: #ff7b75;
  --accent-soft: #211a38;
  --line: #2e2a3b;
  --line-strong: #5c556e;
  --white: #ffffff;
  --radius: 12px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scrollbar-color: var(--purple) var(--paper);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

.page-width {
  width: min(calc(100% - 48px), 1180px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.brand-symbol {
  width: 24px;
}

.header-links,
.site-footer-inner,
.site-footer nav,
.hero-action-row {
  display: flex;
  align-items: center;
}

.header-links {
  gap: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.header-links a,
.site-footer a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 140ms ease;
}

.header-links a:hover,
.site-footer a:hover {
  text-decoration-color: currentColor;
}

.landing-shell {
  display: grid;
  min-height: max(100vh, 100dvh);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.landing-main {
  display: grid;
  min-height: 0;
}

.landing-hero {
  display: grid;
  min-height: 0;
  grid-template-columns: 1fr;
  align-content: center;
  padding: clamp(28px, 4vh, 48px) 0;
}

.hero-copy {
  min-width: 0;
}

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

.hero-copy h1 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(50px, 4.9vw, 70px);
  font-weight: 700;
  letter-spacing: -0.058em;
  line-height: 0.94;
}

.hero-copy h1 span {
  display: block;
  margin-top: 5px;
  color: var(--purple);
}

.hero-action-row {
  margin-top: 28px;
  gap: 20px;
}

.hero-footnote {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.primary-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0 19px;
  border: 0;
  border-radius: var(--radius);
  background: var(--coral);
  color: #211011;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.primary-action:hover {
  background: var(--coral-hover);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
}

.primary-action:active {
  background: #ef5c56;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
}

.secondary-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  padding: 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  transition: border-color 140ms ease, color 140ms ease;
}

.secondary-action:hover {
  border-color: var(--purple-readable);
  color: var(--purple-readable);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #0d0c11;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.site-footer-inner {
  min-height: 84px;
  justify-content: space-between;
  gap: 24px;
}

.site-footer nav {
  gap: 18px;
}

/* Docs */

.docs-shell {
  display: grid;
  min-height: max(100vh, 100dvh);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.docs-shell .site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  width: 100%;
  padding-inline: max(24px, calc((100% - 1400px) / 2));
  background: rgba(17, 16, 22, 0.92);
  backdrop-filter: blur(18px);
}

.docs-main {
  width: min(calc(100% - 48px), 1400px);
  margin-inline: auto;
  padding: 40px 0 96px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 760px) 210px;
  align-items: start;
  justify-content: space-between;
  column-gap: clamp(32px, 4vw, 58px);
  row-gap: 42px;
}

.docs-layout > * {
  min-width: 0;
}

.docs-sidebar {
  position: sticky;
  top: 96px;
  grid-column: 1;
  grid-row: 1 / span 2;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  padding: 18px 10px 28px 0;
  scrollbar-width: thin;
}

.docs-sidebar section + section {
  margin-top: 30px;
}

.docs-sidebar h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

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

.docs-sidebar li + li {
  margin-top: 4px;
}

.docs-sidebar a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  transition: background-color 140ms ease, color 140ms ease;
}

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

.docs-sidebar a.is-current {
  background: var(--accent-soft);
  color: var(--purple-readable);
  font-weight: 650;
}

.docs-intro {
  grid-column: 2;
  grid-row: 1;
  padding: 14px 0 8px;
}

.docs-kicker {
  margin-bottom: 12px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.docs-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.docs-intro h1 {
  max-width: 620px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 4.6vw, 60px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
}

.copy-page-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: border-color 140ms ease, color 140ms ease;
}

.copy-page-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.docs-summary {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.docs-content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-underline-offset: 3px;
}

.docs-toc {
  position: sticky;
  top: 96px;
  grid-column: 3;
  grid-row: 1 / span 2;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  padding: 18px 0 28px 18px;
  scrollbar-width: thin;
}

.docs-toc strong {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.docs-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-toc li + li {
  margin-top: 8px;
}

.docs-toc a {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  transition: color 140ms ease;
}

.docs-toc a:hover,
.docs-toc a.is-active {
  color: var(--coral);
}

.docs-content {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  margin-top: 0;
}

.doc-section {
  padding-bottom: 0;
}

.doc-section + .doc-section {
  padding-top: 42px;
  border-top: 1px solid var(--line);
}

.docs-content h2 {
  scroll-margin-top: 112px;
  position: relative;
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.16;
}

.docs-content h3 {
  scroll-margin-top: 112px;
  position: relative;
  margin: 30px 0 14px;
  color: var(--ink);
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.heading-anchor {
  position: absolute;
  top: 0;
  right: calc(100% + 8px);
  color: var(--purple-readable) !important;
  text-decoration: none !important;
  opacity: 0;
  transition: opacity 140ms ease;
}

.heading-anchor::before {
  content: "#";
}

.docs-content h2:hover .heading-anchor,
.docs-content h3:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.docs-content p,
.docs-content ol,
.docs-content ul,
.docs-content blockquote {
  max-width: 720px;
}

.docs-content p,
.docs-content li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}

.docs-content p {
  margin-bottom: 18px;
}

.docs-content ol,
.docs-content ul {
  margin: 0;
  padding-left: 24px;
}

.docs-content li + li {
  margin-top: 10px;
}

.docs-content strong {
  color: var(--ink);
}

.docs-content li::marker {
  color: var(--coral);
}

.docs-content blockquote {
  position: relative;
  margin: 24px 0;
  padding: 16px 18px 16px 44px;
  border: 1px solid #2a3e65;
  border-radius: 10px;
  background: #111d35;
}

.docs-content blockquote::before {
  content: "i";
  position: absolute;
  top: 18px;
  left: 18px;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid #75a5ff;
  border-radius: 50%;
  color: #9fc0ff;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
}

.docs-content blockquote p {
  margin: 0;
  color: #c3d4f4;
  font-size: 13px;
  line-height: 1.6;
}

.docs-switcher {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px 16px;
  max-width: 720px;
  margin: 22px 0 10px;
}

.docs-switcher > .docs-switcher-label {
  margin: 0;
}

.docs-switcher > .docs-tab-panel {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  margin-top: 2px;
}

.docs-switcher-nested {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 12px 16px;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.docs-switcher-nested > * {
  min-width: 0;
}

.docs-content .docs-switcher-label {
  margin-bottom: 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.docs-content .docs-switcher-nested .docs-switcher-label {
  margin: 0;
}

.docs-switcher-nested .docs-tab-panel {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 4px;
}

.docs-tabs {
  display: flex;
  gap: 2px;
  width: min(100%, 324px);
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d0c11;
}

.docs-tabs-wide {
  width: min(100%, 390px);
}

.docs-tabs-wide button {
  flex: 1;
}

.docs-tabs button {
  min-width: 104px;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 140ms ease, color 140ms ease;
}

.docs-tabs button:hover {
  color: var(--ink);
}

.docs-tabs button:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.docs-tabs button[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--purple-readable);
}

.docs-tab-panel {
  margin-top: 20px;
}

.docs-tab-panel[hidden] {
  display: none;
}

.docs-tab-panel > :last-child,
.docs-tab-panel > .docs-switcher > :last-child {
  margin-bottom: 0;
}

.code-block {
  position: relative;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b0a0e;
  color: var(--white);
}

.copy-button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.copy-button::before,
.copy-button::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.copy-button::before {
  top: 6px;
  left: 6px;
}

.copy-button::after {
  top: 10px;
  left: 10px;
  background: #0b0a0e;
}

.code-block > .copy-button {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
}

.copy-button:hover {
  color: var(--purple-readable);
}

.copy-button[data-state="copied"] {
  background: transparent;
  color: var(--coral);
}

.copy-button[data-state="copied"]::before {
  content: "✓";
  width: auto;
  height: auto;
  border: 0;
  font-size: 15px;
  font-weight: 700;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.copy-button[data-state="copied"]::after {
  display: none;
}

.copy-tooltip {
  position: absolute;
  right: 50%;
  bottom: calc(100% + 7px);
  padding: 5px 7px;
  border-radius: 5px;
  background: #211f26;
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.copy-button:hover .copy-tooltip,
.copy-button:focus-visible .copy-tooltip {
  opacity: 1;
  transform: translate(50%, 0);
}

.code-block pre {
  overflow-x: auto;
  margin: 0;
  padding: 18px 20px;
}

.code-block > .copy-button + pre {
  padding-right: 60px;
}

.code-block code {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.docs-content .code-block {
  margin: 18px 0 24px;
}

.docs-content table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-size: 13px;
}

.docs-content :not(pre) > code {
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.92em;
}

.docs-content .primary-action {
  color: #211011;
  text-decoration: none;
}

.docs-content th,
.docs-content td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  vertical-align: top;
}

.docs-content th {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 820px) {
  .landing-hero {
    align-content: center;
  }
}

@media (max-width: 1180px) {
  .docs-layout {
    grid-template-columns: 200px minmax(0, 760px);
    justify-content: center;
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 940px) {
  .docs-layout {
    display: block;
    max-width: 760px;
    margin-inline: auto;
  }

  .docs-sidebar {
    display: none;
  }

  .docs-content {
    margin-top: 44px;
  }
}

@media (max-width: 720px) {
  .docs-content {
    margin-top: 36px;
  }
}

@media (max-width: 600px) {
  .page-width {
    width: min(calc(100% - 28px), 1180px);
  }

  .site-header {
    min-height: 56px;
  }

  .header-links {
    display: none;
  }

  .landing-hero {
    gap: 22px;
    padding: 22px 0 18px;
  }

  .hero-copy h1 {
    font-size: clamp(42px, 12.4vw, 58px);
  }

  .hero-copy h1 span {
    margin-top: 4px;
  }

  .hero-action-row {
    margin-top: 20px;
    justify-content: space-between;
    gap: 12px;
  }

  .primary-action {
    min-height: 43px;
    padding: 0 13px;
    font-size: 13px;
  }

  .secondary-action {
    min-height: 43px;
    padding: 0 13px;
    font-size: 13px;
  }

  .site-footer {
    font-size: 9px;
  }

  .site-footer-inner {
    min-height: 84px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }

  .site-footer nav {
    gap: 10px;
  }

  .docs-shell .site-header {
    padding-inline: 14px;
  }

  .docs-main {
    width: min(calc(100% - 28px), 760px);
    padding: 32px 0 56px;
  }

  .docs-intro {
    padding: 8px 0 18px;
  }

  .docs-title-row {
    align-items: flex-start;
  }

  .docs-intro h1 {
    font-size: clamp(38px, 11vw, 48px);
  }

  .docs-summary {
    font-size: 15px;
  }

  .copy-page-button {
    min-height: 32px;
    padding-inline: 10px;
    font-size: 11px;
  }

  .docs-tabs {
    width: 100%;
  }

  .docs-tabs button {
    min-width: 0;
    flex: 1;
    padding-inline: 10px;
  }

  .docs-switcher,
  .docs-switcher-nested {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px 12px;
  }

  .docs-content h2 {
    font-size: 26px;
  }

  .doc-section {
    padding-bottom: 0;
  }

  .doc-section + .doc-section {
    padding-top: 32px;
  }

}

@media (max-width: 340px) {
  .header-links {
    gap: 8px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
