/* The style of the written pages. The tool has its own style sheet.
   The two share the same colours, so the site feels like one place. */

:root {
  --bg: #ffffff;
  --bg-sunken: #f6f8fa;
  --bg-raised: #ffffff;
  --bg-hover: #eef1f4;
  --border: #d6dde4;
  --border-strong: #b9c3cd;
  --text: #1c2128;
  --text-dim: #5b6977;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --key: #8250df;
  --string: #0a7d4b;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d1117;
    --bg-sunken: #161b22;
    --bg-raised: #161b22;
    --bg-hover: #21262d;
    --border: #2a313c;
    --border-strong: #3d4653;
    --text: #e6edf3;
    --text-dim: #9198a1;
    --accent: #4493f8;
    --key: #d2a8ff;
    --string: #7ee787;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0d1117;
  --bg-sunken: #161b22;
  --bg-raised: #161b22;
  --bg-hover: #21262d;
  --border: #2a313c;
  --border-strong: #3d4653;
  --text: #e6edf3;
  --text-dim: #9198a1;
  --accent: #4493f8;
  --key: #d2a8ff;
  --string: #7ee787;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* --- the header --- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

.site-head-in {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  flex-wrap: wrap;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
}

.site-brand svg {
  width: 26px;
  height: 26px;
}

.site-nav {
  display: flex;
  gap: 16px;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 15px;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--text);
}

.site-cta {
  background: var(--accent);
  color: var(--accent-text) !important;
  padding: 5px 12px;
  border-radius: 6px;
  font-weight: 600;
}

/* --- the page --- */
main {
  max-width: 740px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

main.wide {
  max-width: 1040px;
}

h1 {
  font-size: 2rem;
  line-height: 1.25;
  margin: 0 0 8px;
}

h2 {
  font-size: 1.35rem;
  margin: 2.2em 0 0.6em;
  padding-top: 0.3em;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.1rem;
  margin: 1.8em 0 0.5em;
}

.lede {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin: 0 0 8px;
}

.meta {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 28px;
}

p,
li {
  overflow-wrap: break-word;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

pre {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.5;
}

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

blockquote {
  margin: 1.5em 0;
  padding: 2px 16px;
  border-left: 3px solid var(--accent);
  color: var(--text-dim);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.93rem;
}

th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--text-dim);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* --- the boxes --- */
.card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-raised);
  text-decoration: none;
  color: inherit;
  margin-bottom: 14px;
}

.card:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.card h2,
.card h3 {
  margin: 0 0 4px;
  border: none;
  padding: 0;
  font-size: 1.1rem;
  color: var(--accent);
}

.card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.try {
  margin: 2em 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--bg-sunken);
}

.try p {
  margin: 0 0 10px;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
}

/* --- the advertisement places --- */
.ad {
  margin: 28px auto;
  text-align: center;
  min-height: 90px;
  overflow: hidden;
}

.ad:empty {
  display: none;
}

/* --- the footer --- */
.site-foot {
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.site-foot-in {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.site-foot a {
  color: var(--text-dim);
  text-decoration: none;
  margin-right: 16px;
}

.site-foot a:hover {
  color: var(--text);
}

@media (max-width: 640px) {
  h1 {
    font-size: 1.6rem;
  }
  main {
    padding: 24px 16px 48px;
  }
}

/* --- the crumb trail on a guide --- */
.crumb-trail {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.crumb-trail a {
  color: var(--text-dim);
  text-decoration: none;
}

.crumb-trail a:hover {
  color: var(--text);
  text-decoration: underline;
}

.crumb-trail span {
  padding: 0 4px;
  color: var(--border-strong);
}
