/* Shared by every post. The tokens are lifted from the site's index.html so
   the blog is the same site rather than a thing bolted onto it: same dark
   default, same light override, same Inter-with-system-fallbacks (no webfont
   request), same radii and rules. */

:root {
  color-scheme: dark light;
  --bg: #07111f;
  --bg-2: #0a1626;
  --surface: rgba(15, 29, 47, .78);
  --surface-strong: #0e1d30;
  --surface-soft: rgba(255, 255, 255, .035);
  --text: #f4f8ff;
  --muted: #9fb0c8;
  --faint: #6f839f;
  --line: rgba(180, 205, 235, .14);
  --line-strong: rgba(180, 205, 235, .24);
  --cyan: #59e4ff;
  --blue: #7aa2ff;
  --green: #73f0bb;
  --amber: #f5c96a;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
  --radius: 22px;
  --radius-sm: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f7fb;
    --bg-2: #eef3f9;
    --surface: rgba(255, 255, 255, .86);
    --surface-strong: #ffffff;
    --surface-soft: rgba(17, 50, 84, .035);
    --text: #0c1a2b;
    --muted: #52657d;
    --faint: #7b8da3;
    --line: rgba(18, 50, 84, .11);
    --line-strong: rgba(18, 50, 84, .18);
    --cyan: #007d99;
    --blue: #365de6;
    --green: #0a9262;
    --amber: #a56200;
    --shadow: 0 24px 70px rgba(40, 72, 107, .13);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 8%, color-mix(in srgb, var(--blue) 11%, transparent), transparent 28rem),
    radial-gradient(circle at 86% 22%, color-mix(in srgb, var(--cyan) 9%, transparent), transparent 26rem),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 52%, var(--bg) 100%);
  font: 16px/1.7 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 16px of gutter at phone width, and a reading column that does not get wide
   enough to lose the line. */
.wrap {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 16px 6rem;
}

/* ------------------------------------------------------------------ chrome */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 0 2.4rem;
  font-size: .92rem;
}

.topbar a { color: var(--muted); text-decoration: none; }
.topbar a:hover { color: var(--text); }
.topbar .home { display: inline-flex; align-items: center; gap: .5rem; }

.kicker {
  font: 600 .74rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 .9rem;
}

/* -------------------------------------------------------------------- prose */

h1 {
  font-size: clamp(1.9rem, 5.2vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 1rem;
}

.standfirst {
  font-size: 1.12rem;
  color: var(--muted);
  margin: 0 0 1.6rem;
}

.byline {
  font: .84rem/1.5 var(--mono);
  color: var(--faint);
  padding-bottom: 2rem;
  margin-bottom: 2.4rem;
  border-bottom: 1px solid var(--line);
}

article h2 {
  font-size: 1.42rem;
  line-height: 1.25;
  letter-spacing: -.01em;
  margin: 3rem 0 .9rem;
}

article h3 {
  font-size: 1.1rem;
  margin: 2.2rem 0 .7rem;
}

article p { margin: 0 0 1.15rem; }

article a {
  color: var(--blue);
  text-decoration-color: var(--line-strong);
  text-underline-offset: .18em;
}

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

strong { color: var(--text); font-weight: 650; }

blockquote {
  margin: 1.6rem 0;
  padding: .2rem 0 .2rem 1.2rem;
  border-left: 2px solid var(--cyan);
  color: var(--muted);
  font-style: normal;
}

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

/* --------------------------------------------------------------------- code */

code {
  font: .88em/1.5 var(--mono);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .1em .36em;
}

/* overflow-x on the pre, not the page: a long line in a terminal transcript
   must not be able to widen the document at phone width. */
pre {
  margin: 1.5rem 0;
  padding: 1.05rem 1.15rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  box-shadow: var(--shadow);
}

pre code {
  font-size: .82rem;
  line-height: 1.55;
  background: none;
  border: 0;
  padding: 0;
  white-space: pre;
}

.out { color: var(--muted); }
.warn { color: var(--amber); }
.good { color: var(--green); }

/* -------------------------------------------------------------------- table */

.tablewrap { overflow-x: auto; margin: 1.6rem 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  min-width: 34rem;
}

th, td {
  text-align: left;
  padding: .62rem .7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font: 600 .74rem/1.3 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}

td code { font-size: .84em; }

/* -------------------------------------------------------------------- cards */

.note {
  margin: 1.8rem 0;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--amber);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  color: var(--muted);
}

.note strong { color: var(--text); }
.note :last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ listing */

.posts { list-style: none; margin: 0; padding: 0; }

.posts li { border-bottom: 1px solid var(--line); }

.posts a {
  display: block;
  padding: 1.5rem 0;
  text-decoration: none;
  color: inherit;
}

.posts a:hover h2 { color: var(--cyan); }

.posts h2 {
  margin: 0 0 .45rem;
  font-size: 1.24rem;
  line-height: 1.3;
  transition: color .15s ease;
}

.posts p { margin: 0 0 .5rem; color: var(--muted); font-size: .98rem; }

.posts .meta { font: .78rem/1.4 var(--mono); color: var(--faint); }

/* --------------------------------------------------------------------- foot */

.foot {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-size: .92rem;
  color: var(--muted);
}

.foot a { color: var(--blue); }
