/* Quiet technical journal — one stylesheet, no external assets. */
:root {
  --paper: #fbfcfd;
  --ink: #253344;
  --muted: #647386;
  --accent: #285b83;
  --accent-soft: #edf3f8;
  --line: #dfe6ec;
  --code: #f0f3f6;
  --width: 1120px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 32px 72px;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-underline-offset: .22em; }
a:hover { color: var(--ink); }
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 2px;
}
h1, h2, h3 { line-height: 1.5; font-weight: 650; }
h1 { margin: 0 0 28px; font-size: 1.6rem; letter-spacing: .025em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 1em 0; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 38px 0 30px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.site-title {
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: .055em;
  text-decoration: none;
  line-height: 1.4;
}
.menu-toggle { cursor: pointer; font-size: .875rem; list-style: none; }
.menu-toggle::-webkit-details-marker { display: none; }
.menu-links { display: flex; gap: 26px; }
.menu-links a { color: var(--muted); font-size: .875rem; text-decoration: none; }
.menu-links a:hover { color: var(--accent); text-decoration: underline; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 64px; }
main, aside { min-width: 0; }
main > h1:first-child { font-size: 1.1rem; margin-bottom: 14px; }
.post-card { padding: 28px 0 30px; border-bottom: 1px solid var(--line); }
.post-card:first-of-type { padding-top: 14px; }
.post-card h2 { margin: 0 0 9px; font-size: 1.35rem; letter-spacing: .015em; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent); }
time { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.post-categories { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 9px 0 14px; }
.post-categories a {
  display: inline-block;
  padding: 1px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.8;
  text-decoration: none;
}
.post-categories a:hover { color: var(--accent); border-color: var(--accent); }
.post-snippet { color: #526174; margin: 14px 0 12px; font-size: .92rem; line-height: 1.9; }
.post-card > p:last-child { margin: 0; }
.read-more { font-size: .8rem; font-weight: 550; text-decoration: none; }
.read-more:hover { text-decoration: underline; }

.sidebar { border-left: 1px solid var(--line); padding-left: 25px; }
.sidebar section + section { margin-top: 38px; }
.sidebar h2 { margin: 0 0 17px; font-size: .85rem; letter-spacing: .08em; }
.sidebar ul { margin: 0; padding: 0; list-style: none; }
.sidebar li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .8rem; line-height: 1.75; }
.sidebar li:first-child { padding-top: 0; }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--muted); text-decoration: none; }
.sidebar a:hover { color: var(--accent); text-decoration: underline; }
.sidebar p { font-size: .8rem; color: var(--muted); }

.breadcrumbs { color: var(--muted); margin-bottom: 25px; font-size: .75rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0; padding: 0; margin: 0; list-style: none; }
.breadcrumbs li + li::before { content: "/"; color: #9aa6b3; margin: 0 10px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 34px; font-size: .78rem; }
.pagination > a, .pagination > span { display: inline-block; padding: 5px 10px; text-align: center; text-decoration: none; }
.pagination > a:hover { background: var(--accent-soft); }
.pagination > span { color: #8794a2; }
.pagination > [aria-current="page"] { background: var(--accent); color: #fff; border-radius: 2px; }
.category-list { padding-left: 1.25rem; }
.category-list li { margin-bottom: 12px; }

.post > h1 { font-size: 1.75rem; margin-bottom: 14px; }
.post > h2 { margin-top: 2em; padding-bottom: .45em; border-bottom: 1px solid var(--line); }
.post > h3 { margin-top: 1.8em; }
.post > p { line-height: 1.9; }
.category-article-nav { display: flex; justify-content: space-between; gap: 24px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .85rem; }
.category-article-nav a { max-width: 48%; }
.category-article-nav a[rel="next"] { margin-left: auto; text-align: right; }
img, video { max-width: 100%; height: auto; }
pre { max-width: 100%; overflow-x: auto; padding: 20px; border: 1px solid var(--line); background: var(--code); border-radius: 3px; line-height: 1.65; font-size: .82rem; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .9em; }
:not(pre) > code { padding: .12em .3em; background: var(--code); border-radius: 2px; }
pre code { font-size: inherit; }
blockquote { margin: 1.5em 0; padding: .1em 1.2em; border-left: 3px solid var(--line); color: var(--muted); }
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 9px 13px; border-bottom: 1px solid var(--line); text-align: left; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

@media (min-width: 761px) {
  .menu-toggle { display: none; }
  .site-menu > .menu-links { display: flex; }
  /* Modern browsers expose the closed details content through this pseudo-element. */
  .site-menu::details-content { content-visibility: visible; display: block; }
}
@media (max-width: 760px) {
  body { padding: 0 22px 48px; font-size: 15px; }
  .site-header { position: relative; padding: 25px 0 22px; margin-bottom: 30px; gap: 16px; }
  .site-title { font-size: 1.25rem; }
  .site-menu { flex-shrink: 0; }
  .menu-toggle { color: var(--muted); padding: 5px 0 5px 8px; }
  .menu-links { position: absolute; z-index: 2; top: calc(100% - 1px); right: 0; min-width: 180px; display: flex; flex-direction: column; gap: 0; padding: 10px 18px; border: 1px solid var(--line); background: var(--paper); }
  .menu-links a { display: block; padding: 9px 0; }
  .site-menu:not([open]) .menu-links { display: none; }
  .layout { grid-template-columns: 1fr; gap: 48px; }
  .sidebar { border-left: 0; border-top: 1px solid var(--line); padding: 28px 0 0; }
  .sidebar section + section { margin-top: 30px; }
  .post-card { padding: 23px 0 25px; }
  .post-card h2 { font-size: 1.18rem; }
  .post > h1 { font-size: 1.45rem; }
  .pagination { gap: 2px; }
  .pagination > a, .pagination > span { padding: 5px 8px; }
  pre { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
/* Article TOC: append once to the end of static/style.css. */
.article-toc {
  margin: 1.5rem 0 2rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid #dce5ed;
  border-left: 3px solid #557a99;
  border-radius: 3px;
  background: #f5f8fb;
  color: #33465a;
  font-size: .92rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.article-toc > h2 { margin: 0 0 .6rem; font-size: 1rem; line-height: 1.5; }
.article-toc ul { margin: .25rem 0; padding-left: 1.25rem; }
.article-toc > ul { margin: 0; }
.article-toc li { margin: .2rem 0; }
.article-toc a { color: #285b83; text-decoration: none; text-underline-offset: .2em; }
.article-toc a:hover { text-decoration: underline; }
.article-toc a:focus-visible { outline: 2px solid #557a99; outline-offset: 3px; }
@media (max-width: 760px) {
  .article-toc { padding: .9rem; }
  .article-toc ul { padding-left: 1rem; }
}


.article-toc {
  padding: 12px 16px;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.article-toc h2 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.article-toc ul,
.article-toc ol {
  margin: 4px 0;
  padding-left: 1.2em;
}

.article-toc li {
  margin: 2px 0;
}

.article-toc a {
  font-size: inherit;
}
