/* THE BLOG IS A ROOM OF THE LANDING, not of the legal pages: its tokens, type,
   bar, keys, closing ask and foot are public/landing.html's. They are copied
   rather than shared because the landing keeps its CSS inline, so a change to
   one of them is a change to both. The font files are the landing's, under the
   same addresses, so a reader who arrives from the front page has them. */
@font-face { font-family: 'Lexend Deca'; font-weight: 600; font-display: swap; src: url(/site-assets/fonts/lexend-deca-600-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Lexend Deca'; font-weight: 600; font-display: swap; src: url(/site-assets/fonts/lexend-deca-600-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400 500; font-display: swap; src: url(/site-assets/fonts/jetbrains-mono-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400 500; font-display: swap; src: url(/site-assets/fonts/jetbrains-mono-400-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Onest'; font-weight: 400 600; font-display: swap; src: url(/site-assets/fonts/onest-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-weight: 400 600; font-display: swap; src: url(/site-assets/fonts/onest-400-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #1A1A1A; --surface: #212121; --raised: #282828; --edge: #333333; --edge-2: #3F3F3F;
  --text: #F3F3EE; --muted: #C3C8C9; --faint: #8C9294; --head: #E9EEEF;
  --accent: #54DDE3; --accent-ink: #04222A;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Onest, sans-serif;
  --display: "Lexend Deca", "JetBrains Mono", "Roboto Mono", -apple-system, BlinkMacSystemFont, Onest, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sec: clamp(64px, 8.5vw, 132px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 16px/24px var(--sans); -webkit-font-smoothing: antialiased; }
main { flex: 1 0 auto; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.wrap { width: min(1280px, calc(100% - 80px)); margin: 0 auto; }
.col { width: min(960px, calc(100% - 36px)); margin: 0 auto; }
h1, h2 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -.03em; color: var(--head); text-wrap: balance; }

/* The bar: the mark, the landing's three chapters and the blog, and the one key. */
.nav { position: sticky; top: 0; z-index: 40; background: #111111; box-shadow: 0 1px 0 rgba(243, 243, 238, .10); }
.nav .wrap { position: relative; display: flex; align-items: center; gap: 32px; width: 100%; height: 64px; padding: 0 28px; }
.brand { display: flex; align-items: center; gap: 9px; min-height: 44px; font-weight: 600; }
.brand img { display: block; width: 26px; height: 32px; }
.nav .mid { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 28px; font: 14px var(--mono); color: var(--muted); }
.nav .mid a, .foot .r a { display: flex; align-items: center; min-height: 44px; transition: color .2s; }
.nav .mid a:hover { color: var(--text); }
.nav .r { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* The keys, cut the way the landing cuts them; see .btn there for why. */
.btn { --f: 13px; --lip: max(2px, calc(var(--f) * .1)); --lipc: #121212; --hi: rgba(243, 243, 238, .14);
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  height: calc(var(--f) * 2.06); padding: 0 calc(var(--f) * .644); border-radius: calc(var(--f) * .357);
  font: 500 var(--f)/1 var(--mono); white-space: nowrap; color: var(--text);
  background-color: #333333; background-image: linear-gradient(180deg, rgba(243, 243, 238, .07), rgba(0, 0, 0, .1));
  box-shadow: inset 0 1px 0 var(--hi), 0 var(--lip) 0 var(--lipc), 0 calc(var(--lip) * 3) calc(var(--lip) * 7) calc(var(--lip) * -3) rgba(0, 0, 0, .75);
  transition: background-color .16s ease-out, box-shadow .1s ease-out, transform .1s ease-out; }
.btn::after { content: ""; position: absolute; left: 0; right: 0; top: min(0px, calc((100% - 44px) / 2)); bottom: min(0px, calc((100% - 44px) / 2)); }
.btn:hover { transition-duration: 0s; background-color: var(--edge-2); }
.btn:active { transform: translateY(var(--lip)); box-shadow: inset 0 1px 0 var(--hi); }
.btn.flat { background: none; box-shadow: none; color: var(--muted); }
.btn.flat:hover { background-color: rgba(255, 255, 255, .08); color: var(--text); }
.btn.flat:active { transform: none; }
.btn.lit { --f: clamp(17px, 1.5vw, 23px); --lipc: #1B6D77; --hi: rgba(255, 255, 255, .45); background-color: var(--accent); color: var(--accent-ink); }
.btn.lit:hover { background-color: #8BF0FF; }

/* The head of a page stands on the hero's field of unlit lamps. */
.top { padding: clamp(48px, 7vw, 104px) 0 clamp(40px, 5vw, 72px); margin-bottom: clamp(40px, 5vw, 64px);
  background-image: radial-gradient(circle, #242424 1.5px, transparent 1.85px); background-size: 4px 4px; }
.kicker { margin: 0 0 20px; font: 13px/1.5 var(--mono); color: var(--faint); }
.kicker a { transition: color .2s; }
.kicker a:hover { color: var(--accent); }
h1 { max-width: 22ch; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.06; }
.top .sub { max-width: 52ch; margin: 20px 0 0; color: var(--muted); font-weight: 500; font-size: clamp(16px, 1.35vw, 21px); line-height: 1.45; text-wrap: balance; }

/* The article. Its first list is the contents the post writes under its title. */
article p, article li { color: var(--muted); font-size: 18px; line-height: 1.7; text-wrap: pretty; }
article p { margin: 0 0 24px; }
article ul, article ol { margin: 0 0 24px; padding-left: 24px; }
article li::marker { color: var(--faint); }
article strong { color: var(--head); font-weight: 600; }
article em { color: var(--text); }
article h2 { margin: 72px 0 20px; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.15; scroll-margin-top: 96px; }
/* A section is set apart by the space over its heading, not by a rule. */
article hr { display: none; }
article a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(84, 221, 227, .45); text-underline-offset: 3px; }
article a:hover { text-decoration-color: currentColor; }
article > ul:first-child { margin: 0 0 48px; padding: 20px 24px; list-style: none; counter-reset: toc;
  background: var(--surface); border: 1px solid var(--edge); border-radius: 8px; }
article > ul:first-child li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; padding: 5px 0; font-size: 14px; line-height: 20px; counter-increment: toc; }
article > ul:first-child li::before { content: counter(toc, decimal-leading-zero); font: 12px/20px var(--mono); color: var(--faint); }
/* A sub-list takes the row under its heading, lined up with the heading's text. */
article > ul:first-child ul { grid-column: 2; margin: 0; padding: 0; list-style: none; }
article > ul:first-child a { color: var(--muted); text-decoration: none; transition: color .2s; }
article > ul:first-child a:hover { color: var(--accent); }
article .table { overflow-x: auto; margin: 8px 0 32px; }
article table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
article th, article td { padding: 14px 12px; text-align: left; vertical-align: top; text-wrap: pretty; }
article th:first-child, article td:first-child { padding-left: 0; }
article thead th { font: 500 13px/1.4 var(--mono); color: var(--faint); vertical-align: bottom; }
article tbody tr { border-top: 1px solid var(--edge); }
article td { color: var(--muted); }
article td:first-child { min-width: 150px; color: var(--head); font-weight: 600; }
/* While the table scrolls, the names of its rows stay put. */
article th:first-child, article td:first-child { position: sticky; left: 0; background: var(--bg); }
/* On a wide window the contents leave the column and stay beside it. A grid
   rather than a float, because sticky needs a box as tall as the article; the
   span is that box. ponytail: a post past 400 blocks loses the contents early. */
@media (min-width: 1100px) {
  article { display: grid; grid-template-columns: minmax(0, 1fr) 220px; column-gap: 48px; align-items: start; }
  article > * { grid-column: 1; }
  article > ul:first-child { grid-column: 2; grid-row: 1 / span 400; position: sticky; top: 96px; margin: 0; }
  article > ul:first-child + * { margin-top: 0; }
}

/* The blog's own page: every post as one block to press. */
.posts { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.posts a { display: block; padding: clamp(22px, 2.4vw, 32px); background: var(--surface); border: 1px solid var(--edge); border-radius: 8px; transition: background-color .16s ease-out, border-color .16s ease-out; }
.posts a:hover { background: var(--raised); border-color: var(--edge-2); }
.posts time { font: 13px/1.5 var(--mono); color: var(--faint); }
.posts h2 { margin-top: 10px; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.15; }
.posts p { max-width: 64ch; margin: 12px 0 0; color: var(--muted); line-height: 1.55; text-wrap: pretty; }

/* The way in, again, at the bottom: the landing's closer, word for word. */
.close { padding: var(--sec) 18px; text-align: center; }
.close h2 { font-size: clamp(38px, 5.2vw, 86px); line-height: 1.04; }
.close p { max-width: 46ch; margin: clamp(12px, 1.2vw, 20px) auto clamp(24px, 2.6vw, 38px); color: var(--muted); font-weight: 500; font-size: clamp(16px, 1.35vw, 21px); line-height: 1.45; text-wrap: balance; }

/* The page ends on the landing's scale. */
.foot { margin-top: auto; padding: 0 0 56px; background-repeat: repeat-x; background-position: 0 100%, 0 100%; background-size: 100% 46px, 100% 22px;
  background-image: repeating-linear-gradient(90deg, var(--edge) 0, var(--edge) 1px, transparent 1px, transparent 96px), repeating-linear-gradient(90deg, #262626 0, #262626 1px, transparent 1px, transparent 16px); }
.foot .wrap { display: flex; align-items: center; gap: 24px; height: 64px; font: 12px var(--mono); color: var(--muted); }
.foot .r { margin-left: auto; display: flex; gap: 22px; }
.foot .r a { min-width: 44px; justify-content: center; }
.foot .r a:hover { color: var(--accent); }
.foot .brand { color: var(--text); font: 600 16px var(--sans); }
.foot .brand img { width: 20px; height: 24px; }

@media (max-width: 960px) {
  .wrap { width: calc(100% - 36px); }
  .nav .wrap { height: 56px; padding: 0 16px; gap: 16px; }
  .nav .mid { position: static; transform: none; margin-left: 24px; }
  .foot { padding-bottom: 40px; background-size: 100% 32px, 100% 15px; }
  .foot .wrap { flex-wrap: wrap; gap: 14px; height: auto; padding: 22px 0; }
  .foot .r { flex-wrap: wrap; row-gap: 0; }
}
/* On a phone the bar keeps the mark and the key; the foot has the rest. */
@media (max-width: 700px) {
  .nav .mid, .nav .flat { display: none; }
  article p, article li { font-size: 17px; }
}
