:root {
  --ink: #000;
  --ink2: #3c3c3c;
  --muted: #6e6e6e;
  --line: #e6e6e6;
  --soft: #f4f4f4;
  --sans: Inter, ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 668px; margin: 0 auto; padding: 96px 24px 64px; }

header { text-align: center; max-width: 860px; margin: 0 auto 64px; }
main > header { margin-left: -96px; margin-right: -96px; }
.meta { font-size: 14px; color: var(--muted); margin: 0 0 20px; }
h1 { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 48px; line-height: 1; font-weight: 600; letter-spacing: -0.035em; margin: 0 0 24px; }
h1 img { height: 1.15em; width: auto; }
.sub { font-size: min(30px, calc((100vw - 48px) / 27)); line-height: 1.3; color: var(--ink2); margin: 0 auto 32px; white-space: nowrap; }
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.btn { font-size: 14px; color: var(--ink); text-decoration: none; background: var(--soft); border-radius: 999px; padding: 8px 16px; }
.btn:hover { background: #e8e8e8; text-decoration: none; }
button.btn { font-family: inherit; letter-spacing: inherit; border: 0; cursor: pointer; }

.toc { display: none; }
@media (min-width: 1280px) {
  .toc { display: flex; flex-direction: column; gap: 12px; position: fixed; top: 120px; left: 32px; width: 160px; font-size: 13px; line-height: 1.35; }
  .toc a { color: #a3a3a3; text-decoration: none; transition: color 0.15s; }
  .toc a:hover, .toc a.on { color: var(--ink); }
}

.lead { font-size: 20px; line-height: 1.55; margin: 0; }
.tldr + h2 { margin-top: 32px; }

h2 { font-size: 26px; line-height: 1.3; font-weight: 600; letter-spacing: -0.02em; margin: 56px 0 12px; scroll-margin-top: 24px; }
h3 { font-size: 20px; line-height: 1.4; font-weight: 500; margin: 40px 0 8px; }
p { margin: 18px 0; }
b { font-weight: 600; }
ul, ol { margin: 18px 0; padding-left: 1.3em; }
li { margin: 6px 0; padding-left: 4px; }

a { color: inherit; text-decoration: underline; text-decoration-color: rgba(0, 0, 0, 0.3); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

.note { margin: 16px 0 8px; padding: 16px 20px; background: var(--soft); border-radius: 8px; font-size: 15.5px; line-height: 1.6; }
.todo { color: #c2410c; }

figure { margin: 48px 0; }
figure img { display: block; width: 100%; height: auto; }
figcaption { font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: 14px; }
figcaption b { color: var(--ink); font-weight: 500; }
.columns { display: flex; gap: 32px; align-items: flex-start; margin: 48px 0; }
.columns figure { margin: 0; min-width: 0; }
main > figure.narrow { width: 80%; margin-left: auto; margin-right: auto; }
@media (min-width: 960px) {
  main > figure, .columns { margin-left: -96px; margin-right: -96px; }
}

.math { font-family: "Times New Roman", serif; font-size: 1.05em; white-space: nowrap; letter-spacing: 0; }

code { font-family: var(--mono); font-size: 0.85em; letter-spacing: 0; }
:not(pre) > code { background: var(--soft); border-radius: 4px; padding: 0.15em 0.4em; }
pre { background: var(--soft); border-radius: 8px; padding: 20px 24px; white-space: pre-wrap; line-height: 1.6; margin: 18px 0; }

table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; margin: 40px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
caption { caption-side: top; text-align: left; font-weight: 500; padding-bottom: 12px; }
th, td { text-align: left; vertical-align: top; padding: 10px 16px 10px 0; }
thead th { border-bottom: 1px solid var(--line); font-weight: 500; }
tbody td:first-child { color: var(--muted); }

footer { font-size: 13px; color: var(--muted); text-align: center; padding: 40px 0 56px; }

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  main { padding: 56px 20px 48px; }
  main > header { margin: 0 0 48px; }
  h1 { font-size: 34px; gap: 4px; }
  h2 { font-size: 22px; margin-top: 44px; }
  .lead { font-size: 18px; }
  .columns { flex-direction: column; gap: 32px; }
  table { font-size: 13.5px; }
}
