/* The developer docs: one column on a phone, a sidebar nav from 900px up.
   Light and dark follow the reader's system. No script, no web font, no external URL. */

:root {
  --bg: #fbfbfa;
  --surface: #f2f2ef;
  --text: #1c1d1f;
  --muted: #5d6066;
  --border: #dcdcd6;
  --link: #0b5cad;
  --accent: #0b5cad;
  --code-bg: #f0f0ec;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --surface: #1e2024;
    --text: #e6e7e9;
    --muted: #a0a4ab;
    --border: #34373d;
    --link: #7db5f2;
    --accent: #7db5f2;
    --code-bg: #22252a;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

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

a {
  color: var(--link);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.skip:focus {
  top: 0.5rem;
}

.site-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand span {
  color: var(--muted);
  font-weight: 400;
}

.layout {
  padding: 0 1rem 4rem;
}

/* Navigation: a block above the page on a phone. */
.site-nav {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.site-nav ul {
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.site-nav li a {
  display: block;
  padding: 0.25rem 0;
  text-decoration: none;
}

.site-nav li a:hover,
.site-nav li a[aria-current="page"] {
  text-decoration: underline;
}

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

.nav-group {
  margin: 0.75rem 0 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

main {
  min-width: 0;
  max-width: 46rem;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
}

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

h2 {
  margin: 2.5rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 1.5rem;
}

h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

code {
  padding: 0.1em 0.35em;
  background: var(--code-bg);
  border-radius: 4px;
  font: 0.875em/1.4 var(--mono);
}

pre {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  line-height: 1.5;
}

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

table {
  display: block;
  max-width: 100%;
  margin: 0 0 1.25rem;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.925rem;
}

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

th {
  background: var(--surface);
}

blockquote {
  margin: 0 0 1rem;
  padding: 0.1rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--surface);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 900px) {
  .site-header {
    padding: 1rem 2rem;
  }

  .layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 3rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 2rem 6rem;
  }

  .site-nav {
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    margin: 1.5rem 0;
    overflow-y: auto;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
