:root {
  --bg: #fdfdfb; --fg: #222; --muted: #6b6b66; --link: #1a5fb4; --rule: #e4e2da; --code-bg: #f3f2ec; --accent: #2b8a3e;
  --w: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16171a; --fg: #e6e4de; --muted: #9a9a93; --link: #7fb3ff; --rule: #2c2e33; --code-bg: #1f2126; --accent: #5fc46f; }
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif; line-height: 1.75; word-wrap: break-word; overflow-wrap: anywhere; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video, iframe { max-width: 100%; height: auto; }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
pre { background: var(--code-bg); padding: 0.8em 1em; overflow-x: auto; border-radius: 4px; line-height: 1.5; white-space: pre-wrap; }
table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
td, th { border: 1px solid var(--rule); padding: 0.2em 0.6em; vertical-align: top; overflow-wrap: normal; }
blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid var(--rule); color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--rule); }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 1.2rem; }
.site-header { border-bottom: 1px solid var(--rule); padding: 1.6rem 0 1rem; margin-bottom: 1.5rem; }
.site-header h1 { margin: 0; font-size: 1.6rem; letter-spacing: 0.02em; }
.site-header h1 a { color: var(--fg); }
.site-header .tagline { margin: 0.1rem 0 0.6rem; color: var(--muted); font-size: 0.95rem; }
.site-nav a { margin-right: 1.1rem; font-size: 0.95rem; }
.site-footer { border-top: 1px solid var(--rule); margin-top: 3rem; padding: 1.2rem 0 2.5rem; color: var(--muted); font-size: 0.85rem; }

.entry { margin-bottom: 2.6rem; }
.entry-title { font-size: 1.35rem; margin: 0 0 0.3rem; line-height: 1.4; }
.entry-title a { color: var(--fg); }
.entry-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.9rem; }
.entry-meta a { color: var(--muted); }
.entry-meta .tag::before { content: "#"; opacity: 0.6; }
.entry-meta .tag { margin-right: 0.5em; }
.entry-body { font-size: 1rem; }
.entry-body p { margin: 0.6em 0; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 2rem 0 0; font-size: 0.95rem; }
.pager .next { margin-left: auto; text-align: right; }
.pagenav { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; margin: 2rem 0; font-size: 0.95rem; }
.pagenav .current { font-weight: 600; color: var(--fg); }
h2.section { font-size: 1.15rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.3rem; margin: 0 0 1.2rem; }
h2.section small { color: var(--muted); font-weight: normal; font-size: 0.85rem; margin-left: 0.6em; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; gap: 1rem; padding: 0.3rem 0; border-bottom: 1px dotted var(--rule); }
.list time { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 6.5em; font-size: 0.9rem; }
.cloud { line-height: 2.1; }
.cloud a { margin-right: 0.9em; white-space: nowrap; }
.cloud a small { color: var(--muted); font-size: 0.75em; margin-left: 0.15em; }
.cols { columns: 2; column-gap: 2rem; }
@media (max-width: 480px) { .cols { columns: 1; } html { font-size: 15px; } }
.notice { color: var(--muted); font-size: 0.85rem; }

.comments { margin-top: 2.5rem; }
.comments h3 { font-size: 1.05rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.3rem; }
.comments h3 small { color: var(--muted); font-weight: normal; margin-left: 0.5em; }
.comment { padding: 0.7rem 0; border-bottom: 1px dotted var(--rule); }
.comment-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.3rem; }
.comment-body { font-size: 0.95rem; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
      background: rgba(10, 10, 12, 0.88); opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0s linear 0.22s; }
.lb.lb-open { opacity: 1; visibility: visible; transition: opacity 0.22s ease; }
.lb-fig { margin: 0; max-width: 94vw; max-height: 94vh; display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
          transform: scale(0.96); transition: transform 0.22s ease; }
.lb-open .lb-fig { transform: scale(1); }
.lb-img { max-width: 94vw; max-height: 86vh; width: auto; height: auto; object-fit: contain; border-radius: 4px;
          box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); background: #fff; opacity: 0; transition: opacity 0.18s ease; cursor: default; }
.lb-loaded .lb-img { opacity: 1; }
.lb-cap { color: #ddd; font-size: 0.85rem; white-space: pre; }
.lb-cap a { color: #fff; }
.lb button { position: absolute; border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 2rem; line-height: 1;
             width: 2.6rem; height: 2.6rem; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb button:hover { background: rgba(255, 255, 255, 0.28); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; margin-top: -1.3rem; }
.lb-next { right: 1rem; top: 50%; margin-top: -1.3rem; }
.lb-noscroll { overflow: hidden; }
@media (max-width: 600px) { .lb-prev, .lb-next { display: none !important; } }

/* layouts of two old blog-part widgets whose CSS lived in the Seesaa template */
.tweetBlockQuote { display: flex; gap: 0.7rem; align-items: flex-start; margin: 0.7rem 0; }
.tweetImg img { width: 48px; height: 48px; border-radius: 4px; }
.tweetMain { flex: 1; }
.tweetDate { color: var(--muted); font-size: 0.85rem; }
.tweetBoth { display: none; }
.amazlet-box { overflow: hidden; margin: 1rem 0; }
.amazlet-image img { max-width: 110px; }
figure.video { margin: 1rem 0; }
figure.video video { display: block; border-radius: 4px; }
