:root {
  color-scheme: light dark;
  --surface: #f7f6f3;
  --surface-raised: #fefefe;
  --surface-code: #efeee9;
  --border: #ddd9d1;
  --text: #141413;
  --text-secondary: #5c5a56;
  --accent: #0e7a46;
  --button: #141413;
  --button-text: #f7f6f3;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Instrument Sans", -apple-system, system-ui, sans-serif;
  --size-small: 0.875rem;
  --size-body: 1rem;
  --size-lead: 1.1875rem;
  --size-title: 1.75rem;
  --size-display: 2.75rem;
  --page: 68rem;
  --gutter: 2rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #151518;
    --surface-raised: #1e1e22;
    --surface-code: #1e1e22;
    --border: #2e2e33;
    --text: #ecebe7;
    --text-secondary: #a3a09a;
    --accent: #3fc184;
    --button: #ecebe7;
    --button-text: #151518;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  -webkit-font-smoothing: antialiased;
  scroll-padding-top: 4.5rem;
}

body {
  font-family: var(--sans);
  font-size: var(--size-body);
  font-weight: 400;
  line-height: 1.6;
  background: var(--surface);
  color: var(--text);
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
code,
pre,
kbd {
  font-family: var(--mono);
  font-size: 0.9em;
}
p code,
li code,
td code,
dd code {
  background: var(--surface-code);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  overflow-wrap: anywhere;
}
td:first-child code {
  overflow-wrap: normal;
  white-space: nowrap;
}
h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.15;
}
h1 {
  font-size: var(--size-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
h2 {
  font-size: var(--size-title);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
h3 {
  font-size: var(--size-lead);
  margin: 2rem 0 0.5rem;
}
p {
  max-width: 42rem;
}
p + p {
  margin-top: 0.75rem;
}

.skip {
  position: absolute;
  left: -100rem;
}
.skip:focus {
  left: var(--gutter);
  top: 0.75rem;
  z-index: 20;
  background: var(--surface-raised);
  padding: 0.25rem 0.75rem;
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
header .wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 3.5rem;
}
.logo {
  font-family: var(--mono);
  font-size: var(--size-lead);
  font-weight: 500;
  text-decoration: none;
}
nav {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
nav a {
  color: var(--text-secondary);
  font-size: var(--size-small);
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color 120ms;
}
nav a:hover {
  color: var(--text);
}
nav a[aria-current="true"],
nav a[aria-current="page"] {
  color: var(--accent);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 4rem;
}
.hero > div:first-child {
  max-width: 46rem;
}
.lead {
  font-size: var(--size-lead);
  color: var(--text-secondary);
  margin-top: 1.25rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}
.note {
  color: var(--text-secondary);
  font-size: var(--size-small);
  margin-top: 1rem;
}
.button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--button);
  border-radius: 6px;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    opacity 120ms,
    transform 100ms;
}
.button:hover {
  opacity: 0.85;
}
.button:active {
  transform: scale(0.97);
}
.button.primary {
  background: var(--button);
  color: var(--button-text);
}
.button.plain {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

/* Code */
pre {
  background: var(--surface-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.7;
  font-size: var(--size-small);
}
pre .dim {
  color: var(--text-secondary);
}
pre.session {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
pre.prose {
  white-space: pre-wrap;
  font-family: var(--sans);
  font-size: var(--size-body);
  line-height: 1.6;
}
.code {
  position: relative;
  margin: 0.75rem 0;
  max-width: 46rem;
}
.code pre {
  padding-right: 5rem;
}
.copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--size-small);
  cursor: pointer;
  transition:
    color 120ms,
    transform 100ms;
}
.copy:hover {
  color: var(--text);
}
.copy:active {
  transform: scale(0.97);
}
.copy[data-done] {
  color: var(--accent);
}

/* Sections */
section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}
section > .wrap > p:first-of-type {
  color: var(--text-secondary);
  font-size: var(--size-lead);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}
th {
  text-align: left;
  font-weight: 500;
  font-size: var(--size-small);
  color: var(--text-secondary);
}
th,
td {
  padding: 0.75rem 1.5rem 0.75rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
td:last-child,
th:last-child {
  padding-right: 0;
}
.after-table {
  margin-top: 1.5rem;
}
td.number {
  font-family: var(--mono);
  white-space: nowrap;
  text-align: right;
}
th.number {
  text-align: right;
}

.commands {
  margin-top: 0.75rem;
}
.commands div {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 0.25rem 2rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.commands dt {
  font-family: var(--mono);
  font-size: var(--size-small);
  overflow-wrap: anywhere;
  padding-top: 0.15rem;
}
.commands dd {
  color: var(--text-secondary);
}

ol.steps {
  margin-top: 1.5rem;
  padding-left: 1.5rem;
}
ol.steps > li {
  padding: 0 0 2rem 0.5rem;
  max-width: 46rem;
}
ol.steps > li::marker {
  font-weight: 500;
}
ol.steps strong {
  font-weight: 500;
}
ul.plain {
  margin: 0.75rem 0 0 1.25rem;
  max-width: 42rem;
}
ul.plain li + li {
  margin-top: 0.4rem;
}
ul.plain strong {
  font-weight: 500;
}

.fit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 3rem;
}

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem;
  color: var(--text-secondary);
  font-size: var(--size-small);
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

@media (max-width: 56rem) {
  :root {
    --gutter: 1.25rem;
    --size-display: 2.125rem;
    --size-title: 1.5rem;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  .commands div {
    grid-template-columns: minmax(0, 1fr);
  }
  .fit {
    grid-template-columns: minmax(0, 1fr);
  }
  section {
    padding: 3rem 0;
  }
  th,
  td {
    padding-right: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Header link to the page that is not this one, and the call to action */
header .button {
  margin-left: auto;
  padding: 0.3rem 0.8rem;
  font-size: var(--size-small);
  white-space: nowrap;
}
.page-title {
  padding-top: 3.5rem;
  padding-bottom: 3rem;
}
.page-title p {
  color: var(--text-secondary);
  font-size: var(--size-lead);
  margin-top: 1rem;
}

/* Tabs, built by script.js from the panels; without scripts both panels show */
.tablist {
  display: inline-flex;
  gap: 0.25rem;
  margin-top: 2rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.tablist button {
  padding: 0.4rem 0.9rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition:
    color 120ms,
    background-color 120ms,
    transform 100ms;
}
.tablist button:hover {
  color: var(--text);
}
.tablist button:active {
  transform: scale(0.97);
}
.tablist button[aria-selected="true"] {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border);
}
.tabs.ready .tab-panel > h3:first-child {
  display: none;
}
.tabs.ready .tab-panel > p:nth-child(2) {
  margin-top: 1.5rem;
}

/* Docs: section links on the left, content on the right */
.docs {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 3rem;
}
.docs-content .wrap {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
.toc {
  position: sticky;
  top: 3.5rem;
  align-self: start;
  max-height: calc(100vh - 3.5rem);
  overflow-y: auto;
  padding: 3.5rem 0 2rem;
}
.toc ul {
  list-style: none;
}
.toc ul ul {
  margin: 0.25rem 0 0.5rem 0.875rem;
}
.toc li + li {
  margin-top: 0.35rem;
}
.toc a {
  display: block;
  color: var(--text-secondary);
  font-size: var(--size-small);
  text-decoration: none;
  transition: color 120ms;
}
.toc a:hover {
  color: var(--text);
}
@media (max-width: 56rem) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .toc {
    position: static;
    max-height: none;
    padding: 2rem 0 0;
  }
  .toc > ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
  }
  .toc li + li {
    margin-top: 0;
  }
  .toc ul ul {
    display: none;
  }
}

/* The recorded run in the hero */
.replay {
  position: relative;
}
.replay .note {
  margin-top: 0.75rem;
}

/* A link on each docs heading, shown on hover or focus */
.anchor {
  margin-left: 0.4em;
  color: var(--text-secondary);
  text-decoration: none;
  opacity: 0;
  transition: opacity 120ms;
}
h2:hover .anchor,
h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}
.note code {
  white-space: nowrap;
}
.replay .table {
  display: block;
  white-space: pre;
  overflow-x: auto;
}
.replay .time {
  white-space: nowrap;
}
.hero .tablist {
  margin-top: 0;
}
.replay pre.session {
  height: 20rem;
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
