/*
 * One stylesheet for the whole site, served from /styles.css rather than
 * inlined into each page: twenty pages sharing one cached file beats twenty
 * copies of the same rules, and Core Web Vitals is a ranking input.
 *
 * No web fonts. A font file is a render-blocking request on a page whose
 * content is text, and the system stack looks native everywhere.
 */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #16161d;
  --muted: #5c5c6b;
  --line: #e2e2ea;
  --accent: #3b5bdb;
  --accent-soft: #eef1fd;
  --code-bg: #f5f5f8;
  --max: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f14;
    --fg: #e9e9f0;
    --muted: #9a9aab;
    --line: #2a2a36;
    --accent: #8ea6ff;
    --accent-soft: #1a1f33;
    --code-bg: #17171f;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  padding: .5rem .75rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  z-index: 10;
}

header.site {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem .9rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 650;
  text-decoration: none;
  color: var(--fg);
  letter-spacing: -.01em;
}

header.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

header.site nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
}
header.site nav a:hover { color: var(--accent); }
header.site nav a[aria-current="page"] { color: var(--fg); font-weight: 550; }

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.crumbs {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.crumbs a { color: var(--muted); }
.crumbs span:last-child { color: var(--fg); }

h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 .6rem;
}

h2 {
  font-size: 1.35rem;
  letter-spacing: -.01em;
  margin: 2.5rem 0 .6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

h3 { font-size: 1.05rem; margin: 1.8rem 0 .4rem; }

.lede {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

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

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

ul, ol { padding-left: 1.3rem; }
li { margin: .35rem 0; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .875em;
  background: var(--code-bg);
  padding: .12em .35em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .9rem 1rem;
  overflow-x: auto;
  font-size: .85rem;
  line-height: 1.55;
}
pre code { background: none; padding: 0; font-size: inherit; }

/* Wide content must scroll inside itself; the page body never does. */
.scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  margin: 1rem 0;
}
th, td {
  text-align: left;
  padding: .6rem .5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { font-weight: 600; }

blockquote {
  margin: 1.5rem 0;
  padding: .1rem 0 .1rem 1rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .9rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.cards li { margin: 0; }

.cards a {
  display: block;
  height: 100%;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}
.cards a:hover { border-color: var(--accent); background: var(--accent-soft); }
.cards strong { display: block; color: var(--accent); margin-bottom: .2rem; }
.cards span { color: var(--muted); font-size: .92rem; }

.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: .9rem 1rem;
  margin: 1.5rem 0;
  font-size: .95rem;
}
.note p { margin: .4rem 0; }
.note p:first-child { margin-top: 0; }
.note p:last-child { margin-bottom: 0; }

.cta {
  display: inline-block;
  padding: .7rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 550;
  margin: .4rem .4rem .4rem 0;
}
.cta.secondary {
  background: none;
  color: var(--accent);
  border: 1px solid var(--line);
}

footer.site {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}
footer.site p { margin: .4rem 0; }
footer.site .fine { font-size: .8rem; }

dl { margin: 1rem 0; }
dt { font-weight: 600; margin-top: 1.2rem; }
dd { margin: .3rem 0 0; color: var(--muted); }
