/* ほぐしや木田ブログ — 落ち着いた基調＋差し色 Museブルー #0A6CF0 */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #efede6;
  --text: #2e2a26;
  --text-soft: #6f6a61;
  --line: #ddd8cc;
  --accent: #0a6cf0;
  --accent-soft: #e3eefc;
  --shadow: 0 2px 10px rgba(46, 42, 38, 0.06);
  --shadow-hover: 0 10px 28px rgba(46, 42, 38, 0.13);
  --radius: 14px;
}
html[data-theme="dark"] {
  --bg: #17191d;
  --surface: #212429;
  --surface-2: #262a31;
  --text: #e8e6e1;
  --text-soft: #a3a099;
  --line: #353a42;
  --accent: #4d94ff;
  --accent-soft: #1d2f4d;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.5);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.85;
  font-size: 16.5px;
  transition: background 0.25s ease, color 0.25s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* 読書プログレスバー */
#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent); z-index: 60; transition: width 0.08s linear;
}

/* 読むと進むミニもち */
#progress-mochi {
  position: fixed; top: 5px; left: 0; z-index: 61; pointer-events: none;
  transition: left 0.08s linear; line-height: 0;
}
#progress-mochi svg { filter: drop-shadow(0 1px 3px rgba(46,42,38,.25)); }
#progress-star {
  position: absolute; top: -7px; right: -9px; font-size: 13px; line-height: 1;
  opacity: 0; transform: scale(.4); transition: opacity .25s ease, transform .25s ease;
}
#progress-mochi.done #progress-star { opacity: 1; transform: scale(1.15); }

/* 実験メーター */
.meter {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-top: 28px; box-shadow: var(--shadow);
}
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.meter-head h2 { font-size: 1.08rem; margin: 0; }
.meter-head span { color: var(--text-soft); font-size: .8rem; }
.meter-row { margin-top: 14px; }
.meter-label { display: flex; justify-content: space-between; font-size: .9rem; }
.meter-track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 5px; }
.meter-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 1s ease; }
#meter-toggle {
  margin-top: 16px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); border-radius: 999px; padding: 5px 14px; cursor: pointer; font-size: .86rem;
}
#meter-toggle:hover { border-color: var(--accent); }
#meter-detail { margin-top: 12px; font-size: .92rem; }
#meter-detail p { margin: 0 0 4px; }
#meter-detail .meter-source { color: var(--text-soft); font-size: .8rem; margin-top: 8px; }

/* ヘッダー */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 880px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px;
}
.brand { font-weight: 800; font-size: 1.12rem; color: var(--text); letter-spacing: 0.02em; }
.brand:hover { text-decoration: none; color: var(--accent); }
.brand small { display: block; font-weight: 500; font-size: 0.72rem; color: var(--text-soft); letter-spacing: 0.04em; }
.main-nav { margin-left: auto; display: flex; gap: 16px; align-items: center; font-size: 0.92rem; }
.main-nav a { color: var(--text); }
.main-nav a:hover { color: var(--accent); text-decoration: none; }
#theme-toggle {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 4px 13px; cursor: pointer; font-size: 0.85rem;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
#theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px 64px; }

/* ヒーロー */
.hero { padding: 52px 0 10px; text-align: left; }
.hero h1 { font-size: 1.9rem; line-height: 1.45; margin: 0 0 10px; }
.hero h1 .accent { color: var(--accent); }
.hero p { color: var(--text-soft); margin: 0; max-width: 620px; }

/* 記事カード */
.post-list { display: grid; gap: 22px; margin-top: 34px; }
.post-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.post-card a { color: inherit; display: block; }
.post-card a:hover { text-decoration: none; }
.post-card img { aspect-ratio: 1280 / 670; object-fit: cover; width: 100%; }
.post-card-body { padding: 18px 22px 22px; }
.post-card time { font-size: 0.82rem; color: var(--text-soft); }
.post-card h2 { font-size: 1.25rem; line-height: 1.5; margin: 6px 0 8px; }
.post-card p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }

/* 記事ページ */
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 30px 40px; margin-top: 30px; box-shadow: var(--shadow); }
.post-eyecatch { border-radius: 10px; margin-bottom: 26px; }
.post h1 { font-size: 1.65rem; line-height: 1.5; margin: 0 0 6px; }
.post time { color: var(--text-soft); font-size: 0.88rem; }
.post-body { margin-top: 22px; }
.post-body h2 {
  font-size: 1.22rem; line-height: 1.55; margin: 38px 0 12px;
  padding-left: 12px; border-left: 4px solid var(--accent);
}
.post-body p { margin: 0 0 1.05em; }
.post-body figure { margin: 26px 0; }
.post-body figure img { border-radius: 10px; border: 1px solid var(--line); margin: 0 auto; }
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 34px 0 18px; }
.checklist {
  background: var(--accent-soft); border-radius: 10px; padding: 16px 20px; margin: 24px 0;
}
.checklist p { margin: 0 0 6px; }
.checklist p:last-child { margin-bottom: 0; }
.tags { color: var(--accent); font-size: 0.92rem; }
.source-note { color: var(--text-soft); font-size: 0.84rem; line-height: 1.7; }
.note-box {
  margin-top: 36px; border: 1.5px dashed var(--accent); border-radius: 10px;
  padding: 16px 20px; background: var(--accent-soft); font-size: 0.95rem;
}
.note-box p { margin: 0; }
.back-link { display: inline-block; margin-top: 26px; font-size: 0.92rem; }

/* About */
.about-lead {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 30px; margin-top: 30px; box-shadow: var(--shadow);
}
.about-lead .truth { font-size: 1.3rem; font-weight: 800; line-height: 1.6; margin: 0 0 10px; }
.about-lead .truth .accent { color: var(--accent); }
.face-tabs { display: flex; gap: 10px; margin: 30px 0 0; }
.face-tab {
  flex: 1; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all 0.18s ease;
}
.face-tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.face-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 30px; margin-top: 14px; box-shadow: var(--shadow);
}
.face-panel h2 { margin-top: 0; font-size: 1.3rem; }
.face-panel[hidden] { display: none; }
.link-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.link-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; transition: transform 0.18s ease, box-shadow 0.18s ease; color: var(--text);
}
.link-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); text-decoration: none; }
.link-card strong { display: block; font-size: 1.02rem; margin-bottom: 4px; }
.link-card span { color: var(--text-soft); font-size: 0.88rem; }

/* トップへ戻る */
#to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 55;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 1.05rem; cursor: pointer; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.2s ease;
}
#to-top.show { opacity: 1; pointer-events: auto; }
#to-top:hover { transform: translateY(-3px); border-color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--line); margin-top: 10px;
  padding: 26px 20px 40px; text-align: center; color: var(--text-soft); font-size: 0.85rem;
}
.site-footer nav { display: flex; gap: 18px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .hero h1 { font-size: 1.5rem; }
  .post { padding: 24px 18px 30px; }
  .link-cards { grid-template-columns: 1fr; }
  .main-nav a.nav-sub { display: none; }
}
