:root {
  --bg: oklch(0.985 0.004 85);
  --fg: oklch(0.22 0.02 70);
  --muted: oklch(0.5 0.015 70);
  --code: oklch(0.96 0.008 85);
  --font: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.18 0.012 260);
    --fg: oklch(0.96 0.008 85);
    --muted: oklch(0.72 0.015 85);
    --code: oklch(0.23 0.012 260);
  }
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: light dark;
}

body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-underline-position: from-font;
  text-decoration-thickness: from-font;
}

a:hover { color: var(--muted); }

.wrap {
  width: min(36rem, calc(100% - 40px));
  margin-inline: auto;
  padding: 28px 0 96px;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.logo {
  text-decoration: none;
}

nav {
  display: flex;
  gap: 16px;
}

nav a { text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--fg); }

h1, h2 {
  margin: 28px 0 10px;
  font-size: inherit;
  font-weight: 700;
}

h1 { margin-top: 0; }

.intro {
  margin: 0 0 12px;
  text-wrap: pretty;
}

.muted { color: var(--muted); }

pre, code {
  font-family: inherit;
  font-size: inherit;
}

pre {
  margin: 24px 0 8px;
  padding: 12px 14px;
  overflow-x: auto;
  background: var(--code);
  line-height: 1.5;
}

.snippet {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 8px;
  background: var(--code);
}

.snippet pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  background: none;
}

.snippet .copy {
  flex: none;
  margin: 0 12px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.snippet .copy:hover { color: var(--fg); }

a.snippet.drag {
  padding: 12px 14px;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
}

a.snippet.drag:hover { color: inherit; }

.snippet pre,
.snippet code {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stacks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 28px 0 0;
  color: var(--muted);
}

.stacks a {
  text-decoration: none;
  color: var(--muted);
}

.stacks a:hover { color: var(--fg); }

.stacks .here { color: var(--fg); }

ol {
  margin: 0;
  padding-left: 0;
  list-style-position: inside;
}

ol li { margin: 0 0 6px; }

pre.keys {
  margin: 0;
  padding: 0;
  background: none;
  overflow-x: auto;
}

footer {
  display: flex;
  gap: 16px;
  margin-top: 48px;
  color: var(--muted);
}

footer a { text-decoration: none; }

::selection {
  background: oklch(0.8 0.14 75 / 0.35);
}

@media (max-width: 520px) {
  .wrap { width: min(36rem, calc(100% - 32px)); padding-top: 20px; }
}
