/* The hand-written pages (blog/, /faq, /privacy, /terms, 404), dressed like the landing page (night, ivory, gold;
   Newsreader for headlines, Inter for text, Instrument Serif for the wordmark). Shared by every page outside the
   landing film and the docs. Two themes: night (the default) and paper, picked by the reader with the button in
   the bar (pages.js) and kept in localStorage; a small script in each page's head applies it before the first paint. */

@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/instrument-serif-latin.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url(/assets/fonts/instrument-serif-italic-latin.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/assets/fonts/inter-latin.woff2) format('woff2'); }
/* Newsreader for headlines: a serif with optical sizes (6..72), so it stays open at every heading size, unlike the
   condensed Instrument Serif, which is kept for the wordmark and the diagrams' labels (their layout is measured on it). */
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/newsreader-latin.woff2) format('woff2'); }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 400; font-display: swap; src: url(/assets/fonts/newsreader-italic-latin.woff2) format('woff2'); }

/* Colors are built from two RGB triplets so the diagrams below can take any alpha of them in either theme. The night
   is a little lifted and far less saturated than the landing's (#070a1b): pale text on deep saturated blue swims. */
:root {
    --ink: 236, 230, 219;
    --gold-rgb: 241, 200, 143;
    --night: #0f121d;
    --deep: #181d31;
    --ivory: rgb(var(--ink));
    --text: rgba(var(--ink), .86);
    --dim: rgba(var(--ink), .74);
    --faint: rgba(var(--ink), .6);
    --gold: rgb(var(--gold-rgb));
    --line: rgba(var(--ink), .12);
    --card: rgba(var(--ink), .04);
    --img: brightness(.88); /* bright paintings glare on the night */
    --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    --display: 'Newsreader', 'Iowan Old Style', Georgia, serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --gut: clamp(16px, 5vw, 64px);
    --measure: 660px; /* about 66 characters of Inter at 18px */
    color-scheme: dark;
}

:root[data-theme="light"] {
    --ink: 36, 30, 22;
    --gold-rgb: 146, 92, 22;
    --night: #f4efe5;
    --deep: #fcfaf5;
    --text: rgba(var(--ink), .9);
    --dim: rgba(var(--ink), .74);
    --faint: rgba(var(--ink), .62);
    --line: rgba(var(--ink), .14);
    --card: rgba(var(--ink), .03);
    --img: none;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(120% 60% at 50% 0%, var(--deep), var(--night) 70%) var(--night);
    color: var(--ivory);
    font: 400 17px/1.7 var(--sans);
    -webkit-font-smoothing: antialiased;
    font-kerning: normal;
    overflow-wrap: break-word;
}

::selection { background: rgba(var(--gold-rgb), .32); }

a { color: var(--gold); text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: rgba(var(--gold-rgb), .55); }
a:hover { color: var(--ivory); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 8px; padding: 8px 14px; background: var(--ivory); color: var(--night); border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px var(--gut); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ivory); text-decoration: none; font: 400 1.35rem/1 var(--serif); }
.brand img { width: 19px; height: 22px; }
:root[data-theme="light"] .brand img { filter: invert(1); }
.bar nav { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); font-size: .92rem; }
.bar nav a { color: var(--dim); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--ivory); }
.bar .cta { padding: 8px 16px; border: 1px solid var(--gold); border-radius: 999px; color: var(--gold); white-space: nowrap; }
.bar .cta:hover { background: var(--gold); color: var(--night); }
.theme { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; color: var(--dim); cursor: pointer; }
.theme:hover { color: var(--ivory); border-color: var(--faint); }
.theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
@media (max-width: 560px) { .bar .docs { display: none; } }

main { padding: clamp(40px, 8vw, 88px) var(--gut) clamp(56px, 10vw, 112px); }

.eyebrow { margin: 0 0 14px; color: var(--gold); font: 600 .78rem/1.4 var(--sans); letter-spacing: .18em; text-transform: uppercase; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; font-optical-sizing: auto; line-height: 1.12; letter-spacing: -.012em; text-wrap: balance; }
h1 { margin: 0 0 20px; font-size: clamp(2.1rem, 5vw, 3.25rem); line-height: 1.08; }
h1 em, h2 em { color: var(--gold); }

/* index */
.blog-head { max-width: 860px; margin: 0 auto 48px; }
.blog-head p { max-width: 640px; margin: 0; color: var(--dim); font-size: 1.08rem; }
.posts { display: grid; gap: 20px; max-width: 860px; margin: 0 auto; padding: 0; list-style: none; }
.post-card { position: relative; padding: 28px clamp(20px, 4vw, 34px); background: var(--card); border: 1px solid var(--line); border-radius: 14px; transition: border-color .3s, background .3s; }
.post-card:hover { border-color: rgba(var(--gold-rgb), .45); background: rgba(var(--ink), .06); }
.post-card h2 { margin: 6px 0 10px; font-size: clamp(1.35rem, 2.6vw, 1.65rem); line-height: 1.2; }
.post-card h2 a { color: var(--ivory); text-decoration: none; }
.post-card h2 a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; } /* the whole card is the link */
.post-card p { margin: 0; color: var(--dim); line-height: 1.6; }
/* the thumbnail sits left of the words, top on phones; it is decoration (the title is the link's name) */
.post-card { display: grid; grid-template-columns: 184px minmax(0, 1fr); column-gap: 28px; align-content: center; }
.post-card > :not(.thumb) { grid-column: 2; }
.post-card .thumb { grid-column: 1; grid-row: 1 / span 3; align-self: center; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; filter: var(--img); transition: filter .3s; }
.post-card:hover .thumb { filter: none; }
@media (max-width: 600px) {
    .post-card { grid-template-columns: minmax(0, 1fr); }
    .post-card > :not(.thumb) { grid-column: 1; }
    .post-card .thumb { grid-row: auto; aspect-ratio: 16 / 9; margin-bottom: 18px; }
}
.meta { color: var(--faint); font: 400 .84rem/1.6 var(--sans); }

/* article */
.post { max-width: var(--measure); margin: 0 auto; font-size: 1.125rem; line-height: 1.75; } /* 18px */
.crumbs, .post .crumbs { margin: 0 0 28px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font: 400 .84rem/1.6 var(--sans); color: var(--faint); }
.post .crumbs li { margin: 0; color: inherit; }
.crumbs li + li::before { content: '›'; margin-right: 6px; }
.crumbs a { color: var(--faint); text-decoration: none; }
.crumbs a:hover { color: var(--ivory); }
.post .lede { margin: 0 0 18px; color: var(--dim); font-size: 1.22rem; line-height: 1.6; }
.post .meta { margin: 0 0 44px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.post h2 { margin: 60px 0 16px; font-size: clamp(1.6rem, 3.4vw, 2.05rem); line-height: 1.15; }
.post h3 { margin: 36px 0 10px; font: 600 1.05em/1.4 var(--sans); letter-spacing: 0; }
.post p, .post li { color: var(--text); }
.post p { margin: 0 0 1.1em; text-wrap: pretty; }
.post ul, .post ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.post li { margin-bottom: .45em; }
.post li::marker { color: var(--gold); }
.post strong { color: var(--ivory); font-weight: 600; }
.post em { font-style: italic; }
.post blockquote { margin: 32px 0; padding: 2px 0 2px 24px; border-left: 2px solid var(--gold); font: italic 400 1.28em/1.5 var(--display); color: var(--ivory); }
.post blockquote p { margin: 0 0 .6em; color: inherit; }
.post blockquote p:last-child { margin: 0; }
.turn { margin: 28px 0; padding: 22px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font: 400 1.12rem/1.6 var(--display); }
.turn p { margin: 0 0 10px; color: var(--ivory); }
.turn p:last-child { margin: 0; }
.turn .me { color: var(--gold); }
.turn figcaption { margin-bottom: 10px; font: 600 .74rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 560px) {
    .post { font-size: 1.0625rem; line-height: 1.7; } /* 17px */
}

/* figures: drawn diagrams (inline SVG, styled here so they share the page's fonts and colors) and the docs' paintings */
.fig { margin: 40px 0 44px; }
.fig figcaption { margin-top: 12px; color: var(--faint); font: 400 .86rem/1.55 var(--sans); }
.fig.wide { width: min(960px, calc(100vw - 2 * var(--gut))); margin-left: calc(50% - min(480px, 50vw - var(--gut))); }
.fig img { display: block; width: 100%; height: auto; border-radius: 12px; filter: var(--img); }
.fig .art { padding: clamp(16px, 3vw, 24px); background: rgba(var(--ink), .025); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; scrollbar-width: thin; }
.fig .art svg { display: block; width: 100%; min-width: 520px; height: auto; overflow: visible; }
.fig svg text { font-family: var(--sans); font-size: 14px; fill: rgba(var(--ink), .88); }
.fig svg .sf { font-family: var(--serif); font-size: 19px; fill: var(--ivory); }
.fig svg .it { font-family: var(--serif); font-style: italic; font-size: 17px; fill: var(--ivory); }
.fig svg .mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; fill: rgba(var(--ink), .82); }
.fig svg .sm { font-size: 12.5px; fill: var(--dim); }
.fig svg .ey { font-size: 11px; font-weight: 600; letter-spacing: .16em; fill: var(--faint); }
.fig svg .g { fill: var(--gold); }
.fig svg .fa { fill: var(--faint); }
.fig svg .box { fill: rgba(var(--ink), .045); stroke: rgba(var(--ink), .2); stroke-width: 1; }
.fig svg .box-g { fill: rgba(var(--gold-rgb), .1); stroke: rgba(var(--gold-rgb), .65); stroke-width: 1.2; }
.fig svg .ln { fill: none; stroke: rgba(var(--ink), .32); stroke-width: 1.4; }
.fig svg .ln-g { fill: none; stroke: var(--gold); stroke-width: 1.6; }
.fig svg .dash { stroke-dasharray: 4 5; }
.fig svg .dot { fill: rgba(var(--ink), .35); }
.fig svg .dot-g { fill: var(--gold); }
.fig svg .head { fill: var(--gold); }
.fig svg .head-d { fill: rgba(var(--ink), .45); }

.next { margin-top: 64px; padding: 30px clamp(20px, 4vw, 34px); background: linear-gradient(135deg, rgba(var(--gold-rgb), .1), rgba(var(--ink), .03)); border: 1px solid rgba(var(--gold-rgb), .3); border-radius: 14px; }
.next h2 { margin: 0 0 10px; font-size: 1.6rem; }
.next p { margin: 0 0 18px; }
.btn { display: inline-block; padding: 11px 22px; border-radius: 999px; background: var(--gold); color: var(--night); font: 600 1rem/1.4 var(--sans); text-decoration: none; }
.btn:hover { background: var(--ivory); color: var(--night); }
.next .link { margin-left: 14px; font: 400 1rem/1.4 var(--sans); }
@media (max-width: 480px) { .next .link { display: block; margin: 14px 0 0; } }

.more { margin-top: 48px; }
.more h2 { margin: 0 0 14px; font-size: 1.35rem; }
.more ul { padding-left: 1.2em; }

/* foot */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding: 28px var(--gut) 36px; border-top: 1px solid var(--line); color: var(--faint); font-size: .86rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { color: var(--dim); text-decoration: none; }
.foot a:hover { color: var(--ivory); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
