/* Pale Blue Signal
   Brand kit: pale-blue-signal-brand (BRAND.md, tokens/tokens.css). Ink on paper, generous
   whitespace. Blue appears only in the mark, links, the meta line and the wordmark's period.
   Type: Geist for headlines and UI, Newsreader for reading, Geist Mono for the meta line and
   labels. The logo is the kit's outlined SVG; its typeface lives only inside those files. */

/* ── Tokens, copied from the brand kit's tokens/tokens.css ─────────────── */
:root {
  --pbs-paper: #F6F7F4;
  --pbs-surface: #FFFFFF;
  --pbs-ink: #0F1419;
  --pbs-body: #2A3038;
  --pbs-graphite: #5B6470;
  --pbs-rule: #DDE1E4;
  --pbs-link: #1F5FA8;
  --pbs-dot: #8DB8DF;

  --pbs-font-display: "Geist", ui-sans-serif, system-ui, sans-serif;
  --pbs-font-body: "Newsreader", Georgia, "Times New Roman", serif;
  --pbs-font-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;

  --pbs-text-meta: 12px;
  --pbs-text-ui: 15px;
  --pbs-text-body: 19px;
  --pbs-text-dek: 21px;
  --pbs-text-h3: 24px;
  --pbs-text-h2: 32px;
  --pbs-text-h1: clamp(34px, 5vw, 48px);
  --pbs-text-display: clamp(40px, 7vw, 64px);

  --pbs-tracking-display: -0.04em;
  --pbs-tracking-meta: 0.08em;
  --pbs-leading-body: 1.65;
  --pbs-leading-head: 1.08;

  --pbs-radius-sm: 8px;
  --pbs-radius-md: 14px;
  --pbs-radius-lg: 20px;
  --pbs-measure: 68ch;
  --pbs-page-max: 1200px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pbs-paper: #0B0F14;
    --pbs-surface: #121821;
    --pbs-ink: #E8EDF2;
    --pbs-body: #C5CDD6;
    --pbs-graphite: #8C96A3;
    --pbs-rule: #232B36;
    --pbs-link: #8DB8DF;
  }
}
:root[data-theme="dark"] {
  --pbs-paper: #0B0F14;
  --pbs-surface: #121821;
  --pbs-ink: #E8EDF2;
  --pbs-body: #C5CDD6;
  --pbs-graphite: #8C96A3;
  --pbs-rule: #232B36;
  --pbs-link: #8DB8DF;
}

/* ── The page ──────────────────────────────────────────────────────────── */
:root { --gutter: 16px; color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (min-width: 760px) { :root { --gutter: 32px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--pbs-paper); }
body {
  margin: 0;
  background: var(--pbs-paper);
  color: var(--pbs-body);
  font: 400 var(--pbs-text-body)/var(--pbs-leading-body) var(--pbs-font-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
a { color: var(--pbs-link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--pbs-ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--pbs-link); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; }
.vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* One reading column, about 68 characters of the essay face wide */
.wrap {
  width: 100%;
  max-width: calc(var(--pbs-measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  font-family: var(--pbs-font-body);
  font-size: var(--pbs-text-body);
}

.skip {
  position: absolute; left: -9999px; top: 10px; z-index: 10;
  padding: 12px 16px; border-radius: var(--pbs-radius-sm);
  background: var(--pbs-ink); color: var(--pbs-paper);
  font: 500 var(--pbs-text-ui)/1 var(--pbs-font-display); text-decoration: none;
}
.skip:focus { left: 12px; }
.skip:hover { color: var(--pbs-paper); }

/* ── The logo: light or dark lockup by theme; the mark alone where the lockup
   would be under its 120px minimum. Clear space: at least one band (a fifth of the mark).
   The logo never shrinks or stretches: it keeps the file's own proportions. */
.brand { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; padding: 6px 0; text-decoration: none; }
.logo { --logo-h: 30px; display: inline-flex; align-items: center; }
.logo-sm { --logo-h: 28px; }
.logo-lg { --logo-h: clamp(40px, 10vw, 56px); }
.logo .lockup { display: inline-flex; }
.logo img { display: block; width: auto; max-width: none; height: var(--logo-h); }
.logo .on-dark, .logo .mark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo .on-light { display: none; }
  :root:not([data-theme="light"]) .logo .on-dark { display: block; }
}
:root[data-theme="dark"] .logo .on-light { display: none; }
:root[data-theme="dark"] .logo .on-dark { display: block; }
@media (max-width: 299px) {
  .logo .lockup { display: none; }
  .logo .mark { display: block; }
}
/* The top bar: the mark alone once the lockup and the links no longer fit side by side */
@media (max-width: 339px) {
  .bar .logo .lockup { display: none; }
  .bar .logo .mark { display: block; }
}

/* ── Top bar on every page but the home page ───────────────────────────── */
.bar { border-bottom: 1px solid var(--pbs-rule); background: var(--pbs-surface); }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; padding-block: 10px; }
.bar-in .brand { flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 0 20px; font: 500 var(--pbs-text-ui)/1.2 var(--pbs-font-display); }
.nav a, .foot-links a {
  display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; padding: 0;
  color: var(--pbs-link); text-decoration: none;
}
.nav a:hover { color: var(--pbs-ink); text-decoration: underline; }

/* ── Home: the lockup and the tagline on the plain page ───────────────── */
.masthead { border-bottom: 1px solid var(--pbs-rule); }
.masthead .wrap { padding-block: clamp(44px, 10vw, 80px) clamp(20px, 4vw, 32px); }
.masthead-name { margin: 0; line-height: 0; }
.tagline {
  max-width: 34em; margin: 24px 0 0;
  color: var(--pbs-graphite);
  font: 400 clamp(19px, 2.4vw, 21px)/1.5 var(--pbs-font-body);
  text-wrap: pretty;
}
.masthead-nav { margin-top: 10px; }

/* ── Home: the list of posts ───────────────────────────────────────────── */
.list { padding-top: clamp(28px, 6vw, 48px); }
.entries { list-style: none; margin: 0; padding: 0; }
.entry { position: relative; padding-block: 26px; border-top: 1px solid var(--pbs-rule); }
.entry:first-child { padding-top: 0; border-top: 0; }
.entry:last-child { padding-bottom: 0; }
.entry .meta { margin-bottom: 10px; }
.e-title {
  margin: 0; color: var(--pbs-ink);
  font: 600 clamp(24px, 3.4vw, 30px)/var(--pbs-leading-head) var(--pbs-font-display);
  letter-spacing: var(--pbs-tracking-display);
  text-wrap: balance;
}
.e-title a { color: inherit; text-decoration: none; }
.e-title a::after { content: ""; position: absolute; inset: 0; }
.entry:hover .e-title a, .e-title a:focus-visible { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }
.e-dek { margin: 10px 0 0; color: var(--pbs-graphite); font: 400 var(--pbs-text-body)/1.5 var(--pbs-font-body); text-wrap: pretty; }
.empty { margin: 0; color: var(--pbs-graphite); }

/* ── The meta line: TOPIC · DATE · N MIN READ ──────────────────────────── */
.meta {
  margin: 0 0 14px;
  color: var(--pbs-link);
  font: 400 var(--pbs-text-meta)/1.6 var(--pbs-font-mono);
  letter-spacing: var(--pbs-tracking-meta);
  text-transform: uppercase;
}
.meta .mi { white-space: nowrap; }
.meta a { color: inherit; }
.meta a:hover { color: var(--pbs-ink); }

/* ── A post ────────────────────────────────────────────────────────────── */
.post { padding-top: clamp(28px, 6vw, 56px); }
.post h1 {
  margin: 0; color: var(--pbs-ink);
  font: 600 var(--pbs-text-h1)/var(--pbs-leading-head) var(--pbs-font-display);
  letter-spacing: var(--pbs-tracking-display);
  text-wrap: balance;
}
.dek {
  margin: 16px 0 0; color: var(--pbs-graphite);
  font: 400 clamp(19px, 2.6vw, 21px)/1.45 var(--pbs-font-body);
  text-wrap: pretty;
}
.byline { margin: 18px 0 0; color: var(--pbs-ink); font: 500 var(--pbs-text-ui)/1.3 var(--pbs-font-display); }

/* Listen */
.listen {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 14px;
  margin: 28px 0 4px; padding: 14px 16px;
  border: 1px solid var(--pbs-rule); border-radius: var(--pbs-radius-md); background: var(--pbs-surface);
}
.listen[hidden] { display: none; }
.l-play {
  width: 48px; height: 48px; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--pbs-ink); color: var(--pbs-paper); cursor: pointer;
}
.l-play svg { width: 20px; height: 20px; fill: currentColor; }
.i-pause, .listen.playing .i-play { display: none; }
.listen.playing .i-pause { display: block; }
.l-title { display: block; color: var(--pbs-ink); font: 600 var(--pbs-text-ui)/1.25 var(--pbs-font-display); }
.l-sub { display: block; margin-top: 3px; color: var(--pbs-graphite); font: 400 14px/1.35 var(--pbs-font-display); }
.l-speed {
  min-width: 48px; height: 44px; padding: 0 10px;
  border: 1px solid var(--pbs-graphite); border-radius: var(--pbs-radius-sm);
  background: var(--pbs-paper); color: var(--pbs-ink);
  font: 500 13px/1 var(--pbs-font-mono); font-variant-numeric: tabular-nums; cursor: pointer;
}
.l-speed:hover { border-color: var(--pbs-ink); }
.l-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--pbs-rule); overflow: hidden; cursor: pointer; }
.l-bar > span { display: block; width: 0; height: 100%; background: var(--pbs-ink); transition: width .3s linear; }
.listen:not(.started) .l-bar { display: none; }
.plain-audio { width: 100%; margin-top: 20px; }

/* Updates: a dated log, newest first */
.updates { margin: 30px 0 4px 6px; padding-left: 22px; border-left: 2px solid var(--pbs-rule); }
.update { position: relative; margin: 0 0 20px; }
.update:last-child { margin-bottom: 0; }
.update::before {
  content: ""; position: absolute; left: -31px; top: .3em;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--pbs-paper); border: 2px solid var(--pbs-ink);
}
.update:first-child::before { background: var(--pbs-ink); }
.u-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; }
.u-n {
  color: var(--pbs-ink);
  font: 500 var(--pbs-text-meta)/1.6 var(--pbs-font-mono);
  letter-spacing: var(--pbs-tracking-meta); text-transform: uppercase;
}
.u-head time { color: var(--pbs-graphite); font: 400 14px/1.4 var(--pbs-font-display); }
.u-new {
  padding: 1px 8px; border-radius: 999px; background: var(--pbs-ink); color: var(--pbs-paper);
  font: 500 11px/1.7 var(--pbs-font-mono); letter-spacing: .06em; text-transform: uppercase;
}
.u-new[hidden] { display: none; }
.u-text { color: var(--pbs-body); }
.u-text p { margin: .3em 0 0; }

/* The essay */
.post-body { margin-top: 28px; color: var(--pbs-body); }
/* A bare address or a long handle wraps instead of pushing the page sideways on a phone */
.post-body, .u-text, .sources, figcaption, .linkcard a, .dek, .page { overflow-wrap: anywhere; }
.post-body > p { margin: 0 0 1.1em; }
.post-body h2 {
  margin: 1.7em 0 .5em; color: var(--pbs-ink);
  font: 600 var(--pbs-text-h3)/var(--pbs-leading-head) var(--pbs-font-display);
  letter-spacing: var(--pbs-tracking-display);
  text-wrap: balance;
}
.post-body h2:first-child { margin-top: .4em; }
.post-body strong { color: var(--pbs-ink); font-weight: 500; }
.post-body ul { margin: 0 0 1.1em; padding-left: 1.2em; }
.post-body li { margin: .3em 0; }
.post-body > blockquote {
  margin: 1.5em 0; padding: 0 0 0 18px; border-left: 2px solid var(--pbs-ink);
  color: var(--pbs-ink); font-style: italic;
}
.post-body > blockquote p { margin: 0; }
.cite { margin-left: 1px; font: 500 .6em/0 var(--pbs-font-mono); font-variant-numeric: tabular-nums; }
.cite a { text-decoration: none; }
.cite a:hover { text-decoration: underline; }

/* Pictures and post cards */
.post-body figure { margin: 1.8em 0; }
.shot img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--pbs-rule); border-radius: var(--pbs-radius-md); background: var(--pbs-surface);
}
figcaption { margin-top: 10px; color: var(--pbs-graphite); font: 400 14px/1.45 var(--pbs-font-display); }
figcaption a { white-space: nowrap; }
.xpost .twitter-tweet, .quote blockquote {
  margin: 0; padding: 16px 18px;
  border: 1px solid var(--pbs-rule); border-radius: var(--pbs-radius-md); background: var(--pbs-surface);
  font: 400 17px/1.55 var(--pbs-font-body);
}
.xpost .twitter-tweet p, .quote blockquote p { margin: 0 0 .6em; color: var(--pbs-ink); }
.quote blockquote p:last-child { margin: 0; }
.xpost .twitter-tweet { color: var(--pbs-graphite); font-size: 15px; }
.xpost .twitter-tweet p { font-size: 17px; }
.xpost iframe { max-width: 100% !important; }
.video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--pbs-radius-md); }
.linkcard a {
  display: block; padding: 14px 16px;
  border: 1px solid var(--pbs-rule); border-radius: var(--pbs-radius-md); background: var(--pbs-surface);
  color: inherit; text-decoration: none;
}
.linkcard a:hover { border-color: var(--pbs-ink); }
.lc-site {
  display: block; color: var(--pbs-graphite);
  font: 400 var(--pbs-text-meta)/1.5 var(--pbs-font-mono); letter-spacing: var(--pbs-tracking-meta); text-transform: uppercase;
}
.lc-title { display: block; margin-top: 6px; color: var(--pbs-ink); font: 600 17px/1.3 var(--pbs-font-display); letter-spacing: -.02em; }
.lc-desc { display: block; margin-top: 6px; color: var(--pbs-graphite); font: 400 16px/1.45 var(--pbs-font-body); }

/* Labels (Sources) */
.label {
  margin: 0 0 12px; color: var(--pbs-graphite);
  font: 500 var(--pbs-text-meta)/1.5 var(--pbs-font-mono);
  letter-spacing: var(--pbs-tracking-meta); text-transform: uppercase;
}
.sources { margin-top: 2.6em; padding-top: 20px; border-top: 1px solid var(--pbs-rule); }
.sources ol { margin: 0; padding-left: 2.4em; color: var(--pbs-body); font: 400 16px/1.5 var(--pbs-font-body); }
.sources li { margin: .5em 0; padding-left: .2em; }
.sources li::marker { content: "[" counter(list-item) "]  "; color: var(--pbs-graphite); font: 400 12px var(--pbs-font-mono); }
.s-outlet { color: var(--pbs-ink); font-weight: 500; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--pbs-graphite); border-radius: var(--pbs-radius-sm);
  background: var(--pbs-surface); color: var(--pbs-ink);
  font: 500 var(--pbs-text-ui)/1 var(--pbs-font-display); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--pbs-ink); color: var(--pbs-ink); }
.btn.primary { border-color: var(--pbs-ink); background: var(--pbs-ink); color: var(--pbs-paper); }
.btn.primary:hover { color: var(--pbs-paper); }
.share { display: flex; flex-wrap: wrap; gap: 10px; margin: 2.4em 0 0; }

/* Follow along */
.follow { margin-top: clamp(36px, 7vw, 56px); }
.follow h2 {
  margin: 0 0 8px; padding-top: 24px; border-top: 1px solid var(--pbs-rule);
  color: var(--pbs-ink); font: 600 20px/var(--pbs-leading-head) var(--pbs-font-display); letter-spacing: -.03em;
}
.follow p { margin: 0; color: var(--pbs-graphite); font-size: 17px; line-height: 1.55; }
.substack { display: block; width: 100%; max-width: 480px; border: 1px solid var(--pbs-rule); border-radius: var(--pbs-radius-sm); }

/* About and not-found pages */
.page { padding-top: clamp(28px, 6vw, 56px); }
.page h1 {
  margin: 0 0 .7em; color: var(--pbs-ink);
  font: 600 var(--pbs-text-h1)/var(--pbs-leading-head) var(--pbs-font-display);
  letter-spacing: var(--pbs-tracking-display);
  text-wrap: balance;
}
.page p { margin: 0 0 1.1em; }

/* Footer */
.foot { margin-top: clamp(48px, 9vw, 88px); border-top: 1px solid var(--pbs-rule); }
.foot .wrap { padding-block: 30px 44px; }
.foot-tag { max-width: 34em; margin: 12px 0 0; color: var(--pbs-graphite); font: 400 16px/1.5 var(--pbs-font-body); }
.foot-links {
  display: flex; flex-wrap: wrap; gap: 0 20px; margin: 10px 0 0; padding: 0; list-style: none;
  font: 500 var(--pbs-text-ui)/1.2 var(--pbs-font-display);
}
.foot-links a:hover { color: var(--pbs-ink); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .bar .nav, .masthead-nav, .listen, .share, .follow, .foot { display: none; }
  html, body { background: #fff; color: #000; }
}
