/* A small reading layer derived from AstroPaper. Edit the palette here. */
:root {
  --paper: #fafaf8;
  --ink: #222724;
  --muted: #626b66;
  --rule: #dce1dc;
  --accent: #256257;
  --link: #256257;
  --soft: #eff3ef;
  --code: #f0f2ee;
  --focus: #256257;
  --font: "Inter", "Noto Sans JP", "Noto Sans CJK JP", system-ui, sans-serif;
  --measure: 780px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #171f1d;
  --ink: #e8efeb;
  --muted: #a6b5ac;
  --rule: #36453e;
  --accent: #9bd0b7;
  --link: #9bd0b7;
  --soft: #202c26;
  --code: #1c2923;
  --focus: #9bd0b7;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.7 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: #78ac9055; }
a { color: var(--link); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; background: none; border: 0; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 2px; }
button:disabled { opacity: .5; cursor: not-allowed; }
img { max-width: 100%; height: auto; }
svg { max-width: 100%; }
h1,h2,h3,h4 { margin-top: 0; line-height: 1.3; letter-spacing: -.027em; font-weight: 650; text-wrap: pretty; }
p { margin-top: 0; margin-bottom: 1.25em; }
code,pre,kbd { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
code,pre,kbd,time,output { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.wrap { width: min(var(--measure), calc(100% - 64px)); margin-inline: auto; }
.sr-only { 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: -90px; left: 16px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 16px; }
.skip-link:focus { top: 10px; }
.muted, .section-kicker { color: var(--muted); }
.section-kicker { font-size: 12px; letter-spacing: .035em; }
.text-link { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; }
.text-link svg { width: 18px; height: 18px; }
/* Header: identity and utilities, not a hero banner. */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 100px; border-bottom: 1px solid var(--rule); }
.wordmark { color: var(--ink); font-size: 21px; letter-spacing: -.045em; font-weight: 650; text-decoration: none; white-space: nowrap; }
.header-right, .desktop-nav { display: flex; align-items: center; }
.header-right { gap: 7px; }
.desktop-nav { gap: 24px; margin-right: 14px; }
.desktop-nav a { color: var(--ink); font-size: 14px; text-decoration: none; }
.desktop-nav a:hover, .desktop-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.icon-button { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; color: var(--ink); flex: none; padding: 8px; }
.icon-button:hover { background: var(--soft); }
.site-header svg { width: 20px; height: 20px; }
.mobile-nav { display: none; }
/* Home / archive. No cards, banners, or motion needed to read the list. */
.intro { padding-block: 51px 27px; }
.intro h1 { font-size: clamp(29px, 4vw, 37px); margin: 0 0 18px; line-height: 1.23; letter-spacing: -.035em; }
.intro p { max-width: 700px; font-size: 17px; line-height: 1.85; margin-bottom: 18px; }
.intro-links { display: flex; gap: 23px; font-size: 14px; }
.preview-banner { color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 5px 14px; padding-block: 12px; border-block: 1px dashed var(--rule); }
.preview-banner a { margin-left: auto; white-space: nowrap; }
.writing-section { padding-block: 35px 68px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: 0 0 3px; }
.section-heading h2 { margin: 0; font-size: 21px; }
.section-heading>a { font-size: 13px; }
.post-row { padding-block: 24px 23px; position: relative; border-bottom: 1px solid var(--rule); }
.post-list .post-row:last-child { border-bottom: 0; }
.post-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.post-meta .eyebrow { color: var(--muted); font-weight: 500; }
.meta-dot { opacity: .65; }
.sample-badge, .language-badge { color: var(--accent); font-size: 11px; border: 1px solid var(--rule); border-radius: 3px; padding: 0 5px; margin-left: 3px; }
.post-row h3 { font-size: 22px; line-height: 1.4; margin: 7px 0 6px; }
.post-row h3 a { text-decoration: none; }
.post-row h3 a:hover { text-decoration: underline; }
.post-row p { font-size: 15px; line-height: 1.8; margin: 0; color: var(--muted); }
.site-footer { border-top: 1px solid var(--rule); padding-block: 25px 35px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 23px; font-size: 13px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.colophon { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 20px; margin-top: 17px; font-size: 11px; color: var(--muted); }
.colophon a { color: inherit; }
.page-main { padding-block: 48px 75px; min-height: 60vh; }
.page-intro { margin-bottom: 30px; }
.page-intro h1 { font-size: 36px; margin-block: 5px 15px; }
.page-intro>p { color: var(--muted); font-size: 17px; max-width: 690px; }
.inline-notice { border-left: 2px solid var(--accent); background: var(--soft); color: var(--muted); padding: 12px 16px; font-size: 13px; }
.filters { display: flex; gap: 6px 17px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); padding-block: 5px 15px; }
.filters button { font-size: 14px; padding: 5px 2px; color: var(--muted); border-bottom: 2px solid transparent; }
.filters button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.no-posts, .empty-state { padding: 25px 0; color: var(--muted); }
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px; margin-bottom: 40px; }
.qa-grid section { border-top: 1px solid var(--rule); padding-top: 18px; }
.qa-grid h2 { font-size: 18px; margin-bottom: 10px; }
.qa-grid p { color: var(--muted); font-size: 14px; }
/* Articles stay in one column, including their optional table of contents. */
.post-main { padding-block: 43px 60px; }
.post-header, .article-grid, .post-end { width: min(var(--measure), calc(100% - 64px)); margin-inline: auto; }
.back-link { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 24px; text-decoration: none; }
.post-header .post-meta { margin-bottom: 14px; }
.post-header h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.23; letter-spacing: -.04em; margin-bottom: 19px; }
.post-description { font-size: 18px; line-height: 1.8; color: var(--muted); margin-bottom: 20px; }
.post-byline { display: flex; flex-wrap: wrap; font-size: 13px; gap: 6px; color: var(--muted); }
.translation-link { margin-left: auto; }
.resource-links { display: flex; gap: 19px; margin-top: 20px; font-size: 14px; }
.sample-notice { font-size: 12px; border-left: 2px solid var(--accent); padding: 10px 15px; background: var(--soft); margin-block: 25px 28px; }
.sample-notice strong { color: var(--accent); }
.sample-notice p { color: var(--muted); margin: 2px 0 0; line-height: 1.65; }
.article-grid { min-width: 0; }
.toc { font-size: 13px; margin: 0 0 35px; border-bottom: 1px solid var(--rule); padding: 0 0 15px; }
.toc summary { cursor: pointer; color: var(--muted); font-weight: 550; }
.toc ol { list-style: none; padding: 9px 0 0 17px; margin: 0; columns: 2; column-gap: 30px; }
.toc li { break-inside: avoid; padding: 3px 0; }
.toc li.depth-3 { padding-left: 12px; }
.toc a { text-decoration: none; }
.toc a[aria-current="true"] { text-decoration: underline; }
.prose { font-size: 17px; line-height: 1.92; min-width: 0; overflow-wrap: anywhere; }
.prose:lang(ja) { line-height: 2.05; letter-spacing: .015em; }
.prose p { margin: 0 0 1.45em; }
.prose h2 { font-size: 26px; margin: 1.9em 0 .75em; scroll-margin-top: 26px; }
.prose h3 { font-size: 21px; margin: 1.65em 0 .7em; scroll-margin-top: 26px; }
.prose h4 { font-size: 18px; margin: 1.4em 0 .7em; }
.prose>h2:first-child, .prose>h3:first-child { margin-top: 0; }
.prose strong { font-weight: 700; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.prose ul, .prose ol { padding-left: 1.6em; margin: 0 0 1.5em; }
.prose li { padding-left: .15em; margin: .25em 0; }
.prose li>p { margin: .4em 0; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 1.6em 0; padding: .25em 0 .25em 1.2em; color: var(--muted); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose :not(pre)>code { background: var(--code); font-size: .85em; border-radius: 3px; padding: .13em .28em; }
.prose pre { background: var(--code) !important; font-size: 13px; line-height: 1.8; padding: 20px; overflow-x: auto; max-width: 100%; white-space: pre; border: 1px solid var(--rule); border-radius: 4px; margin: 1.5em 0; tab-size: 2; }
.prose pre code { font-size: inherit; background: none; padding: 0; }
.code-wrap { margin: 1.6em 0; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; min-width: 0; }
.code-wrap pre { margin: 0; border: 0; border-radius: 0; }
.code-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; font-size: 11px; border-bottom: 1px solid var(--rule); color: var(--muted); background: var(--soft); }
.code-toolbar button { font-size: 11px; padding: 2px 5px; }
.code-toolbar button:hover { color: var(--ink); }
html[data-theme="dark"] .astro-code, html[data-theme="dark"] .astro-code span { color: var(--shiki-dark) !important; background-color: var(--shiki-dark-bg) !important; }
html[data-theme="light"] .astro-code, html[data-theme="light"] .astro-code span { color: var(--shiki-light) !important; }
.astro-code .line.diff.add { background: #3b8d3030 !important; }
.astro-code .line.diff.remove { background: #bc4d4d28 !important; }
.astro-code .line.highlighted { background: #81986e26 !important; }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.6em 0; font-size: 14px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.prose th,.prose td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--rule); }
.prose th { background: var(--soft); font-weight: 650; white-space: nowrap; }
.table-scroll { overflow-x: auto; width: 100%; margin: 1.6em 0; }
.table-scroll table { display: table; min-width: 100%; margin: 0; overflow: visible; }
.table-scroll td { min-width: 80px; }
.prose td[align=right],.prose th[align=right] { text-align: right; }
.prose figure { margin: 1.8em 0; }
.prose figure img,.prose>p>img { display: block; width: 100%; border: 1px solid var(--rule); border-radius: 3px; background: #fafaf8; }
.prose figcaption { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 11px; }
.zoom-image { display: block; padding: 0; width: 100%; cursor: zoom-in; }
.zoom-image img { width: 100%; display: block; }
#image-viewer { width: min(1280px,95vw); max-width: 95vw; max-height: 92vh; padding: 18px; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; color: var(--ink); }
#image-viewer::backdrop { background: #0d1619ba; }
#image-viewer img { display: block; width: 100%; max-height: 78vh; object-fit: contain; }
.close-viewer { display: block; margin: 0 0 12px auto; font-size: 13px; padding: 5px 10px; }
.prose .katex { font-size: 1.08em; }
.prose .katex-display { overflow-x: auto; overflow-y: hidden; padding: 12px 2px; margin: 1.6em 0; max-width: 100%; }
.prose .katex-display>.katex { white-space: nowrap; }
.prose .math { max-width: 100%; }
.prose .math.display { overflow-x: auto; overflow-y: hidden; margin: 1.5em 0; padding: 12px 0; }
.prose .math.display svg { max-width: none; }
.prose details { background: var(--soft); border: 1px solid var(--rule); border-radius: 3px; padding: 12px 16px; margin: 1.5em 0; font-size: 15px; }
.prose details>summary { cursor: pointer; font-weight: 550; }
.prose details>p { margin: 12px 0 0; }
.prose sup { line-height: 0; }
.footnotes { border-top: 1px solid var(--rule); color: var(--muted); font-size: 13px; margin-top: 40px; padding-top: 20px; }
.footnotes ol { padding-left: 22px; }
.footnotes p { margin: .4em 0; }
.footnote-ref { font-size: .78em; padding-inline: 2px; }
.post-end { margin-top: 45px; border-top: 1px solid var(--rule); padding-top: 25px; }
.tags { display: flex; gap: 8px 20px; flex-wrap: wrap; font-size: 12px; }
.tags a { text-decoration: none; }
.tags a::before { content: '#'; }
.post-end-row { display: flex; justify-content: space-between; margin: 22px 0 36px; font-size: 13px; }
.post-end>h2 { font-size: 20px; }
/* Search */
.search-form>label { display: block; font-size: 13px; margin-bottom: 9px; }
.search-field { display: flex; gap: 12px; align-items: center; background: var(--soft); border: 1px solid var(--rule); border-radius: 4px; padding: 8px 13px; }
.search-field svg { flex: none; }
.search-field input { background: none; border: 0; color: var(--ink); min-width: 0; width: 100%; font-size: 17px; padding: 6px 0; }
.search-field input:focus { outline: none; }
.search-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-field kbd { font-size: 12px; color: var(--muted); border: 1px solid var(--rule); padding: 0 5px; border-radius: 2px; }
#search-status { font-size: 13px; margin-top: 18px; }
.search-hit { padding: 24px 0; border-bottom: 1px solid var(--rule); }
.search-hit>span { font-size: 11px; color: var(--muted); }
.search-hit h2 { font-size: 22px; margin: 7px 0; }
.search-hit h2 a { text-decoration: none; }
.search-hit p { font-size: 14px; color: var(--muted); margin: 0; }
/* Framework-free MDX example */
.mixture-explorer { background: var(--soft); border: 1px solid var(--rule); border-radius: 4px; padding: 24px; margin: 30px 0; }
.demo-heading { display: flex; flex-direction: column; gap: 7px; }
.demo-heading strong { font-size: 22px; }
.mixture-explorer>p { font-size: 14px; color: var(--muted); margin: 10px 0 20px; }
.mixture-explorer label { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 550; }
.mixture-explorer input { display: block; width: 100%; margin: 12px 0 22px; accent-color: var(--accent); }
.mixture-bar { height: 26px; display: flex; overflow: hidden; border-radius: 3px; border: 1px solid var(--rule); }
.mixture-bar span { display: block; }
[data-web-bar] { background: #256257; }
[data-books-bar] { background: #9bbf9d; }
[data-code-bar] { background: #5f8390; }
.small-button { border: 1px solid var(--rule); background: var(--paper); padding: 5px 16px; font-size: 13px; border-radius: 3px; }
.not-found h1 { max-width: 560px; font-size: 40px; margin-top: 20px; }
/* Small screens retain readable type. Only wide code / math / data scroll. */
@media (max-width: 600px) {
 .wrap, .post-header, .article-grid, .post-end { width: calc(100% - 40px); }
 .site-header { min-height: 82px; gap: 12px; }
 .wordmark { font-size: 20px; }
 .desktop-nav { display: none; }
 .header-right { gap: 2px; }
 .icon-button { width: 34px; height: 38px; padding: 7px; }
 .mobile-nav { display: block; position: relative; margin-left: 5px; }
 .mobile-nav>summary { display: flex; gap: 5px; padding: 8px 0 8px 5px; list-style: none; font-size: 12px; cursor: pointer; }
 .mobile-nav>summary::-webkit-details-marker { display: none; }
 .mobile-nav nav { position: absolute; top: 42px; right: 0; z-index: 10; display: grid; width: 155px; padding: 8px; background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; }
 .mobile-nav nav a { padding: 8px; font-size: 14px; text-decoration: none; }
 .intro { padding-top: 34px; }
 .intro h1 { font-size: 30px; line-height: 1.25; }
 .intro p { font-size: 16px; line-height: 1.88; }
 .preview-banner { font-size: 11px; }
 .preview-banner a { margin-left: 0; }
 .writing-section { padding-top: 28px; }
 .post-row { padding-block: 22px; }
 .post-row h3 { font-size: 21px; }
 .post-row p { font-size: 14px; }
 .post-meta { font-size: 11px; gap: 5px; }
 .section-heading h2 { font-size: 20px; }
 .section-heading>a { font-size: 12px; }
 .page-main { padding-top: 34px; }
 .page-intro h1 { font-size: 32px; }
 .page-intro>p { font-size: 16px; }
 .post-main { padding-top: 31px; }
 .post-header h1 { font-size: 31px; line-height: 1.28; }
 .post-description { font-size: 17px; }
 .post-byline { font-size: 12px; }
 .translation-link { margin-left: 0; width: 100%; margin-top: 6px; }
 .prose { font-size: 16.5px; line-height: 1.95; }
 .prose h2 { font-size: 24px; }
 .prose h3 { font-size: 20px; }
 .prose pre { padding: 16px; font-size: 12px; }
 .prose table { font-size: 13px; }
 .prose th, .prose td { padding: 10px; }
 .toc ol { columns: 1; }
 .mixture-explorer { padding: 19px; }
 .qa-grid { grid-template-columns: 1fr; gap: 12px; }
 .colophon { font-size: 10px; }
}
@media (max-width: 360px) {
 .wrap, .post-header, .article-grid, .post-end { width: calc(100% - 32px); }
 .wordmark { font-size: 18px; }
 .icon-button { width: 30px; }
 .intro h1, .post-header h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media print {
 :root { --paper: white; --ink: black; --muted: #444; --rule: #bbb; --accent: #222; --soft: white; --code: white; --link: black; }
 .header-right,.preview-banner,.sample-notice,.site-footer,.toc,.code-toolbar,.post-end,.resource-links,.back-link { display: none !important; }
 .wrap,.post-header,.article-grid,.post-end { width: 100%; max-width: none; }
 .post-main { padding: 20px 0; }
 .prose { font-size: 11pt; }
 .prose pre { white-space: pre-wrap; }
 .post-header h1 { font-size: 25pt; }
 a { text-decoration: none; }
}

.theme-toggle span{display:flex;align-items:center;justify-content:center} :root[data-theme="light"] .theme-sun{display:none} :root[data-theme="dark"] .theme-moon{display:none}
