@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --brand: #76abdb;
  --brand-ink: #1f3447;
  --desktop: #dce9f5;
  --grid: #c5d9ec;
  --paper: #fbfdff;
  --surface: #edf3f9;
  --chrome: #dce8f3;
  --ink: #22364a;
  --muted: #50677e;
  --line: #b6c9db;
  --frame: #56728d;
  /* The brand blue is a fill; small links and focus rings need a darker tone. */
  --accent: #285f8f;
  --accent-soft: #d4e6f5;
  --selection: #b8d6f0;
  --shadow: 0 12px 30px #294d7015, 0 3px 5px #294d700c;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: "D2Coding", "JetBrains Mono", "Pretendard Variable", ui-monospace, SFMono-Regular, Consolas, monospace;
  --body-size: 1.125rem;
  --window-radius: 12px;
  --control-radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --desktop: #172532;
    --grid: #203445;
    --paper: #1d2e3e;
    --surface: #24394c;
    --chrome: #2d465d;
    --ink: #e7f0f8;
    --muted: #b4c7d8;
    --line: #45617a;
    --frame: #7394b1;
    --accent: #97c2e8;
    --accent-soft: #304f69;
    --selection: #395d7b;
    --shadow: 0 12px 30px #0a172438, 0 3px 5px #0a172420;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --desktop: #172532;
  --grid: #203445;
  --paper: #1d2e3e;
  --surface: #24394c;
  --chrome: #2d465d;
  --ink: #e7f0f8;
  --muted: #b4c7d8;
  --line: #45617a;
  --frame: #7394b1;
  --accent: #97c2e8;
  --accent-soft: #304f69;
  --selection: #395d7b;
  --shadow: 0 12px 30px #0a172438, 0 3px 5px #0a172420;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body {
  margin: 0;
  background-color: var(--desktop);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
[hidden] { display: none !important; }
::selection { color: var(--ink); background: var(--selection); }
* { scrollbar-color: var(--frame) var(--surface); scrollbar-width: thin; }
input, textarea { caret-color: var(--accent); }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
a, button { -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; }
button, input[type="submit"] { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
button {
  min-height: 40px;
  padding: .38rem .8rem;
  border: 1px solid var(--frame);
  border-radius: var(--control-radius);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.4;
}
button:hover { background: var(--accent-soft); border-color: var(--frame); }
button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--frame); }
button:active { transform: translateY(1px); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
img { max-width: 100%; height: auto; vertical-align: middle; }
p, h1, h2, h3, h4, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 10; padding: 1rem; background: var(--paper); border: 2px solid var(--accent); }
.skip-link:focus { top: 1rem; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--frame); }
.menu-bar { max-width: 1280px; min-height: 66px; padding: 0 32px; margin: auto; display: flex; align-items: center; gap: 44px; }
.site-brand, .footer-brand { font-size: 1.5rem; font-weight: 750; letter-spacing: -.035em; text-decoration: none; }
.primary-nav { display: flex; gap: 28px; align-items: center; }
.primary-nav a { display: flex; min-height: 44px; align-items: center; font-size: .9375rem; text-decoration: none; }
.primary-nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; }
.theme-toggle { margin-left: auto; font-size: .8125rem; min-width: 92px; }
.desktop { max-width: 1244px; margin: 0 auto; padding: 52px 32px 0; }
.desktop-intro { padding: 4px 4px 32px; }
.desktop-intro h1 { font-weight: 730; font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1.25; letter-spacing: -.035em; }
.desktop-intro p { margin-top: 16px; color: var(--muted); font-size: .9375rem; }
.desktop-window { border: 1px solid var(--frame); border-radius: var(--window-radius); background: var(--paper); box-shadow: var(--shadow); overflow: clip; }
.window-bar { min-height: 42px; padding: 0 16px; background: var(--brand); color: var(--brand-ink); border-bottom: 1px solid var(--frame); display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; gap: 8px; }
.window-lights { display: flex; gap: 7px; }
.window-lights i { width: 11px; height: 11px; border-radius: 50%; border: 1px solid #8c423a55; background: #e89a89; }
.window-lights i:nth-child(2) { background: #e3c983; border-color: #8c713a55; }
.window-lights i:nth-child(3) { background: #93bf9b; border-color: #3a7b4655; }
.window-name { text-align: center; font-size: .8125rem; font-weight: 550; color: inherit; }
.window-grip { justify-self: end; width: 28px; height: 10px; border-block: 1px solid currentColor; position: relative; opacity: .7; }
.window-grip::after { content: ""; position: absolute; inset: 4px 0 auto; border-top: 1px solid currentColor; }
.library-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); }
.library-sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 28px 16px; }
.sidebar-label { color: var(--muted); font-size: .8125rem; font-weight: 550; margin: 0 10px 14px; }
.category-nav { display: grid; gap: 6px; }
.category-nav a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 10px; text-decoration: none; border-radius: var(--control-radius); font-size: .875rem; line-height: 1.45; min-height: 44px; }
.category-nav a:hover { background: var(--chrome); }
.category-nav a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); font-weight: 650; }
.category-nav a[aria-current="page"] .item-count { color: inherit; }
.item-count { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.library-sidebar .sidebar-label + .category-nav + .sidebar-label,
.library-sidebar .tag-cloud + .sidebar-label { margin-top: 28px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }
.tag-cloud a { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: .75rem; text-decoration: none; color: var(--muted); }
.tag-cloud a:hover { background: var(--chrome); color: var(--ink); }
.tag-cloud a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.sidebar-note { margin: 44px 10px 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }
.sidebar-note a { display: inline-block; margin-top: 16px; }
.library-main { padding: 28px 32px 12px; min-width: 0; }
.library-toolbar { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.library-toolbar h1, .library-toolbar h2 { font-size: 1.125rem; font-weight: 650; }
.search-form { display: flex; gap: 6px; align-items: stretch; }
.search-form input { min-width: 0; width: 200px; min-height: 40px; border: 1px solid var(--frame); border-radius: var(--control-radius); background: var(--paper); color: var(--ink); padding: .5rem .75rem; font-size: .875rem; }
.search-form input::placeholder { color: var(--muted); opacity: 1; }
.search-form button { font-size: .875rem; white-space: nowrap; }
.search-context { padding-top: 20px; color: var(--muted); }
.archive-description { padding-top: 20px; max-width: 62ch; color: var(--muted); line-height: 1.7; text-wrap: pretty; }
.archive-description p + p { margin-top: .5rem; }
.post-preview { padding: 30px 0; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.3fr); gap: 28px; align-items: center; }
.post-preview + .post-preview { border-top: 1px solid var(--line); }
.preview-image { display: block; aspect-ratio: 16/9; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.preview-image img { width: 100%; height: 100%; object-fit: contain; }
.preview-copy { min-width: 0; }
.preview-copy h2 { font-size: clamp(1.2rem, 1.8vw, 1.5rem); font-weight: 670; letter-spacing: -.02em; line-height: 1.43; text-wrap: pretty; }
.preview-copy h2 a { text-decoration: none; }
.preview-copy h2 a:hover { text-decoration: underline; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: .8125rem; font-weight: 450; line-height: 1.6; }
.post-meta time { font-variant-numeric: tabular-nums; }
.preview-copy .post-meta { margin-top: 12px; }
.post-meta a { text-decoration: none; color: var(--accent); }
.post-meta a:hover { text-decoration: underline; }
.preview-copy > p { margin-top: 14px; font-size: .9375rem; line-height: 1.75; color: var(--muted); }
.read-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; min-height: 32px; font-size: .875rem; font-weight: 600; color: var(--accent); }
.document-cover { display: grid; width: 35%; height: 64%; align-content: center; gap: 10px; margin: 10% auto; padding: 14px; background: var(--paper); border: 1px solid var(--line); }
.document-cover span { border-top: 2px solid var(--frame); }
.document-cover span:last-child { width: 65%; }
.window-status { display: flex; justify-content: space-between; padding: 8px 18px; font-size: .75rem; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface); }
.pagination { border-top: 1px solid var(--line); padding-block: 24px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 12px; }
.page-numbers { padding: 4px 10px; }
.page-numbers.current { background: var(--brand); color: var(--brand-ink); border-radius: 4px; }
.empty-state { padding: 64px 32px; }
.empty-state h1, .empty-state h2 { font-size: 1.6rem; margin-bottom: 16px; }
.empty-state p { margin-bottom: 24px; }
.empty-state .search-form { margin-bottom: 24px; }

.reading-desktop { padding-top: 38px; }
.reading-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: .8125rem; }
.reading-toolbar > a { font-weight: 550; padding: 6px 0; }
.reading-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reading-controls button, .reading-controls .search-form button { min-height: 44px; font-size: .8125rem; white-space: nowrap; flex: 0 0 auto; }
.reading-toolbar .search-form { flex: 1 1 160px; min-width: 0; }
.reading-toolbar .search-form input { flex: 1 1 auto; }
.reading-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); align-items: start; }
.reading-sidebar { position: sticky; top: 24px; margin: 42px 0 32px; padding: 0 22px; max-height: calc(100dvh - 48px); overflow-y: auto; }
.toc-disclosure summary { color: var(--muted); font-size: .8125rem; font-weight: 600; padding: 4px 0 14px; cursor: pointer; }
.toc { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.toc a { text-decoration: none; color: var(--muted); font-size: .8125rem; line-height: 1.55; padding: 9px 8px; border-radius: 4px; }
.toc a:hover { background: var(--surface); color: var(--accent); }
.toc a[aria-current="location"] { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.toc .toc-h3 { padding-left: 18px; }
.back-top { display: inline-block; margin-top: 24px; color: var(--muted); font-size: .8125rem; }
.reading-article { width: 100%; min-width: 0; max-width: 768px; padding: 48px 44px 64px; margin: 0 auto; }
.article-header { margin-bottom: 40px; }
.article-header h1 { font-size: clamp(1.9rem, 3.3vw, 2.625rem); font-weight: 720; line-height: 1.34; letter-spacing: -.03em; }
.article-header .post-meta { margin-top: 24px; font-size: .875rem; }
.article-body { font-size: var(--body-size); font-weight: 400; line-height: 1.85; letter-spacing: 0; }
.article-body > :first-child { margin-top: 0; }
.article-body p { margin-bottom: 1.2em; }
.article-body > p:first-child { font-size: 1.08em; line-height: 1.8; }
.article-body h2 { font-size: 1.45em; line-height: 1.45; letter-spacing: -.025em; font-weight: 680; margin: 2.5em 0 .8em; scroll-margin-top: 28px; }
.article-body h3 { font-size: 1.18em; line-height: 1.5; font-weight: 650; margin: 2em 0 .7em; scroll-margin-top: 28px; }
.article-body h4 { font-size: 1em; margin: 1.8em 0 .7em; }
.article-body a { color: var(--accent); overflow-wrap: anywhere; }
.article-body strong { font-weight: 670; }
.article-body ul, .article-body ol { margin: 1em 0 1.5em; padding-left: 1.5em; }
.article-body li { padding-left: .2em; margin-bottom: .55em; }
.article-body li::marker { color: var(--accent); }
.article-body blockquote { margin: 1.6em 0; padding: 1.3em 1.5em; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.article-body figure { margin: 2em 0; }
.article-body .wp-block-image { width: 560px; max-width: 100%; margin-inline: auto; }
.article-body figure img { width: 100%; height: auto; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; }
.figure-motion-controls:not([hidden]) { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.figure-motion-controls button { min-height: 44px; padding: 8px 12px; font: inherit; font-size: .8125rem; }
.figure-motion-controls button:disabled { opacity: .55; cursor: default; }
.article-body .figure-motion-status { font-size: .875rem; line-height: 1.65; margin: 12px 0; }
.figure-motion-status:empty { display: none; }
.figure-motion details { margin-top: 12px; font-size: .875rem; }
.figure-gif-download { display: inline-block; padding-block: 10px; font-size: .8125rem; }
.article-body .lecture-note { margin: 1.6em 0; padding-inline: 16px; border-block: 1px solid var(--line); }
.article-body .lecture-note > summary { min-height: 44px; padding-block: 14px; font-weight: 650; line-height: 1.65; cursor: pointer; overflow-wrap: anywhere; }
.article-body .lecture-note > summary::marker { color: var(--accent); }
.article-body .lecture-note > :last-child:not(summary) { margin-bottom: 16px; }
.article-body figcaption { margin-top: 12px; text-align: left; color: var(--muted); font-size: .8125rem; line-height: 1.65; }
.article-body code { font-family: var(--mono); font-size: .84em; font-weight: 400; font-variant-ligatures: none; }
.article-body :not(pre) > code { display: inline-block; max-width: 100%; vertical-align: baseline; padding: .08em .3em; border-radius: 3px; background: var(--surface); border: 1px solid var(--line); line-height: 1.5; overflow-wrap: anywhere; }
.code-window { margin: 1.6em 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 4px 14px; border-bottom: 1px solid var(--line); background: var(--chrome); font-family: var(--sans); font-size: .75rem; font-weight: 550; }
.copy-code { min-height: 32px; padding: 3px 10px; font-size: .75rem; background: var(--paper); }
.article-body pre { min-width: 0; max-width: 100%; max-height: 38rem; margin: 0; padding: 22px; overflow: auto; white-space: pre; tab-size: 4; font-family: var(--mono); font-size: .9375rem; line-height: 1.75; color: var(--ink); background: var(--surface); word-break: normal; overflow-wrap: normal; }
.article-body pre code { display: block; font-size: inherit; font-family: inherit; line-height: inherit; white-space: pre; overflow-wrap: normal; }
.article-body > pre { margin-block: 1.5em; border: 1px solid var(--line); border-radius: 8px; }
/* Width follows content, not the column: a 2-column table should stay narrow
   and left-aligned instead of stretching across the whole post. A table wider
   than the reading column still scrolls inside this box, never the page. */
.table-scroll { margin: 1.8em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; width: -webkit-fit-content; width: fit-content; max-width: 100%; }
.article-body table { width: auto; max-width: 100%; border-collapse: collapse; font-size: .875rem; line-height: 1.7; text-align: left; font-variant-numeric: tabular-nums; }
/* Markdown emits inline column alignment; headers follow the reading style independently. */
.article-body th { background: var(--chrome); text-align: center !important; font-weight: 700; white-space: nowrap; }
.article-body th :is(code, strong) { font-weight: inherit; }
.article-body td, .article-body th { padding: 13px 16px; vertical-align: top; overflow-wrap: break-word; }
/* No forced min-width: a short numeric/label column now sizes to its content
   instead of padding out to 110px. Body cells keep normal wrapping — data
   tables here are short values, but a future prose cell must still be able
   to wrap, so nowrap is not applied here (only on headers, which are always
   short labels). */
.article-body tr + tr, .article-body tbody tr:first-child { border-top: 1px solid var(--line); }
.series-box { margin: 4px 0 32px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--control-radius); }
.series-label { font-size: .875rem; font-weight: 600; display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.series-progress { color: var(--muted); font-weight: 450; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.series-summary { margin-top: 8px; color: var(--muted); font-size: .8125rem; line-height: 1.65; text-wrap: pretty; }
.series-jump { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .8125rem; }
.series-jump a { text-decoration: none; }
.series-jump a:hover { text-decoration: underline; }
.series-all { color: var(--muted); }
.series-toc { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 28px; }
.series-toc h2 { font-size: 1rem; font-weight: 650; margin-bottom: 18px; }
.series-toc ol { list-style: none; display: grid; gap: 2px; counter-reset: none; margin: 0; padding: 0; }
.series-toc li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 10px; padding: 12px 10px; border-radius: var(--control-radius); }
.series-toc li.is-current { background: var(--surface); }
.series-number { grid-row: span 2; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.series-title { font-size: 1rem; line-height: 1.6; font-weight: 550; text-decoration: none; text-wrap: pretty; }
a.series-title:hover { text-decoration: underline; }
.series-here { margin-left: 8px; font-size: .75rem; font-weight: 450; color: var(--brand-ink); background: var(--brand); padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.series-excerpt { color: var(--muted); font-size: .8125rem; line-height: 1.6; text-wrap: pretty; }
.series-count { padding-top: 20px; color: var(--muted); font-size: .875rem; }
.post-tags { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post-tags-label { color: var(--muted); font-size: .8125rem; margin-right: 4px; }
.post-tags a { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .8125rem; text-decoration: none; color: var(--muted); }
.post-tags a:hover { background: var(--chrome); color: var(--ink); }
.related-posts { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 28px; }
.related-posts h2 { font-size: 1rem; font-weight: 650; margin-bottom: 18px; }
.related-posts > a { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding: 13px 0; font-size: 1rem; line-height: 1.65; text-decoration: none; }
.related-posts > a:hover { text-decoration: underline; }
.related-posts > a span { flex: 0 0 auto; }
.comments { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.comments h2, .comments h3 { font-size: 1.25rem; margin-bottom: 20px; }
.comment-list { padding-left: 0; list-style: none; }
.comment-list li { margin-block: 24px; }
.comment-metadata { font-size: .8125rem; color: var(--muted); }
.comments p { margin-bottom: 16px; }
.comments label { display: block; margin-bottom: 6px; }
.comments input:not([type="checkbox"]), .comments textarea { max-width: 100%; padding: 10px; border: 1px solid var(--frame); background: var(--paper); color: var(--ink); border-radius: 6px; }
.comments textarea { width: 100%; }
.comment-form-cookies-consent { display: flex; align-items: start; gap: 8px; }
.comment-form-cookies-consent input { margin-top: 7px; }
.page-desktop { padding-top: 48px; }
.page-window { max-width: 900px; margin: auto; }
.page-window .reading-article { padding-top: 48px; }
.site-footer { max-width: 1244px; margin: 0 auto; padding: 40px 36px 48px; display: flex; justify-content: space-between; align-items: start; gap: 32px; }
.footer-brand { font-size: 1.125rem; }
.site-footer p { margin-top: 6px; font-size: .8125rem; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: end; gap: 12px 22px; padding-top: 5px; }
.site-footer nav a { font-size: .75rem; color: var(--muted); }
.reader-large { --body-size: 1.25rem; }
.reader-focus .reading-layout { grid-template-columns: minmax(0, 1fr); }
.reader-focus .reading-sidebar { display: none; }
.reader-focus .reading-window { max-width: 900px; margin-inline: auto; }

@media (max-width: 1000px) {
  .menu-bar { padding-inline: 24px; gap: 28px; }
  .desktop { padding-inline: 24px; }
  .library-layout { grid-template-columns: 164px minmax(0, 1fr); }
  .library-sidebar { padding-inline: 10px; }
  .library-main { padding-inline: 24px; }
  .post-preview { grid-template-columns: minmax(0, .75fr) minmax(0, 1.3fr); gap: 20px; }
  .reading-layout { grid-template-columns: 190px minmax(0, 1fr); }
  .reading-sidebar { padding-inline: 16px; }
  .reading-article { padding: 40px 32px 56px; }
  .article-header h1 { font-size: 2.125rem; }
}
@media (max-width: 760px) {
  .menu-bar { min-height: 62px; gap: 20px; padding-inline: 20px; flex-wrap: wrap; }
  .site-brand { font-size: 1.3rem; }
  .primary-nav { gap: 18px; margin-left: auto; }
  .primary-nav a { font-size: .875rem; }
  .primary-nav a:nth-child(n+3) { display: none; }
  .theme-toggle { margin-left: 0; min-width: 84px; min-height: 36px; font-size: .75rem; }
  .desktop { padding: 28px 16px 0; }
  .desktop-intro { padding: 4px 4px 24px; }
  .desktop-intro h1 { font-size: 2.1rem; }
  .desktop-intro p { font-size: .8125rem; margin-top: 12px; }
  .library-layout { display: block; }
  .library-sidebar { padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-note { display: none; }
  .sidebar-label { margin: 0 0 8px; font-size: .75rem; }
  .library-sidebar .sidebar-label + .category-nav + .sidebar-label,
  .library-sidebar .tag-cloud + .sidebar-label { margin-top: 16px; }
  .series-toc li { grid-template-columns: 24px minmax(0, 1fr); padding: 10px 6px; }
  .series-jump { gap: 6px 14px; }
  .category-nav { display: flex; flex-wrap: wrap; gap: 6px; }
  .category-nav a { padding: 7px 9px; min-height: 36px; font-size: .75rem; gap: 8px; }
  .library-main { padding: 20px 20px 0; }
  .library-toolbar { gap: 12px; flex-wrap: wrap; padding-bottom: 20px; }
  .search-form { flex: 1; min-width: 190px; justify-content: end; }
  .search-form input { flex: 1; width: 145px; max-width: 260px; }
  .post-preview { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 26px 0; }
  .preview-copy h2 { font-size: 1.4rem; }
  .preview-copy > p { font-size: .9375rem; }
  .preview-copy .post-meta { margin-top: 10px; }
  .read-link { margin-top: 10px; min-height: 40px; }
  .reading-desktop { padding: 20px 12px 0; }
  .window-bar { padding-inline: 14px; grid-template-columns: 64px 1fr 64px; }
  .window-name { font-size: .75rem; }
  .reading-toolbar { padding: 10px 16px; gap: 8px; }
  /* Search takes its own row so the three controls keep their labels. */
  .reading-controls { gap: 6px; width: 100%; }
  .reading-controls .search-form { order: -1; flex: 1 0 100%; }
  .reading-controls button { padding: 5px 10px; font-size: .75rem; }
  .reading-layout { display: flex; flex-direction: column; }
  .reading-sidebar { position: static; width: 100%; padding: 0 22px; margin: 0; max-height: none; overflow: visible; order: 0; border-bottom: 1px solid var(--line); }
  .toc-disclosure summary { padding: 16px 0; }
  .toc { padding: 8px 0 16px; }
  .toc a { min-height: 44px; display: flex; align-items: center; }
  .back-top { display: none; }
  .reading-article { padding: 32px 22px 40px; }
  .article-header { margin-bottom: 28px; }
  .article-header h1 { font-size: clamp(1.75rem, 5.7vw, 2.2rem); line-height: 1.4; letter-spacing: -.025em; }
  .article-header .post-meta { margin-top: 18px; font-size: .8125rem; }
  .article-body { --body-size: 1.0625rem; line-height: 1.85; }
  .reader-large .article-body { --body-size: 1.1875rem; }
  .article-body > p:first-child { font-size: 1.04em; }
  .article-body h2 { font-size: 1.35em; margin-top: 2.2em; }
  .article-body pre { font-size: .8125rem; padding: 18px 16px; }
  .article-body figcaption { font-size: .75rem; }
  .article-body td, .article-body th { padding: 11px 12px; }
  .related-posts { margin-top: 40px; }
  .site-footer { padding: 28px 24px 36px; display: block; }
  .site-footer nav { justify-content: start; margin-top: 22px; gap: 14px 20px; }
  .site-footer nav a { min-height: 32px; display: flex; align-items: center; }
  .empty-state { padding: 40px 24px; }
}
@media (max-width: 370px) {
  .menu-bar { padding-inline: 14px; gap: 12px; }
  .primary-nav { gap: 12px; }
  .primary-nav a:nth-child(2) { display: none; }
  .reading-toolbar { padding-inline: 12px; }
  .reading-article { padding-inline: 18px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, .category-nav a, .toc a { transition: background-color 140ms ease-out, border-color 140ms ease-out; }
}
@media print {
  .lecture-note::details-content { display: block; content-visibility: visible; }
  .lecture-note > summary { break-after: avoid; }
  body { background: none; color: #22364a; }
  .site-header, .site-footer, .window-bar, .reading-toolbar, .reading-sidebar, .related-posts, .comments, .copy-code { display: none !important; }
  .desktop, .reading-article { padding: 0; max-width: none; }
  .desktop-window { border: 0; box-shadow: none; }
  .reading-layout { display: block; }
  .article-body { font-size: 11pt; }
  .article-body pre { max-height: none; white-space: pre-wrap; font-size: 9pt; }
  .article-body pre code { white-space: pre-wrap; }
  .article-body h2, .article-body h3 { break-after: avoid; }
  figure, tr { break-inside: avoid; }
}
