/* One stylesheet for every page. No JavaScript anywhere on the site, so the only
   things that can go wrong are the ones you can see in this file. */

:root {
  color-scheme: light dark;
  --paper: #ffffff;
  --ink: #16262c;
  --ink-soft: #4c5f66;
  --rule: #d5dde0;
  --accent: #067a99;
  --code-bg: #f1f6f8;
  --font-text: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Noto Serif", Georgia, serif;
  --font-code: ui-monospace, "SF Mono", Menlo, Consolas, "Cascadia Mono", "Liberation Mono", monospace;
  --measure: 40rem;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1c21;
    --ink: #e4ecef;
    --ink-soft: #a7b8be;
    --rule: #2a3d45;
    --accent: #5cc4de;
    --code-bg: #162830;
  }
}

html {
  font-family: var(--font-text);
  font-size: 106.25%;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

.wrap {
  max-inline-size: var(--measure);
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 40rem) {
  .wrap {
    padding-inline: 1.5rem;
  }
}

/* Text */

h1, h2, h3 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: 1.95rem;
  margin-block: 0 0.5rem;
}

h2 {
  font-size: 1.5rem;
  margin-block: 2.5rem 0.75rem;
}

h3 {
  font-size: 1.25rem;
  margin-block: 0 0.5rem;
}

p, ul, ol, pre, table, figure {
  margin-block: 0 1rem;
}

.lead {
  font-size: 1.15rem;
  line-height: 1.5;
}

ul, ol {
  padding-inline-start: 1.25rem;
}

li + li {
  margin-block-start: 0.5rem;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

strong {
  font-weight: 700;
}

kbd {
  font-family: var(--font-code);
  font-size: 0.9em;
}

/* Code and commands */

code, pre {
  font-family: var(--font-code);
}

code {
  font-size: 0.92em;
}

pre {
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
}

pre code {
  font-size: inherit;
}

/* Program output reads fine wrapped, commands do not. */
.wrap-lines {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The install line is the headline of every tool: the one thing a developer came
   for, set apart so it can be read and copied without reading anything else. */
.install {
  font-size: 1.05rem;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  overflow-x: auto;
}

.install code {
  font-size: 1rem;
  white-space: pre-wrap;
}

/* Layout pieces */

.masthead {
  display: grid;
  gap: 1.25rem;
  padding-block: 2.5rem 1rem;
}

@media (min-width: 40rem) {
  .masthead {
    grid-template-columns: 7.5rem 1fr;
    align-items: center;
    gap: 1.75rem;
    padding-block-start: 3.5rem;
  }
}

.masthead img {
  inline-size: 7.5rem;
  block-size: 7.5rem;
  border-radius: 50%;
  display: block;
}

.masthead p {
  margin-block-end: 0;
}

.top {
  padding-block: 1.25rem;
  border-block-end: 1px solid var(--rule);
  margin-block-end: 2.5rem;
}

.top a {
  color: var(--ink);
  text-decoration: none;
}

.top a:hover {
  text-decoration: underline;
}

.title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-block-end: 0.75rem;
}

.title img {
  inline-size: 3.5rem;
  block-size: 3.5rem;
  flex: none;
}

.title h1 {
  margin: 0;
}

.tool + .tool {
  border-block-start: 1px solid var(--rule);
  margin-block-start: 2rem;
  padding-block-start: 2rem;
}

.links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

.links li {
  margin: 0;
}

figure {
  margin-inline: 0;
  margin-block: 1.5rem 2rem;
}

figure img {
  inline-size: 100%;
  block-size: auto;
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

/* A screenshot that brings its own window frame and shadow gets no second frame. */
.plain img {
  border: 0;
  border-radius: 0;
}

figcaption {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-block-start: 0.5rem;
}

table {
  border-collapse: collapse;
  inline-size: 100%;
  font-size: 0.95rem;
}

th, td {
  text-align: start;
  vertical-align: top;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-block-end: 1px solid var(--rule);
}

th {
  font-weight: 700;
}

footer {
  margin-block: 3.5rem 2rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

footer p {
  margin: 0;
}
