/* ─────────────────────────────────────────────
   TSUMUGURU / AIでつくったもの — 共通スタイル
   藍（indigo）と茜（madder）、明朝とゴシックの組み合わせ
   ───────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, p, ul, ol, li, table, figure, pre, blockquote { margin: 0; padding: 0; }
ol, ul { list-style: none; }
table { border-collapse: collapse; }
img { max-width: 100%; height: auto; display: block; }

:root {
  --ground:      #ffffff;
  --ground-2:    #f2f4f7;
  --panel:       #ffffff;
  --line:        #dde1e9;
  --line-soft:   #ecedf2;
  --ink:         #171c2b;
  --ink-soft:    #4d5470;
  --ink-faint:   #6e7589;
  --indigo:      #2f4d8f;
  --indigo-wash: #eaeff9;
  --madder:      #ab423a;
  --madder-wash: #fbefed;
  --code:        #f0f2f6;
  --code-block:  #1d2231;
  --code-ink:    #dfe2ea;

  --sans:  "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground:      #11141d;
    --ground-2:    #1a1e2a;
    --panel:       #191d28;
    --line:        #2f3542;
    --line-soft:   #242936;
    --ink:         #e8e8e2;
    --ink-soft:    #a8adbe;
    --ink-faint:   #7d8499;
    --indigo:      #8aa6de;
    --indigo-wash: #1d2438;
    --madder:      #d9756a;
    --madder-wash: #2c1e1d;
    --code:        #222836;
    --code-block:  #0c0f17;
    --code-ink:    #ccd2e0;
  }
}

:root[data-theme="dark"] {
  --ground:      #11141d;
  --ground-2:    #1a1e2a;
  --panel:       #191d28;
  --line:        #2f3542;
  --line-soft:   #242936;
  --ink:         #e8e8e2;
  --ink-soft:    #a8adbe;
  --ink-faint:   #7d8499;
  --indigo:      #8aa6de;
  --indigo-wash: #1d2438;
  --madder:      #d9756a;
  --madder-wash: #2c1e1d;
  --code:        #222836;
  --code-block:  #0c0f17;
  --code-ink:    #ccd2e0;
}

:root[data-theme="light"] {
  --ground:      #ffffff;
  --ground-2:    #f2f4f7;
  --panel:       #ffffff;
  --line:        #dde1e9;
  --line-soft:   #ecedf2;
  --ink:         #171c2b;
  --ink-soft:    #4d5470;
  --ink-faint:   #6e7589;
  --indigo:      #2f4d8f;
  --indigo-wash: #eaeff9;
  --madder:      #ab423a;
  --madder-wash: #fbefed;
  --code:        #f0f2f6;
  --code-block:  #1d2231;
  --code-ink:    #dfe2ea;
}

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--indigo); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }
strong { font-weight: 700; color: var(--ink); }

/* ── ページ枠 ───────────────────────────── */
.page {
  max-width: 54rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 4.5rem;
}

/* ── サイトナビ ─────────────────────────── */
.sitenav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.sitenav .brand {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
  text-decoration: none;
}

.sitenav .brand span { color: var(--ink-faint); font-size: .8rem; margin-left: .5rem; letter-spacing: .12em; }

.sitenav .back { font-size: .85rem; text-decoration: none; }
.sitenav .back:hover { text-decoration: underline; }

/* ── 見出し ─────────────────────────────── */
.eyebrow {
  font-size: .72rem;
  letter-spacing: .18em;
  color: var(--ink-faint);
  font-weight: 600;
}

h1 {
  font-family: var(--sans);
  font-size: clamp(1.75rem, 5.2vw, 2.6rem);
  line-height: 1.45;
  font-weight: 700;
  text-wrap: balance;
  letter-spacing: -.01em;
}

h2 {
  font-family: var(--sans);
  font-size: clamp(1.22rem, 3.6vw, 1.5rem);
  line-height: 1.55;
  font-weight: 700;
  text-wrap: balance;
  letter-spacing: -.005em;
  display: flex;
  align-items: baseline;
  gap: .75rem;
}

h2::before {
  content: "";
  flex: none;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--indigo);
  transform: translateY(-.15em);
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.7;
  color: var(--ink);
  letter-spacing: -.005em;
  padding-top: .9rem;
  border-top: 1px solid var(--line-soft);
}

/* ── 導入部 ─────────────────────────────── */
.lede { display: flex; flex-direction: column; gap: 1.5rem; }
.lede p { color: var(--ink-soft); }

.definition {
  font-family: var(--sans);
  font-size: clamp(1.02rem, 2.6vw, 1.14rem);
  line-height: 1.95;
  border-left: 2px solid var(--indigo);
  padding-left: 1.25rem;
}

.definition em {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--indigo-wash) 62%);
  padding: 0 .1em;
}

/* ── セクション ─────────────────────────── */
section { display: flex; flex-direction: column; gap: 1.4rem; }
section > p { color: var(--ink-soft); max-width: 46rem; }

.stack { display: flex; flex-direction: column; gap: 1.4rem; }

/* ── 本文リスト ─────────────────────────── */
ul.bullets { display: flex; flex-direction: column; gap: .6rem; }

ul.bullets li {
  color: var(--ink-soft);
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.85;
}

ul.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .82em;
  width: .3rem;
  height: 1px;
  background: var(--ink-faint);
}

/* ── コマンド・インラインコード ─────────── */
.cmd, code.inline {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--code);
  color: var(--indigo);
  padding: .12em .5em;
  border-radius: 3px;
  white-space: nowrap;
  font-weight: 600;
}

code.inline { color: var(--ink); font-weight: 500; }

/* ── コードブロック ─────────────────────── */
.codeblock { display: flex; flex-direction: column; gap: 0; }

.codeblock .cb-title {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--ink-faint);
  background: var(--ground-2);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: .5rem .9rem;
}

pre {
  background: var(--code-block);
  color: var(--code-ink);
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.75;
  padding: 1.1rem 1.2rem;
  border-radius: 4px;
  overflow-x: auto;
}

.codeblock .cb-title + pre { border-radius: 0 0 4px 4px; }
pre code { font: inherit; color: inherit; background: none; padding: 0; }

/* ── カード（比較・汎用） ───────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }

@media (min-width: 42rem) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.card-label {
  font-size: .72rem;
  letter-spacing: .14em;
  font-weight: 700;
  color: var(--ink-faint);
}

.card.is-before .card-label { color: var(--madder); }
.card.is-after  .card-label { color: var(--indigo); }

.card .quote { font-family: var(--sans); font-size: .98rem; font-weight: 600; line-height: 1.8; }

.card .note {
  font-size: .87rem;
  color: var(--ink-soft);
  line-height: 1.8;
  margin-top: auto;
  padding-top: .5rem;
  border-top: 1px solid var(--line-soft);
}

/* ── 手順（順序に意味があるものだけ） ───── */
ol.steps { display: flex; flex-direction: column; gap: 1.25rem; counter-reset: step; }

ol.steps > li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 1rem;
  align-items: start;
  counter-increment: step;
}

ol.steps > li::before {
  content: counter(step);
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 700;
  color: var(--indigo);
  background: var(--indigo-wash);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  line-height: 1;
}

ol.steps .st-title { font-weight: 700; line-height: 1.7; }
ol.steps .st-body { color: var(--ink-soft); font-size: .94rem; line-height: 1.85; }
ol.steps .st-title + .st-body { margin-top: .3rem; }
ol.steps .st-body + .st-body { margin-top: .7rem; }

/* ── 表 ─────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.data { width: 100%; font-size: .93rem; min-width: 28rem; }

table.data th {
  text-align: left;
  font-size: .72rem;
  letter-spacing: .12em;
  color: var(--ink-faint);
  font-weight: 700;
  padding: 0 1rem .6rem 0;
  border-bottom: 1px solid var(--line);
}

table.data td {
  padding: .8rem 1rem .8rem 0;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  line-height: 1.7;
}

table.data td:last-child { color: var(--ink-soft); padding-right: 0; }
table.data .nowrap { white-space: nowrap; }
table.data .strongcell { font-weight: 600; white-space: nowrap; }

/* ── 横並びフロー ───────────────────────── */
.flow-wrap { overflow-x: auto; padding-bottom: .5rem; }
.flow { display: flex; align-items: stretch; gap: .4rem; min-width: max-content; }

.flow-step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .7rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-width: 6.5rem;
}

.flow-step .fs-phase { font-size: .74rem; color: var(--ink-faint); font-weight: 600; }
.flow-arrow { display: grid; place-items: center; color: var(--line); font-size: .9rem; flex: none; }

/* ── Q&A・注意書き ─────────────────────── */
.qa { display: flex; flex-direction: column; gap: 1.5rem; }
.qa-item { display: flex; flex-direction: column; gap: .4rem; }
.qa-q { font-weight: 700; color: var(--madder); font-size: .95rem; line-height: 1.7; }
.qa-a { color: var(--ink-soft); font-size: .94rem; line-height: 1.85; }

.callout {
  background: var(--madder-wash);
  border-left: 2px solid var(--madder);
  border-radius: 0 4px 4px 0;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.callout .co-title { font-weight: 700; font-size: .9rem; color: var(--madder); }
.callout p { font-size: .9rem; color: var(--ink-soft); line-height: 1.85; }

/* ── 締め ───────────────────────────────── */
.closing {
  background: var(--indigo-wash);
  border-radius: 4px;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.closing .kicker {
  font-family: var(--sans);
  font-size: clamp(1.08rem, 3vw, 1.32rem);
  line-height: 1.75;
  text-wrap: balance;
}

.closing p { color: var(--ink-soft); font-size: .94rem; }

/* ── フッター ───────────────────────────── */
footer.site {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  font-size: .85rem;
  color: var(--ink-soft);
  line-height: 1.95;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

footer.site .sig { font-weight: 700; color: var(--ink); font-family: var(--sans); }
footer.site .fine { font-size: .78rem; color: var(--ink-faint); }

/* ── トップページ: 記事カード ───────────── */
.entries { display: flex; flex-direction: column; gap: 1rem; }

.entry {
  display: grid;
  grid-template-columns: 1fr;
  gap: .55rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.6rem 1.6rem 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .18s ease, transform .18s ease;
}

.entry:hover { border-color: var(--indigo); transform: translateY(-1px); }

@media (prefers-reduced-motion: reduce) {
  .entry { transition: none; }
  .entry:hover { transform: none; }
}

.entry .en-kind {
  font-size: .7rem;
  letter-spacing: .16em;
  font-weight: 700;
  color: var(--indigo);
}

.entry .en-title {
  font-family: var(--sans);
  font-size: clamp(1.1rem, 3vw, 1.28rem);
  line-height: 1.6;
  font-weight: 700;
  text-wrap: balance;
  letter-spacing: -.005em;
}

.entry .en-desc { font-size: .9rem; color: var(--ink-soft); line-height: 1.8; }

.entry .en-meta {
  font-size: .76rem;
  color: var(--ink-faint);
  font-family: var(--mono);
  letter-spacing: .02em;
  padding-top: .35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.entry .en-arrow {
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1;
  color: var(--indigo);
  flex: none;
  transition: transform .18s ease;
}

.entry:hover .en-arrow { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
  .entry .en-arrow { transition: none; }
  .entry:hover .en-arrow { transform: none; }
}
