@font-face {
  font-family: "XCharter";
  src: url("/fonts/XCharter-Roman.otf") format("opentype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "XCharter";
  src: url("/fonts/XCharter-Italic.otf") format("opentype");
  font-display: swap;
  font-style: italic;
  font-weight: 400;
}

@font-face {
  font-family: "XCharter";
  src: url("/fonts/XCharter-Bold.otf") format("opentype");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

@font-face {
  font-family: "XCharter";
  src: url("/fonts/XCharter-BoldItalic.otf") format("opentype");
  font-display: swap;
  font-style: italic;
  font-weight: 700;
}

@font-face {
  font-family: "Berkeley Mono";
  src: url("/fonts/BerkeleyMono-Regular.otf") format("opentype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Berkeley Mono";
  src: url("/fonts/BerkeleyMono-Oblique.otf") format("opentype");
  font-display: swap;
  font-style: italic;
  font-weight: 400;
}

@font-face {
  font-family: "Berkeley Mono";
  src: url("/fonts/BerkeleyMono-Bold.otf") format("opentype");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

@font-face {
  font-family: "Berkeley Mono";
  src: url("/fonts/BerkeleyMono-Bold-Oblique.otf") format("opentype");
  font-display: swap;
  font-style: italic;
  font-weight: 700;
}

:root {
  color-scheme: light;
  --font-body: "XCharter", Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --bg: #fbfaf6;
  --bg-soft: #f0ede6;
  --surface: #fffdf8;
  --surface-2: #f2eee4;
  --text: #2d2a26;
  --text-strong: #1e1b18;
  --muted: #6f6860;
  --muted-2: #8c8479;
  --border: #ddd6c9;
  --accent: #6f5f3e;
  --accent-2: #4f5d55;
  --accent-soft: #ebe5d5;
  --code-bg: #f5f1e8;
  --code-border: #d6cdbc;
  --code-text: #302c27;
  --syntax-comment: #837a70;
  --syntax-keyword: #596b62;
  --syntax-string: #8f5f2d;
  --syntax-number: #8c5e71;
  --syntax-name: #6f5f3e;
  --syntax-type: #6a5f8f;
  --shadow: 0 18px 45px rgba(54, 39, 24, 0.07);
  --measure: 42rem;
  --rail: 16rem;
  --site-pad: clamp(1rem, 3vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #1d1d1b;
    --bg-soft: #171716;
    --surface: #252421;
    --surface-2: #2e2c28;
    --text: #ded8cd;
    --text-strong: #f2eadb;
    --muted: #aaa194;
    --muted-2: #837b70;
    --border: #3b3832;
    --accent: #d0a85c;
    --accent-2: #a9b58e;
    --accent-soft: #332d21;
    --code-bg: #20201d;
    --code-border: #49443b;
    --code-text: #e6dfd0;
    --syntax-comment: #8f8679;
    --syntax-keyword: #a9b58e;
    --syntax-string: #dbc074;
    --syntax-number: #c94f6d;
    --syntax-name: #d0a85c;
    --syntax-type: #b8a1d9;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1d1d1b;
  --bg-soft: #171716;
  --surface: #252421;
  --surface-2: #2e2c28;
  --text: #ded8cd;
  --text-strong: #f2eadb;
  --muted: #aaa194;
  --muted-2: #837b70;
  --border: #3b3832;
  --accent: #d0a85c;
  --accent-2: #a9b58e;
  --accent-soft: #332d21;
  --code-bg: #20201d;
  --code-border: #49443b;
  --code-text: #e6dfd0;
  --syntax-comment: #8f8679;
  --syntax-keyword: #a9b58e;
  --syntax-string: #dbc074;
  --syntax-number: #c94f6d;
  --syntax-name: #d0a85c;
  --syntax-type: #b8a1d9;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.45;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
}

body,
button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--text-strong);
  text-decoration-color: var(--accent);
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

::selection {
  background: var(--accent-soft);
  color: var(--text-strong);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.meta-mono {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.45;
  letter-spacing: 0;
}

.skip-link {
  position: absolute;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 10;
  transform: translateY(-150%);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text-strong);
  text-decoration: none;
}

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

.site-header {
  padding: 0.85rem var(--site-pad) 0;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: calc(var(--measure) + var(--rail) + 5rem);
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.85rem;
}

.site-title {
  color: var(--text-strong);
  font-size: 1.14rem;
  font-weight: 500;
  line-height: 1.1;
  text-decoration: none;
}

.site-nav .menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.site-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav a:hover {
  color: var(--text-strong);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.soundtrack-icon {
  position: relative;
  display: block;
  width: 0.56rem;
  height: 0.62rem;
}

.soundtrack-icon::before,
.soundtrack-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.soundtrack-icon::before {
  top: 0.07rem;
  left: 0.13rem;
  width: 0;
  height: 0;
  border-block: 0.24rem solid transparent;
  border-left: 0.36rem solid currentColor;
}

.soundtrack-icon::after {
  display: none;
}

.soundtrack-toggle.is-playing .soundtrack-icon::before,
.soundtrack-toggle.is-playing .soundtrack-icon::after {
  top: 0.07rem;
  width: 0.14rem;
  height: 0.48rem;
  border: 0;
  background: currentColor;
}

.soundtrack-toggle.is-playing .soundtrack-icon::before {
  left: 0.11rem;
}

.soundtrack-toggle.is-playing .soundtrack-icon::after {
  left: 0.33rem;
  display: block;
}

.soundtrack-volume-control {
  display: inline-flex;
  align-items: center;
  width: 3.8rem;
  height: 1.55rem;
}

.soundtrack-volume-control[hidden] {
  display: none;
}

.soundtrack-volume {
  width: 100%;
  height: 1rem;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.soundtrack-volume::-webkit-slider-runnable-track {
  height: 0.14rem;
  border-radius: 999px;
  background: var(--border);
}

.soundtrack-volume::-webkit-slider-thumb {
  width: 0.56rem;
  height: 0.56rem;
  margin-top: -0.21rem;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--accent);
}

.soundtrack-volume::-moz-range-track {
  height: 0.14rem;
  border-radius: 999px;
  background: var(--border);
}

.soundtrack-volume::-moz-range-thumb {
  width: 0.56rem;
  height: 0.56rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--accent);
}

.theme-icon {
  position: relative;
  display: block;
  width: 0.72rem;
  height: 0.72rem;
}

.theme-icon::before,
.theme-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.theme-icon::before {
  inset: 0.08rem;
  border-radius: 50%;
  background: currentColor;
}

.theme-icon::after {
  top: 0.02rem;
  left: 0.28rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--surface-2);
}

:root[data-theme="dark"] .theme-icon::before {
  inset: 0.22rem;
  box-shadow:
    0 -0.28rem 0 -0.11rem currentColor,
    0 0.28rem 0 -0.11rem currentColor,
    0.28rem 0 0 -0.11rem currentColor,
    -0.28rem 0 0 -0.11rem currentColor,
    0.2rem 0.2rem 0 -0.11rem currentColor,
    -0.2rem 0.2rem 0 -0.11rem currentColor,
    0.2rem -0.2rem 0 -0.11rem currentColor,
    -0.2rem -0.2rem 0 -0.11rem currentColor;
}

:root[data-theme="dark"] .theme-icon::after {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-icon::before {
    inset: 0.22rem;
    box-shadow:
      0 -0.28rem 0 -0.11rem currentColor,
      0 0.28rem 0 -0.11rem currentColor,
      0.28rem 0 0 -0.11rem currentColor,
      -0.28rem 0 0 -0.11rem currentColor,
      0.2rem 0.2rem 0 -0.11rem currentColor,
      -0.2rem 0.2rem 0 -0.11rem currentColor,
      0.2rem -0.2rem 0 -0.11rem currentColor,
      -0.2rem -0.2rem 0 -0.11rem currentColor;
  }

  :root:not([data-theme]) .theme-icon::after {
    display: none;
  }
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--accent);
  color: var(--text-strong);
}

.icon-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0.18rem;
}

.page-shell {
  width: min(var(--measure), calc(100% - 2 * var(--site-pad)));
  margin: 0 auto;
  padding: 1.8rem 0 2.8rem;
}

.home-shell {
  display: grid;
  gap: clamp(1.2rem, 3vw, 1.8rem);
}

.post-index h1,
.page-header h1 {
  margin: 0 0 0.6rem;
  color: var(--text-strong);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1.05;
}

.post-list {
  display: grid;
  gap: 0.58rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-list li {
  display: grid;
  grid-template-columns: minmax(8.5rem, max-content) 1fr;
  gap: 0.8rem;
  align-items: baseline;
  border-top: 1px solid var(--border);
  padding-top: 0.58rem;
}

.post-list a {
  color: var(--text-strong);
  font-weight: 400;
  text-decoration-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.home-quote {
  justify-self: center;
  display: grid;
  grid-template-columns: minmax(1.5rem, 1fr) auto minmax(1.5rem, 1fr);
  align-items: center;
  gap: 0.7rem;
  width: min(100%, 42rem);
  max-width: none;
  margin: -0.05rem 0 0;
  overflow-x: auto;
  color: var(--text);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.18;
  text-align: center;
  white-space: nowrap;
  scrollbar-width: none;
}

.home-quote::before,
.home-quote::after {
  content: "";
  height: 1px;
  background: color-mix(in srgb, var(--border) 72%, transparent);
}

.home-quote::-webkit-scrollbar {
  display: none;
}

.home-art {
  justify-self: center;
  width: min(30rem, 100%);
  margin: 0;
  color: var(--muted);
}

.home-art a {
  color: inherit;
}

.home-art > a {
  display: flex;
  justify-content: center;
}

.home-art img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(24rem, 68vh);
  height: auto;
  border: 1px solid var(--border);
  background: var(--surface);
}

.home-art figcaption {
  margin-top: 0.46rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.25;
  text-align: center;
}

.home-art cite {
  font-style: italic;
}

.article-shell {
  padding: 1.25rem var(--site-pad) 3.25rem;
}

.article-header {
  width: min(var(--measure), 100%);
  margin: 0 auto 1.65rem;
  text-align: center;
}

.toc-title {
  margin: 0;
  color: var(--text);
  text-transform: uppercase;
}

.article-header h1 {
  margin: 0 0 0.6rem;
  color: var(--text-strong);
  font-size: 3.2rem;
  font-weight: 400;
  line-height: 1;
  text-wrap: balance;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.8rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
}

.article-meta p {
  margin: 0;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--measure)) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 3rem);
  align-items: start;
  justify-content: center;
  max-width: 88rem;
  margin: 0 auto;
}

.article-content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.article-sidebar {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  position: sticky;
  top: 1.25rem;
  width: min(100%, var(--rail));
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  scrollbar-width: thin;
}

.toc-card {
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.28;
  overflow-x: clip;
}

.toc-body {
  display: grid;
  grid-template-columns: 0.18rem minmax(0, 1fr);
  gap: 0.82rem;
  align-items: stretch;
  min-width: 0;
}

.toc-progress {
  align-self: stretch;
  width: 0.18rem;
  min-height: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 72%, transparent);
}

.toc-progress span {
  display: block;
  width: 100%;
  height: calc(var(--toc-progress, 0) * 1%);
  min-height: 0.18rem;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: top;
  transition: height 120ms ease;
}

.toc-card nav,
.toc-card ul {
  margin: 0;
  padding: 0;
}

.toc-card .toc-title {
  margin-bottom: 0.5rem;
}

.toc-card ul {
  display: grid;
  gap: 0.28rem;
  list-style: none;
}

.toc-card ul ul {
  margin-top: 0.28rem;
  padding-left: 0.8rem;
  border-left: 1px solid var(--border);
}

.toc-card a {
  color: var(--text);
  display: block;
  position: relative;
  padding-left: 0.7rem;
  text-decoration: none;
  transition: color 120ms ease;
}

.toc-card a:hover {
  color: var(--accent);
}

.toc-card a.is-active {
  color: var(--text-strong);
}

.toc-card a.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.46em;
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 50%;
  background: var(--accent);
}

.toc-links {
  min-width: 0;
  overflow-wrap: anywhere;
}

.prose {
  color: var(--text);
  overflow-wrap: break-word;
}

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

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

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table,
.prose figure,
.prose .highlight {
  margin-block: 0.82rem;
}

.prose p {
  hyphens: auto;
}

.prose h2,
.prose h3,
.prose h4 {
  color: var(--text-strong);
  font-weight: 400;
  line-height: 1.08;
  text-wrap: balance;
}

.prose h2 {
  margin: 1.75rem 0 0.35rem;
  font-size: 2.15rem;
}

.prose h3 {
  margin: 1.35rem 0 0.3rem;
  font-size: 1.45rem;
}

.prose h4 {
  margin: 1.15rem 0 0.25rem;
  font-size: 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.16rem;
}

.prose li > ul,
.prose li > ol {
  margin-block: 0.2rem;
}

.prose blockquote {
  border-left: 0.16rem solid var(--accent);
  margin-left: 0;
  padding: 0.2rem 0 0.2rem 1rem;
  color: var(--muted);
  font-style: italic;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.prose code,
.prose kbd {
  border: 1px solid var(--code-border);
  border-radius: 0.22rem;
  background: color-mix(in srgb, var(--code-bg) 72%, var(--surface));
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 0.87em;
  line-height: 1.25;
}

.prose code {
  padding: 0.06rem 0.24rem;
}

.prose pre code {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.89rem;
  line-height: 1.28;
}

.prose .highlight,
.prose > pre {
  overflow-x: auto;
  border: 1px solid var(--code-border);
  background: var(--code-bg);
  color: var(--code-text);
  box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: var(--muted-2) transparent;
}

.prose .highlight,
.prose > pre {
  margin-block: 0.58rem;
}

.prose .highlight pre,
.prose > pre {
  margin: 0;
  padding: 0.5rem 0.64rem;
  -webkit-text-size-adjust: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  tab-size: 2;
}

.prose .code-block.has-control-gutter .highlight pre,
.prose .code-block.has-control-gutter > pre {
  padding-top: 1.42rem;
}

.prose .highlight pre {
  overflow: visible;
  border: 0;
  background: transparent;
}

.prose .highlight::-webkit-scrollbar,
.prose > pre::-webkit-scrollbar {
  height: 0.38rem;
}

.prose .highlight::-webkit-scrollbar-thumb,
.prose > pre::-webkit-scrollbar-thumb {
  border: 0.12rem solid var(--code-bg);
  border-radius: 999px;
  background: var(--muted-2);
}

.prose .code-block {
  position: relative;
  --code-wrap-offset: 1.15rem;
  margin-block: 0.58rem;
}

.prose .code-block .highlight,
.prose .code-block > pre {
  margin-block: 0;
}

.code-block-toolbar {
  position: absolute;
  top: 0.3rem;
  right: 0.32rem;
  z-index: 2;
  display: inline-flex;
  gap: 0.18rem;
  opacity: 0.72;
  transition: opacity 140ms ease;
}

.code-block:hover .code-block-toolbar,
.code-block:focus-within .code-block-toolbar {
  opacity: 1;
}

.code-block-button {
  border: 1px solid var(--code-border);
  border-radius: 0.18rem;
  padding: 0.16rem 0.32rem;
  background: color-mix(in srgb, var(--surface) 74%, var(--code-bg));
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1;
  cursor: pointer;
}

.code-block-button[hidden] {
  display: none;
}

.code-block-button:hover,
.code-block-button:focus-visible,
.code-block-button[aria-pressed="true"] {
  color: var(--text-strong);
  border-color: var(--accent);
}

.code-block-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0.12rem;
}

.code-block.is-wrapped .highlight,
.code-block.is-wrapped > pre {
  overflow-x: visible;
}

.code-block.is-wrapped pre,
.code-block.is-wrapped code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-block.is-wrapped .line {
  display: block;
  position: relative;
  padding-left: calc(var(--line-indent, 0ch) + var(--code-wrap-offset));
  text-indent: calc(-1 * (var(--line-indent, 0ch) + var(--code-wrap-offset)));
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-block.is-wrapped .line::before {
  content: "";
  position: absolute;
  top: calc(1.28em + 0.06rem);
  bottom: 0.08rem;
  left: var(--line-indent, 0ch);
  width: 2px;
  background: color-mix(in srgb, var(--muted-2) 54%, transparent);
  pointer-events: none;
}

.code-block.is-wrapped .cl {
  white-space: inherit;
}

@media (hover: none) {
  .code-block-toolbar {
    opacity: 1;
  }
}

.highlight code,
.chroma {
  font-family: var(--font-mono);
}

.chroma {
  background: transparent;
  color: var(--code-text);
}

.chroma .line {
  display: block;
}

.chroma .c,
.chroma .c1,
.chroma .cm,
.chroma .cs {
  color: var(--syntax-comment);
  font-style: italic;
}

.chroma .k,
.chroma .kc,
.chroma .kd,
.chroma .kn,
.chroma .kp,
.chroma .kr,
.chroma .kt {
  color: var(--syntax-keyword);
  font-weight: 600;
}

.chroma .s,
.chroma .s1,
.chroma .s2,
.chroma .se,
.chroma .sh,
.chroma .sx {
  color: var(--syntax-string);
}

.chroma .m,
.chroma .mi,
.chroma .mf,
.chroma .mh,
.chroma .il {
  color: var(--syntax-number);
}

.chroma .nf,
.chroma .nx,
.chroma .na,
.chroma .nb {
  color: var(--syntax-name);
}

.chroma .nc {
  color: var(--syntax-type);
}

.chroma .o,
.chroma .p {
  color: var(--muted);
}

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 1rem;
  line-height: 1.34;
}

.prose th,
.prose td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.prose th {
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 500;
  text-transform: uppercase;
}

.prose tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}

.prose a code {
  color: inherit;
}

.prose figure {
  margin-inline: 0;
}

.prose figcaption,
.caption,
.marginnote,
.sidenote {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.28;
}

.prose figure img {
  display: block;
  border-radius: 0.35rem;
}

.prose .marginnote,
.prose .sidenote,
.prose .margin-figure {
  display: block;
}

.prose .footnotes {
  margin-top: 2.35rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.prose .footnote-ref {
  font-family: var(--font-mono);
  font-size: 0.78em;
  line-height: 0;
}

.prose .footnote-backref {
  text-decoration: none;
}

@media (min-width: 72rem) {
  .prose .marginnote,
  .prose .sidenote,
  .prose .margin-figure {
    float: right;
    clear: right;
    width: var(--rail);
    margin: 0.2rem calc(-1 * (var(--rail) + clamp(2rem, 5vw, 4rem))) 0.8rem 1rem;
  }
}

@media (max-width: 68rem) {
  html {
    font-size: 19px;
  }

  .post-index h1,
  .page-header h1 {
    font-size: 1.7rem;
  }

  .article-header h1 {
    font-size: 2.65rem;
  }

  .prose h2 {
    font-size: 1.75rem;
  }

  .prose h3 {
    font-size: 1.28rem;
  }

  .article-layout {
    display: block;
    width: min(var(--measure), 100%);
  }

  .article-sidebar {
    position: static;
    width: 100%;
    max-height: none;
    margin-bottom: 1.5rem;
    overflow: visible;
  }

  .toc-card {
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    background: var(--surface);
    padding: 0.85rem;
  }

  .toc-body {
    display: block;
  }

  .toc-progress {
    display: none;
  }

  .toc-card a {
    padding-left: 0;
  }

  .toc-card a.is-active {
    color: var(--text);
  }

  .toc-card a.is-active::before {
    display: none;
  }
}

@media (max-width: 42rem) {
  .site-header {
    padding-top: 0.85rem;
  }

  .site-header-inner {
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    padding-bottom: 0.7rem;
  }

  .site-nav {
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-left: auto;
    min-width: min(100%, 13rem);
  }

  .site-nav .menu {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.25rem 0.5rem;
  }

  .site-nav:has(.soundtrack-volume-control:not([hidden])) {
    flex-basis: 100%;
    justify-content: flex-start;
    margin-left: 0;
    min-width: 0;
  }

  .site-nav:has(.soundtrack-volume-control:not([hidden])) .menu {
    justify-content: flex-start;
  }

  .site-nav a {
    min-height: 1.55rem;
  }

  .article-shell {
    padding-top: 1.35rem;
  }

  .article-header {
    text-align: left;
  }

  .article-header h1 {
    font-size: 2.05rem;
  }

  .article-meta {
    justify-content: flex-start;
  }

  .post-list li {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.15rem 0.65rem;
  }

  .post-list a {
    min-width: 0;
  }

  .home-quote {
    grid-template-columns: minmax(0.8rem, 1.4rem) minmax(0, 1fr) minmax(0.8rem, 1.4rem);
    gap: 0.48rem;
    overflow-x: visible;
    white-space: normal;
  }

  .prose table {
    margin-inline: calc(-1 * var(--site-pad));
    width: calc(100% + 2 * var(--site-pad));
    padding-inline: var(--site-pad);
  }
}

@media (max-width: 27rem) {
  .site-nav {
    flex-basis: 100%;
    justify-content: flex-start;
    margin-left: 0;
    min-width: 0;
  }

  .site-nav .menu {
    justify-content: flex-start;
  }
}
