/* M's R&D — Experimental Journal / style.css
   1ファイル構成。黒背景・ミニマル。外部フォント/画像なし。 */
:root {
  color-scheme: dark;
  --bg: #0b0c0d; --raise: #121415; --ink: #e8ebeb; --muted: #98a1a1; --rule: #272b2d; --accent: #5eead4;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", Meiryo, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 1rem/1.9 var(--sans); letter-spacing: .02em; -webkit-font-smoothing: antialiased; }
body > * { width: 100%; max-width: 42rem; margin-inline: auto; padding-inline: 1.25rem; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-underline-offset: .25em; text-decoration-color: var(--muted); }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--accent); color: #04120f; padding: .6rem 1rem; z-index: 9; }
.skip-link:focus { top: 1rem; }

.site-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1.5rem; padding-block: 1.25rem; font-family: var(--mono); font-size: .8rem; }
.site-header a { text-decoration: none; }
.site-name { color: var(--ink); }
.site-link { color: var(--muted); }

main > section, main > article { padding-block: 2.5rem; border-top: 1px solid var(--rule); }
main > .intro { border-top: 0; padding-top: 3.5rem; }

h1 { font-size: clamp(2.2rem, 11vw, 3.6rem); font-weight: 300; line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere; }
.tagline { margin-top: 1.5rem; font-size: 1.15rem; line-height: 1.7; }
.intro > p:not(.tagline) { margin-top: .75rem; color: var(--muted); }
h2 { font-family: var(--mono); font-size: .8rem; font-weight: 400; letter-spacing: .08em; color: var(--accent); margin-bottom: 1.25rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 2rem 0 .5rem; }
section > p { color: var(--muted); }

/* 箇条書き */
.chain, .bullets { margin-top: 1.5rem; }
.chain li, .bullets li { position: relative; padding-left: 1.3rem; margin-top: .35rem; }
.chain li::before, .bullets li::before { content: ""; position: absolute; left: 0; top: .85em; width: .4rem; height: .4rem; background: var(--accent); }
.bullets { margin-top: 0; }
.bullets strong { font-family: var(--mono); color: var(--accent); font-size: .9em; margin-right: .5rem; }

/* 記事一覧 */
.posts li { display: grid; grid-template-columns: auto 1fr; gap: 0 1rem; padding: .9rem 0; border-top: 1px solid var(--rule); }
.posts li:first-child { border-top: 0; padding-top: 0; }
.posts time, .meta { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.posts a { grid-column: 1 / -1; font-weight: 700; text-decoration: none; margin-top: .15rem; }
.posts a:hover { text-decoration: underline; }
.tag { font-family: var(--mono); font-size: .78rem; color: var(--accent); }
.meta .tag { margin-left: 1rem; }

/* 記事ページ */
.post-head h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); font-weight: 400; line-height: 1.45; letter-spacing: 0; margin-top: .5rem; }
.nb { display: inline-block; }
.dek { margin-top: 1rem; color: var(--muted); }
.article-body { margin-top: 2rem; line-height: 2; }
.article-body p { margin-top: 1.1rem; }
.article-body h2 { font-family: var(--sans); font-size: 1.25rem; font-weight: 700; letter-spacing: 0; color: var(--ink); margin: 3rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); line-height: 1.5; }
.article-body h2 + p { margin-top: 1rem; }
.article-body .pull { font-weight: 700; border-left: 2px solid var(--accent); padding-left: 1rem; margin-block: 1.5rem; }
.article-body .flow { font-family: var(--mono); font-size: .92rem; color: var(--accent); background: var(--raise); border: 1px solid var(--rule); padding: .8rem 1rem; overflow-wrap: anywhere; }
.summary { background: var(--raise); border: 1px solid var(--rule); padding: 1.1rem 1.25rem; margin-bottom: 2.5rem; }
.article-body .summary h2 { font: 400 .8rem/1.5 var(--mono); letter-spacing: .08em; color: var(--accent); margin: 0 0 .5rem; padding: 0; border: 0; }
.summary li { position: relative; padding-left: 1.2rem; margin-top: .35rem; line-height: 1.8; }
.summary li::before { content: ""; position: absolute; left: 0; top: .8em; width: .4rem; height: .4rem; background: var(--accent); }
.back { padding-block: 1rem 2rem; font-family: var(--mono); font-size: .85rem; }
.back a { text-decoration: none; }

.site-footer { padding-block: 2.5rem 3rem; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--muted); }
.site-footer p + p { margin-top: .25rem; }
.site-footer a { color: var(--muted); }

/* ---------- メールレター誘導バー（下部固定・全幅） ----------
   Minimal Days のイメージに合わせた明るい配色。色は下の4変数だけ変えれば調整できます。
   対応: PC / タブレット / スマホ縦横 / iPhone（ノッチ・ホームバー）/ 文字拡大 / キーボード操作 */
html { scroll-padding-bottom: var(--promo-h, 0px); }  /* フォーカス・アンカー移動時にバーで隠れない */

body > .promo {
  --promo-bg: #f5f1ea;      /* 背景 */
  --promo-ink: #2b2a28;     /* 文字 */
  --promo-sub: #666158;     /* 補助文字 */
  --promo-key: #4f6b5c;     /* ボタン・罫線 */
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  width: 100%; max-width: none; margin: 0; padding: 0;
  background: var(--promo-bg); color: var(--promo-ink);
  border-top: 1px solid var(--promo-key);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .35);
  -webkit-tap-highlight-color: transparent;
}
body > .promo[hidden] { display: none; }
.promo :focus-visible { outline: 2px solid var(--promo-key); outline-offset: 2px; }

.promo-inner {
  display: flex; align-items: center; gap: .5rem .9rem;
  max-width: 62rem; margin-inline: auto;
  padding-top: .55rem;
  padding-bottom: calc(.55rem + env(safe-area-inset-bottom, 0px));      /* iPhoneのホームバー */
  padding-left: max(1rem, env(safe-area-inset-left, 0px));              /* 横向き時のノッチ */
  padding-right: max(.25rem, env(safe-area-inset-right, 0px));
}
.promo-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.promo-text strong { font-size: .9rem; }
.promo-text > span { display: none; font-size: .78rem; color: var(--promo-sub); }

.promo-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 1rem;                                    /* タップしやすい44px */
  font-family: var(--mono); font-size: .85rem; line-height: 1; letter-spacing: .02em;
  text-decoration: none; white-space: nowrap;
  background: var(--promo-key); color: #fff; border: 1px solid var(--promo-key);
}
.promo-close {
  flex: none; width: 44px; height: 44px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--promo-sub); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
@media (hover: hover) {
  .promo-btn:hover { background: transparent; color: var(--promo-key); }
  .promo-close:hover { color: var(--promo-ink); }
}

/* 幅30rem以上: 補助文を表示 */
@media (min-width: 30rem) { .promo-text > span { display: block; } }

/* PC・大きいタブレット */
@media (min-width: 52rem) {
  .promo-inner { padding-top: .8rem; padding-bottom: calc(.8rem + env(safe-area-inset-bottom, 0px)); padding-right: max(1.25rem, env(safe-area-inset-right, 0px)); gap: 1rem 1.25rem; }
  .promo-text { flex-direction: row; align-items: baseline; gap: 1rem; }
  .promo-text strong { font-size: 1rem; white-space: nowrap; }
  .promo-text > span { font-size: .85rem; }
  .promo-close { margin-right: -.5rem; }
}

/* 横向きスマホ（高さが小さい）: バーを薄くして本文を隠しすぎない */
@media (max-height: 30rem) and (orientation: landscape) {
  .promo-inner { padding-top: .3rem; padding-bottom: calc(.3rem + env(safe-area-inset-bottom, 0px)); }
  .promo-text { flex-direction: row; align-items: baseline; gap: .75rem; }
  .promo-text > span { display: none; }
  .promo-btn, .promo-close { min-height: 40px; height: 40px; }
}

/* 極小画面（折りたたみの外側など）: ボタンを詰める */
@media (max-width: 22rem) {
  .promo-text strong { font-size: .82rem; }
  .promo-btn { padding: 0 .75rem; font-size: .8rem; }
}

/* バーに隠れないよう、フッターへバーの実高さ分の余白（JSが --promo-h を設定。無い場合は6rem） */
body.has-promo .site-footer { padding-bottom: calc(var(--promo-h, 6rem) + 1.25rem); }

@media (forced-colors: active) { .promo { border-top: 2px solid CanvasText; } }
@media print { .promo { display: none; } }
