:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --text: #1f2328;
  --muted: #57606a;
  --border: #d8dee4;
  --accent: #3451b2;
  --accent-text: #ffffff;
  --code-bg: #f6f8fa;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-soft: #161b22;
    --text: #e6edf3;
    --muted: #9da7b3;
    --border: #30363d;
    --accent: #a8b1ff;
    --accent-text: #0d1117;
    --code-bg: #161b22;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px / 1.65 var(--font);
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  scroll-margin-top: 1rem;
}

h1 {
  margin-top: 0;
  font-size: 2rem;
}

h2 {
  margin-top: 2.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.anchor {
  color: var(--muted);
  font-weight: 400;
  text-decoration: none;
  opacity: 0.5;
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.1em 0.3em;
}

pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  line-height: 1.5;
  font-size: 0.875rem;
}

p code,
li code,
td code {
  overflow-wrap: anywhere;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-text);
}

.skip:focus {
  left: 0.5rem;
}

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
}

.links a,
.flavors a {
  display: inline-block;
  padding: 0.25rem 0;
  text-decoration: none;
}

.flavors {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  align-items: center;
  padding: 0.35rem 1.25rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

.flavors a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 2.5rem;
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

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

.sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  font-size: 0.925rem;
}

.sidebar h2 {
  margin: 1.25rem 0 0.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.sidebar a {
  display: block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
}

.sidebar a:hover {
  background: var(--bg-soft);
}

.sidebar a[aria-current="page"] {
  background: var(--bg-soft);
  color: var(--accent);
  font-weight: 600;
}

main {
  min-width: 0;
}

.doc {
  max-width: 48rem;
}

.doc img,
.doc video,
.doc svg,
.doc iframe {
  max-width: 100%;
}

.doc img,
.doc video,
.doc svg {
  height: auto;
}

table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.925rem;
}

th,
td {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--bg-soft);
}

.edit {
  margin-top: 3rem;
  font-size: 0.925rem;
}

.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 0;
  color: var(--accent);
}

.tagline {
  margin: 0.25rem 0 1rem;
  font-size: 1.75rem;
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.button {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}

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

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.features div {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
}

.features h2 {
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
  font-size: 1.1rem;
}

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

.foot {
  padding: 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.foot p {
  margin: 0.25rem 0;
}

@media (max-width: 52rem) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .sidebar {
    position: static;
    order: 2;
    max-height: none;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
  }

  .hero h1 {
    font-size: 2.5rem;
  }
}
