/* Field Notes。色は Atelier MoJa のサイトにそろえた */
:root {
  --paper: #FBF8F2;
  --card: #FFFFFF;
  --ink: #2A2724;
  --muted: #7A736B;
  --rule: #E6E0D5;
  --accent: #3F6F8F;
  --zebra: #F6F2EA;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1A1917;
    --card: #23211E;
    --ink: #E8E3DA;
    --muted: #A39B90;
    --rule: #3A3631;
    --accent: #8DB6D1;
    --zebra: #201E1B;
  }
}
:root[data-theme="dark"] {
  --paper: #1A1917;
  --card: #23211E;
  --ink: #E8E3DA;
  --muted: #A39B90;
  --rule: #3A3631;
  --accent: #8DB6D1;
  --zebra: #201E1B;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans JP", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3, p, li { word-break: auto-phrase; }

.bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.bar a { color: var(--ink); text-decoration: none; }
.bar .site { font-weight: 600; letter-spacing: .02em; }
.bar nav a { color: var(--muted); }

.foot {
  max-width: 1080px; margin: 64px auto 0; padding: 24px 16px 48px;
  border-top: 1px solid var(--rule);
  color: var(--muted); font-size: 13px;
}

/* トップ */
.top { max-width: 720px; margin: 0 auto; padding: 48px 16px 0; }
.top h1 { font-size: 32px; font-weight: 600; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 40px; }
.posts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.posts li { border-bottom: 1px solid var(--rule); }
.posts a { display: grid; gap: 4px; padding: 20px 0; color: var(--ink); text-decoration: none; }
.posts time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.posts .t { font-size: 20px; font-weight: 600; line-height: 1.5; }
.posts .s { color: var(--muted); font-size: 15px; }
.posts a:hover .t { color: var(--accent); }

/* 記事 */
.post { max-width: 1080px; margin: 0 auto; padding: 40px 16px 0; }
.post.narrow { max-width: 720px; }
.post-head { max-width: 720px; margin: 0 0 32px; }
.post-head .date { color: var(--muted); font-size: 13px; margin: 0; font-variant-numeric: tabular-nums; }
.post h1 { font-size: 28px; line-height: 1.45; font-weight: 600; margin: 4px 0 8px; }
.subtitle { color: var(--muted); margin: 0; }
.en { margin: 12px 0 0; font-size: 14px; }

.post-grid { display: block; }
.toc {
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--card);
  padding: 12px 16px; margin: 0 0 32px;
  font-size: 14px; line-height: 1.6;
}
.toc-h { margin: 0 0 6px; font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 4px 0; }
.toc li.sub { padding-left: 1em; font-size: 13px; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover, .toc a.here { color: var(--accent); }

@media (min-width: 960px) {
  .post-grid { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 48px; }
  .toc { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; margin: 0; }
}

.body { min-width: 0; }
.body h2 { font-size: 21px; font-weight: 600; margin: 48px 0 12px; padding-top: 12px; border-top: 1px solid var(--rule); }
.body h3 { font-size: 17px; font-weight: 600; margin: 32px 0 8px; }
.body p { margin: 0 0 1em; }
.body ol, .body ul { padding-left: 1.6em; margin: 0 0 1em; }
.body li { margin: .3em 0; }
.body code { font-size: .9em; background: var(--zebra); padding: .1em .3em; border-radius: 4px; }

.table { overflow-x: auto; margin: 16px 0 20px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.55; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 13px; white-space: nowrap; }
tbody tr:nth-child(even) { background: var(--zebra); }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
