/* pasiaj.com — writing.
   A dark masthead in the Daring Fireball tradition over a warm, generous
   reading column in the Stratechery one. Serif for reading, sans for chrome. */

:root {
  --paper: #fbfaf6;
  --paper-2: #f3f0e8;
  --ink: #1c1b19;
  --ink-2: #3d3a35;
  --muted: #736d63;
  --rule: #e2ddd1;
  --accent: #b53a16;
  --accent-soft: #f4e3d9;
  --band: #1f2124;
  --band-ink: #f2efe8;
  --band-muted: #9a978f;
  --wiki: #1d6b78;
  --wiki-soft: #e2eff0;

  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 36rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16171a;
    --paper-2: #1e2024;
    --ink: #ebe7df;
    --ink-2: #cdc8bd;
    --muted: #938d82;
    --rule: #2f3136;
    --accent: #ec7a4f;
    --accent-soft: #3a2519;
    --band: #0c0d0f;
    --band-ink: #ebe7df;
    --band-muted: #7d7a73;
    --wiki: #6cc3cf;
    --wiki-soft: #16292c;
    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: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
.mono { font-family: var(--mono); font-size: .9em; }

/* Masthead ------------------------------------------------------------------ */

.masthead {
  background: var(--band);
  color: var(--band-ink);
  border-bottom: 3px solid var(--accent);
}
.masthead-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.1rem var(--gutter) 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem 2rem;
}
.wordmark { text-decoration: none; display: flex; flex-direction: column; gap: .1rem; }
.wordmark-name {
  font: 700 1.6rem/1.1 var(--serif);
  letter-spacing: -.01em;
}
.wordmark-name::after { content: "."; color: var(--accent); }
.wordmark-tag { font: 400 .8rem/1.3 var(--sans); color: var(--band-muted); letter-spacing: .01em; }

.nav { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; font: 500 .8rem/1 var(--sans); text-transform: uppercase; letter-spacing: .08em; }
.nav a { text-decoration: none; color: var(--band-muted); padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--band-ink); }
.nav a[aria-current="page"] { color: var(--band-ink); border-bottom-color: var(--accent); }
.nav a.nav-wiki::before { content: "◇ "; color: #6cc3cf; }

/* Layout -------------------------------------------------------------------- */

.layout {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 4rem;
}
@media (min-width: 64rem) {
  .layout { grid-template-columns: minmax(0, 44rem) 17rem; justify-content: space-between; }
}
.narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) 4rem; }
.wide { max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter) 4rem; }

/* Front page stream --------------------------------------------------------- */

.stream { padding-bottom: 3rem; }
.entry { padding: 2.75rem 0 2.5rem; border-bottom: 1px solid var(--rule); }
.entry:last-of-type { border-bottom: 0; }

.dateline {
  margin: 0 0 .6rem;
  font: 600 .72rem/1.2 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem;
}
.dateline .sep { color: var(--rule); }

.entry-title, .post-title, .page-title {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.12;
  margin: 0 0 1.1rem;
  text-wrap: balance;
}
.entry-title { font-size: clamp(1.75rem, 3.6vw, 2.35rem); }
.entry-lead .entry-title { font-size: clamp(2.1rem, 5vw, 3.1rem); }
.entry-title a { text-decoration: none; }
.entry-title a:hover { color: var(--accent); }
.entry-lede > :last-child { margin-bottom: 0; }
.entry-more { margin: 1.1rem 0 0; font: 600 .85rem/1 var(--sans); }
.entry-more a { color: var(--accent); text-decoration: none; }
.entry-more a:hover { text-decoration: underline; }
.empty { font: italic 1.2rem var(--serif); color: var(--muted); padding: 4rem 0; }

/* Rail ---------------------------------------------------------------------- */

.rail { padding: 2.75rem 0 3rem; font-size: .9rem; color: var(--ink-2); }
@media (min-width: 64rem) {
  .rail { border-left: 1px solid var(--rule); padding-left: 2rem; }
  .rail > :first-child { position: sticky; top: 1.5rem; }
}
@media (max-width: 63.99rem) { .rail { border-top: 3px double var(--rule); } }
.rail-block { margin: 0 0 2rem; }
.rail-block p { margin: 0 0 .6rem; }
.rail-title, .rail-kicker { font: 600 .7rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 .6rem; }
.rail-title a { text-decoration: none; }
.rail-about { font: 400 1rem/1.5 var(--serif); }
.rail-about a { color: var(--accent); text-decoration: none; font: 600 .85rem var(--sans); }
.rail-themes { list-style: none; margin: .5rem 0 0; padding: 0; }
.rail-themes li { display: flex; justify-content: space-between; padding: .35rem 0; border-top: 1px solid var(--rule); }
.rail-themes a { text-decoration: none; }
.rail-themes a:hover { color: var(--accent); }
.count { color: var(--muted); font-variant-numeric: tabular-nums; }
.rail-wiki {
  background: #0f1c24;
  color: #d8e6ea;
  padding: 1rem 1rem .5rem;
  border-radius: 3px;
  background-image: repeating-linear-gradient(135deg, rgba(108,195,207,.06) 0 2px, transparent 2px 9px);
}
.rail-wiki .rail-kicker { color: #6cc3cf; }
.rail-canon { display: block; text-decoration: none; padding: .55rem 0 .6rem; border-top: 1px solid rgba(108,195,207,.2); }
.rail-canon-title { display: block; font: 600 .98rem/1.3 var(--sans); color: #fff; }
.rail-canon-meta { display: block; font: .72rem/1.4 var(--mono); color: #8fb1b8; }
.rail-canon:hover .rail-canon-title { color: #6cc3cf; }
.rail-small a { color: var(--muted); }

/* Prose --------------------------------------------------------------------- */

.prose {
  font: 400 1.2rem/1.62 var(--serif);
  color: var(--ink);
  hanging-punctuation: first;
}
@media (max-width: 40rem) { .prose { font-size: 1.1rem; } }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose .table-wrap { margin: 0 0 1.15em; }
.prose h2 {
  font: 700 1.45rem/1.25 var(--serif);
  letter-spacing: -.01em;
  margin: 2.2em 0 .7em;
}
.prose h3 { font: 700 .82rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .1em; margin: 2em 0 .6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--muted); }
.prose ol > li::marker { font: 600 .85em var(--sans); color: var(--accent); }
.prose strong { font-weight: 700; }
.prose blockquote {
  margin-left: 0;
  padding: .1em 0 .1em 1.1em;
  border-left: 3px solid var(--accent);
  color: var(--ink-2);
}
.prose hr { border: 0; text-align: center; margin: 2.5em 0; }
.prose hr::after { content: "⁂"; color: var(--muted); }
.prose a { text-decoration-thickness: 1px; text-underline-offset: .18em; }
.prose a.ext { text-decoration-color: var(--muted); }
.prose a.ext:hover { color: var(--accent); text-decoration-color: currentColor; }
.prose code { font: .85em var(--mono); background: var(--paper-2); padding: .1em .3em; border-radius: 3px; }
.table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; font: .9rem/1.4 var(--sans); width: 100%; }
.prose th, .prose td { text-align: left; padding: .5em .7em; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font-weight: 600; }

/* The two kinds of internal link a reader must be able to tell apart:
   a concept (real background) and a wiki page (fiction). */
a.l-concept {
  color: inherit;
  text-decoration: underline dotted var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: .22em;
}
a.l-concept:hover { color: var(--accent); background: var(--accent-soft); text-decoration-style: solid; }
a.l-wiki {
  color: var(--wiki);
  text-decoration: underline dashed color-mix(in srgb, var(--wiki) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
}
a.l-wiki::after {
  content: "◇";
  font: 600 .6em/1 var(--sans);
  vertical-align: .55em;
  margin-left: .12em;
}
a.l-wiki:hover { background: var(--wiki-soft); text-decoration-style: solid; }
a.l-post { color: var(--accent); }
.l-broken { color: var(--muted); border-bottom: 1px dotted var(--muted); cursor: help; }

.fin { text-align: left; color: var(--accent); margin: 1.6em 0 0 !important; font-size: 1rem; }

/* Post ---------------------------------------------------------------------- */

.post-head, .page-head { padding: 3.5rem 0 1.5rem; }
.post-title { font-size: clamp(2.2rem, 6vw, 3.4rem); margin-bottom: .2rem; }
.page-title { font-size: clamp(2.4rem, 6vw, 3.6rem); margin-bottom: .6rem; }
.kicker {
  font: 600 .72rem/1.2 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .8rem;
}
.kicker a { text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.kicker .sep { color: var(--muted); margin: 0 .3em; }
.page-dek { font: 400 1.2rem/1.5 var(--serif); color: var(--ink-2); max-width: 40rem; margin: 0; }

.badge {
  display: inline-block;
  font: 600 .62rem/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3em .5em .25em;
  border-radius: 2px;
  vertical-align: .2em;
  white-space: nowrap;
}
.badge-draft { background: #f5d76e; color: #3b2f00; margin-left: .4rem; }
.badge-thought { background: var(--wiki-soft); color: var(--wiki); }

.refs {
  margin: 3rem 0 0;
  padding: 1.4rem 0 0;
  border-top: 3px double var(--rule);
  display: grid;
  gap: 1.5rem 2.5rem;
  font-size: .95rem;
}
.refs-title { font: 600 .7rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 .7rem; }
.refs-list { list-style: none; margin: 0; padding: 0; columns: 3 11rem; column-gap: 2rem; }
.refs-list li { break-inside: avoid; }
.refs-list li { padding: .25rem 0; }
.refs-list a:not([class]) { text-decoration: none; }
.refs-list a:not([class]):hover { color: var(--accent); }
.fiction-tag { color: var(--wiki); letter-spacing: .05em; margin-left: .3em; }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.2rem;
  font: 600 1rem/1.3 var(--serif);
}
.pager a { text-decoration: none; }
.pager a:hover { color: var(--accent); }
.pager span { display: block; font: 600 .7rem/1.6 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pager-next { text-align: right; }

/* Archive ------------------------------------------------------------------- */

.archive-year h2 { font: 700 1rem var(--sans); color: var(--muted); border-bottom: 1px solid var(--rule); padding-bottom: .4rem; }
.archive { list-style: none; padding: 0; margin: 0 0 2rem; }
.archive li { display: flex; gap: 1rem; align-items: baseline; padding: .45rem 0; font: 1.15rem/1.35 var(--serif); }
.archive time { font: .8rem var(--mono); color: var(--muted); min-width: 3.2rem; }
.archive a { text-decoration: none; }
.archive a:hover { color: var(--accent); }

/* Concepts ------------------------------------------------------------------ */

.theme-jump { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.6rem; }
.theme-jump a {
  font: 600 .78rem/1 var(--sans);
  text-decoration: none;
  padding: .55rem .8rem;
  border: 1px solid var(--rule);
  border-radius: 99px;
}
.theme-jump a:hover { border-color: var(--accent); color: var(--accent); }

.theme { padding: 2.5rem 0 1rem; border-top: 1px solid var(--rule); scroll-margin-top: 1rem; }
.theme:first-of-type { margin-top: 1.5rem; }
.theme-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1.2rem; margin-bottom: 1.4rem; }
.theme-head h2 { font: 700 1.9rem/1.1 var(--serif); letter-spacing: -.01em; margin: 0; }
.theme-head p { margin: 0; color: var(--muted); font: italic 1.05rem var(--serif); }

.concept-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 0 2.5rem;
}
.concept-card { padding: 1rem 0 1.2rem; border-top: 1px solid var(--rule); }
.concept-card > a { text-decoration: none; display: block; }
.concept-card h3 { font: 700 1.2rem/1.3 var(--serif); margin: 0 0 .35rem; }
.concept-card h3 .badge { margin-left: .3rem; vertical-align: .25em; }
.concept-card > a:hover h3 { color: var(--accent); }
.concept-card p { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--ink-2); }
.concept-card .cited { margin-top: .5rem; font-size: .78rem; color: var(--muted); }
.concept-card .cited a { color: var(--accent); text-decoration: none; }

.concept-title { font-size: clamp(2rem, 5vw, 2.8rem); }
.prose-concept > p:first-child { font-size: 1.3rem; line-height: 1.5; }

/* About --------------------------------------------------------------------- */

.about .prose h2 { font-size: 1.2rem; }
.social { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-family: var(--sans); font-size: 1rem; }

/* Footer -------------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--rule); background: var(--paper-2); }
.site-footer-inner {
  max-width: 72rem; margin: 0 auto; padding: 1.5rem var(--gutter) 2.5rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  font-size: .8rem; color: var(--muted);
}
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }

/* Hover previews ------------------------------------------------------------ */

.preview {
  position: absolute;
  z-index: 50;
  width: min(24rem, calc(100vw - 2rem));
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  box-shadow: 0 12px 32px -8px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.06);
  padding: .9rem 1.1rem 1rem;
  font: 400 .92rem/1.5 var(--sans);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}
.preview.is-on { opacity: 1; transform: none; }
.preview-kind { font: 600 .65rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 0 0 .3rem; }
.preview-title { font: 700 1.1rem/1.25 var(--serif); margin: 0 0 .4rem; }
.preview-text { margin: 0; color: var(--ink-2); }
.preview.is-wiki {
  background: #0f1c24;
  color: #e3edf0;
  border-color: #0f1c24;
  border-top-color: #6cc3cf;
  font-family: var(--sans);
}
.preview.is-wiki .preview-kind { color: #6cc3cf; }
.preview.is-wiki .preview-title { font-family: var(--sans); font-weight: 650; }
.preview.is-wiki .preview-text { color: #b9ccd1; }

/* Series (Jobiekonomia) -------------------------------------------------------
   The optimistic register: same serif reading column as the blog, but a green
   and sunlit palette, numbered parts and a hero, so an essay series reads as a
   bound pamphlet rather than a dated post. */

body.theme-series {
  --accent: #2f6b3f;
  --accent-soft: #e3efe2;
  --sun: #e2a52a;
  --series-bg: #f5f1e3;
}
@media (prefers-color-scheme: dark) {
  body.theme-series { --accent: #86c795; --accent-soft: #1d2b20; --sun: #e9b949; --series-bg: #1b1d17; }
}
.theme-series .masthead { border-bottom-color: var(--sun); }
.theme-series .nav a[aria-current="page"] { border-bottom-color: var(--sun); }

.series-kicker {
  font: 600 .72rem/1.2 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .8rem;
}
.series-kicker a { text-decoration: none; }
.series-kicker a:hover { text-decoration: underline; }
.series-kicker .sep { color: var(--muted); margin: 0 .3em; }

.series-hero {
  background: var(--series-bg);
  background-image: radial-gradient(circle at 86% 62%, color-mix(in srgb, var(--sun) 35%, transparent) 0 7rem, transparent 7rem);
  border-bottom: 1px solid var(--rule);
  padding: 4rem var(--gutter) 3rem;
  text-align: left;
}
.series-hero > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.series-hero-title { font: 700 clamp(2.8rem, 9vw, 4.6rem)/1 var(--serif); letter-spacing: -.03em; margin-top: 0; margin-bottom: .6rem; }
.series-hero-dek { font: italic 400 clamp(1.25rem, 3vw, 1.6rem)/1.3 var(--serif); color: var(--ink-2); margin-top: 0; margin-bottom: 0; }
.narrow-inner { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 2.5rem var(--gutter) 4rem; }

.series-cards { list-style: none; padding: 0 !important; margin: 2rem 0 !important; display: grid; gap: .75rem; }
.series-card { margin: 0 !important; }
.series-card a {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: .15rem 1rem;
  text-decoration: none;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  background: var(--paper);
  font-family: var(--sans);
}
.series-card a:hover { border-color: var(--accent); background: var(--accent-soft); }
.series-num { grid-row: span 2; font: 700 1.6rem/1 var(--serif); color: var(--sun); }
.series-card-title { font: 700 1.12rem/1.3 var(--serif); color: var(--ink); }
.series-card-text { font-size: .88rem; line-height: 1.45; color: var(--ink-2); }
.series-card.is-current a { background: var(--accent-soft); border-left-color: var(--sun); }

.series-toc { margin-top: 3rem; padding-top: 1.5rem; border-top: 3px double var(--rule); }
.series-toc .series-cards { margin-top: .5rem !important; }

a.l-series { color: inherit; text-decoration: underline solid #2f6b3f; text-decoration-thickness: 2px; text-underline-offset: .22em; }
a.l-series:hover { background: #e3efe2; }

.series-callout {
  margin: 3rem 0 0;
  padding: 1.4rem 1.5rem 1.2rem;
  background: #f5f1e3;
  border-left: 4px solid #2f6b3f;
  font: .95rem/1.5 var(--sans);
  color: #3d3a35;
}
@media (prefers-color-scheme: dark) { .series-callout { background: #1b1d17; color: var(--ink-2); border-left-color: #86c795; } }
.series-callout .series-kicker { color: #2f6b3f; }
.series-callout-title { font: 700 1.45rem/1.2 var(--serif); margin: 0 0 .5rem; }
.series-callout-title a { text-decoration: none; color: var(--ink); }
.series-callout-title a:hover { color: #2f6b3f; }
.series-callout p { margin: 0 0 .6rem; }
.series-callout-parts { margin: .6rem 0 0; padding-left: 1.3em; }
.series-callout-parts li { padding: .15rem 0; }
.series-callout-parts a { color: inherit; text-decoration-color: #2f6b3f; text-underline-offset: .18em; }

.rail-series { background: #f5f1e3; padding: 1rem 1rem .7rem; border-left: 4px solid #2f6b3f; }
@media (prefers-color-scheme: dark) { .rail-series { background: #1b1d17; } }
.rail-series .rail-kicker { color: #2f6b3f; }
.rail-series-title { display: block; font: 700 1.3rem/1.2 var(--serif); text-decoration: none; margin-bottom: .3rem; }
.rail-series ol { margin: .5rem 0 0; padding-left: 1.2em; font-size: .85rem; }
.rail-series li { padding: .15rem 0; }
.rail-series ol a { text-decoration: none; }
.rail-series ol a:hover { color: #2f6b3f; text-decoration: underline; }
