:root {
  color-scheme: light;   /* OSのダーク設定に関係なくライト固定 */
  --bg:#f2f5f8; --ink:#171a1f; --soft:#363b43; --muted:#5b636e; --line:#e1e6ec;
  --accent:#2f56c8; --tint:#e8edf3;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif;
  line-height: 1.7; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
/* display を持つ要素でも hidden 属性を効かせる */
[hidden] { display: none !important; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 22px; }

/* masthead / nav */
.masthead { border-bottom: 1px solid var(--line); padding: 34px 0 22px; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.brand-sub { font-size: 13.5px; color: var(--muted); margin: 4px 0 16px; }
.nav { display: flex; gap: 6px; }
.nav a {
  font-size: 13.5px; font-weight: 600; text-decoration: none; color: var(--muted);
  padding: 5px 12px; border-radius: 8px;
}
.nav a[aria-current="page"] { color: var(--ink); background: var(--tint); }

main { padding: 8px 0 48px; }

/* article */
.post { padding: 32px 0; }
.feed .post + .post { border-top: 1px solid var(--line); }
.post-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cat { font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.post-meta time { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.post-title {
  font-family: inherit;
  font-size: 25px; line-height: 1.4; font-weight: 700; letter-spacing: -.005em;
  margin: 0 0 16px; text-wrap: balance;
}
.single .post-title { font-size: 28px; }
/* 共有リンクで開いた記事（起点）を淡く強調 */
.post.focus { background: var(--tint); border-radius: 8px; padding-left: 16px; padding-right: 16px; }
.post.focus::before { content: "共有リンクで開いた記事"; display: inline-block; font-size: 11px; font-weight: 700;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: 1px 8px; margin-bottom: 10px; }
.post-title a { color: var(--ink); text-decoration: none; }
.post-title a:hover { color: var(--accent); }
.post-body {
  font-family: inherit;
  font-size: 17px; line-height: 1.9; color: var(--soft);
}
.post-body p { margin: 0 0 16px; }
.post-body a { color: var(--accent); text-underline-offset: 3px; }
.post-body img { border-radius: 10px; margin: 6px 0; }
.post-body h2, .post-body h3 { font-family: inherit; line-height: 1.4; margin: 28px 0 12px; }

.backlink { margin-top: 34px; font-family: system-ui, sans-serif; font-size: 13.5px; }
.backlink a { text-decoration: none; }

/* archive list (/posts/) */
.archive { list-style: none; padding: 0; margin: 22px 0; }
.archive li { display: flex; gap: 14px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.archive time { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--muted); flex: none; }
.archive a { text-decoration: none; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 22px 0 44px; color: var(--muted); font-size: 12.5px; }

a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* infinite scroll affordances */
.feed-sentinel { height: 1px; }
.feed-loader { display: flex; justify-content: center; gap: 6px; padding: 26px 0; }
.feed-loader span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: fl 1s infinite ease-in-out both; }
.feed-loader span:nth-child(2) { animation-delay: .16s; }
.feed-loader span:nth-child(3) { animation-delay: .32s; }
.feed-end { text-align: center; color: var(--muted); font-size: 12.5px; padding: 26px 0 10px; letter-spacing: .03em; }
@keyframes fl { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .feed-loader span { animation: none; opacity: .5; } }

@media (max-width: 640px) {
  .post-title { font-size: 22px; }
  .single .post-title { font-size: 24px; }
  .post-body { font-size: 16px; }
}
