@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

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

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080a0e;
  --bg-elev: #121820;
  --bg-header: #0c0f14;
  --text: #e8edf5;
  --text-muted: #a8b2c2;
  --cyan: #5ad7f5;
  --magenta: #f0abfc;
  --violet: #c4b5fd;
  --line: rgba(232, 237, 245, 0.14);
  --accent-line: rgba(90, 215, 245, 0.45);
  --code-bg: #0d131b;
  --inline-code-bg: rgba(90, 215, 245, 0.08);
  --quote: rgba(240, 171, 252, 0.1);
  --grid: rgba(90, 215, 245, 0.045);
  --scan: rgba(255, 255, 255, 0.028);
  --glow: rgba(90, 215, 245, 0.22);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-elev: #ffffff;
  --bg-header: #f8fafc;
  --text: #14181f;
  --text-muted: #3e4856;
  --cyan: #0b6278;
  --magenta: #8e1a62;
  --violet: #5b3d8a;
  --line: rgba(20, 24, 31, 0.12);
  --accent-line: rgba(11, 98, 120, 0.45);
  --code-bg: #eef3f8;
  --inline-code-bg: rgba(11, 98, 120, 0.08);
  --quote: rgba(142, 26, 98, 0.07);
  --grid: rgba(20, 24, 31, 0.045);
  --scan: rgba(20, 24, 31, 0.03);
  --glow: rgba(11, 98, 120, 0.18);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  font-size: 1.0625rem;
  line-height: 1.7;
  background-image:
    radial-gradient(900px 420px at 0% -10%, color-mix(in srgb, var(--cyan) 12%, transparent), transparent 55%),
    radial-gradient(720px 380px at 100% 0%, color-mix(in srgb, var(--magenta) 10%, transparent), transparent 50%);
}

main {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
  padding: 0.4rem 0 2.5rem;
}

.shell {
  width: min(70ch, calc(100% - 2rem));
  margin-inline: auto;
  min-width: 0;
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "IBM Plex Mono", ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}

p, ul, ol, figure, blockquote, pre {
  margin-top: 0;
}

a {
  color: var(--cyan);
  text-underline-offset: 0.18em;
}

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

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

::selection {
  background: color-mix(in srgb, var(--cyan) 32%, transparent);
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 30;
  transform: translateY(-160%);
  padding: 0.45rem 0.7rem;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--cyan);
  border-radius: 6px;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

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

.fx-grid,
.fx-scan {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.fx-grid {
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(90deg, #000 0%, transparent 14%, transparent 86%, #000 100%);
}

.fx-scan {
  background: repeating-linear-gradient(
    to bottom,
    var(--scan),
    var(--scan) 1px,
    transparent 1px,
    transparent 4px
  );
  mask-image: linear-gradient(90deg, #000 0%, transparent 16%, transparent 84%, #000 100%);
  opacity: 0.55;
}

html[data-fx="off"] .fx-grid,
html[data-fx="off"] .fx-scan {
  display: none;
}

.site-header,
.site-footer {
  position: relative;
  z-index: 2;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-header);
  border-bottom: 1px solid var(--line);
}

.site-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), var(--magenta), transparent);
  opacity: 0.7;
}

.header-inner,
.footer-inner {
  padding-block: 0.7rem;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.site-title {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}

.site-title:hover {
  color: var(--cyan);
}

.header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.55rem;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}

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

.fx-toggle,
.code-block__copy {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.fx-toggle {
  min-height: 44px;
  padding: 0 0.8rem;
}

.fx-toggle:hover,
.code-block__copy:hover {
  color: var(--cyan);
  border-color: var(--accent-line);
  box-shadow: 0 0 0 1px var(--glow);
}

.theme-toggle {
  --knob: 36px;
  --pad: 4px;
  flex: 0 0 auto;
  position: relative;
  width: 78px;
  height: 44px;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #e7eef5;
  box-shadow: inset 0 0 0 1px rgba(20, 24, 31, 0.04);
  color: var(--cyan);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

html[data-theme="dark"] .theme-toggle {
  border-color: rgba(90, 215, 245, 0.55);
  background: #101820;
  box-shadow:
    0 0 14px rgba(90, 215, 245, 0.28),
    inset 0 0 10px rgba(90, 215, 245, 0.08);
}

.theme-toggle:hover {
  border-color: var(--accent-line);
}

html[data-theme="dark"] .theme-toggle:hover {
  box-shadow:
    0 0 18px rgba(90, 215, 245, 0.42),
    inset 0 0 10px rgba(90, 215, 245, 0.12);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.theme-toggle__track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  container-type: inline-size;
}

.theme-toggle__hint,
.theme-toggle__icon {
  display: block;
  width: 14px;
  height: 14px;
}

.theme-toggle__hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.72;
}

.theme-toggle__hint--sun {
  left: 12px;
  color: #c4842a;
}

.theme-toggle__hint--moon {
  right: 11px;
  color: var(--cyan);
}

.theme-toggle__knob {
  position: absolute;
  top: var(--pad);
  left: var(--pad);
  width: var(--knob);
  height: var(--knob);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 24, 31, 0.18);
  transform: translateX(0);
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.theme-toggle__icon {
  position: absolute;
  inset: 0;
  margin: auto;
}

html[data-theme="light"] .theme-toggle__icon.when-light {
  color: #8a5a12;
}

html[data-theme="dark"] .theme-toggle__knob {
  background: #d9f6ff;
  box-shadow: 0 0 10px rgba(90, 215, 245, 0.75);
  transform: translateX(calc(100cqw - var(--knob) - (var(--pad) * 2)));
}

html[data-theme="dark"] .theme-toggle__icon.when-dark {
  color: #08303c;
}

html[data-theme="dark"] .when-light,
html[data-theme="light"] .when-dark,
html[data-fx="off"] .when-fx-on,
html[data-fx="on"] .when-fx-off {
  display: none;
}

.home-intro,
.page-header,
.post-header {
  margin-bottom: 1.25rem;
}

.home-intro h1,
.page-header h1,
.post-header h1,
.not-found h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: var(--cyan);
}

.lede,
.empty,
.closing-note {
  color: var(--text-muted);
}

.post-list {
  display: flex;
  flex-direction: column;
}

.post-card {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0.35rem 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}

.post-card:not(:has(.post-card__media)) {
  grid-template-columns: minmax(0, 1fr);
}

.post-card__media {
  display: block;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.post-card__media img {
  display: block;
  width: 100%;
  height: 7.25rem;
  object-fit: contain;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.post-card__body {
  min-width: 0;
}

.post-card__title {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

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

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

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.post-card__summary {
  margin: 0.8rem 0 0;
}

.post-card__image,
.prose img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
}

.post--about .prose figure {
  margin-left: 0;
  margin-right: 0;
}

.post--about .prose img {
  width: min(420px, 100%);
}

.post-hero {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.9rem 0 0.15rem;
}

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

.tags li {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--magenta);
  border: 1px solid color-mix(in srgb, var(--magenta) 45%, transparent);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  background: color-mix(in srgb, var(--magenta) 8%, transparent);
}

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.7rem;
  margin: 1rem 0 1.25rem;
}

.share__label {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.share__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.share__btn:hover {
  color: var(--cyan);
  border-color: var(--accent-line);
}

.share__btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.toc {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-elev) 82%, transparent);
}

.toc h2 {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.toc ul {
  margin: 0.25rem 0;
  padding-left: 1.1rem;
}

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

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

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

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose figure,
.prose dl {
  margin: 1rem 0;
}

.prose h2,
.prose h3,
.prose h4 {
  scroll-margin-top: 5.5rem;
}

.prose h2 {
  margin: 2.2rem 0 0.7rem;
  padding-bottom: 0.28rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.22rem;
}

.prose h3 {
  margin: 1.7rem 0 0.5rem;
  font-size: 1.05rem;
}

.prose h4 {
  margin: 1.3rem 0 0.4rem;
  font-size: 0.95rem;
}

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

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

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

.prose a {
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
}

.prose {
  max-width: 70ch;
  overflow-wrap: break-word;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.35rem 0 0.35rem 1rem;
  border-left: 2px solid var(--magenta);
  background: linear-gradient(90deg, var(--quote), transparent 75%);
}

.prose blockquote p {
  margin: 0.35rem 0;
}

.prose figure {
  margin: 1.75rem 0;
}

.prose figcaption,
.diagram figcaption {
  margin-top: 0.5rem;
  text-align: center;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.prose figcaption h4 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
}

.prose :not(pre) > code {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 0.08em 0.35em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--inline-code-bg);
  overflow-wrap: anywhere;
}

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

.table-scroll {
  margin: 1.5rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

.prose th {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--cyan);
}

.prose tr:last-child td {
  border-bottom: 0;
}

.code-block,
.diagram {
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
  overflow: hidden;
}

.code-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.25rem 0.55rem 0.25rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.code-block__lang {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.code-block__copy {
  min-height: 32px;
  padding: 0.2rem 0.65rem;
}

.prose,
.post,
.post-list,
.highlight,
.code-block,
.diagram,
.table-scroll {
  min-width: 0;
  max-width: 100%;
}

.code-block pre {
  margin: 0;
  padding: 0.95rem 1rem 1.05rem;
  overflow-x: auto;
  max-width: 100%;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  background: transparent;
}

.diagram {
  padding: 0.85rem 0.85rem 0.7rem;
  overflow-x: auto;
}

.diagram-view svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

.diagram-fallback {
  margin: 0;
  white-space: pre-wrap;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.84rem;
}

.comments-title {
  margin: 2rem 0 0.75rem;
  font-size: 1.15rem;
}

.not-found {
  padding-top: 1.5rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-lead,
.footer-copy {
  margin: 0;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

@media (max-width: 640px) {
  body {
    font-size: 1.02rem;
  }

  .post-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-card__media img {
    height: auto;
    max-height: 12rem;
  }
}

:root {
  --sidebar: 272px;
  --panel: 250px;
  --topbar: 64px;
}

.layout {
  min-height: 100vh;
}

.layout-main {
  margin-left: var(--sidebar);
  min-width: 0;
}

.layout-body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.75rem;
  padding: 0 1.25rem 2rem;
}

.layout-center {
  flex: 1 1 42rem;
  width: min(100%, 46rem);
  min-width: 0;
  max-width: 46rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--bg-header);
  border-bottom: 1px solid var(--line);
}

.topbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), var(--magenta), transparent);
  opacity: 0.7;
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: var(--topbar);
  padding: 0.35rem 1rem;
}

.topbar__title {
  display: none;
  min-width: 0;
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.crumbs {
  min-width: 0;
  flex: 1;
}

.crumbs ol {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.crumbs li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: var(--text-muted);
}

.crumbs li:last-child {
  overflow: hidden;
}

.crumbs li:last-child span,
.crumbs a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.crumbs__sep {
  color: var(--cyan);
}

.icon-btn,
.sidebar__close,
.search__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}

.icon-btn:hover,
.sidebar__close:hover,
.search__close:hover {
  color: var(--cyan);
  border-color: var(--accent-line);
}

.search {
  position: relative;
}

.search__form {
  display: flex;
  align-items: center;
}

.search__open,
.search__close,
.nav-toggle,
.sidebar__close,
.drawer-backdrop {
  display: none;
}

.search__input {
  width: 11.5rem;
  height: 40px;
  padding: 0 0.85rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.search__input:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-color: var(--accent-line);
}

.search__results {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 30;
  width: min(22rem, 70vw);
  max-height: min(24rem, 60vh);
  margin: 0;
  padding: 0.35rem;
  overflow: auto;
  list-style: none;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.search__results a {
  display: block;
  padding: 0.45rem 0.6rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
}

.search__results a:hover,
.search__results a:focus {
  background: color-mix(in srgb, var(--cyan) 12%, transparent);
  outline: none;
}

.search__hit-title,
.search__empty {
  display: block;
}

.search__hit-date {
  display: block;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 15;
  width: var(--sidebar);
  background: var(--bg-header);
  border-right: 1px solid var(--line);
}

.sidebar__scroll {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%;
  padding: 1.4rem 1rem 1rem;
  overflow: auto;
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.profile__photo {
  display: block;
  width: 6.5rem;
  height: 6.5rem;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 16%, transparent);
}

.profile__name {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}

.profile__tagline {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.side-nav ul,
.social ul {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

.side-nav a svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.side-nav a:hover,
.side-nav a[aria-current="page"] {
  color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 8%, transparent);
}

.social {
  margin-top: auto;
}

.social ul {
  flex-direction: row;
  justify-content: center;
  gap: 0.15rem;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  border-radius: 999px;
}

.social a:hover {
  color: var(--cyan);
}

.social svg {
  width: 18px;
  height: 18px;
}

.sidebar__close {
  align-self: flex-end;
}

.panel {
  position: sticky;
  top: calc(var(--topbar) + 1rem);
  flex: 0 0 var(--panel);
  width: var(--panel);
  min-width: 0;
  padding-top: 1.1rem;
}

.panel__block + .panel__block {
  margin-top: 1.5rem;
}

.panel h2,
.toc h2 {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.recent {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.recent a:hover {
  color: var(--cyan);
}

.recent time {
  display: block;
  margin-top: 0.12rem;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
}

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

.tag-cloud__btn {
  min-height: 36px;
  padding: 0.15rem 0.55rem;
  color: var(--magenta);
  background: color-mix(in srgb, var(--magenta) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--magenta) 45%, transparent);
  border-radius: 999px;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  line-height: 1.3;
  cursor: pointer;
}

.tag-cloud__btn:hover {
  color: var(--cyan);
  border-color: var(--accent-line);
}

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

.toc-fold {
  margin: 0 0 1.15rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-elev) 82%, transparent);
}

.toc-fold summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.9rem;
  cursor: pointer;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.toc-fold .toc {
  margin: 0;
  padding: 0 0.9rem 0.85rem;
  border: 0;
  background: transparent;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 44px;
  padding: 0.7rem 0.85rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pager a span {
  color: var(--text-muted);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pager a:hover {
  border-color: var(--accent-line);
  color: var(--cyan);
}

.pager__newer {
  text-align: right;
  grid-column: 2;
}

.archive-year + .archive-year {
  margin-top: 1.4rem;
}

.archive-list {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.archive-list li {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}

.archive-list time {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

.archive-list a {
  color: var(--text);
  text-decoration: none;
}

.archive-list a:hover {
  color: var(--cyan);
}

.site-footer {
  margin-top: 1rem;
}

@media (max-width: 1199px) {
  .panel {
    display: none;
  }
}

@media (max-width: 1023px) {
  .layout-main {
    margin-left: 0;
  }

  .layout-body {
    display: block;
    padding-inline: 0.9rem;
  }

  .layout-center {
    width: auto;
    max-width: none;
  }

  .crumbs {
    display: none;
  }

  .topbar__title {
    display: block;
    flex: 1;
  }

  .nav-toggle,
  .search__open {
    display: inline-flex;
  }

  .search__form,
  .search__close {
    display: none;
  }

  .search.is-open .search__form {
    display: flex;
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 32;
    gap: 0.35rem;
    padding: 0.45rem;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .search.is-open .search__input {
    width: min(16rem, 68vw);
  }

  .search.is-open .search__close {
    display: inline-flex;
    width: auto;
    padding: 0 0.7rem;
    border-color: var(--line);
    border-radius: 999px;
  }

  .search.is-open .search__results {
    position: fixed;
    top: calc(var(--topbar) + 4.2rem);
    left: 0.9rem;
    right: 0.9rem;
    width: auto;
  }

  .topbar {
    padding-top: env(safe-area-inset-top);
  }

  .sidebar {
    z-index: 40;
    width: min(18.5rem, 88vw);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 180ms ease;
  }

  .sidebar__scroll {
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .sidebar.is-open {
    transform: none;
    visibility: visible;
  }

  .sidebar__close {
    display: inline-flex;
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    background: rgba(4, 6, 10, 0.62);
    border: 0;
  }

  html[data-theme="light"] .drawer-backdrop {
    background: rgba(20, 24, 31, 0.4);
  }

  body.drawer-open {
    overflow: hidden;
  }

  .theme-toggle {
    width: 64px;
    --knob: 32px;
  }
}

@media (min-width: 1200px) {
  .toc-fold {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  html[data-theme="dark"] {
    --text-muted: #c5ceda;
    --line: rgba(232, 237, 245, 0.42);
  }

  html[data-theme="light"] {
    --text-muted: #243040;
    --line: rgba(20, 24, 31, 0.4);
  }
}
