:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1d1f1e;
  --muted: #6b6f6c;
  --line: #e2e0d8;
  --accent: #3d5a3a;
  --accent-soft: #e8eee5;
  --radius: 10px;
  --wrap: 760px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151716;
    --surface: #1e211f;
    --text: #e8e9e6;
    --muted: #9ba19c;
    --line: #2f3330;
    --accent: #9cc196;
    --accent-soft: #263023;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: 0.04em; }
.logo img { width: 40px; height: 40px; object-fit: contain; }
.site-nav { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 14px; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { border-bottom: 2px solid var(--accent); }

main { padding-top: 40px; padding-bottom: 64px; }

/* ホーム */
.hero { padding: 16px 0 24px; }
.hero h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.3; margin: 0 0 16px; letter-spacing: 0.06em; }
.lead { color: var(--muted); margin: 0; }

h2 { font-size: 22px; line-height: 1.5; margin: 56px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
h3 { font-size: 19px; line-height: 1.5; margin: 40px 0 12px; }
h4, h5, h6 { font-size: 17px; margin: 32px 0 8px; }

.tiles { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tiles a { display: block; height: 100%; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; line-height: 1.6; font-size: 15px; }
.tiles a:hover { border-color: var(--accent); }

/* 記事 */
.post-head { margin-bottom: 32px; }
.post-head h1 { font-size: clamp(24px, 5vw, 32px); line-height: 1.45; margin: 4px 0 8px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 999px; letter-spacing: 0.06em; }
.meta { color: var(--muted); font-size: 13px; margin: 0; }
.post p, .post ul, .post ol { margin: 0 0 1.4em; }
.post li { margin: 0.3em 0; }
figure { margin: 24px 0; }
figure img { border-radius: var(--radius); }
img.favicon { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; border-radius: 0; }
blockquote { margin: 24px 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
code { font-size: 0.9em; background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }

.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.6; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr:first-child td { font-weight: 700; background: var(--accent-soft); }

.video { position: relative; aspect-ratio: 16 / 9; margin: 24px 0; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.bookmark { display: flex; gap: 16px; margin: 24px 0; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.bookmark:hover { border-color: var(--accent); }
.bookmark-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.bookmark-title { font-weight: 700; line-height: 1.5; }
.bookmark-desc { color: var(--muted); font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bookmark-host { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.bookmark-thumb { flex: 0 0 160px; }
.bookmark-thumb img { width: 160px; height: 100%; max-height: 110px; object-fit: cover; border-radius: 6px; }
@media (max-width: 520px) {
  .bookmark { flex-direction: column-reverse; }
  .bookmark-thumb { flex-basis: auto; }
  .bookmark-thumb img { width: 100%; max-height: 180px; }
}

/* フッター */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0 40px; font-size: 13px; color: var(--muted); }
.social { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.social a { color: var(--text); text-decoration: none; }
.social a:hover { color: var(--accent); }
.copy { margin: 0; line-height: 1.7; }
