@font-face {
  font-family: "iA Writer Quattro S";
  src: url("fonts/iAWriterQuattroS-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "iA Writer Quattro S";
  src: url("fonts/iAWriterQuattroS-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "iA Writer Quattro S";
  src: url("fonts/iAWriterQuattroS-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "iA Writer Quattro S";
  src: url("fonts/iAWriterQuattroS-BoldItalic.woff2") format("woff2");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-v24-latin-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-v24-latin-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-v24-latin-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0F0F11;
  --surface: #17171B;
  --border: #2A2A31;
  --heading: #F4F4F6;
  --text: #E7E7EA;
  --muted: #9B9BA6;
  --faint: #80808B;
  --accent: #7CC0FF;
  --font-body: "iA Writer Quattro S", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --measure: 66ch;
  --shell: 72rem;
  --step--1: 0.875rem;
  --step-0: 1.09375rem;
  --step-1: 1.3125rem;
  --step-2: 1.575rem;
  --step-3: 1.89rem;
  --step-4: 2.268rem;
}

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

html {
  min-width: 19.5rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 100%;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 19.5rem;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.66;
}

::selection {
  background: var(--border);
  color: var(--heading);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

input[type="search"]::-webkit-search-cancel-button {
  appearance: none;
  -webkit-appearance: none;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 58%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: color-mix(in srgb, var(--accent) 78%, var(--heading));
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
}

:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--heading);
  font-family: var(--font-body);
  font-weight: 700;
}

.shell {
  width: min(calc(100% - 3rem), var(--shell));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.55rem 0.75rem;
  transform: translateY(-180%);
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.masthead {
  display: grid;
  min-height: 3.8rem;
  grid-template-columns: auto minmax(0, 1fr) minmax(12rem, 16rem);
  align-items: center;
  gap: clamp(1rem, 3vw, 2.25rem);
}

.wordmark {
  color: var(--heading);
  font-family: var(--font-body);
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  text-decoration: none;
}

.wordmark span {
  color: var(--accent);
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  font-size: var(--step--1);
}

.primary-nav a {
  color: var(--muted);
  text-decoration: none;
}

.primary-nav a:hover {
  color: color-mix(in srgb, var(--accent) 78%, var(--heading));
  text-decoration: underline;
}

.primary-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

.site-search {
  display: flex;
  min-width: 0;
  height: 2.15rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.site-search input {
  min-width: 0;
  flex: 1;
  padding: 0.35rem 0.55rem;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.site-search input::placeholder {
  color: var(--faint);
  opacity: 1;
}

.site-search input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-search button {
  padding: 0.3rem 0.55rem;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.site-search button:hover {
  color: var(--heading);
}

.topic-strip {
  display: flex;
  min-height: 2.65rem;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  padding-block: 0.48rem;
  border-top: 1px solid var(--border);
  scrollbar-color: var(--border) var(--bg);
  scrollbar-width: thin;
}

.topic-strip__label,
.topic-strip__index,
.topic-link {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.025em;
  line-height: 1.4;
  text-decoration: none;
}

.topic-strip__label {
  color: var(--faint);
}

.topic-strip__index,
.topic-link {
  color: var(--muted);
}

.topic-strip__index:hover,
.topic-link:hover {
  color: color-mix(in srgb, var(--accent) 78%, var(--heading));
  text-decoration: underline;
}

.topic-strip__index[aria-current="page"],
.topic-link[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

.topic-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.topic-link small {
  color: var(--faint);
  font-size: 0.6rem;
}

main {
  min-height: 58vh;
}

.section-kicker {
  margin: 0 0 0.55rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.page-intro {
  display: grid;
  grid-template-columns: 8rem minmax(0, 43rem);
  column-gap: 2rem;
  padding-block: clamp(2.75rem, 5vw, 4rem);
}

.page-intro .section-kicker {
  grid-column: 1;
  grid-row: 1 / span 2;
  padding-top: 0.35rem;
}

.page-intro h1 {
  grid-column: 2;
  max-width: 28ch;
  margin: 0;
  font-size: clamp(var(--step-3), 3vw, var(--step-4));
  letter-spacing: -0.025em;
  line-height: 1.16;
}

.page-intro > p:last-child {
  grid-column: 2;
  max-width: 60ch;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.feed {
  border-top: 1px solid var(--border);
}

.feed-item {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 2rem;
  padding-block: clamp(2.2rem, 4.5vw, 3.6rem);
  border-bottom: 1px solid var(--border);
}

.feed-date {
  padding-top: 0.25rem;
}

.feed-date time {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-style: normal;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.feed-item__paper {
  position: relative;
  max-width: var(--measure);
  min-width: 0;
}

.feed-item__meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.8rem;
}

.type-mark,
.feed-topic,
.entry-topic {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.055em;
  line-height: 1.4;
}

.type-mark {
  color: var(--faint);
  text-transform: uppercase;
}

.type-mark::before {
  content: "[";
}

.type-mark::after {
  content: "]";
}

.feed-topic,
.entry-topic {
  color: var(--muted);
  text-decoration-color: var(--border);
}

.feed-item__header h2 {
  max-width: 34ch;
  margin: 0;
  font-size: clamp(var(--step-1), 2.5vw, var(--step-2));
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.feed-item__header h2 a {
  text-decoration-thickness: 1px;
}

.feed-summary {
  max-width: 62ch;
  margin: 0.85rem 0 0.75rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.read-more,
.filed-permalink,
.note-permalink {
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.feed-item--link .feed-item__paper,
.feed-item--note .feed-item__paper,
.feed-item--quote .feed-item__paper {
  padding-left: 1.35rem;
  border-left: 1px solid var(--border);
}

.feed-item--note .feed-item__paper {
  max-width: 56ch;
  border-left-color: var(--muted);
}

.feed-item--note .feed-item__meta {
  margin-bottom: 0.45rem;
}

.feed-item--quote .feed-item__paper {
  max-width: 60ch;
}

.external-glyph {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72em;
  transform: translateY(-0.18em);
}

.link-destination,
.entry-destination {
  display: inline;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
}

.link-header > p {
  margin: 0.55rem 0 0;
}

.feed-excerpt {
  margin-top: 0.9rem;
}

.prose--compact {
  max-width: 62ch;
  font-size: 1rem;
  line-height: 1.65;
}

.prose--compact p {
  margin-block: 0.75rem;
}

.prose--note {
  margin-top: 0;
  font-size: var(--step-1);
  line-height: 1.62;
}

.prose--quote,
.prose--quote blockquote {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  font-size: var(--step-1);
  font-style: italic;
  line-height: 1.55;
}

.prose--quote p {
  margin: 0;
}

.quote-source,
.entry-source {
  margin: 0.9rem 0 0.75rem;
  color: var(--muted);
  font-size: var(--step--1);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 0;
}

.tag-list a {
  display: inline-flex;
  min-height: 1.65rem;
  max-width: 100%;
  align-items: center;
  padding: 0.2rem 0.48rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  line-height: 1.2;
  text-decoration: none;
}

.tag-list a:hover {
  border-color: color-mix(in srgb, var(--accent) 78%, var(--heading));
  color: color-mix(in srgb, var(--accent) 78%, var(--heading));
}

.tag-list a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
}

.topic-heading,
.tag-heading,
.archive-heading,
.compact-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 22rem);
  align-items: end;
  gap: clamp(1.5rem, 5vw, 4rem);
  padding-block: clamp(2.8rem, 6vw, 4.8rem) 2.4rem;
}

.topic-heading h1,
.tag-heading h1,
.archive-heading h1,
.compact-heading h1,
.facet-heading h1,
.reading-room-heading h1,
.feed-landing h1,
.search-heading h1 {
  margin: 0;
  font-size: clamp(var(--step-3), 3vw, var(--step-4));
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.topic-heading h1,
.tag-heading h1 {
  overflow-wrap: anywhere;
}

.topic-heading__note,
.tag-heading__note {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: var(--step--1);
}

.topic-heading__note span,
.tag-heading__note span {
  color: var(--heading);
  font-family: var(--font-mono);
}

.entry-shell {
  padding-block: 1.5rem 4rem;
}

.breadcrumbs {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  white-space: nowrap;
}

.breadcrumbs a {
  flex: 0 0 auto;
  color: var(--muted);
}

.breadcrumbs a:hover {
  color: color-mix(in srgb, var(--accent) 78%, var(--heading));
}

.breadcrumbs span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry {
  margin-top: 2.8rem;
}

.entry-header {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.entry-header__margin {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.entry-header__margin time {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.entry-header__main {
  max-width: 49rem;
  min-width: 0;
}

.entry-header h1 {
  max-width: 30ch;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(var(--step-3), 3.5vw, var(--step-4));
  letter-spacing: -0.03em;
  line-height: 1.14;
}

.entry-body-wrap {
  position: relative;
  width: min(var(--measure), calc(100% - 10rem));
  margin-top: 2.6rem;
  margin-left: 10rem;
}

/* A post opens with its rich first paragraph as the standfirst. */
.entry--post .prose--entry > p:first-child {
  color: var(--text);
  font-size: var(--step-1);
  line-height: 1.62;
}

.entry--link .entry-header {
  padding-bottom: 1.5rem;
}

.entry-external-title {
  color: var(--accent);
}

.entry--link .entry-header__main > p:last-child {
  margin: 0.75rem 0 0;
}

.entry--link .entry-destination {
  margin-bottom: 0;
}

.entry--link .entry-body-wrap {
  margin-top: 2rem;
}

.entry-via {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: var(--step--1);
}

.note-dateline {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.entry--note .entry-header,
.entry--quote .entry-header {
  padding-bottom: 1.25rem;
}

.entry--note .entry-body-wrap {
  max-width: 58ch;
  margin-top: 1.5rem;
  padding-left: 1.4rem;
  border-left: 1px solid var(--muted);
}

.entry--note .prose--entry {
  font-size: var(--step-1);
  line-height: 1.62;
}

.entry--quote .entry-body-wrap {
  max-width: 60ch;
  margin-top: 1.5rem;
  padding-left: 1.4rem;
  border-left: 1px solid var(--border);
}

.entry--quote .prose--entry,
.entry--quote .prose--entry blockquote {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text);
  font-size: clamp(var(--step-1), 2.3vw, var(--step-2));
  font-style: italic;
  line-height: 1.52;
}

.entry--quote .prose--entry p {
  margin: 0;
}

.entry-source {
  margin-top: 1.25rem;
}

.entry-tags {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.entry-tags .tag-list {
  margin: 0;
}

.back-to-topic {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 3.5rem 0 0 10rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.prose {
  color: var(--text);
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose--entry {
  font-size: var(--step-0);
  line-height: 1.68;
}

.prose--entry p,
.prose--entry ul,
.prose--entry ol,
.prose--entry blockquote,
.prose--entry table,
.prose--entry .highlight {
  margin-block: 1.4em;
}

.prose--entry h2,
.prose--entry h3,
.prose--entry h4 {
  margin-bottom: 0.65em;
  color: var(--heading);
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.25;
  scroll-margin-top: 2rem;
}

.prose--entry h2 {
  margin-top: 2.4em;
  font-size: var(--step-2);
}

.prose--entry h3 {
  margin-top: 2.1em;
  font-size: var(--step-1);
}

.prose--entry h4 {
  margin-top: 1.9em;
  font-size: var(--step-0);
}

.prose--entry .heading-anchor {
  display: inline-block;
  margin-right: 0.45rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.58em;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  vertical-align: 0.18em;
}

.prose--entry .heading-anchor:hover {
  text-decoration: underline;
}

.prose--entry ul,
.prose--entry ol {
  padding-left: 1.4em;
}

.prose--entry li {
  margin-block: 0.4em;
  padding-left: 0.15em;
}

.prose--entry li::marker {
  color: var(--muted);
}

.prose--entry blockquote {
  margin-left: 0;
  padding: 0.15rem 0 0.15rem 1.2rem;
  border-left: 1px solid var(--muted);
  color: var(--muted);
  font-style: italic;
}

.prose--entry table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  background: var(--surface);
  font-size: var(--step--1);
  line-height: 1.55;
}

.prose--entry th,
.prose--entry td {
  min-width: 9rem;
  padding: 0.7rem 0.85rem;
  border: 0;
  text-align: left;
  vertical-align: top;
}

.prose--entry th {
  border-bottom: 1px solid var(--border);
  color: var(--heading);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
}

.prose--entry tbody tr:nth-child(even) {
  background: rgba(255,255,255,.025);
}

.prose code:not(.highlight code) {
  padding: 0.1em 0.28em;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.84em;
}

.highlight {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.highlight pre,
.highlight code {
  /* Both selectors are required: Pygments puts the glyphs in an inner code
     element, where the UA stylesheet's default monospace binding would
     otherwise beat a pre-only rule. */
  font-family: var(--font-mono);
}

.highlight pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow: visible;
  background: transparent;
  color: var(--text);
  font-size: 0.79rem;
  line-height: 1.65;
  tab-size: 4;
}

:root {
  color-scheme: dark;
  --page-bg: #0f0f11;
  --figure-edge: #ffffff1a;
  --diagram-stroke: #e7e7ea;
  --diagram-accent: #7cc0ff;
}

/* 1 · Default: do nothing. Forgetting an annotation costs a bright-but-honest
      image, never a mangled one. */
.prose img, .prose svg { max-width: 100%; height: auto; }

/* 2 · .mat — first choice. No filter, never lies about color. */
img.mat, .mat > img, figure.mat img {
  background: #fff; padding: 12px; border-radius: 10px;
  box-shadow: 0 0 0 1px var(--figure-edge), 0 12px 32px #0009;
}

/* 3 · .invert — BLACK-ON-WHITE LINE ART ONLY. 0.92 keeps ink at #EBEBEB.
      Four selectors: attr_list may land the class on the wrapping <p>. */
img.invert, .invert > img, figure.invert img, svg.invert {
  filter: invert(0.92) hue-rotate(180deg);
}

/* 4 · .knockout — dissolves the white box: invert(1) → pure black bg,
      screen renders pure black as transparent. MUST be invert(1). */
img.invert.knockout, .invert.knockout > img {
  filter: invert(1) hue-rotate(180deg);
  mix-blend-mode: screen;
}
.prose { background-color: var(--page-bg); } /* screen needs an opaque backdrop */

/* 5 · Inline SVG — the actually-correct fix (currentColor doesn't cross <img>). */
.prose svg.diagram { stroke: var(--diagram-stroke); fill: none; color: var(--diagram-stroke); }
.prose svg.diagram .accent { stroke: var(--diagram-accent); fill: var(--diagram-accent); }
.prose svg.diagram text { fill: var(--diagram-stroke); stroke: none; }
.prose svg:not(.invert) { filter: none; }

/* 6 · Photos: never dim (text-in-image accessibility); frame instead. */
img.photo, figure.photo img {
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--figure-edge), 0 12px 32px #0009;
}

/* 7 · Escape hatches. */
@media print { img.invert, .invert > img, svg.invert { filter: none; mix-blend-mode: normal; } }
@media (forced-colors: active) { img.invert, .invert > img, svg.invert { filter: none; mix-blend-mode: normal; } }

.prose > p:has(> img),
.prose > p:has(> svg) {
  margin-block: 2.2rem;
}

.empty-state {
  max-width: 42rem;
  margin: 3.5rem auto;
  padding-block: 2.4rem;
  border-block: 1px solid var(--border);
  text-align: left;
}

.empty-state h1,
.empty-state h2 {
  margin: 0;
  font-size: var(--step-2);
  line-height: 1.25;
}

.empty-state > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.search-heading,
.facet-heading,
.reading-room-heading,
.feed-landing {
  max-width: var(--shell);
  padding-block: clamp(2.8rem, 6vw, 4.8rem) 2.4rem;
}

.search-heading {
  border-bottom: 1px solid var(--border);
}

.archive-search {
  max-width: 44rem;
  margin-top: 1.8rem;
}

.archive-search > label,
.day-search label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.archive-search > div,
.day-search > div {
  display: flex;
  min-width: 0;
}

.archive-search input,
.day-search input {
  min-width: 0;
  flex: 1;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.archive-search input::placeholder,
.day-search input::placeholder {
  color: var(--faint);
  opacity: 1;
}

.archive-search input:focus-visible,
.day-search input:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.archive-search button,
.day-search button {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-left: 0;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.archive-search button:hover,
.day-search button:hover {
  background: var(--surface);
  color: var(--heading);
}

.search-results-heading {
  padding-block: 1rem;
  border-bottom: 1px solid var(--border);
}

.search-results-heading p {
  margin: 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.search-results-heading strong {
  color: var(--heading);
  font-family: var(--font-mono);
}

.search-results-heading span {
  color: var(--text);
  font-style: italic;
}

.archive-heading > div > p:last-child,
.compact-heading > div > p:last-child,
.facet-heading > p:last-child,
.reading-room-heading > p:last-child,
.feed-landing > p:not(.section-kicker) {
  max-width: 58ch;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.day-search {
  max-width: 22rem;
}

.day-search small {
  display: block;
  margin-top: 0.45rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.archive-shell {
  border-top: 1px solid var(--border);
}

.archive-ledger {
  max-width: 66rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-year {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  margin-top: 2.4rem;
  color: var(--heading);
  font-family: var(--font-mono);
  font-size: var(--step-1);
  font-weight: 700;
}

.archive-year::after {
  height: 1px;
  background: var(--border);
  content: "";
}

.archive-record {
  position: relative;
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--border);
}

.archive-record > time {
  padding-top: 0.2rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.archive-record__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.archive-topic {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

.archive-topic:hover {
  color: color-mix(in srgb, var(--accent) 78%, var(--heading));
}

.archive-record h2 {
  max-width: 36ch;
  margin: 0;
  font-size: var(--step-1);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.archive-record__main > p {
  max-width: 62ch;
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.archive-record .tag-list {
  margin-top: 0.75rem;
}

.archive-record__external {
  display: inline-block;
  margin-left: 0.15em;
  color: var(--accent);
  font-size: 0.65em;
  transform: translateY(-0.16em);
}

.archive-record--note h2 {
  font-size: 1rem;
}

.archive-record--quote h2 {
  font-style: italic;
}

.facet-heading,
.reading-room-heading {
  max-width: var(--shell);
}

.facet-heading h1,
.reading-room-heading h1 {
  max-width: 28ch;
}

.facet-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.facet-card {
  display: inline-flex;
  min-width: 0;
  min-height: 2.3rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
}

.facet-card:hover {
  border-color: color-mix(in srgb, var(--accent) 78%, var(--heading));
  color: color-mix(in srgb, var(--accent) 78%, var(--heading));
}

.facet-card > span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.facet-card small {
  flex: 0 0 auto;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.format-ticket {
  align-self: end;
  justify-self: end;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.compact-heading--day strong {
  color: var(--heading);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.day-search--compact {
  width: 100%;
}

.reading-room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.reading-room-card {
  position: relative;
  min-height: 10rem;
  padding: 1.5rem 2.5rem 1.5rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  text-decoration: none;
}

.reading-room-card:nth-child(odd) {
  margin-right: 1.5rem;
}

.reading-room-card:nth-child(even) {
  margin-left: 1.5rem;
}

.reading-room-card__index {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.reading-room-card h2 {
  max-width: 24ch;
  margin: 0.65rem 0 0.55rem;
  color: var(--accent);
  font-size: var(--step-1);
  line-height: 1.3;
}

.reading-room-card > p:last-child {
  max-width: 42ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.reading-room-card:hover {
  border-bottom-color: color-mix(in srgb, var(--accent) 78%, var(--heading));
}

.reading-room-card:hover h2 {
  color: color-mix(in srgb, var(--accent) 78%, var(--heading));
}

.feed-landing {
  max-width: min(calc(100% - 3rem), 48rem);
  margin-inline: auto;
  text-align: left;
}

.feed-landing > p:not(.section-kicker) {
  margin-inline: 0;
}

.format-ticket--large {
  font-size: 0.75rem;
}

.site-footer {
  margin-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  display: flex;
  min-height: 3.4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  color: var(--faint);
  font-size: 0.72rem;
}

.site-footer__inner p {
  margin: 0;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

.site-footer__links a {
  color: var(--muted);
}

.site-footer__links a:hover {
  color: color-mix(in srgb, var(--accent) 78%, var(--heading));
}

@media (max-width: 62rem) {
  .masthead {
    grid-template-columns: auto minmax(0, 1fr) minmax(11rem, 14rem);
  }

  .page-intro,
  .feed-item,
  .entry-header {
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 1.5rem;
  }

  .entry-body-wrap {
    width: min(var(--measure), calc(100% - 8.5rem));
    margin-left: 8.5rem;
  }

  .back-to-topic {
    margin-left: 8.5rem;
  }
}

@media (max-width: 48rem) {
  .shell {
    width: min(calc(100% - 2rem), var(--shell));
  }

  .masthead {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem 1rem;
    padding-block: 0.75rem;
  }

  .primary-nav {
    justify-content: flex-end;
    gap: 0.75rem;
    font-size: 0.78rem;
  }

  .site-search {
    grid-column: 1 / -1;
    width: 100%;
  }

  .topic-strip {
    width: 100%;
    padding-inline: 1rem;
  }

  .page-intro {
    display: block;
    padding-block: 2.8rem;
  }

  .page-intro .section-kicker {
    padding-top: 0;
  }

  .page-intro > p:last-child {
    margin-top: 0.85rem;
  }

  .feed-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding-block: 2.2rem;
  }

  .feed-date {
    padding-top: 0;
  }

  .feed-item--link .feed-item__paper,
  .feed-item--note .feed-item__paper,
  .feed-item--quote .feed-item__paper {
    padding-left: 1rem;
  }

  .topic-heading,
  .tag-heading,
  .archive-heading,
  .compact-heading {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-block: 2.7rem 2rem;
  }

  .topic-heading__note,
  .tag-heading__note {
    margin: 0;
  }

  .entry-shell {
    padding-top: 1rem;
  }

  .entry {
    margin-top: 2rem;
  }

  .entry-header {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .entry-header__margin {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .entry-body-wrap,
  .entry--note .entry-body-wrap,
  .entry--quote .entry-body-wrap {
    width: 100%;
    margin-left: 0;
  }

  .highlight pre {
    font-size: 0.74rem;
  }

  .back-to-topic {
    margin-left: 0;
  }

  .archive-search > div,
  .day-search > div {
    align-items: stretch;
  }

  .archive-search button,
  .day-search button {
    flex: 0 0 auto;
  }

  .archive-record {
    grid-template-columns: 4.6rem minmax(0, 1fr);
    gap: 0.75rem;
  }

  .archive-year {
    grid-template-columns: 4.6rem minmax(0, 1fr);
  }

  .reading-room-grid {
    grid-template-columns: 1fr;
  }

  .reading-room-card:nth-child(n) {
    margin-inline: 0;
  }

  .reading-room-card {
    min-height: 0;
    padding-right: 0;
  }

  .format-ticket {
    justify-self: start;
  }

  .empty-state {
    margin-block: 2.5rem;
  }

  .site-footer__inner {
    min-height: 4.5rem;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
  }
}

@media (max-width: 25rem) {
  .primary-nav {
    gap: 0.55rem;
    font-size: 0.72rem;
  }

  .archive-search > div,
  .day-search > div {
    flex-direction: column;
  }

  .archive-search button,
  .day-search button {
    border-top: 0;
    border-left: 1px solid var(--border);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .breadcrumbs,
  .back-to-topic {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .entry-shell,
  .entry,
  .entry-body-wrap {
    width: 100%;
    margin: 0;
  }
}
