:root {
  color-scheme: dark light;
  --bg: #121212;
  --panel: #1f1f1f;
  --panel-strong: #282828;
  --text: #f5f7f2;
  --muted: #b8beb4;
  --soft: #7f877d;
  --green: #1ed760;
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --body-gradient: linear-gradient(180deg, rgba(30, 215, 96, 0.08) 0, rgba(18, 18, 18, 0) 420px);
  --nav-bg: rgba(18, 18, 18, 0.86);
  --hover-bg: rgba(255, 255, 255, 0.08);
  --tag-bg: rgba(30, 215, 96, 0.13);
  --pre-bg: #0a0a0a;
  --pre-text: #e6f2e9;
  --docs-sidebar-bg: rgba(18, 18, 18, 0.9);
  --secondary-bg: rgba(255, 255, 255, 0.06);
  --primary-text: #07160c;
  --footer-bg: #0b0b0b;
  --link-decoration: rgba(255, 255, 255, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  --bg: #f7f8f4;
  --panel: #ffffff;
  --panel-strong: #edf2ea;
  --text: #141712;
  --muted: #4e5a50;
  --soft: #6d776e;
  --green: #138a3d;
  --line: rgba(14, 24, 16, 0.13);
  --shadow: 0 24px 70px rgba(25, 38, 26, 0.13);
  --body-gradient: linear-gradient(180deg, rgba(30, 215, 96, 0.16) 0, rgba(247, 248, 244, 0) 420px);
  --nav-bg: rgba(247, 248, 244, 0.88);
  --hover-bg: rgba(20, 23, 18, 0.08);
  --tag-bg: rgba(30, 215, 96, 0.16);
  --docs-sidebar-bg: rgba(247, 248, 244, 0.9);
  --secondary-bg: rgba(20, 23, 18, 0.05);
  --primary-text: #06120a;
  --footer-bg: #eef3eb;
  --link-decoration: rgba(20, 23, 18, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    var(--body-gradient),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

a {
  color: inherit;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand img {
  width: 132px;
  height: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
  background: var(--hover-bg);
  outline: none;
}

.theme-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--secondary-bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--hover-bg);
  outline: none;
}

.article {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 70px clamp(20px, 5vw, 72px) 90px;
  min-width: 0;
}

.eyebrow {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 0 0 16px;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.96;
}

.lede {
  max-width: 820px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.content {
  margin-top: 56px;
  display: grid;
  gap: 28px;
  min-width: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 34px);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
}

.panel h3 {
  margin: 24px 0 10px;
  font-size: 22px;
  line-height: 1.2;
}

.panel p,
.panel li {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.68;
}

.panel p {
  margin: 0 0 16px;
}

.panel p:last-child {
  margin-bottom: 0;
}

.panel ul,
.panel ol {
  margin: 0;
  padding-left: 22px;
}

.option-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 18px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
}

.option-table thead,
.option-table tbody,
.option-table tr {
  display: block;
}

.option-table tr {
  display: grid;
  grid-template-columns: minmax(135px, 0.7fr) minmax(230px, 1fr) minmax(0, 1.6fr);
  min-width: 0;
}

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

.option-table th {
  background: var(--panel-strong);
  color: var(--text);
  font-size: 14px;
}

.option-table td {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  min-width: 0;
  overflow-wrap: break-word;
}

.option-table code {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

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

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

.mini-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 20px;
}

.mini-card b {
  display: block;
  margin-bottom: 8px;
}

.mini-card span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

pre {
  margin: 18px 0 0;
  max-width: 100%;
  padding: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pre-bg);
  color: var(--pre-text);
  font-size: 14px;
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.docs-layout {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 56px;
  display: block;
}

.docs-sidebar {
  position: sticky;
  top: 77px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin-bottom: 24px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--docs-sidebar-bg);
  backdrop-filter: blur(14px);
}

.docs-sidebar a {
  min-height: 34px;
  display: flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.docs-sidebar a:hover,
.docs-sidebar a:focus-visible {
  color: var(--text);
  background: var(--hover-bg);
  outline: none;
}

.docs-main {
  min-width: 0;
  display: grid;
  gap: 28px;
}

.docs-page .article {
  width: min(1700px, calc(100% - 48px));
  padding-right: clamp(20px, 3vw, 48px);
  padding-left: clamp(20px, 3vw, 48px);
}

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

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: var(--secondary-bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  border-color: transparent;
  background: var(--green);
  color: var(--primary-text);
}

.footer {
  padding: 42px clamp(20px, 5vw, 72px);
  background: var(--footer-bg);
  border-top: 1px solid var(--line);
}

.footer-inner {
  width: min(980px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.footer a {
  color: var(--text);
  text-decoration-color: var(--link-decoration);
  text-underline-offset: 4px;
}

@media (max-width: 760px) {
  .nav {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .article {
    padding-top: 46px;
  }

  .docs-page .article {
    width: 100%;
    padding-right: 20px;
    padding-left: 20px;
  }

  .docs-layout {
    margin-top: 38px;
  }

  .docs-sidebar {
    position: static;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
  }

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

  .option-table {
    border: 0;
  }

  .option-table thead {
    display: none;
  }

  .option-table tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
  }

  .option-table td {
    display: block;
    border-bottom: 1px solid var(--line);
  }

  .option-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .button {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
  }
}
