@font-face {
  font-family: Manrope;
  src: url("../assets/fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/ibm-plex-mono-latin-400-normal.woff2")
    format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  --page-base: #101015;
  --purple: #b28aef;
  --text-primary: #efedf4;
  --text-muted: #a6a2b0;
  --surface: #17171e;
  --surface-raised: #1d1c25;
  --border: #323039;
  --code-bg: #14141a;
  --focus: #c8a8ff;
  --link-accent: #c9a0fa;
  --section-border: rgb(178 138 239 / 65%);
  --content-border: #272727;
  --reading-pad: clamp(24px, 4.8vw, 64px);
  --safe-top: env(safe-area-inset-top, 0px);
  --pad: max(
    clamp(24px, 5vw, 88px),
    env(safe-area-inset-left),
    env(safe-area-inset-right)
  );
  --mono: "IBM Plex Mono", monospace;
  --sans:
    Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  --body:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color-scheme: dark;
  font-family: var(--sans);
  color: var(--text-primary);
  background: var(--page-base);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html {
  scrollbar-gutter: stable;
  scroll-behavior: auto;
  scroll-padding-top: calc(110px + var(--safe-top));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-width: 320px;
}
body.modal-open {
  overflow: hidden;
}
button,
input {
  font: inherit;
}
button,
a,
input,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  background: none;
  border: 0;
}
img,
svg {
  max-width: 100%;
}
img {
  height: auto;
}
::selection {
  background: #755895;
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}
main:focus {
  outline: none;
}
[hidden] {
  display: none !important;
}
.shell {
  width: calc(min(100%, 1760px) - var(--pad) * 2);
  margin-inline: auto;
}
.eyebrow {
  font: 13px/1.6 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-weight: 600;
}
h1 > span,
h2 > span {
  color: var(--purple);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 20px;
  padding: 15px 20px;
  background: var(--purple);
  color: var(--page-base);
  transform: translateY(-180%);
}
.skip-link:focus {
  transform: none;
}

/* Match the approved Projects shell, including its mobile two-row header. */
.site-header {
  height: calc(100px + var(--safe-top));
  padding: var(--safe-top) var(--pad) 0;
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(30px, 4vw, 80px);
  background: linear-gradient(#101015 15%, #101015ee 65%, #10101500);
}
.brand {
  font-size: clamp(28px, 2.5vw, 36px);
  font-weight: 800;
  letter-spacing: -1px;
  white-space: nowrap;
}
.brand > span {
  color: var(--purple);
}
.brand:focus-visible {
  outline-offset: 7px;
  border-radius: 2px;
}
.site-navigation {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(36px, 4.2vw, 72px);
  margin-right: -6px;
}
.site-navigation a,
.search-trigger {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 10px 6px;
  font-size: clamp(20px, 1.65vw, 26px);
  font-weight: 600;
  transition: color 160ms ease;
}
.site-navigation a:is(:hover, :focus-visible, :active, [aria-current]),
.search-trigger:is(:hover, :focus-visible, :active),
body:has(#search-dialog[open]) .search-trigger {
  color: var(--link-accent);
}
.site-navigation :focus-visible {
  outline-color: var(--link-accent);
}
.search-trigger {
  gap: 8px;
}
.search-trigger svg {
  width: 0.95em;
  height: 0.95em;
  flex-shrink: 0;
}
kbd {
  font: 12px/1 var(--mono);
  border: 1px solid #62546f;
  color: #c5b8d1;
  border-radius: 3px;
  padding: 4px 5px;
}
/* The article header masks scrolling prose; its progress stays inside that layer. */
.page-article .site-header {
  background: var(--page-base);
}
.reading-track {
  position: absolute;
  bottom: 0;
  height: 2px;
  inset-inline: 0;
  z-index: 1;
  background: var(--page-base);
  pointer-events: none;
}
#reading-progress {
  height: 100%;
  width: 100%;
  background: var(--purple);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* Open at the same H1 baseline and type scale as Projects. */
.writing-hero {
  padding-block: calc(184px + var(--safe-top)) 64px;
  border-bottom: 2px solid var(--section-border);
}
.hero-copy h1,
.collection-hero h1 {
  font-size: clamp(72px, 7.8vw, 118px);
  line-height: 1.1;
  font-weight: 570;
  letter-spacing: -0.075em;
  margin: 0;
}
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: #c5b9d3;
  transition: color 0.15s;
}
.text-link:hover {
  color: var(--purple);
}
.section-heading {
  margin-bottom: 34px;
}
.section-heading h2 {
  margin: 0;
  font-size: 48px;
  line-height: 1.15;
  letter-spacing: -0.045em;
  font-weight: 550;
}
.footer-bottom a:is(:hover, :focus-visible) {
  color: var(--link-accent);
  outline-color: var(--link-accent);
}
.article-index {
  border-top: 1px solid var(--content-border);
}
.index-row {
  padding-block: 34px 35px;
  border-bottom: 1px solid var(--content-border);
}
.index-copy {
  min-width: 0;
  max-width: 880px;
}
.index-copy h3 {
  font-size: 25px;
  line-height: 1.55;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin-bottom: 12px;
}
.index-copy h3 a {
  transition: color 0.15s;
  overflow-wrap: anywhere;
}
.index-copy h3 a:hover {
  color: #d0b7ef;
}
.index-copy > p {
  font: 16.5px/1.9 var(--body);
  color: #b1aaba;
  max-width: 800px;
  margin-bottom: 17px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.index-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  font: 13px/1.8 var(--mono);
  color: #aaa3b5;
}
.index-meta a {
  font-family: var(--body);
  color: #bda8d3;
}
.index-meta a:hover {
  color: var(--purple);
}
.meta-dot {
  color: #857a91;
}
.pagination {
  display: flex;
  gap: 22px;
  justify-content: center;
  margin-top: 40px;
  font-size: 14px;
}
.pagination a,
.pagination .current {
  padding: 10px;
}
.pagination .current,
.pagination a:hover {
  color: var(--purple);
}
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
}
.topic-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 22px;
  min-width: 0;
  padding: 22px 0;
  border-bottom: 1px solid var(--content-border);
  font: 18px/1.65 var(--body);
  transition: color 0.15s;
}
.topic-item > span:first-child {
  overflow-wrap: anywhere;
}
.topic-item:hover {
  color: var(--purple);
}
.topic-count {
  font: 13px/1.7 var(--mono);
  color: #b2a6c0;
  flex-shrink: 0;
}
.site-footer {
  border-top: 2px solid var(--section-border);
  padding-block: 24px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 15px;
  font-weight: 400;
  color: #afa8b9;
}
.footer-bottom > span {
  white-space: nowrap;
}
.footer-bottom a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  transition: color 160ms ease;
}

/* Collections share one plain index and the same type scale. */
.collection-page {
  padding-block: calc(184px + var(--safe-top)) 88px;
  min-height: calc(100svh - 180px);
}
.collection-hero {
  padding-bottom: 42px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--section-border);
}
.collection-hero h1 {
  overflow-wrap: anywhere;
}
.collection-hero h1:has(+ p) {
  margin-bottom: 20px;
}
.collection-hero .topic-title {
  font-size: clamp(46px, 5.4vw, 68px);
}
.collection-hero p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
}
.collection-hero > .text-link {
  margin-bottom: 28px;
}
.topic-collection {
  margin-bottom: 64px;
}
.topic-collection:last-child {
  margin-bottom: 0;
}
.topic-collection h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b6aabf;
  font-weight: 500;
  margin-bottom: 0;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--section-border);
}
.tag-grid .topic-item {
  font-size: 18px;
}
.not-found {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: calc(100svh - 195px);
  padding-block: 190px 110px;
}
.not-found h1 {
  font-size: 88px;
  line-height: 1.1;
  letter-spacing: -0.06em;
  margin-bottom: 30px;
}
.not-found p {
  font-size: 24px;
  color: #bfb6cb;
  margin-bottom: 28px;
}
.empty-state {
  font-size: 17px;
  color: var(--text-muted);
}

.reading-page .shell {
  width: min(100% - var(--reading-pad) * 2, 1120px);
}

/* Prose leads; the contents list lives in the page's natural scroll. */
.article-hero {
  padding-block: 142px 45px;
}
.article-back {
  margin-bottom: 26px;
}
.article-hero > h1 {
  max-width: 900px;
  font-size: 46px;
  line-height: 1.5;
  letter-spacing: -0.035em;
  font-weight: 650;
  margin-bottom: 21px;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.article-deck {
  max-width: 820px;
  font: 19px/1.9 var(--body);
  color: #bcb4c7;
  margin-bottom: 25px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font: 14px/1.85 var(--mono);
  color: #ada4b8;
}
.article-meta a {
  font-family: var(--body);
  color: #c3abd9;
}
.article-cover {
  display: block;
  max-height: 540px;
  width: 100%;
  object-fit: contain;
  margin-top: 36px;
}
.reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 780px) minmax(0, 228px);
  gap: 64px;
  align-items: start;
  border-top: 1px solid var(--border);
  padding-top: 44px;
}
.reading-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
.toc-column {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: var(--toc-top, 119px);
  min-width: 0;
  align-self: start;
}
.toc-panel summary {
  font-size: 14px;
  color: #c0b4cd;
  list-style: none;
  pointer-events: none;
  margin-bottom: 22px;
}
.toc-panel summary::-webkit-details-marker {
  display: none;
}
.toc-panel summary > span {
  display: none;
}
.toc-panel .toc,
.toc-panel .toc-child {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-panel .toc-child {
  padding-left: 12px;
}
.toc-panel .toc-item {
  margin: 0 0 10px;
}
.toc-panel .toc-link {
  display: block;
  font: 14px/1.75 var(--body);
  color: #ada4b8;
  border-left: 1px solid transparent;
  padding-left: 11px;
  overflow-wrap: anywhere;
  transition: color 0.15s;
}
.toc-panel .toc-level-2 .toc-link {
  font-size: 13.5px;
}
.toc-panel .toc-level-3 {
  display: none;
}
.toc-panel .toc-link:hover,
.toc-panel .toc-link.is-active,
.toc-panel .toc-link[aria-current] {
  color: #d2b3f5;
  border-left-color: var(--purple);
}
.article-body {
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.95;
  letter-spacing: 0.015em;
  color: #d6d2dc;
  overflow-wrap: anywhere;
}
.article-body > :first-child {
  margin-top: 0;
}
.article-body p {
  margin-block: 0 1.6em;
}
.article-body :is(h1, h2, h3, h4, h5, h6) {
  position: relative;
  font-family: var(--sans);
  color: #f0edf5;
  font-weight: 650;
  line-height: 1.55;
  letter-spacing: -0.02em;
  scroll-margin-top: 6px;
  text-wrap: pretty;
}
.article-body h1 {
  font-size: 36px;
  margin: 2.6em 0 1.05em;
  padding-top: 0;
  border-top: 0;
}
.article-body h2 {
  font-size: 32px;
  margin: 2.5em 0 0.9em;
}
.article-body h3 {
  font-size: 25px;
  margin: 2em 0 0.8em;
}
.article-body h4 {
  font-size: 19px;
  margin: 1.8em 0 0.75em;
}
.article-body :is(h5, h6) {
  font-size: 19px;
  margin: 1.8em 0 0.75em;
}
.article-body :is(h1, h2, h3, h4) + :is(h2, h3, h4) {
  margin-top: 1em;
}
.article-body a {
  color: #c8a5f1;
  text-decoration: underline;
  text-decoration-color: #a58aba75;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: color 0.15s;
}
.article-body a:hover {
  color: #ecd9ff;
  text-decoration-color: currentColor;
}
.article-body strong {
  font-weight: 650;
  color: #f1edf6;
}
.article-body em {
  color: #c5becf;
}
.article-body :is(ul, ol) {
  padding-left: 1.6em;
  margin: 1em 0 1.65em;
}
.article-body li {
  padding-left: 0.15em;
  margin: 0.4em 0;
}
.article-body li::marker {
  color: #b29ac9;
}
.article-body li :is(ul, ol) {
  margin-block: 0.45em 0.75em;
}
.article-body li p {
  margin-bottom: 0.5em;
}
.article-body blockquote {
  margin: 2em 0;
  padding: 3px 0 3px 24px;
  border-left: 2px solid #b28aef9c;
  color: #bfb7cc;
}
.article-body blockquote p:last-child {
  margin-bottom: 0;
}
.article-body blockquote blockquote {
  margin-block: 1em;
}
.article-body hr {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 3em 0;
}
.article-body :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: #23202c;
  border: 1px solid #37303f;
  color: #d3b6f1;
  border-radius: 3px;
  padding: 2px 5px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  overflow-wrap: anywhere;
}
.article-body pre {
  font: 14px/1.85 var(--mono);
  letter-spacing: 0;
  overflow-x: auto;
  tab-size: 4;
  margin: 0;
  padding: 20px 22px;
  max-width: 100%;
  background: var(--code-bg);
  color: #d2ccd9;
}
.article-body pre code {
  font: inherit;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  border: 0;
  padding: 0;
  color: inherit;
  background: none;
}
.article-body figure.highlight,
.article-body .code-block {
  margin: 2em 0;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--code-bg);
  position: relative;
}
.article-body figure.highlight {
  display: flex;
  flex-direction: column;
}
.code-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 15px;
  background: #1b1922;
  border-bottom: 1px solid var(--border);
  line-height: 1;
  font: 12px var(--mono);
}
.code-language {
  color: #b2a1c6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.code-copy {
  font: 12px var(--mono);
  color: #d0c3df;
  padding: 8px 10px;
  border: 1px solid #42374d;
  border-radius: 3px;
  min-width: 55px;
}
.code-copy:hover {
  border-color: var(--purple);
  color: var(--purple);
}
.article-body figure.highlight > table {
  display: block;
  width: 100%;
  overflow: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  font: 14px/1.85 var(--mono);
}
.article-body figure.highlight > table td {
  padding: 0;
  border: 0;
  background: none;
}
.article-body figure.highlight pre {
  overflow: visible;
}
.article-body figure.highlight .gutter pre {
  padding-right: 14px;
  padding-left: 14px;
  color: #9b8aaa;
  text-align: right;
  border-right: 1px solid #2a2531;
  user-select: none;
}
.article-body figure.highlight .code {
  width: 100%;
}
.article-body figure.highlight .code pre {
  padding-left: 18px;
}
.article-body figure.highlight .line {
  min-height: 1.85em;
}
.article-body table:not(.highlight table) {
  display: block;
  max-width: 100%;
  width: max-content;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 15px;
  line-height: 1.75;
}
.article-body th {
  font-weight: 600;
  text-align: left;
  background: #1c1923;
  color: #dfd3ee;
}
.article-body :is(th, td) {
  padding: 12px 16px;
  border: 1px solid #37303e;
  min-width: 70px;
}
.article-body tbody tr:nth-child(even) {
  background: #17151d;
}
.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2em auto 1em;
  border-radius: 4px;
}
.article-body img[data-lightbox-image] {
  cursor: zoom-in;
}
.article-body img:focus-visible {
  outline-offset: 4px;
}
.article-body figcaption,
.article-body .image-caption {
  font-size: 15px;
  line-height: 1.8;
  text-align: center;
  color: #a49aad;
  margin: 8px 0 25px;
}
.article-body p:has(> img) + p:has(> em:only-child) {
  font-size: 15px;
  color: #a49aad;
  text-align: center;
  margin-top: -0.25em;
}
.article-body .katex {
  font-size: 1.08em;
  letter-spacing: 0;
}
.article-body .katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 2px;
  margin: 1.6em 0;
}
.article-body .katex-display > .katex {
  white-space: nowrap;
}
.article-body details {
  border-block: 1px solid var(--border);
  padding: 16px 0;
  margin-block: 2em;
}
.article-body details > summary {
  cursor: pointer;
  font-weight: 600;
  color: #d7c1ed;
}
.article-body details[open] > summary {
  margin-bottom: 18px;
}
.article-body input[type="checkbox"] {
  accent-color: var(--purple);
  width: 15px;
  height: 15px;
  margin-right: 7px;
}
.article-body .footnotes {
  font-size: 15px;
  color: #aaa0b5;
  border-top: 1px solid var(--border);
  margin-top: 50px;
}
.article-body .footnote-ref {
  font-size: 0.75em;
}
.article-body [data-footnote-ref] {
  font-family: var(--mono);
  text-decoration: none;
}
.article-body .sr-only {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
}
.article-body [data-footnote-backref] {
  margin-left: 8px;
  padding: 4px;
}
.article-body .footnotes :is(li, p) {
  font-size: 15px;
  line-height: 1.9;
}
.heading-anchor {
  position: absolute;
  right: 100%;
  margin-right: 3px;
  top: 0.2em;
  opacity: 0;
  color: var(--purple);
  font: 15px var(--mono);
  padding: 7px 2px;
  transition: opacity 0.15s;
}
.article-body :is(h1, h2, h3, h4):hover > .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}
.highlight .comment,
.highlight .quote {
  color: #8c8299;
}
.highlight .keyword,
.highlight .selector-tag,
.highlight .literal {
  color: #c59bea;
}
.highlight .string,
.highlight .regexp,
.highlight .addition {
  color: #b8c89e;
}
.highlight .number,
.highlight .built_in,
.highlight .type {
  color: #d8b18d;
}
.highlight .title,
.highlight .function .title,
.highlight .section {
  color: #c3b8e8;
}
.highlight .meta,
.highlight .symbol,
.highlight .attribute {
  color: #b7a0c8;
}
.highlight .variable,
.highlight .params {
  color: #d4c9e0;
}
.highlight .deletion {
  color: #e5a4af;
}

.article-body .headerlink {
  display: none;
}
.article-body figure.highlight td {
  padding: 0;
}
.article-end {
  margin-top: 72px;
  border-top: 2px solid var(--section-border);
  padding-top: 40px;
  padding-bottom: 100px;
}
.article-taxonomy > h2 {
  font-size: 17px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 18px;
}
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
}
.article-tags a {
  font-size: 16px;
  line-height: 1.8;
  color: #cfc5d8;
}
.article-tags a:is(:hover, :focus-visible) {
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.article-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 28px;
}
.article-actions button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  min-height: 44px;
  font-size: 17px;
  color: #cfc5d8;
}
.article-actions button:is(:hover, :focus-visible):not(:disabled) {
  color: var(--purple);
}
.article-actions [data-like][aria-pressed="true"] {
  color: #d2b3f5;
}
.article-actions [data-like-count] {
  font-family: var(--mono);
}
.related-section {
  margin-top: 56px;
  border-top: 2px solid var(--section-border);
  padding-top: 40px;
}
.related-section .section-heading h2 {
  font-size: 32px;
}
.related-section .index-row {
  padding-block: 25px;
}
.related-section .article-index {
  border-top: 0;
}
.related-section .index-row:last-child {
  border-bottom: 0;
}
.related-section .index-copy h3 {
  font-size: 22px;
}
.related-section .index-copy > p {
  font-size: 16px;
}
.article-series {
  margin-block: 20px 50px;
  padding-block: 26px;
  border-block: 1px solid var(--border);
}
.series-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: baseline;
}
.series-heading h2 {
  font-size: 24px;
  margin-bottom: 22px;
}
.series-heading > span {
  font: 13px var(--mono);
  color: var(--text-muted);
  white-space: nowrap;
}
.series-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.series-navigation a {
  font-size: 17px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.series-navigation a > span {
  display: block;
  font-size: 13px;
  color: #b7a7c7;
  margin-bottom: 8px;
}
.discussion {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 2px solid var(--section-border);
}
.discussion h2 {
  font-size: 24px;
  margin-bottom: 12px;
  font-weight: 500;
}
[data-comments-mount] {
  margin-top: 28px;
}
.giscus,
.giscus-frame {
  width: 100%;
}
/* Dialogs inherit the reading surface. Native modal semantics handle focus. */
dialog {
  color: var(--text-primary);
  border: 1px solid #51435f;
  background: #19161f;
  padding: 0;
}
dialog::backdrop {
  background: #08070dd9;
}
.search-dialog {
  width: min(780px, calc(100vw - 32px));
  max-height: 88svh;
  margin: 6svh auto 0;
  border-radius: 8px;
  box-shadow: 0 25px 100px #0005;
  overflow: hidden;
}
.search-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 25px;
  border-bottom: 1px solid var(--border);
}
.search-topline h2 {
  margin: 0;
  font-size: 13px;
  color: #c2adcf;
}
.search-topline button {
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  color: var(--text-muted);
}
.search-input-wrap {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 24px 25px 12px;
}
.search-input-wrap > span {
  font: 23px var(--mono);
  color: var(--purple);
}
#search-input {
  min-width: 0;
  flex: 1;
  width: 100%;
  background: none;
  border: 0;
  color: var(--text-primary);
  outline: 0;
  font-size: 24px;
  height: 45px;
  letter-spacing: -0.02em;
}
#search-input::placeholder {
  color: #95829f;
}
#search-input:focus-visible {
  box-shadow: 0 1px 0 #c29bed;
}
.search-status {
  font-size: 13px;
  color: #aaa0b6;
  padding: 0 25px;
  margin-bottom: 20px;
  line-height: 1.7;
}
.search-results {
  overflow: auto;
  max-height: 45svh;
  padding: 0 12px;
  overscroll-behavior: contain;
}
.search-result {
  margin: 0 0 7px;
  border: 1px solid transparent;
  border-radius: 4px;
}
.search-result a {
  display: block;
  padding: 17px 15px;
}
.search-result.is-active,
.search-result:has(.is-active),
.search-result:hover {
  background: #282031;
  border-color: #594468;
}
.search-result-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.65;
  margin-bottom: 7px;
}
.search-result-excerpt {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.85;
  color: #b5a9c0;
  margin: 0;
}
.search-result mark {
  background: #6547826b;
  color: #efddff;
}
.search-result-meta {
  font-size: 13px;
  color: #c09ee2;
  margin-top: 9px;
}
.search-help {
  display: flex;
  gap: 28px;
  justify-content: flex-start;
  padding: 19px 25px;
  border-top: 1px solid var(--border);
  font: 13px/1.7 var(--sans);
  color: #a79ab2;
}
.search-help > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.search-help kbd {
  font-size: 13px;
  padding: 3px 5px;
}
.toast {
  position: fixed;
  z-index: 100;
  bottom: 30px;
  left: 50%;
  transform: translate(-50%, 10px);
  background: #d3bee8;
  color: #211728;
  font-size: 13px;
  padding: 12px 20px;
  border-radius: 5px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  max-width: calc(100% - 40px);
  text-align: center;
}
.toast.is-visible,
.toast[data-visible="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}
.lightbox {
  max-width: 100vw;
  max-height: 100svh;
  width: 100vw;
  height: 100svh;
  border: 0;
  background: transparent;
  overflow: hidden;
  margin: 0;
  padding: 35px;
}
.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  gap: 16px;
}
.lightbox-image {
  max-width: 100%;
  max-height: calc(100svh - 130px);
  object-fit: contain;
  margin: auto;
}
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  background: #221b2b;
  border: 1px solid #695576;
  border-radius: 4px;
  padding: 12px 18px;
  font-size: 13px;
  z-index: 1;
}
.lightbox-caption {
  max-width: 760px;
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
  color: #c4b9d0;
  margin: 0;
}
.article-body .image-unavailable {
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 1150px) {
  .reading-layout {
    grid-template-columns: minmax(0, 780px);
    max-width: 780px;
    gap: 0;
  }
  .article-hero {
    max-width: 780px;
  }
  .toc-column {
    position: static;
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 34px;
    border-bottom: 1px solid var(--border);
  }
  .reading-main {
    grid-row: 2;
  }
  .toc-panel summary {
    pointer-events: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    margin-bottom: 18px;
    font-size: 15px;
  }
  .toc-panel summary > span {
    display: inline;
    transition: transform 0.15s;
  }
  .toc-panel[open] summary > span {
    transform: rotate(180deg);
  }
  .toc-panel .toc {
    padding-bottom: 18px;
    columns: 2;
    column-gap: 28px;
  }
  .toc-panel .toc-item {
    break-inside: avoid;
  }
  .toc-panel .toc-child {
    display: none;
  }
  .tag-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 30px;
  }
}
@media (max-width: 680px) {
  :root {
    --reading-pad: 24px;
  }
  .section-heading {
    margin-bottom: 28px;
  }
  .section-heading h2 {
    font-size: 38px;
  }
  .index-row {
    padding-block: 26px 28px;
  }
  .index-copy h3 {
    font-size: 22px;
    line-height: 1.65;
    margin-bottom: 11px;
  }
  .index-copy > p {
    font-size: 16px;
    line-height: 1.9;
    margin-bottom: 16px;
    -webkit-line-clamp: 3;
  }
  .index-meta {
    font-size: 12.5px;
    gap: 6px 9px;
  }
  .topic-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .topic-item,
  .tag-grid .topic-item {
    font-size: 18px;
    padding-block: 19px;
  }
  .site-footer {
    padding-block: 20px;
  }
  .collection-page {
    padding-block: calc(190px + var(--safe-top)) 64px;
  }
  .collection-hero .topic-title {
    font-size: 40px;
  }
  .collection-hero p {
    font-size: 16px;
  }
  .topic-collection {
    margin-bottom: 45px;
  }
  .topic-collection h2 {
    font-size: 14px;
  }
  .not-found {
    padding-block: 158px 90px;
    min-height: calc(100svh - 206px);
  }
  .not-found h1 {
    font-size: 72px;
  }
  .not-found p {
    font-size: 21px;
  }
  .article-hero {
    padding-block: 110px 33px;
  }
  .article-back {
    font-size: 14px;
    margin-bottom: 20px;
  }
  .article-hero > h1 {
    font-size: 32px;
    line-height: 1.55;
    margin-bottom: 18px;
  }
  .article-deck {
    font-size: 18px;
    line-height: 1.9;
    margin-bottom: 23px;
  }
  .article-meta {
    font-size: 14px;
    gap: 7px 10px;
  }
  .reading-layout {
    padding-top: 18px;
  }
  .toc-column {
    margin-bottom: 30px;
  }
  .toc-panel .toc {
    columns: 1;
  }
  .toc-panel .toc-link {
    font-size: 14px;
  }
  .article-body {
    font-size: 18px;
    line-height: 1.95;
    letter-spacing: 0.01em;
  }
  .article-body h1 {
    font-size: 30px;
  }
  .article-body h2 {
    font-size: 27px;
  }
  .article-body h3 {
    font-size: 23px;
  }
  .article-body h4 {
    font-size: 20px;
  }
  .article-body blockquote {
    padding-left: 18px;
    margin-inline: 0;
  }
  .article-body pre,
  .article-body figure.highlight > table {
    font-size: 13px;
  }
  .article-body pre {
    padding: 18px 15px;
  }
  .article-body figure.highlight .gutter pre {
    padding-inline: 10px;
  }
  .article-body figure.highlight .code pre {
    padding-left: 13px;
  }
  .article-body table:not(.highlight table) {
    font-size: 15px;
  }
  .article-body :is(th, td) {
    padding: 10px 13px;
  }
  .article-body .katex {
    font-size: 1em;
  }
  .article-body .katex-display {
    margin-inline: 0;
  }
  .article-body .footnotes :is(li, p) {
    font-size: 15px;
  }
  .article-end {
    margin-top: 56px;
    padding-top: 32px;
    padding-bottom: 65px;
  }
  .article-taxonomy > h2,
  .article-actions button {
    font-size: 16px;
  }
  .article-tags {
    gap: 10px 20px;
  }
  .article-actions {
    padding-top: 24px;
  }
  .related-section {
    margin-top: 44px;
    padding-top: 32px;
  }
  .related-section .section-heading h2 {
    font-size: 26px;
  }
  .related-section .index-copy h3 {
    font-size: 21px;
  }
  .related-section .index-copy > p {
    font-size: 16px;
  }
  .series-navigation {
    grid-template-columns: minmax(0, 1fr);
  }
  .discussion {
    margin-top: 46px;
    padding-top: 32px;
  }
  .search-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100svh - 30px);
    margin-top: 15px;
  }
  .search-topline {
    padding: 13px 18px;
  }
  .search-input-wrap {
    padding: 17px 18px 10px;
  }
  #search-input {
    font-size: 20px;
  }
  .search-status {
    padding-inline: 18px;
    margin-bottom: 13px;
  }
  .search-results {
    max-height: calc(100svh - 250px);
    padding-inline: 7px;
  }
  .search-result a {
    padding: 15px 11px;
  }
  .search-result-title {
    font-size: 18px;
  }
  .search-result-excerpt {
    font-size: 15px;
  }
  .lightbox {
    padding: 20px 14px;
  }
  .lightbox-caption {
    font-size: 13px;
  }
}
@media (max-width: 370px) {
  .article-hero > h1 {
    font-size: 30px;
  }
}
@media (max-width: 900px) {
  .writing-hero {
    padding-top: calc(190px + var(--safe-top));
    padding-bottom: 48px;
  }
  .hero-copy h1,
  .collection-hero h1 {
    font-size: clamp(64px, 11vw, 90px);
  }
  .collection-page {
    padding-top: calc(190px + var(--safe-top));
  }
}
@media (max-width: 700px) {
  :root {
    --pad: max(24px, env(safe-area-inset-left), env(safe-area-inset-right));
  }
  html {
    scroll-padding-top: calc(132px + var(--safe-top));
  }
  .site-header {
    height: calc(116px + var(--safe-top));
    display: block;
    padding-top: calc(12px + var(--safe-top));
    background: linear-gradient(#101015 65%, #10101500);
  }
  .brand {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 26px;
  }
  .site-navigation {
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 0;
  }
  .site-navigation a,
  .search-trigger {
    min-height: 44px;
    padding: 8px 0;
    font-size: 17px;
  }
  .article-hero {
    padding-top: calc(154px + var(--safe-top));
  }
  .footer-bottom {
    font-size: 14px;
    gap: 10px;
  }
  .collection-hero {
    padding-bottom: 32px;
    margin-bottom: 40px;
  }
  .search-help,
  .search-topline kbd {
    display: none;
  }
}
@media (max-width: 400px) {
  .site-navigation {
    gap: 10px;
  }
  .site-navigation a,
  .search-trigger {
    font-size: 16px;
  }
  .search-trigger {
    gap: 5px;
  }
}
/* The full chronology uses purple section rules and neutral item rules. */
.writing-count {
  margin: 22px 0 0;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 500;
  color: #b9b5c2;
}
.writing-year {
  padding-block: 56px 88px;
}
.writing-year + .writing-year {
  border-top: 2px solid var(--section-border);
}
.writing-year > h2 {
  margin: 0 0 20px;
  font-size: 32px;
  line-height: 1.3;
  font-weight: 550;
  letter-spacing: -0.04em;
}
.timeline-entry {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 28px;
  align-items: baseline;
}
.timeline-entry:last-child {
  border-bottom: 0;
}
.timeline-date {
  font: 14px/1.8 var(--mono);
  color: #aaa3b5;
}
.writing-timeline .index-meta {
  font-size: 14px;
}
.topics-page .collection-hero {
  border-bottom: 0;
  padding-bottom: 0;
}
.topics-back {
  font-size: 17px;
  gap: 8px;
}
.topics-back > span {
  transition: transform 160ms ease;
}
.topics-back:is(:hover, :focus-visible) {
  color: var(--purple);
}
.topics-back:is(:hover, :focus-visible) > span {
  transform: translateX(-3px);
}
.footer-bottom > a {
  font-size: 16px;
}
@media (max-width: 700px) {
  .writing-year {
    padding-block: 44px 64px;
  }
  .writing-year > h2 {
    font-size: 30px;
    margin-bottom: 16px;
  }
  .timeline-entry {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .topics-back {
    font-size: 16px;
  }
  .footer-bottom > a {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  :root {
    color-scheme: light;
    background: #fff;
    color: #111;
  }
  .site-header,
  .site-footer,
  .toc-column,
  .reading-track,
  .article-end,
  .heading-anchor,
  .code-toolbar,
  .article-back {
    display: none !important;
  }
  .shell {
    width: 100%;
  }
  .article-hero {
    padding: 0 0 25px;
  }
  .reading-layout {
    display: block;
  }
  .article-body {
    color: #222;
    font-size: 12pt;
  }
  .article-body :is(h1, h2, h3, h4, strong),
  .article-body a {
    color: #111;
  }
  .article-body pre {
    white-space: pre-wrap;
  }
}
