/* progrium.xyz
   One column, one family (Recursive), one pixel font for the wordmark.
   Sans for reading, casual for the informal bits, mono for the machinery. */

@font-face {
  font-family: "Recursive";
  src: url("/_assets/fonts/Recursive.woff2") format("woff2");
  font-weight: 300 1000;
  font-style: oblique 0deg 15deg;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("/_assets/fonts/Silkscreen-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("/_assets/fonts/Silkscreen-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #111; --soft: #6e6e6e; --hair: #e4e4e4; --paper: #fff; --shade: #f3f3f1;
  --dim: #444; --faint: #9a9a9a; --tended: #a0a0a0; --placeholder: #aaa;
  --sans: "Recursive", ui-sans-serif, system-ui, sans-serif;
  --mono: "Recursive", ui-monospace, Menlo, monospace;
  --pixel: "Silkscreen", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ececec; --soft: #8e8e8e; --hair: #2a2a2a; --paper: #0b0b0b; --shade: #171717;
    --dim: #b8b8b8; --faint: #6a6a6a; --tended: #6a6a6a; --placeholder: #5c5c5c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #ececec; --soft: #8e8e8e; --hair: #2a2a2a; --paper: #0b0b0b; --shade: #171717;
  --dim: #b8b8b8; --faint: #6a6a6a; --tended: #6a6a6a; --placeholder: #5c5c5c;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-variation-settings: "MONO" 0, "CASL" 0;
  font-size: 17.5px;
  line-height: 1.62;
  font-weight: 380;
  container-type: inline-size;
}
h1, h2, h3, p, figure, dl, dd, pre, blockquote { margin: 0; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img, video, iframe { max-width: 100%; }
img { height: auto; }
::selection { background: var(--ink); color: var(--paper); }

/* the machinery voice: dates, nav, meta, code */
.mono, .meta, .nav, .foot, .yr, .byline, .now, .sec, .more, .src, .cont,
.reply-row, .prevnext, .nl-home, .nl-row, .pl, .yrs, .dl, figcaption, code, pre, .vid .vt, .vid .vs, .term {
  font-family: var(--mono);
  font-variation-settings: "MONO" 1, "CASL" 0;
}
.mono, .meta, .nav, .foot, .yr, .byline, .now, .sec, .more, .reply-row, .nl-home, .nl-row, .dl {
  font-size: 13.5px;
  font-weight: 400;
}
/* the casual voice: logs, links, margin notes */
.casual, .e-log .e-body, .e-link .e-body, .logpost .e-body, .sn, .nl-lead {
  font-variation-settings: "MONO" 0, "CASL" 1;
  font-weight: 400;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
.site {
  max-width: calc(34em + 40px);
  margin: 0 auto;
  padding: 44px 20px 0;
}
main { max-width: 34em; }

/* ---------- header ---------- */
.head {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "name" "who" "nav";
  column-gap: 24px;
  max-width: 34em;
  margin-bottom: 40px;
}
.wordmark {
  grid-area: name;
  justify-self: start;
  display: inline-block;
  line-height: 1;
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 26px;
  text-decoration: none;
  text-transform: lowercase;
}
.wordmark::after { content: "_"; opacity: 0; }
.wordmark:hover::after { opacity: 1; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.who {
  grid-area: who;
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-variation-settings: "MONO" 1, "CASL" 0;
  font-size: 14px;
  color: var(--soft);
}
.who::before { content: "aka "; color: var(--faint); }
.nav { grid-area: nav; margin-top: 12px; color: var(--soft); }
.nav::before { content: "[ "; }
.nav::after { content: " ]"; }
.nav a + a::before { content: " | "; color: var(--soft); display: inline-block; white-space: pre; text-decoration: none; }
.nav a[aria-current] { text-decoration: none; font-weight: 500; }
@container (min-width: 620px) {
  .head { grid-template-columns: auto 1fr; grid-template-areas: "name nav" "who nav"; }
  .nav { align-self: start; justify-self: end; margin-top: 0; padding-top: 6px; line-height: 1; white-space: nowrap; font-size: 14px; }
}

/* ---------- home ---------- */
.intro { font-size: 19px; line-height: 1.55; }
.intro p + p { margin-top: .7em; color: var(--dim); }
.now { margin-top: 1.1em; }
.now-k { color: var(--soft); margin-right: .6em; }
.sec { font-weight: 500; color: var(--soft); margin: 44px 0 6px; text-transform: lowercase; }
.more { margin-top: 26px; }

/* ---------- streams ---------- */
.yr { color: var(--soft); margin: 26px 0 4px; }
.yeargroup:first-of-type > .yr { margin-top: 8px; }
.stream { display: grid; gap: 18px; }
.e { min-width: 0; }
.meta { color: var(--soft); }
.meta .k::before, .meta .len::before { content: " · "; }
.meta .mark { margin-left: .4em; }
.e-body { min-width: 0; }
.e-body p + p { margin-top: .75em; }
.e-article h3 { font-size: 21px; font-weight: 720; letter-spacing: -.01em; line-height: 1.3; text-wrap: balance; }
.e-article h3 a { text-decoration: none; }
.e-article h3 a:hover { text-decoration: underline; }
.dek { color: var(--dim); }
.e-link h3, .e-log h3 { font-size: 17.5px; font-weight: 600; line-height: 1.4; }
.e-log h3 { margin-bottom: .35em; }
.e-log h3 a { text-decoration: none; }
.e-log h3 a:hover { text-decoration: underline; }
.src { font-size: 12.5px; color: var(--soft); font-weight: 400; margin-left: .4em; }
.cont { display: inline-block; margin-top: 4px; font-size: 13px; color: var(--soft); }
.cont, .permalink, .backlinks { color: var(--soft); }
.permalink { text-decoration: none; }
.permalink:hover { text-decoration: underline; }

/* compact list: articles index */
.compact .stream { gap: 6px; }
.compact .e { display: grid; grid-template-columns: 4.2em 1fr; gap: 0 10px; align-items: baseline; }
.compact .yr { margin-top: 22px; }
.compact .yeargroup:first-child .yr { margin-top: 0; }
.compact h3 { font-size: 17.5px; font-weight: 500; line-height: 1.45; }
.compact h3 a { text-decoration: none; }
.compact h3 a:hover { text-decoration: underline; }

/* logs index */
.journal { display: grid; gap: 26px; }
.journal .jm { margin: 12px 0 -8px; }
.journal .jm:first-child { margin-top: 0; }
.journal .meta { margin-bottom: 4px; }

/* ---------- posts ---------- */
.post { position: relative; }
.post h1 { font-size: 38px; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; text-wrap: balance; }
.byline { color: var(--soft); margin: 12px 0 30px; }
.byline a { color: var(--soft); }
.body > * + * { margin-top: 1em; }
.body h2 { font-size: 1.3em; font-weight: 720; letter-spacing: -.01em; line-height: 1.25; margin-top: 1.8em; }
.body h3 { font-size: 1.08em; font-weight: 700; margin-top: 1.6em; }
.body h4 { font-size: 1em; font-weight: 700; margin-top: 1.4em; }
.body ul, .body ol { padding-left: 1.3em; }
.body li + li { margin-top: .3em; }
.body blockquote { border-left: 2px solid var(--ink); padding-left: 16px; color: var(--dim); }
.body hr { border: 0; border-top: 1px solid var(--hair); margin: 2em 0; }
.body img { display: block; margin: 1.4em 0; }
.body table { border-collapse: collapse; font-size: .9em; }
.body td, .body th { border-bottom: 1px solid var(--hair); padding: 6px 10px 6px 0; text-align: left; }

/* margin notes: inline on narrow screens, in the margin when there's room */
.sn { display: block; font-size: 14.5px; line-height: 1.45; color: var(--dim); margin: 1em 0; padding-left: 12px; border-left: 1px solid var(--hair); }
@container (min-width: 1200px) {
  .sn { position: absolute; right: -15.5em; width: 13em; margin: 0; padding-left: 0; border: 0; transform: translateY(-4.6em); }
}

/* code */
code { font-size: .88em; background: var(--shade); padding: .05em .3em; }
pre { position: relative; background: var(--shade); padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.6; tab-size: 4; }
pre code { background: none; padding: 0; font-size: inherit; }
pre[data-lang]::before { content: attr(data-lang); position: absolute; right: 10px; top: 6px; font-size: 11px; color: var(--soft); }
.chroma [class^="k"], .chroma .nt { font-weight: 700; }
.chroma [class^="c"]:not(.cl) { color: var(--soft); font-variation-settings: "MONO" 1, "CASL" 1; }

/* figures */
figure { margin: 1.4em 0; }
figure svg { display: block; width: 100%; height: auto; color: var(--ink); }
figcaption { margin-top: 8px; font-size: 13px; color: var(--soft); }

/* youtube facade */
.vid {
  position: relative; display: block; width: 100%; aspect-ratio: 16/9; margin: 10px 0;
  background: #0d0d0d; color: #fff; overflow: hidden; cursor: pointer; text-decoration: none;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 4px);
}
:root[data-theme="dark"] .vid { outline: 1px solid var(--hair); }
.vid .play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 2px solid #fff; border-radius: 50%; }
.vid .play::after { content: ""; position: absolute; left: 25px; top: 19px; border-style: solid; border-width: 12px 0 12px 19px; border-color: transparent transparent transparent #fff; }
.vid:hover .play { background: #fff; }
.vid:hover .play::after { border-left-color: #0d0d0d; }
.vid .vt { position: absolute; left: 14px; top: 12px; right: 14px; font-size: 15px; font-weight: 600; }
.vid .vs { position: absolute; left: 14px; bottom: 10px; font-size: 12px; color: #aaa; }
iframe.vid { border: 0; cursor: auto; }

/* ---------- keycaps: reserved for actions ---------- */
.key, .nl button {
  display: inline-block;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
  border: 1px solid var(--ink);
  border-bottom-width: 3px;
  border-radius: 5px;
  padding: 4px 12px;
  cursor: pointer;
}
/* press: the ledge gives 1px back to padding, so the box keeps its size and nothing around it moves */
.key:hover, .nl button:hover { transform: translateY(1px); border-bottom-width: 2px; padding-bottom: 5px; }
.key:focus-visible, .nl button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.key.small { padding: 1px 8px; }
.key.small:hover { padding-bottom: 2px; }

/* ---------- end of a post ---------- */
.reply-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 32px; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--hair); font-size: 13.5px; }
.prevnext a { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-decoration: none; }
.prevnext a:hover { text-decoration: underline; }
.prevnext .next { grid-column: 2; text-align: right; align-items: flex-end; }
.prevnext .pn-k { color: var(--soft); font-size: 12px; }
.logpost .e-body p { font-size: 1.12em; line-height: 1.55; }
.logpost .byline { margin-bottom: 18px; }
.logpost .log-h { margin-bottom: 22px; }

/* ---------- newsletter ---------- */
.nl input {
  font: inherit; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px dashed var(--ink); border-radius: 0;
  padding: 4px 2px; min-width: 0;
}
.nl input::placeholder { color: var(--placeholder); }
.nl input:focus { outline: none; border-bottom-style: solid; }
.nl button::after { content: " ⏎"; }
.nl-home { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 24px; background: var(--shade); padding: 12px 18px; }
.nl-home label { color: var(--soft); }
.nl-home input { flex: 1 1 12em; }
.nl-box { margin-top: 36px; padding: 16px 18px; background: var(--shade); }
.nl-lead { font-size: 16px; margin-bottom: 10px; }
.nl-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.nl-row input { flex: 1 1 14em; }
.nl .hp { position: absolute; left: -5000px; }

/* ---------- projects ---------- */
.proj-group { display: grid; gap: 18px; }
.proj { display: grid; grid-template-columns: 2em 1fr; gap: 2px 10px; }
.proj .g { grid-row: span 3; font-size: 1.2em; line-height: 1.3; }
.proj b { font-weight: 700; }
.proj .pname { text-decoration: underline; }
.proj b a:not(.pname) { text-decoration: none; }
.yrs { font-size: 13px; color: var(--soft); margin-left: .4em; }
.proj .d { grid-column: 2; font-size: 16.5px; color: var(--dim); }
.pl { grid-column: 2; font-size: 13px; color: var(--soft); }
.pl a { color: var(--soft); }

/* ---------- hubs: project and tag pages ---------- */
.hub-meta { color: var(--soft); font-family: var(--mono); font-variation-settings: "MONO" 1, "CASL" 0; font-size: 13.5px; margin-bottom: 10px; }
.pixel-h1 { font-family: var(--pixel); font-weight: 700; font-size: 28px; line-height: 1.1; text-transform: lowercase; margin-bottom: .2em; }
.hub-links { font-size: 13.5px; margin-bottom: 18px; }
.story p + p { margin-top: .8em; }
.hub-projs a { text-decoration: none; margin-right: .8em; }
.hub-projs a:hover { text-decoration: underline; }
.hub .sec { margin-top: 36px; }

/* ---------- about ---------- */
.about-top { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.about-top > div { flex: 1 1 16em; min-width: 0; }
.portrait { display: block; width: 150px; filter: grayscale(1); }
:root[data-theme="dark"] .portrait { filter: grayscale(1) brightness(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .portrait { filter: grayscale(1) brightness(.9); } }
.about-top p + p { margin-top: .8em; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; margin-top: 22px; font-size: 14px; }
.dl dt { color: var(--soft); }
.dl dd { display: flex; flex-wrap: wrap; gap: 0 .9em; }
.tl { margin-top: 44px; }
.tl .sec { margin: 0 0 12px; }
.tl .yeargroup { display: grid; grid-template-columns: 3.6em 1fr; gap: 0 10px; margin-top: 10px; }
.tl .yr { margin: 0; padding-top: .15em; }
.tl .stream { gap: 2px; }
.tl .ev { display: grid; grid-template-columns: 1.6em 2.8em 1fr; gap: 0 6px; align-items: baseline; font-size: 16px; line-height: 1.75; }
.tl .ev .meta { font-size: 13.5px; }

/* ---------- docs ---------- */
.doc h1 { font-size: 32px; }
.doc-dek { color: var(--soft); margin-bottom: 18px; }
.toc { margin: 0 0 8px; padding-left: 0; list-style-position: inside; color: var(--soft); font-size: .9em; font-family: var(--mono); font-variation-settings: "MONO" 1, "CASL" 0; }
.doc-foot { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--hair); color: var(--soft); display: grid; gap: 4px; }
.doc-foot a { color: var(--soft); }

/* ---------- 404 ---------- */
.e404 { padding: 20px 0 10px; }
.big404 { font-family: var(--pixel); font-weight: 700; font-size: 72px; line-height: 1; letter-spacing: .04em; }
.cur { animation: blink 1s steps(1) infinite; }
.term { margin-top: 28px; font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; background: none; padding: 0; }

/* ---------- footer ---------- */
.foot {
  max-width: 595px; margin: 64px 0 0; padding: 16px 0 28px;
  border-top: 1px solid var(--hair); color: var(--soft);
  display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between;
}
.foot a { color: var(--soft); }
.elsewhere { display: inline-flex; flex-wrap: wrap; gap: 0 .9em; }
.tended { flex-basis: 100%; margin-top: 4px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--tended); }
.keys { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.keys .key { color: var(--ink); }
.built { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .wordmark:hover::after, .cur { animation: none; }
  .key:hover, .nl button:hover { transform: none; }
}

/* what links here */
.backlinks summary { cursor: pointer; list-style: none; text-decoration: underline; text-underline-offset: 3px; }
.backlinks summary::-webkit-details-marker { display: none; }
.backlinks ul { margin: 8px 0 0; padding: 0; list-style: none; }
.backlinks li a { color: var(--soft); }
.byline .tags a + a::before { content: ", "; color: var(--soft); display: inline-block; white-space: pre; text-decoration: none; }

/* On narrow screens titles wrap, so tighten each title and open up the gaps between them. */
@container (max-width: 620px) {
  .compact .stream { gap: 14px; }
  .compact h3 { line-height: 1.3; }
}

/* On narrow screens the signup label takes its own line, and the input and button share the next. */
@container (max-width: 620px) {
  .nl-home label { flex-basis: 100%; }
  .nl-home input, .nl-row input { flex: 1 1 0; }
  .nl button { flex: none; }
}

/* On narrow screens the footer rows stack, so give them room to breathe. */
@container (max-width: 620px) {
  .foot { row-gap: 12px; }
  .elsewhere { gap: 4px 1.4em; }
  .tended { margin-top: 6px; row-gap: 14px; }
}
