/* One stylesheet, no framework, no webfonts. The whole point of the blog is
   that a long technical answer is readable without LinkedIn's constraints, so
   everything here serves the measure, the code blocks and the tables. */

:root {
  --bg:      #fbfaf8;
  --fg:      #1b1b1a;
  --muted:   #5d5c58;
  --rule:    #e0ddd6;
  --link:    #1b4d7a;
  --codebg:  #f2efe9;
  --marker:  #8a5a1f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #16181a;
    --fg:     #e6e4df;
    --muted:  #a09d95;
    --rule:   #2e3236;
    --link:   #8fc0e8;
    --codebg: #1e2225;
    --marker: #d9a45b;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 1.25rem;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main, header.site, footer.site { max-width: 40rem; margin: 0 auto; }

header.site { padding: 2rem 0 0; }
header.site .home {
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--muted);
}
header.site .home:hover { color: var(--fg); }

footer.site {
  margin-top: 4rem;
  padding: 1.25rem 0 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

h1 { font-size: 1.75rem; line-height: 1.25; margin: 2rem 0 0.5rem; }
h2 { font-size: 1.25rem; margin: 2.5rem 0 0.5rem; }
h3 { font-size: 1.0625rem; margin: 1.75rem 0 0.375rem; }

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

/* The metadata strip under the title: how deep the piece goes, and the date the
   claims in it were last checked. The freshness line is not decoration -- a
   version-dependent claim with no date on it is the thing that ages badly. */
p.meta {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}
p.meta span + span::before { content: " · "; }
p.meta .freshness { white-space: nowrap; }

p.provenance {
  margin: 0 0 2rem;
  padding-left: 0.875rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Code. No token colours by design -- see the note in hugo.toml. */
code, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875rem;
}
code { background: var(--codebg); padding: 0.1em 0.3em; border-radius: 3px; }
pre {
  background: var(--codebg);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.875rem 1rem;
  overflow-x: auto;         /* long SQL scrolls in its own box, not the page */
  line-height: 1.5;
}
pre code { background: none; padding: 0; }

/* Tables are how trade-offs get shown. On a phone they scroll rather than
   squeezing the page sideways. */
.table-wrap, table { display: block; max-width: 100%; overflow-x: auto; }
table { border-collapse: collapse; font-size: 0.9375rem; }
th, td { border: 1px solid var(--rule); padding: 0.4rem 0.625rem; text-align: left; }
th { background: var(--codebg); }

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

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

ul.posts { list-style: none; padding: 0; }
ul.posts li { padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
ul.posts a { font-weight: 600; text-decoration: none; }
ul.posts a:hover { text-decoration: underline; }
ul.posts .blurb { display: block; color: var(--muted); font-size: 0.9375rem; }

.footnotes {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--muted);
}
.footnotes a { overflow-wrap: anywhere; }

p.backlink { margin-top: 3rem; font-size: 0.9375rem; }

img { max-width: 100%; height: auto; }
