:root {
  color-scheme: light;
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-soft: #f3f5f6;
  --text: #222222;
  --text-soft: rgba(34, 34, 34, 0.66);
  --text-faint: rgba(34, 34, 34, 0.46);
  --line: #e6e7e8;
  --line-strong: #d3d7d9;
  --accent: #33c3f0;
  --accent-strong: #0d7697;
  --accent-soft: rgba(51, 195, 240, 0.13);
  --code-bg: #20272b;
  --code-text: #eef4f5;
  --quote-bg: rgba(51, 195, 240, 0.07);
  --shadow: 0 16px 45px rgba(28, 38, 43, 0.07);
  --ui: "Raleway", "Helvetica Neue", Arial, sans-serif;
  --prose: "Source Serif 4", Georgia, serif;
  --mono: "Source Code Pro", SFMono-Regular, Consolas, monospace;
  --shell: 960px;
  --reading: 740px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15191b;
  --surface: #1d2326;
  --surface-soft: #222a2e;
  --text: #edf0f1;
  --text-soft: rgba(237, 240, 241, 0.68);
  --text-faint: rgba(237, 240, 241, 0.48);
  --line: #30383c;
  --line-strong: #414b50;
  --accent: #62c9e9;
  --accent-strong: #8bd9ef;
  --accent-soft: rgba(98, 201, 233, 0.12);
  --code-bg: #0e1214;
  --code-text: #edf4f5;
  --quote-bg: rgba(98, 201, 233, 0.08);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

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

html {
  scroll-behavior: smooth;
}

body.blog-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

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

.blog-shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.blog-reading-column {
  width: min(calc(100% - 40px), var(--reading));
  margin-inline: auto;
}

.blog-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.blog-header__inner {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.blog-brand {
  display: inline-flex;
  flex-direction: column;
  color: var(--text);
  text-decoration: none;
  line-height: 1.2;
}

.blog-brand:hover {
  color: var(--text);
}

.blog-brand__title {
  font-family: var(--prose);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.blog-brand__author {
  margin-top: 0.28rem;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blog-nav {
  display: flex;
  align-items: center;
  gap: 1.45rem;
}

.blog-nav > a:not(.icon-link) {
  position: relative;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-decoration: none;
  text-transform: uppercase;
}

.blog-nav > a:not(.icon-link)::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.55rem;
  left: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 160ms ease;
}

.blog-nav > a:hover,
.blog-nav > a[aria-current="page"] {
  color: var(--text);
}

.blog-nav > a:hover::after,
.blog-nav > a[aria-current="page"]::after {
  transform: scaleX(1);
}

.icon-link,
.theme-toggle {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.icon-link:hover,
.theme-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.icon-link svg,
.theme-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.icon-link svg {
  fill: currentColor;
  stroke: none;
}

html[data-theme="light"] .theme-toggle__sun,
html[data-theme="dark"] .theme-toggle__moon {
  display: none;
}

.blog-main {
  min-height: calc(100vh - 230px);
  padding: 5.5rem 0 7rem;
}

.page-intro {
  max-width: 700px;
  margin-bottom: 4.8rem;
}

.page-intro h1 {
  margin: 0;
  font-family: var(--prose);
  font-size: clamp(2.7rem, 8vw, 4.75rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.page-intro--compact h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.5rem);
}

.page-intro p {
  max-width: 610px;
  margin: 1.4rem 0 0;
  color: var(--text-soft);
  font-family: var(--prose);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  line-height: 1.55;
}

.post-list {
  border-top: 1px solid var(--line-strong);
}

.post-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  column-gap: 3rem;
  padding: 3.2rem 0 3.4rem;
  border-bottom: 1px solid var(--line);
}

.post-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 220ms ease;
}

.post-card:hover::before {
  width: 76px;
}

.post-card__title {
  grid-column: 1;
  margin: 0;
  font-family: var(--prose);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.post-card__title a {
  color: var(--text);
  text-decoration: none;
}

.post-card__title a:hover {
  color: var(--accent-strong);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.8rem;
  color: var(--text-faint);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.035em;
}

.post-card .post-meta,
.post-card .tag-list,
.post-card__excerpt {
  grid-column: 1;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.18rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-decoration: none;
  text-transform: lowercase;
}

.tag:hover,
.tag[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tag--static {
  pointer-events: none;
}

.post-card__excerpt {
  max-width: 680px;
  margin: 1.4rem 0 0;
  color: var(--text-soft);
  font-family: var(--prose);
  font-size: 1.07rem;
  line-height: 1.65;
}

.read-more {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: center;
  justify-self: end;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.read-more span {
  display: inline-block;
  margin-left: 0.25rem;
  transition: transform 160ms ease;
}

.read-more:hover span {
  transform: translateX(4px);
}

.pagination {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding-top: 2.5rem;
}

.pagination a {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
}

.empty-state {
  padding: 3.5rem;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}

.empty-state p {
  margin: 0 0 0.7rem;
  font-family: var(--prose);
  font-size: 1.25rem;
}

.blog-footer {
  border-top: 1px solid var(--line);
}

.blog-footer__inner {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  color: var(--text-faint);
  font-size: 0.72rem;
  line-height: 1.55;
}

.blog-footer__inner p {
  max-width: 680px;
  margin: 0;
}

.blog-footer__inner a {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

/* Article */
.post-main {
  padding: 5.7rem 0 7rem;
}

.post-header {
  margin-bottom: 5rem;
}

.post-header__back {
  display: inline-block;
  margin-bottom: 2.4rem;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.post-header__back span {
  display: inline-block;
  margin-right: 0.35rem;
  transition: transform 160ms ease;
}

.post-header__back:hover span {
  transform: translateX(-4px);
}

.post-header h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--prose);
  font-size: clamp(2.55rem, 7vw, 4.55rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.post-meta--large {
  margin-top: 1.4rem;
}

.post-header .tag-list {
  margin-top: 1.25rem;
}

.post-layout {
  width: min(calc(100% - 40px), 1220px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 210px minmax(0, var(--reading)) 210px;
  column-gap: 35px;
  align-items: start;
}

.post-layout--without-toc {
  display: block;
}

.post-toc {
  grid-column: 1;
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.post-toc__details summary {
  margin-bottom: 0.85rem;
  color: var(--text);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  list-style: none;
  text-transform: uppercase;
}

.post-toc__details summary::-webkit-details-marker {
  display: none;
}

.post-toc__details summary::after {
  content: "−";
  float: right;
  color: var(--text-faint);
}

.post-toc__details:not([open]) summary::after {
  content: "+";
}

#post-toc-list ol {
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
  list-style: none;
}

#post-toc-list ol ol {
  margin-top: 0.25rem;
  border-left: 0;
}

#post-toc-list li {
  margin: 0;
}

#post-toc-list a {
  display: block;
  margin-left: -1px;
  padding: 0.34rem 0 0.34rem 0.8rem;
  border-left: 2px solid transparent;
  color: var(--text-faint);
  font-size: 0.72rem;
  line-height: 1.35;
  text-decoration: none;
}

#post-toc-list ol ol a {
  padding-left: 1.35rem;
  font-size: 0.68rem;
}

#post-toc-list a:hover,
#post-toc-list a.is-active {
  border-left-color: var(--accent);
  color: var(--text);
}

.post-content {
  grid-column: 2;
  width: 100%;
  color: var(--text);
  font-family: var(--prose);
  font-size: clamp(1.08rem, 1.8vw, 1.19rem);
  line-height: 1.78;
}

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

.post-content h2,
.post-content h3,
.post-content h4 {
  position: relative;
  scroll-margin-top: 2rem;
  color: var(--text);
  font-family: var(--ui);
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.post-content h2 {
  margin: 4.8rem 0 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.7rem, 3.5vw, 2.15rem);
  font-weight: 600;
}

.post-content h3 {
  margin: 3rem 0 1rem;
  font-size: clamp(1.35rem, 2.7vw, 1.62rem);
  font-weight: 600;
}

.post-content h4 {
  margin: 2.35rem 0 0.8rem;
  font-size: 1.08rem;
  font-weight: 600;
}

.heading-anchor {
  position: absolute;
  left: -1.2em;
  padding-right: 0.25em;
  color: var(--text-faint);
  font-weight: 400;
  opacity: 0;
  text-decoration: none;
  transition: opacity 120ms ease;
}

.post-content h2:hover .heading-anchor,
.post-content h3:hover .heading-anchor,
.post-content h4:hover .heading-anchor,
.heading-anchor:focus {
  opacity: 1;
}

.post-content p {
  margin: 1.45rem 0;
}

.post-content a {
  overflow-wrap: anywhere;
}

.post-content strong {
  font-weight: 600;
}

.post-content ul,
.post-content ol {
  margin: 1.45rem 0;
  padding-left: 1.45rem;
}

.post-content li {
  margin: 0.45rem 0;
  padding-left: 0.25rem;
}

.post-content blockquote {
  margin: 2.2rem 0;
  padding: 1.2rem 1.5rem;
  border-left: 3px solid var(--accent);
  background: var(--quote-bg);
  color: var(--text-soft);
  font-size: 1.08em;
}

.post-content blockquote > :first-child {
  margin-top: 0;
}

.post-content blockquote > :last-child {
  margin-bottom: 0;
}

.post-content hr {
  width: 80px;
  margin: 4rem auto;
  border: 0;
  border-top: 1px solid var(--line-strong);
}

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border-radius: 2px;
}

.post-content figure {
  margin: 2.8rem 0;
}

.post-content figcaption {
  max-width: 620px;
  margin: 0.85rem auto 0;
  color: var(--text-faint);
  font-family: var(--ui);
  font-size: 0.72rem;
  line-height: 1.55;
  text-align: center;
}

.post-content table {
  display: block;
  width: 100%;
  margin: 2.3rem 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: var(--ui);
  font-size: 0.82rem;
  line-height: 1.55;
}

.post-content th,
.post-content td {
  min-width: 120px;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.post-content th {
  border-bottom-color: var(--line-strong);
  font-weight: 600;
}

.post-content code {
  padding: 0.1em 0.28em;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-soft);
  font-family: var(--mono);
  font-size: 0.82em;
}

.post-content pre,
.citation-block pre {
  margin: 0;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--mono);
  font-size: 0.79rem;
  line-height: 1.65;
  tab-size: 2;
}

.post-content pre {
  margin: 2.2rem 0;
  padding: 1.3rem 1.4rem;
  border-radius: 3px;
}

.post-content pre code,
.citation-block pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.code-frame {
  margin: 2.2rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--code-bg);
}

.code-frame pre {
  padding: 1.25rem 1.4rem;
}

.code-frame__bar,
.code-toolbar {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.65rem 0.35rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--ui);
  font-size: 0.64rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.code-copy {
  padding: 0.28rem 0.5rem;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.code-copy:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.highlight {
  position: relative;
}

.highlight .code-toolbar + pre,
.highlight .code-toolbar + div pre {
  margin-top: 0;
  border-radius: 0 0 3px 3px;
}

.highlight:has(.code-toolbar) {
  margin: 2.2rem 0;
  overflow: hidden;
  border-radius: 3px;
  background: var(--code-bg);
}

.highlight:has(.code-toolbar) pre {
  margin: 0;
}

.update-note {
  margin: 0 0 2.5rem !important;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text-soft);
  font-family: var(--ui);
  font-size: 0.78rem;
}

.demo-figure {
  padding: 2rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.demo-figure__plot {
  height: 190px;
  display: flex;
  align-items: end;
  gap: 8%;
  padding: 1rem 2rem 0;
  border-bottom: 1px solid var(--line-strong);
}

.demo-figure__bar {
  flex: 1;
  min-width: 24px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 40%, var(--surface)));
}

.footnotes {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.86em;
}

.citation-block {
  margin-top: 4.8rem;
}

.post-footer {
  margin-top: 5.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-strong);
}

.post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.post-actions a,
.copy-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.related-posts {
  margin-top: 4rem;
}

.related-posts h2 {
  margin: 0 0 1.2rem;
  font-family: var(--prose);
  font-size: 1.55rem;
  font-weight: 500;
}

.related-posts ul {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.related-posts li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.related-posts li a {
  color: var(--text);
  font-family: var(--prose);
  text-decoration: none;
}

.related-posts li time {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.post-subscribe {
  margin: 3rem 0 0;
  color: var(--text-faint);
  font-size: 0.75rem;
}

/* Tags */
.tag-page-heading {
  margin: -2.6rem 0 2.7rem;
}

.tag-page-heading p {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-faint);
  font-size: 0.76rem;
}

.tag-cloud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-cloud a {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
}

.tag-cloud a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tag-cloud__count {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* Search */
.search {
  max-width: 820px;
}

.search-label,
.search-tags > p {
  display: block;
  margin: 0 0 0.55rem;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-box {
  position: relative;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 1rem;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--text-faint);
  stroke-linecap: round;
  stroke-width: 1.6;
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  height: 58px;
  padding: 0 1rem 0 3rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  appearance: none;
}

.search-box input::placeholder {
  color: var(--text-faint);
}

.search-box input:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent-soft);
  outline-offset: 0;
}

.search-tags {
  margin-top: 1.6rem;
}

#search-tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

#search-tag-filters button {
  cursor: pointer;
}

.search-status {
  min-height: 1.5em;
  margin: 2.6rem 0 0.8rem;
  color: var(--text-faint);
  font-size: 0.75rem;
}

.search-results {
  border-top: 1px solid var(--line-strong);
}

.search-result {
  padding: 1.5rem 0 1.7rem;
  border-bottom: 1px solid var(--line);
}

.search-result h2 {
  margin: 0;
  font-family: var(--prose);
  font-size: 1.45rem;
  font-weight: 500;
}

.search-result h2 a {
  color: var(--text);
  text-decoration: none;
}

.search-result p {
  margin: 0.65rem 0 0;
  color: var(--text-soft);
  font-family: var(--prose);
}

.search-result__meta {
  margin-top: 0.45rem;
  color: var(--text-faint);
  font-size: 0.68rem;
}

/* Rouge tokens */
.highlight .c,
.highlight .cm,
.highlight .c1 { color: #91a0a6; }
.highlight .k,
.highlight .kd,
.highlight .kn { color: #82d2ef; }
.highlight .s,
.highlight .s1,
.highlight .s2 { color: #b9d98b; }
.highlight .mi,
.highlight .mf { color: #efc77d; }
.highlight .nf,
.highlight .nb { color: #d7a5ef; }

@media (max-width: 1080px) {
  .post-layout {
    grid-template-columns: minmax(170px, 200px) minmax(0, var(--reading));
    justify-content: center;
  }
}

@media (max-width: 860px) {
  .blog-header__inner {
    min-height: 82px;
  }

  .blog-nav {
    gap: 1rem;
  }

  .blog-nav > a:not(.icon-link) {
    font-size: 0.64rem;
  }

  .post-layout {
    width: min(calc(100% - 40px), var(--reading));
    display: flex;
    flex-direction: column;
  }

  .post-toc {
    position: static;
    width: 100%;
    max-height: none;
    margin-bottom: 2.5rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    background: var(--surface);
    overflow: visible;
  }

  .post-toc__details summary {
    margin: 0;
  }

  .post-toc__details[open] summary {
    margin-bottom: 0.85rem;
  }

  .post-content {
    width: 100%;
  }

  .tag-cloud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .blog-shell,
  .blog-reading-column,
  .post-layout {
    width: min(calc(100% - 30px), var(--shell));
  }

  .blog-header__inner {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 0;
  }

  .blog-nav {
    width: 100%;
    gap: 0.95rem;
    overflow-x: auto;
    padding-bottom: 0.3rem;
  }

  .blog-nav > a:not(.icon-link) {
    flex: 0 0 auto;
  }

  .blog-brand__title {
    font-size: 1.5rem;
  }

  .blog-main {
    padding: 4rem 0 5rem;
  }

  .page-intro {
    margin-bottom: 3.5rem;
  }

  .post-card {
    display: block;
    padding: 2.5rem 0 2.7rem;
  }

  .read-more {
    display: inline-block;
    margin-top: 1.2rem;
  }

  .post-main {
    padding: 4rem 0 5rem;
  }

  .post-header {
    margin-bottom: 3.5rem;
  }

  .post-header__back {
    margin-bottom: 1.8rem;
  }

  .post-content h2 {
    margin-top: 4rem;
  }

  .heading-anchor {
    display: none;
  }

  .blog-footer__inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.6rem 0 2rem;
  }

  .tag-cloud {
    grid-template-columns: 1fr;
  }

  .related-posts li {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }
}

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