:root {
  /* Native controls - the <select> popup above all - are painted by the browser,
     not by this stylesheet. Declaring the scheme is what makes that popup dark
     instead of white-on-white against a see-through field background. */
  color-scheme: dark;
  --canvas: #070d14;
  --image-opacity: .58;
  --backdrop-image: url("backdrop-dark.jpg");
  --text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
  --canvas-glow-a: rgba(207, 230, 245, .065);
  --canvas-glow-b: rgba(93, 120, 143, .12);
  --image-wash-top: rgba(3, 10, 17, .46);
  --image-wash-bottom: rgba(3, 9, 15, .62);
  --surface: rgba(12, 19, 27, .76);
  --surface-raised: rgba(21, 30, 40, .52);
  --panel: rgba(10, 17, 25, .72);
  --card: rgba(13, 21, 30, .70);
  --glass-highlight: rgba(255, 255, 255, .05);
  --glass-shadow-edge: rgba(255, 255, 255, .025);
  --hero-start: rgba(49, 57, 65, .83);
  --hero-end: rgba(28, 32, 38, .86);
  --header: rgba(7, 13, 20, .82);
  --drawer: rgba(7, 13, 20, .88);
  --line: rgba(225, 231, 237, .13);
  --line-bright: rgba(225, 231, 237, .24);
  --chip: rgba(255, 255, 255, .06);
  --quote: rgba(255, 255, 255, .05);
  --focus-ring: rgba(158, 194, 204, .34);
  --field: rgba(255, 255, 255, .07);
  --text: #eef1f4;
  --muted: #b4bdc8;
  --faint: #bcc5d0;
  --accent: #9ec2cc;
  --accent-soft: #dbe4e8;
  --link: #b3cae0;
  --purple: #a0abbd;
  --code: rgba(5, 10, 15, .70);
  --on-accent: #0b0f14;
  --code-keyword: #94c2e8;
  --code-string: #a5d6b0;
  --code-comment: #8894a1;
  --code-number: #e6bd8d;
  --code-func: #c7b7ea;
  --code-builtin: #8ed3d2;
  --code-punct: #b4bdc8;
  --code-deleted: #eda2a2;
  --code-inserted: #a9d8a9;
  --shadow: 0 1.25rem 4.5rem rgba(0, 0, 0, .40);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Noto Sans JP", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", "Noto Sans JP", Menlo, monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --canvas: #e9eff3;
  --image-opacity: .52;
  --backdrop-image: url("backdrop-light.jpg");
  --text-shadow: 0 1px 2px rgba(255, 255, 255, .6);
  --canvas-glow-a: rgba(255, 255, 255, .28);
  --canvas-glow-b: rgba(102, 132, 149, .16);
  --image-wash-top: rgba(242, 248, 250, .52);
  --image-wash-bottom: rgba(232, 241, 246, .68);
  --surface: rgba(252, 254, 255, .82);
  --surface-raised: rgba(255, 255, 255, .60);
  --panel: rgba(250, 253, 255, .78);
  --card: rgba(255, 255, 255, .76);
  --glass-highlight: rgba(255, 255, 255, .58);
  --glass-shadow-edge: rgba(76, 90, 105, .10);
  --hero-start: rgba(238, 242, 245, .9);
  --hero-end: rgba(218, 225, 230, .86);
  --header: rgba(244, 249, 252, .86);
  --drawer: rgba(244, 249, 252, .92);
  --line: rgba(38, 50, 66, .16);
  --line-bright: rgba(38, 50, 66, .28);
  --chip: rgba(23, 32, 51, .05);
  --quote: rgba(23, 32, 51, .045);
  --focus-ring: rgba(44, 106, 111, .28);
  --field: rgba(23, 32, 51, .05);
  --text: #172033;
  --muted: #465470;
  --faint: #45536a;
  --accent: #1f5b60;
  --accent-soft: #1a494e;
  --link: #24547c;
  --purple: #56526a;
  --code: rgba(234, 240, 245, .72);
  --on-accent: #f8fbfc;
  --code-keyword: #12558f;
  --code-string: #1f5c3a;
  --code-comment: #5b6878;
  --code-number: #8a4614;
  --code-func: #5a3d99;
  --code-builtin: #0f5b60;
  --code-punct: #3d4a5d;
  --code-deleted: #93202a;
  --code-inserted: #1c5b2c;
  --shadow: 0 1.3rem 4rem rgba(43, 61, 88, .16);
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: transparent;
  font: 16px/1.75 var(--sans);
  transition: color .25s ease, background-color .25s ease;
}
/* The photo is a backdrop, not a competing layer: blurred, desaturated and dimmed
   so every text tier keeps a WCAG AA ratio over the brightest part of the image.
   The blur is baked into the file rather than applied here - a fixed, full-screen
   filter is recomposited on every frame, and the result never changes. */
body::before {
  position: fixed; z-index: -2; inset: 0; content: "";
  background: var(--backdrop-image) center / cover no-repeat;
  opacity: var(--image-opacity);
  pointer-events: none;
}
body::after {
  position: fixed; z-index: -1; inset: 0; content: "";
  background:
    linear-gradient(180deg, var(--image-wash-top), var(--image-wash-bottom)),
    radial-gradient(56rem 35rem at 7% -12%, var(--canvas-glow-a), transparent 62%),
    radial-gradient(42rem 32rem at 96% 15%, var(--canvas-glow-b), transparent 67%);
  pointer-events: none;
}
::selection { color: var(--on-accent); background: var(--accent); }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { color: var(--accent-soft); }
button, input { font: inherit; }

.skip-link {
  position: fixed; z-index: 20; top: -5rem; left: 1rem;
  padding: .5rem .85rem; border-radius: .6rem; color: var(--on-accent); background: var(--accent);
}
.skip-link:focus { top: 1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.site-header {
  position: sticky; z-index: 10; top: 0; border-bottom: 1px solid var(--line);
  background: var(--header);
}
.site-header__inner, .site-main, .site-footer {
  width: min(1240px, calc(100% - 3rem)); margin-inline: auto;
}
.site-header__inner { display: flex; gap: 1.15rem; align-items: center; min-height: 4.6rem; }
.brand {
  display: inline-flex; gap: .65rem; align-items: center; flex: 1 0 auto;
  color: var(--text); font: 750 1rem/1 var(--mono); letter-spacing: -.04em; text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand__icon {
  width: 1.65rem; height: 1.65rem; image-rendering: pixelated;
  filter: drop-shadow(0 .15rem .36rem rgba(0, 0, 0, .35));
}
.site-nav { display: flex; gap: 1.05rem; align-items: center; }
.site-nav a, .github-link, .theme-toggle, .menu-toggle {
  color: var(--muted); font: 650 .79rem/1 var(--sans); letter-spacing: .025em; text-decoration: none;
}
.site-nav a:hover, .github-link:hover { color: var(--accent); }
.github-link { display: inline-flex; gap: .4rem; align-items: center; color: var(--accent-soft); white-space: nowrap; }
.github-link__mark { display: none; }
.theme-toggle {
  display: inline-flex; gap: .36rem; align-items: center; padding: .42rem 0;
  border: 0; border-radius: 0; color: var(--text); background: transparent;
  cursor: pointer; transition: color .2s ease, transform .2s ease;
}
.theme-toggle:hover { color: var(--accent-soft); transform: translateY(-1px); }
.menu-toggle {
  display: none; align-items: center; justify-content: center; width: auto; height: auto; padding: .65rem .7rem;
  border: 0; border-radius: 0; color: var(--text); background: transparent; cursor: pointer;
  font-size: 1.12rem; line-height: 1; transition: transform .18s ease, color .18s ease;
}
.menu-toggle:hover { color: var(--accent-soft); transform: translateY(-1px); }

.site-main { min-height: calc(100vh - 12rem); padding-block: clamp(1.25rem, 3vw, 2.5rem) 3.75rem; }
/* Text drawn straight on the photo gets a tight shadow so glyph edges stay
   separated from whatever is behind them; anything on its own surface resets it. */
.site-main, .site-footer, .site-header { text-shadow: var(--text-shadow); }
.hero, .post-card, .category-card, .tag, .tag-cloud__tag, .topic-cloud__topic, .year-cloud__year,
.post-content pre, .post-content code, .post-content th, .post-content blockquote, .legacy-tags,
.button, .search-box input, .home-search input, .site-sidebar .sidebar-license,
.post-content table, .comments { text-shadow: none; }
.site-footer {
  display: flex; gap: 1rem; justify-content: space-between; padding-block: 1.7rem 2.5rem;
  border-top: 1px solid var(--line); color: var(--faint); font: .76rem/1.65 var(--mono);
}
.site-footer a { color: var(--muted); }
.eyebrow {
  margin: 0 0 .68rem; color: var(--accent); font: 750 .71rem/1.35 var(--mono); letter-spacing: .14em;
}

.hero {
  padding: 1.05rem 1.35rem; margin-bottom: 1rem;
  border: 1px solid var(--line); border-radius: 1.2rem;
  background: var(--panel); box-shadow: inset 0 1px 0 var(--glass-highlight), 0 .7rem 2rem rgba(0, 0, 0, .10);
}
.hero h1, .page-heading h1, .post-page h1, .not-found h1 {
  margin: 0; color: var(--text); font-weight: 790; line-height: 1.08; letter-spacing: -.065em;
}
.hero h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
.hero h1 [lang="ja"] { color: var(--accent); font-style: normal; }

.site-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem);
  gap: clamp(1.1rem, 2.3vw, 2.2rem); align-items: start;
}
.site-layout__content { min-width: 0; }
.site-sidebar {
  position: sticky; top: 5.8rem; isolation: isolate; overflow: visible;
  border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none;
}
.site-sidebar::before { display: none; }
.home-search, .discovery-section { overflow: hidden; border: 0; background: transparent; }
.home-search + .discovery-section,
.discovery-section + .discovery-section { border-top: 1px solid var(--line); }
.sidebar-static-section { padding: .82rem 1.05rem 1rem; border-top: 1px solid var(--line); }
.sidebar-static-section__heading { margin-bottom: .35rem; }
.sidebar-static-section__heading .eyebrow { display: block; margin-bottom: .28rem; }
.sidebar-static-section__heading strong { display: block; color: var(--text); font-size: 1rem; letter-spacing: -.025em; }
.site-sidebar h2, .home-article-heading h2 {
  margin: 0; color: var(--text); font-size: 1.15rem; letter-spacing: -.025em;
}
.home-search form { display: flex; gap: .5rem; margin: 0 1.2rem 1.2rem; }
.home-search input {
  min-width: 0; flex: 1; padding: .68rem 0; border: 0; border-bottom: 1px solid var(--line-bright); border-radius: 0;
  outline: none; color: var(--text); background: transparent; font: .79rem/1.25 var(--sans);
}
.home-search input:focus { border-bottom-color: var(--accent); box-shadow: none; }
.home-search button {
  padding: .65rem 0 .65rem .32rem; border: 0; border-radius: 0; color: var(--accent);
  background: transparent; font: 750 .74rem/1 var(--mono); cursor: pointer;
  transition: transform .18s ease, color .18s ease;
}
.home-search button:hover { color: var(--accent-soft); transform: translateY(-1px); }
.discovery-section summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 3.9rem;
  padding: .82rem 1.05rem; cursor: pointer; list-style: none;
}
.discovery-section summary::-webkit-details-marker { display: none; }
.discovery-section summary .eyebrow { display: block; margin-bottom: .28rem; }
.discovery-section summary > .eyebrow { margin: 0; }
.discovery-section summary strong { display: block; color: var(--text); font-size: 1rem; letter-spacing: -.025em; }
.discovery-section__chevron { color: var(--accent); font-size: 1.25rem; transition: transform .23s ease; }
.discovery-section:not([open]) .discovery-section__chevron { transform: rotate(-90deg); }
.discovery-section > p { margin: 0 1.05rem .85rem; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.topic-cloud {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem;
  max-height: 8.5rem; overflow-y: auto; padding: .05rem 1.05rem .78rem; scrollbar-width: none;
}
.label-cloud {
  max-height: none; overflow: visible; padding: .05rem 0 0;
  color: var(--muted); font-family: var(--mono); line-height: 1.7; scrollbar-width: none;
}
.label-cloud a { display: inline; margin-right: .36rem; color: var(--muted); text-decoration: none; }
.label-cloud a:hover { color: var(--accent-soft); text-decoration: underline; }
.label-cloud__count { color: var(--faint); font: .72em/1 var(--mono); }
.year-cloud { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0 1.2rem 1.25rem; }
.topic-cloud__topic, .year-cloud__year {
  display: block; min-width: 0; overflow: hidden; padding: .3rem .46rem;
  border: 1px solid var(--line-bright); border-radius: .64rem; color: var(--accent-soft);
  background: var(--chip); font-family: var(--mono); line-height: 1.25; text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.topic-cloud__topic { font-size: .66rem !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-cloud__topic span { float: right; margin-left: .3rem; }
.topic-cloud__topic:hover, .year-cloud__year:hover {
  border-color: var(--accent); color: var(--on-accent); background: var(--accent); transform: translateY(-2px);
}
.topic-cloud__topic span, .year-cloud__year span { color: var(--accent); font-size: .7em; }
.topic-cloud__topic:hover span, .year-cloud__year:hover span { color: var(--on-accent); }
.year-cloud__year {
  border-color: var(--line-bright); color: var(--link); background: var(--chip);
  font: .75rem/1.2 var(--mono);
}
.year-cloud__year span { color: var(--faint); }
.archive-tree {
  max-height: 13.5rem; overflow: auto; overscroll-behavior: contain;
  padding: .1rem .72rem .48rem 1.05rem; scrollbar-width: none;
}
.archive-toolbar { display: flex; gap: .65rem; align-items: center; justify-content: flex-end; padding: 0 .8rem .08rem; color: var(--faint); font: .61rem/1.2 var(--mono); }
.archive-toolbar button {
  padding: .18rem 0; border: 0; border-radius: 0; color: var(--faint);
  background: transparent; font: .61rem/1.2 var(--mono); cursor: pointer;
}
.archive-toolbar button:hover { color: var(--accent-soft); }
.archive-tree__year { border-top: 1px solid var(--line); }
.archive-tree__year:first-child { border-top: 0; }
.archive-tree__year > summary,
.archive-tree__month > summary {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  cursor: pointer; list-style: none;
}
.archive-tree__year > summary::-webkit-details-marker,
.archive-tree__month > summary::-webkit-details-marker { display: none; }
.archive-tree__year > summary { min-height: 1.6rem; padding: .22rem .32rem .18rem 0; color: var(--text); font: 700 .75rem/1.15 var(--mono); }
.archive-tree__year > summary::before { color: var(--accent); content: "›"; transform: rotate(0deg); transition: transform .18s ease; }
.archive-tree__year[open] > summary::before { transform: rotate(90deg); }
.archive-tree__year > summary span { margin-right: auto; }
.archive-tree small { color: var(--faint); font: .68rem/1 var(--mono); }
.archive-tree__month { margin: 0 0 .04rem .38rem; border-left: 1px solid var(--line); }
.archive-tree__month > summary { min-height: 1.45rem; padding: .14rem .36rem .14rem .58rem; color: var(--muted); font: .68rem/1.1 var(--mono); }
.archive-tree__month > summary::before { color: var(--faint); content: "›"; transform: rotate(0deg); transition: transform .18s ease; }
.archive-tree__month[open] > summary::before { transform: rotate(90deg); }
.archive-tree__month > summary span { margin-right: auto; }
.archive-tree__month ul { margin: 0 0 .12rem; padding: 0 0 0 .78rem; list-style: none; }
.archive-tree__month li { display: grid; grid-template-columns: 2.55rem minmax(0, 1fr); gap: .28rem; padding: .12rem .15rem .12rem 0; }
.archive-tree__month time { color: var(--faint); font: .61rem/1.3 var(--mono); }
.archive-tree__month a {
  display: -webkit-box; overflow: hidden; color: var(--muted); font-size: .68rem; line-height: 1.3;
  text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.archive-tree__month a:hover { color: var(--accent-soft); }
.sidebar-license { display: flex; align-items: center; padding: .78rem 1.05rem; border-top: 1px solid var(--line); }
.sidebar-license--top { border-top: 0; border-bottom: 1px solid var(--line); }
.sidebar-license a { display: inline-flex; }
.sidebar-license img { display: block; width: 88px; height: 31px; border-radius: 0; }
.sidebar-about { padding: .82rem 1.05rem 1rem; border-top: 1px solid var(--line); }
.sidebar-about .sidebar-static-section__heading { margin-bottom: .45rem; }
.sidebar-about__identity { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: .62rem; align-items: center; color: var(--text); font: 700 .78rem/1.3 var(--mono); text-decoration: none; }
.sidebar-about__identity img { display: block; width: 3rem; height: 3rem; border: 0; border-radius: 0; object-fit: cover; }
.sidebar-about__identity:hover { color: var(--accent-soft); }
.sidebar-about__link { display: inline-block; margin-top: .58rem; color: var(--muted); font: .68rem/1.35 var(--mono); }
.sidebar-about__link:hover { color: var(--accent-soft); }
.sidebar-license--about { margin-top: .72rem; padding: .72rem 0 0; }
.topic-cloud::-webkit-scrollbar, .label-cloud::-webkit-scrollbar, .archive-tree::-webkit-scrollbar { width: 0; height: 0; }
.sidebar-scrim { display: none; }
.home-article-heading { margin: .15rem 0 1rem; }

.page-heading { padding-bottom: 1.6rem; margin-bottom: 1.8rem; border-bottom: 1px solid var(--line); }
.page-heading h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.page-heading p:not(.eyebrow) { max-width: 46rem; margin: .65rem 0 0; color: var(--muted); }
.text-link { color: var(--accent-soft); }
.post-list { display: grid; gap: .82rem; }
.post-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 9.25rem; gap: 1.35rem;
  overflow: hidden; padding: 1.3rem 1.45rem; border: 1px solid var(--line);
  border-radius: 1.15rem; background: var(--card);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 .8rem 2.4rem rgba(0, 0, 0, .10);
  /* Off-screen cards cost nothing to lay out until they scroll into view. */
  content-visibility: auto; contain-intrinsic-size: auto 12rem;
  transition: border-color .22s ease;
}
.post-card::before {
  position: absolute; top: 1.1rem; bottom: 1.1rem; left: 0; width: 3px; border-radius: 99px;
  background: var(--accent); content: ""; opacity: .42; transition: opacity .22s ease;
}
.post-card:hover { border-color: var(--line-bright); }
.post-card:hover::before { opacity: 1; }
.post-card__meta { color: var(--faint); font: .72rem/1 var(--mono); }
.post-card h2 { margin: .72rem 0 .55rem; font-size: clamp(1.15rem, 2vw, 1.52rem); line-height: 1.32; letter-spacing: -.03em; }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent-soft); }
.post-card__body { min-width: 0; }
.post-card p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: .93rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.post-card__thumbnail {
  display: block; align-self: center; width: 9.25rem; height: 9.25rem; overflow: hidden;
  border: 1px solid var(--line); border-radius: 1rem; background: var(--surface);
}
.post-card__thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }

.post-tags, .post-categories { display: flex; flex-wrap: wrap; gap: .42rem; margin-top: 1rem; }
.category {
  display: inline; padding: 0; color: var(--accent); background: none;
  font: 700 .67rem/1.3 var(--mono); letter-spacing: .01em; text-decoration: none;
}
.category + .category::before { margin: 0 .38rem; color: var(--faint); content: "/"; }
.category:hover { color: var(--accent-soft); }
.tag, .tag-cloud__tag {
  display: inline-flex; gap: .35rem; align-items: center; padding: .25rem .5rem; border: 1px solid var(--line-bright);
  border-radius: .6rem; color: var(--text); background: var(--surface); font: .72rem/1.3 var(--mono); text-decoration: none;
}
.tag:hover, .tag-cloud__tag:hover { border-color: var(--accent); color: var(--accent-soft); }
.pagination {
  display: flex; gap: .9rem; align-items: center; justify-content: space-between; padding-top: 2.2rem;
  color: var(--muted); font: .8rem/1 var(--mono);
}
.pagination a { padding: .25rem 0; border: 0; border-radius: 0; color: var(--text); text-decoration: none; }
.pagination a:hover { color: var(--accent); }

.post-page { max-width: 900px; margin-inline: auto; }
.post-page__header { padding-bottom: 2rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.post-page h1 { font-size: clamp(2.2rem, 5vw, 4.2rem); word-break: break-word; }
.post-page__details { display: flex; flex-wrap: wrap; gap: .75rem 1.1rem; align-items: center; margin-top: 1.2rem; color: var(--muted); font: .76rem/1.5 var(--mono); }
.post-page__details .post-categories { margin: 0; }
.post-content { color: var(--text); font-size: 1.035rem; overflow-wrap: anywhere; }
.post-content > :first-child { margin-top: 0; }
.post-content h1, .post-content h2, .post-content h3, .post-content h4, .post-content h5, .post-content h6 {
  margin: 2.55em 0 .7em; color: var(--text); line-height: 1.3; letter-spacing: -.025em; scroll-margin-top: 6rem;
}
.post-content h1 { font-size: 1.9em; }
.post-content h2 { padding-bottom: .42em; border-bottom: 1px solid var(--line); font-size: 1.52em; }
.post-content h3 { font-size: 1.22em; }
.post-content p, .post-content li { line-height: 1.9; }
.post-content p { margin: 1.15em 0; }
.post-content ul, .post-content ol { padding-left: 1.45rem; }
.post-content li + li { margin-top: .35rem; }
.post-content a { color: var(--link); }
.post-content strong { color: var(--text); }
.post-content hr { height: 1px; margin: 2.4rem 0; border: 0; background: var(--line); }
.post-content blockquote { margin: 1.6rem 0; padding: .25rem 1.1rem; border-left: 3px solid var(--accent); color: var(--muted); background: var(--quote); }
.post-content blockquote > :first-child { margin-top: .4rem; }
.post-content blockquote > :last-child { margin-bottom: .4rem; }
.post-content code { padding: .13em .33em; border: 1px solid var(--line-bright); border-radius: .3rem; color: var(--accent-soft); background: var(--code); font: .86em/1.5 var(--mono); }
.post-content pre { overflow: auto; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--code); }
.post-content pre code { padding: 0; border: 0; color: var(--text); background: none; font-size: .84rem; }
.post-content .legacy-code { white-space: pre-wrap; }
.post-content table { display: block; max-width: 100%; overflow: auto; margin: 1.5rem 0; border-collapse: collapse; font-size: .92rem; }
.post-content th, .post-content td { padding: .55rem .7rem; border: 1px solid var(--line-bright); }
.post-content th { color: var(--accent-soft); background: var(--surface-raised); }
.post-content img, .post-content video {
  display: block; width: min(100%, 46rem); max-width: 100%; height: auto; max-height: 34rem;
  margin: 1.5rem auto; border: 0; border-radius: 0; background: transparent; object-fit: contain;
}
.post-content iframe { display: block; width: 100%; max-width: 100%; min-height: 460px; margin: 1.8rem auto; border: 1px solid var(--line-bright); border-radius: .8rem; background: #fff; }
.post-content .part { color: inherit !important; background: transparent !important; font-family: inherit !important; letter-spacing: normal !important; }
.post-content .part[style] { font-size: inherit !important; }
.post-content .separator { max-width: 100%; }
.legacy-tags { margin-top: 2rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); }
.legacy-tags summary { padding: .88rem 1rem; color: var(--muted); font: .76rem/1.3 var(--mono); cursor: pointer; }
.legacy-tags .post-tags { padding: 0 1rem 1rem; margin: 0; }
.post-source { margin-top: 3rem; padding-top: 1.15rem; border-top: 1px solid var(--line); color: var(--faint); font: .75rem/1.5 var(--mono); }
.post-adjacent { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 1.5rem; }
.post-adjacent a { min-width: 0; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.post-adjacent a:last-child { text-align: right; }
.comments { margin-top: 3.25rem; padding-top: 1.8rem; border-top: 1px solid var(--line); }
.comments h2 { margin: 0 0 1rem; color: var(--text); font-size: 1.3rem; }
.comments--pending { color: var(--faint); font-size: .88rem; }
.comments--pending p { margin: 0; }
.giscus, .giscus-frame { width: 100%; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: .55rem; }
.tag-cloud__tag { padding: .42rem .58rem; font-size: .8rem; }
.tag-cloud__tag span { color: var(--accent); }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .95rem; }
.category-card {
  display: flex; gap: .75rem; align-items: baseline; justify-content: space-between; min-height: 8.1rem;
  padding: 1.2rem; border: 1px solid var(--line); border-radius: 1.1rem; color: var(--text);
  background: linear-gradient(135deg, var(--panel), var(--surface)); box-shadow: 0 .7rem 2rem rgba(0, 0, 0, .05);
  font: 700 .94rem/1.4 var(--mono); text-decoration: none; transition: transform .2s ease, border-color .2s ease;
}
.category-card:hover { border-color: var(--accent); color: var(--accent-soft); transform: translateY(-3px); }
.category-card strong { color: var(--accent); font-size: 1.5rem; }
.archive-year { margin: 2rem 0 3rem; scroll-margin-top: 6rem; }
.archive-year h2 { display: flex; gap: .65rem; align-items: baseline; margin: 0 0 .55rem; padding-bottom: .45rem; border-bottom: 1px solid var(--line); color: var(--accent-soft); font: 700 1.3rem/1 var(--mono); }
.archive-year h2 span { color: var(--faint); font-size: .75rem; }
.archive-year ul { padding: 0; margin: 0; list-style: none; }
.archive-year li { display: grid; grid-template-columns: 3.2rem 1fr; gap: .8rem; padding: .55rem .25rem; border-bottom: 1px dashed var(--line); }
.archive-year time { color: var(--faint); font: .75rem/1.7 var(--mono); }
.archive-year a { color: var(--text); text-decoration: none; }
.archive-year a:hover { color: var(--accent-soft); }
.search-box { max-width: 780px; }
.search-box label { display: block; margin-bottom: .5rem; color: var(--muted); font: .78rem/1 var(--mono); }
.search-box input { width: 100%; padding: .8rem 1rem; border: 1px solid var(--line-bright); border-radius: .85rem; outline: none; color: var(--text); background: var(--field); font: 1rem var(--sans); }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.search-status { min-height: 1.6em; color: var(--muted); font: .8rem/1.5 var(--mono); }
.search-result { padding: 1rem 0; border-top: 1px solid var(--line); }
.search-result h2 { margin: 0; font-size: 1.06rem; }
.search-result h2 a { color: var(--text); text-decoration: none; }
.search-result p { margin: .3rem 0 0; color: var(--muted); font-size: .9rem; }
.search-result__meta { color: var(--faint); font: .72rem/1.8 var(--mono); }
.not-found { max-width: 700px; padding: 8vh 0; }
.not-found h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
.not-found p:not(.eyebrow) { color: var(--muted); }
.about-profile {
  display: grid; grid-template-columns: minmax(9rem, 13.75rem) minmax(0, 1fr); gap: 1.65rem; align-items: start;
  padding: 1.25rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.about-profile__photo { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 0; background: var(--surface); object-fit: cover; }
.about-profile__body h2 { margin: 0; color: var(--text); font-size: 1.55rem; letter-spacing: -.04em; }
.about-profile__body > p { margin: .55rem 0 1.2rem; color: var(--muted); }
.about-profile dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .28rem 1rem; margin: 0; font-size: .88rem; }
.about-profile dt { color: var(--faint); font: .72rem/1.65 var(--mono); }
.about-profile dd { margin: 0; color: var(--muted); }
.about-profile__contact { display: flex; flex-wrap: wrap; gap: .55rem .9rem; align-items: baseline; margin-top: 1.3rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.about-profile__contact h3 { width: 100%; margin: 0; color: var(--accent); font: 750 .72rem/1.3 var(--mono); letter-spacing: .12em; }
.about-profile__contact a { font: .84rem/1.45 var(--mono); }
.button { display: inline-block; padding: .65rem .95rem; border: 1px solid var(--accent); border-radius: .75rem; color: var(--accent); text-decoration: none; }
.button:hover { color: var(--on-accent); background: var(--accent); }

@media (max-width: 1050px) {
  body.sidebar-open { overflow: hidden; }
  .site-header { z-index: 50; }
  .site-layout { grid-template-columns: 1fr; }
  .site-sidebar {
    display: block; position: fixed; z-index: 40; top: 4.6rem; right: 0; bottom: 0; width: min(23rem, calc(100vw - 1rem));
    max-height: none; margin: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
    border-width: 0 0 0 1px; border-style: solid; border-color: var(--line-bright); border-radius: 0;
    background: var(--drawer); box-shadow: none;
    opacity: 0; pointer-events: none;
    transform: translateX(calc(100% + 1rem)); transition: transform .32s cubic-bezier(.2, .75, .25, 1), opacity .2s ease;
  }
  .site-sidebar::-webkit-scrollbar { width: 0; height: 0; }
  body.sidebar-open .site-sidebar { opacity: 1; pointer-events: auto; transform: translateX(0); }
  .sidebar-scrim {
    display: block; position: fixed; z-index: 30; inset: 4.6rem 0 0; width: 100%; height: auto; padding: 0; border: 0;
    opacity: 0; pointer-events: none; background: rgba(0, 0, 0, .30); cursor: pointer; transition: opacity .24s ease;
  }
  body.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .discovery-section summary { min-height: 3.5rem; padding: .72rem .82rem; }
  .discovery-section summary strong, .sidebar-static-section__heading strong { font-size: .92rem; }
  .home-search form { margin: 0 .82rem .82rem; }
  .home-search button { padding-inline: .58rem; }
  .topic-cloud { padding-inline: .82rem; }
  .archive-tree { max-height: 14rem; padding-left: .82rem; }
  .sidebar-static-section { padding-inline: .82rem; }
  .sidebar-license { padding-inline: .82rem; }
}
@media (max-width: 1050px) and (min-width: 761px) {
  .site-header__inner { position: relative; }
  .site-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  /* Keep the link reachable on tablets: show the mark, drop the label. */
  .github-link__mark { display: block; }
  .github-link__text { display: none; }
  .github-link { padding: .4rem .2rem; }
}
@media (max-width: 760px) {
  .site-sidebar { top: 4rem; width: min(22rem, calc(100vw - .7rem)); }
  .sidebar-scrim { inset: 4rem 0 0; }
  .site-header__inner { position: relative; gap: .72rem; width: min(1240px, calc(100% - 1.35rem)); min-height: 4rem; padding-block: .68rem; }
  .site-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .github-link__mark { display: block; }
  .github-link__text { display: none; }
  .github-link { flex: 0 0 auto; padding: .4rem .2rem; }
  .theme-toggle { padding: .4rem .52rem; }
  .theme-toggle [data-theme-label] { display: none; }
  .brand { flex: 1 1 auto; min-width: 0; max-width: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .theme-toggle, .menu-toggle { flex: 0 0 auto; }
  .site-main { width: min(1240px, calc(100% - 1.35rem)); padding-block: 1.6rem 3.5rem; }
  .site-footer { width: min(1240px, calc(100% - 1.35rem)); display: block; }
  .site-footer div + div { margin-top: .35rem; }
  .hero { padding: 1.05rem 1.15rem; margin-bottom: 1.2rem; border-radius: 1rem; }
  .hero h1 { font-size: clamp(1.85rem, 9vw, 2.55rem); letter-spacing: -.055em; }
  .post-card { grid-template-columns: minmax(0, 1fr) 4.75rem; gap: .8rem; padding: 1.3rem 1.15rem 1.25rem 1.35rem; border-radius: 1rem; }
  .post-card__thumbnail { width: 4.75rem; height: 4.75rem; border-radius: .8rem; }
  .post-card__thumbnail img { border-radius: .8rem; }
  .category-grid { grid-template-columns: 1fr; }
  .post-content { font-size: 1rem; }
  .post-content img, .post-content video { width: min(100%, 46rem); max-height: 28rem; }
  .post-content iframe { min-height: 360px; }
  .post-adjacent { grid-template-columns: 1fr; }
  .post-adjacent a:last-child { text-align: left; }
  .archive-year li { grid-template-columns: 3rem 1fr; }
  .about-profile { grid-template-columns: minmax(0, 10rem) minmax(0, 1fr); gap: 1rem; }
}
@media (max-width: 440px) {
  .about-profile { grid-template-columns: 1fr; }
  .about-profile__photo { width: min(13.75rem, 100%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important; animation-duration: .01ms !important;
    animation-iteration-count: 1 !important; transition-duration: .01ms !important;
  }
}
@media print {
  body { color: #111; background: #fff; }
  .site-header, .site-footer, .post-adjacent, .post-source, .theme-toggle, .legacy-tags { display: none; }
  .site-main { width: auto; padding: 0; }
  .post-content { color: #111; }
}


/* Code blocks: server-rendered Pygments classes mapped onto the site palette,
   so highlighting works in both themes without shipping a JS highlighter. */
.code-block { position: relative; margin: 1.6rem 0; }
.code-block__bar {
  display: flex; gap: .75rem; align-items: center; justify-content: space-between;
  padding: .4rem .75rem .4rem .95rem; border: 1px solid var(--line); border-bottom: 0;
  border-radius: .85rem .85rem 0 0; background: var(--surface-raised);
  color: var(--faint); font: 650 .68rem/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase;
}
.code-block__copy {
  padding: .22rem .55rem; border: 1px solid var(--line-bright); border-radius: .45rem;
  color: var(--text); background: var(--field); cursor: pointer;
  font: 650 .68rem/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.code-block__copy:hover { color: var(--on-accent); border-color: var(--accent); background: var(--accent); }
.code-block__copy[data-copied] { color: var(--on-accent); border-color: var(--accent); background: var(--accent); }
.code-block .highlight { margin: 0; }
.code-block .highlight pre { margin: 0; border-radius: 0 0 .85rem .85rem; }
.post-content .highlight pre { border: 1px solid var(--line); }
.post-content .highlight pre code { color: var(--text); }

.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp, .highlight .cpf { color: var(--code-comment); font-style: italic; }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: var(--code-keyword); }
.highlight .o, .highlight .ow, .highlight .p { color: var(--code-punct); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd,
.highlight .se, .highlight .sh, .highlight .si, .highlight .sr, .highlight .ss, .highlight .sx { color: var(--code-string); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: var(--code-number); }
.highlight .nf, .highlight .nd, .highlight .fm { color: var(--code-func); }
.highlight .nb, .highlight .nc, .highlight .nn, .highlight .ne, .highlight .nt { color: var(--code-builtin); }
.highlight .na, .highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi { color: var(--code-number); }
.highlight .gd { color: var(--code-deleted); }
.highlight .gi { color: var(--code-inserted); }
.highlight .gh, .highlight .gu, .highlight .gp { color: var(--accent); }
.highlight .ge { font-style: italic; }
.highlight .gs { font-weight: 700; }
.highlight .err { color: var(--code-deleted); background: none; }

/* HackMD :::info blocks keep their callout shape instead of leaking as text. */
.callout {
  margin: 1.6rem 0; padding: .9rem 1.1rem; border: 1px solid var(--line-bright);
  border-left: 3px solid var(--accent); border-radius: .2rem .85rem .85rem .2rem;
  background: var(--quote);
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout--success { border-left-color: var(--code-inserted); }
.callout--warning { border-left-color: var(--code-number); }
.callout--danger { border-left-color: var(--code-deleted); }
.callout__title { margin: 0 0 .5rem; color: var(--text); font-weight: 700; }
.spoiler {
  margin: 1.6rem 0; border: 1px solid var(--line-bright); border-radius: .85rem;
  background: var(--quote);
}
.spoiler > summary {
  padding: .7rem 1rem; color: var(--accent-soft); cursor: pointer;
  font: 650 .84rem/1.4 var(--mono); list-style: none;
}
.spoiler > summary::-webkit-details-marker { display: none; }
.spoiler > summary::before { margin-right: .45rem; content: "›"; display: inline-block; transition: transform .18s ease; }
.spoiler[open] > summary::before { transform: rotate(90deg); }
.spoiler > :not(summary) { padding-inline: 1rem; }
.spoiler > :last-child { padding-bottom: .35rem; }
.post-content .task-list { padding-left: .35rem; list-style: none; }
.task-list__item { display: flex; gap: .55rem; align-items: baseline; }
.task-list__item input { margin: 0; accent-color: var(--accent); }
.draft-flag {
  display: inline-block; margin: 0 0 .9rem; padding: .3rem .7rem;
  border: 1px solid var(--code-number); border-radius: .55rem;
  color: var(--code-number); background: var(--quote);
  font: 700 .72rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}

/* Home-page filter. Hidden until the script enables it, so a reader without
   JavaScript never sees a control that cannot work. */
.post-filter {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  margin: 0 0 1rem; padding: .7rem .85rem;
  border: 1px solid var(--line); border-radius: .9rem;
  background: var(--panel);
}
/* display:flex above outranks the UA's [hidden] rule, so restate it. */
.post-filter[hidden] { display: none; }
.post-filter__field { display: flex; min-width: 0; }
.post-filter__field--grow { flex: 1 1 14rem; }
.post-filter input, .post-filter select {
  width: 100%; padding: .5rem .7rem;
  border: 1px solid var(--line-bright); border-radius: .6rem;
  outline: none; color: var(--text); background: var(--field);
  font: .82rem/1.4 var(--sans);
}
.post-filter select { cursor: pointer; }
/* The popup list is drawn by the browser from these values, so they have to be
   opaque: a see-through field background leaves the options white on white. */
.post-filter select option {
  color: var(--text);
  background: var(--canvas);
}
.post-filter input:focus, .post-filter select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring);
}
.post-filter__reset {
  padding: .5rem .8rem; border: 1px solid var(--line-bright); border-radius: .6rem;
  color: var(--text); background: var(--field); cursor: pointer;
  font: 650 .74rem/1.4 var(--mono);
}
.post-filter__reset:hover { color: var(--on-accent); border-color: var(--accent); background: var(--accent); }
.post-filter__status {
  flex-basis: 100%; margin: 0; color: var(--muted); font: .74rem/1.5 var(--mono);
}
.post-filter__status:empty { display: none; }
.post-filter__empty { margin: 1.5rem 0; color: var(--muted); }
@media (max-width: 620px) {
  .post-filter__field--grow { flex-basis: 100%; }
  .post-filter__field { flex: 1 1 8rem; }
}
.visitor-count { margin-top: .6rem; color: var(--faint); font: .68rem/1.6 var(--mono); }
.visitor-count span { display: block; }
.visitor-count[hidden] { display: none; }
.maintenance { text-align: left; }
.maintenance__meta { margin-top: 2rem; color: var(--faint); font: .8rem/1.6 var(--mono); }
.visitor-count__legacy { white-space: nowrap; }
