/* ANIUMA article design system
   journal / case 共通。記事本文（.body 内）で使う部品集。
   スクロール発火アニメは /scripts/article.js が .in を付与して駆動する。 */

:root {
  --paper: #faf8f4;
  --ink: #2b2622;
  --sub: #7a716a;
  --line: #e5ded4;
  --accent: #c46a42;
  --accent-soft: #f3e2d7;
  --box: #f4f0e8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: "Zen Kaku Gothic New", sans-serif; font-feature-settings: "palt"; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 680px; margin: 0 auto; padding: 12vh 24px; }
.back { font-size: 12px; letter-spacing: .12em; color: var(--sub); text-decoration: none; }
.date { margin-top: 32px; font-size: 12px; letter-spacing: .14em; color: var(--accent); }
h1 { font-family: "Shippori Mincho", serif; font-size: 26px; line-height: 1.7; letter-spacing: .06em; margin-top: 12px; }
.tags { margin-top: 14px; font-size: 11px; letter-spacing: .1em; color: var(--sub); }
.body { margin-top: 6vh; border-top: 1px solid var(--line); padding-top: 6vh; }

/* ---- 基本タイポグラフィ ---- */
.body p { font-size: 15px; line-height: 2.3; letter-spacing: .04em; margin-bottom: 1.8em; }
/* 日本語の組版: 両端揃え＋文字間で調整し、行末のガタつきをなくす */
.body p, .body li, .body blockquote { text-align: justify; text-justify: inter-character; line-break: strict; }
.body h2 { font-family: "Shippori Mincho", serif; font-size: 19px; letter-spacing: .08em; margin: 2.6em 0 1em; counter-increment: sec; display: flex; align-items: baseline; gap: 14px; }
.body { counter-reset: sec; }
.body h2::before { content: counter(sec, decimal-leading-zero); font-family: "Zen Kaku Gothic New", sans-serif; font-size: 11px; letter-spacing: .18em; color: var(--accent); }
.body h3 { font-size: 16px; letter-spacing: .06em; margin: 2em 0 .8em; }
.body a { color: var(--accent); }
.body ul, .body ol { margin: 0 0 1.8em 1.4em; font-size: 15px; line-height: 2.1; }
.body img { max-width: 100%; border-radius: 8px; }
.body blockquote { border-left: 2px solid var(--accent); padding-left: 1.2em; color: var(--sub); margin-bottom: 1.8em; }
.body blockquote p { margin-bottom: .6em; }
.body code { background: #f0ebe2; padding: .1em .4em; border-radius: 4px; font-size: .9em; }
.body pre { background: #2b2622; color: #f5f1ea; padding: 1.2em 1.4em; border-radius: 10px; overflow-x: auto; margin-bottom: 1.8em; }
.body pre code { background: none; padding: 0; }
.body hr { border: none; border-top: 1px solid var(--line); margin: 3em 0; }

/* ---- 読了プログレスバー（article.jsが生成） ---- */
.read-progress { position: fixed; top: 0; left: 0; width: 100%; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: 0 0; z-index: 60; pointer-events: none; }

/* ---- コードコピーボタン（article.jsが生成） ---- */
.body pre { position: relative; }
.body pre .code-copy {
  position: absolute; top: 8px; right: 8px; font: inherit; font-size: 11px; letter-spacing: .08em;
  color: #f5f1ea; background: rgba(255,255,255,.12); border: none; border-radius: 6px;
  padding: 5px 12px; cursor: pointer; opacity: 0; transition: opacity .25s, background .25s;
}
.body pre:hover .code-copy, .body pre .code-copy:focus-visible, .body pre .code-copy.done { opacity: 1; }
.body pre .code-copy:hover { background: rgba(255,255,255,.22); }
.body pre .code-copy.done { color: #2b2622; background: var(--accent-soft); }
@media (hover: none) { .body pre .code-copy { opacity: 1; } }

/* ---- リード文: 記事冒頭の導入。最初の段落を少し大きく ---- */
.body .lead { font-size: 17px; line-height: 2.4; color: var(--ink); }

/* ---- スクロール発火の共通挙動 ---- */
.fx { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s ease; }
.fx.in { opacity: 1; transform: none; }

/* ---- プルクオート: 本文から抜き出す一文 ---- */
.pull { margin: 2.6em 0; padding: 0; border: none; text-align: center; position: relative; }
.pull p { font-family: "Shippori Mincho", serif; font-size: 19px; line-height: 2; letter-spacing: .08em; color: var(--ink); margin: 0; }
.pull::before, .pull::after { content: ""; display: block; width: 32px; height: 1px; background: var(--accent); margin: 1.4em auto; transform: scaleX(0); transition: transform .9s ease .2s; }
.pull.in::before, .pull.in::after { transform: scaleX(1); }

/* ---- まとめボックス: 要点・TL;DR ---- */
.box { background: var(--box); border-radius: 12px; padding: 1.6em 1.8em; margin: 0 0 2em; }
.box .box-t { font-size: 11px; letter-spacing: .2em; color: var(--accent); margin-bottom: 1em; }
.box ul { margin: 0 0 0 1.2em; }
.box p { margin-bottom: 0; }

/* ---- 注記: 補足・免責 ---- */
.note { border: 1px solid var(--line); border-radius: 12px; padding: 1.3em 1.6em; margin: 0 0 2em; font-size: 13px; color: var(--sub); }
.note p { font-size: 13px; line-height: 2; margin-bottom: 0; }

/* ---- キーナンバー: 数字の強調（data-count でカウントアップ） ---- */
.kv { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 2em; }
.kv > div { flex: 1 1 140px; background: var(--box); border-radius: 12px; padding: 1.3em 1.2em; }
.kv .n { font-family: "Shippori Mincho", serif; font-size: 30px; letter-spacing: .04em; color: var(--accent); line-height: 1.2; }
.kv .n small { font-size: 14px; margin-left: 2px; }
.kv .l { font-size: 11.5px; letter-spacing: .08em; color: var(--sub); margin-top: .6em; line-height: 1.7; }

/* ---- チェックリスト: スクロールでチェックが入る ---- */
.checks { list-style: none; margin: 0 0 2em !important; }
.checks li { position: relative; padding: .55em 0 .55em 2.1em; font-size: 15px; line-height: 2; border-bottom: 1px dashed var(--line); }
.checks li::before { content: ""; position: absolute; left: 0; top: .95em; width: 17px; height: 17px; border: 1.5px solid var(--sub); border-radius: 5px; }
.checks li::after { content: ""; position: absolute; left: 4px; top: 1.12em; width: 9px; height: 5px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg) scale(0); transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.checks.in li::after { transform: rotate(-45deg) scale(1); }
.checks.in li:nth-child(1)::after { transition-delay: .15s; }
.checks.in li:nth-child(2)::after { transition-delay: .4s; }
.checks.in li:nth-child(3)::after { transition-delay: .65s; }
.checks.in li:nth-child(4)::after { transition-delay: .9s; }
.checks.in li:nth-child(5)::after { transition-delay: 1.15s; }
.checks.in li:nth-child(6)::after { transition-delay: 1.4s; }

/* ---- 比較テーブル: モデル比較など。横スクロール対応 ---- */
.tbl { overflow-x: auto; margin: 0 0 2em; -webkit-overflow-scrolling: touch; }
.tbl table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 13.5px; line-height: 1.9; }
.tbl th { font-size: 11px; letter-spacing: .12em; color: var(--sub); font-weight: 500; text-align: left; padding: .7em .9em; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.tbl td { padding: .85em .9em; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr td:first-child { font-weight: 700; white-space: nowrap; }
.tbl .pick td { background: var(--accent-soft); }
.tbl .pick td:first-child::after { content: "採用"; font-size: 10px; font-weight: 500; letter-spacing: .1em; color: #fff; background: var(--accent); border-radius: 4px; padding: .15em .5em; margin-left: .7em; vertical-align: 1px; }
.tbl.fx tr { opacity: 0; transform: translateY(8px); transition: opacity .6s ease, transform .6s ease; }
.tbl.fx.in tr { opacity: 1; transform: none; }
.tbl.fx.in tr:nth-child(1) { transition-delay: .05s; }
.tbl.fx.in tr:nth-child(2) { transition-delay: .15s; }
.tbl.fx.in tr:nth-child(3) { transition-delay: .25s; }
.tbl.fx.in tr:nth-child(4) { transition-delay: .35s; }
.tbl.fx.in tr:nth-child(5) { transition-delay: .45s; }
.tbl.fx.in tr:nth-child(6) { transition-delay: .55s; }

/* ---- タイムライン: 実装の経過・年表 ---- */
.tl { list-style: none; margin: 0 0 2em !important; position: relative; padding-left: 24px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); transform-origin: top; transform: scaleY(0); transition: transform 1.2s ease; }
.tl.in::before { transform: scaleY(1); }
.tl li { position: relative; padding: .6em 0; font-size: 14.5px; line-height: 2; }
.tl li::before { content: ""; position: absolute; left: -24px; top: 1.15em; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); transform: scale(0); transition: transform .4s cubic-bezier(.34,1.56,.64,1); }
.tl.in li::before { transform: scale(1); }
.tl.in li:nth-child(1)::before { transition-delay: .2s; }
.tl.in li:nth-child(2)::before { transition-delay: .45s; }
.tl.in li:nth-child(3)::before { transition-delay: .7s; }
.tl.in li:nth-child(4)::before { transition-delay: .95s; }
.tl.in li:nth-child(5)::before { transition-delay: 1.2s; }
.tl li b { display: block; font-size: 11.5px; letter-spacing: .12em; color: var(--accent); font-weight: 500; }

/* ---- ソースカード: 出典・参照リンク ---- */
.src { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 1.2em 1.5em; margin: 0 0 2em; text-decoration: none; color: inherit; transition: border-color .3s, transform .3s; }
.src:hover { border-color: var(--accent); transform: translateY(-2px); }
.src .src-k { font-size: 10.5px; letter-spacing: .2em; color: var(--accent); }
.src .src-t { font-size: 14.5px; font-weight: 500; line-height: 1.9; margin-top: .4em; }
.src .src-u { font-size: 11.5px; color: var(--sub); margin-top: .3em; word-break: break-all; }

/* ---- 対比ブロック: 2つの考え方・やり方を左右で見せる ---- */
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 2em; position: relative; }
.vs > div { border-radius: 12px; padding: 1.5em 1.5em 1.4em; }
.vs .bad { background: #eeeae2; }
.vs .good { background: var(--accent-soft); }
.vs .vs-t { font-size: 11px; letter-spacing: .18em; margin-bottom: .9em; font-weight: 500; }
.vs .bad .vs-t { color: var(--sub); }
.vs .good .vs-t { color: var(--accent); }
.vs p { font-size: 13.5px; line-height: 2.1; margin-bottom: 0; }
.vs ul { margin: 0 0 0 1.2em; font-size: 13.5px; line-height: 2.1; }
.vs.fx > div { opacity: 0; transform: translateY(10px); transition: opacity .7s ease, transform .7s ease; }
.vs.fx.in > div { opacity: 1; transform: none; }
.vs.fx.in .good { transition-delay: .3s; }
@media (max-width: 560px) { .vs { grid-template-columns: 1fr; } }

/* ---- ループ図: 人が輪の中にいる循環をステップで見せる ---- */
.loop { list-style: none; margin: 0 0 2em !important; display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.loop li { flex: 1 1 120px; position: relative; background: var(--box); border-radius: 10px; padding: 1.1em 1em 1em; font-size: 12.5px; line-height: 1.9; color: var(--sub); text-align: center; }
.loop li b { display: block; font-size: 13.5px; color: var(--ink); font-weight: 700; letter-spacing: .04em; margin-bottom: .3em; }
.loop li.human { background: var(--accent-soft); outline: 1.5px solid var(--accent); outline-offset: -1.5px; }
.loop li.human b { color: var(--accent); }
.loop li:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 12px; z-index: 1; }
.loop li:last-child::after { content: "↺"; display: block; margin-top: .2em; color: var(--accent); font-size: 14px; }
.loop.fx li { opacity: 0; transform: scale(.94); transition: opacity .5s ease, transform .5s cubic-bezier(.34,1.56,.64,1); }
.loop.fx.in li { opacity: 1; transform: none; }
.loop.fx.in li:nth-child(2) { transition-delay: .25s; }
.loop.fx.in li:nth-child(3) { transition-delay: .5s; }
.loop.fx.in li:nth-child(4) { transition-delay: .75s; }
.loop.fx.in li:nth-child(5) { transition-delay: 1s; }
@media (max-width: 560px) {
  .loop { flex-direction: column; gap: 22px; }
  .loop li:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -16px; transform: translateX(-50%); }
}

/* ---- 二軸マップ: 価格×能力など、選択肢の位置関係を面で見せる ----
   点は --x/--y（%）で置く。0%が左/下、100%が右/上。.pick で本命を強調 */
.map2 { margin: 0 0 2em; }
.map2 .map2-t { font-size: 11px; letter-spacing: .2em; color: var(--accent); margin-bottom: 1em; }
.map2 .map2-plot { position: relative; height: 300px; background: var(--box); border-radius: 12px; }
.map2 .map2-plot::before, .map2 .map2-plot::after { content: ""; position: absolute; background: var(--line); }
.map2 .map2-plot::before { left: 8%; right: 8%; top: 50%; height: 1px; }
.map2 .map2-plot::after { top: 8%; bottom: 8%; left: 50%; width: 1px; }
.map2 .ax { position: absolute; font-size: 10.5px; letter-spacing: .14em; color: var(--sub); display: flex; gap: .8em; align-items: center; }
.map2 .ax b { font-weight: 500; color: var(--ink); }
.map2 .ax i { font-style: normal; }
.map2 .ax-x { left: 50%; bottom: 8px; transform: translateX(-50%); }
/* 縦書きで上=複雑側にするため、markup順（定型→複雑）をrow-reverseで反転 */
.map2 .ax-y { left: 8px; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; flex-direction: row-reverse; }
.map2 .pt { position: absolute; left: var(--x); bottom: var(--y); transform: translate(-50%, 50%); text-align: center; }
.map2 .pt::before { content: ""; display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); margin: 0 auto 6px; }
.map2 .pt b { display: block; font-size: 12px; letter-spacing: .04em; line-height: 1.5; white-space: nowrap; }
.map2 .pt small { display: block; font-size: 10.5px; color: var(--sub); line-height: 1.6; white-space: nowrap; }
.map2 .pt.pick::before { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.map2 .pt.pick b { color: var(--accent); }
.map2.fx .pt { opacity: 0; transform: translate(-50%, 50%) scale(.6); transition: opacity .5s ease, transform .5s cubic-bezier(.34,1.56,.64,1); }
.map2.fx.in .pt { opacity: 1; transform: translate(-50%, 50%) scale(1); }
.map2.fx.in .pt:nth-of-type(2) { transition-delay: .2s; }
.map2.fx.in .pt:nth-of-type(3) { transition-delay: .4s; }
.map2.fx.in .pt:nth-of-type(4) { transition-delay: .6s; }
.map2.fx.in .pt:nth-of-type(5) { transition-delay: .8s; }
.map2.fx.in .pt:nth-of-type(6) { transition-delay: 1s; }
@media (max-width: 560px) {
  .map2 .map2-plot { height: 250px; }
  .map2 .pt small { display: none; }
  /* 縦書きの端ラベルは高さが足りず折り返すので、軸名だけ残す */
  .map2 .ax-y i { display: none; }
}

/* ---- 概念の対応表: 「AはBにあたる」の対応関係を線でつなぐ ---- */
.pairs { margin: 0 0 2em; }
.pairs { max-width: 620px; margin-left: auto; margin-right: auto; }
/* 左列は名前の幅に締める（1frだと短い名前の左に空白が広がりすぎる） */
.pairs > div { display: grid; grid-template-columns: minmax(6.5em, max-content) 44px 1fr; align-items: baseline; padding: .8em 0; border-bottom: 1px dashed var(--line); }
.pairs dt { text-align: right; font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.pairs dd { margin: 0; font-size: 13.5px; line-height: 2; color: var(--sub); }
.pairs > div::before { content: ""; grid-column: 2; grid-row: 1; justify-self: center; align-self: center; width: 22px; height: 1px; background: var(--accent); position: relative; transform: scaleX(0); transition: transform .5s ease; }
.pairs dt { grid-column: 1; grid-row: 1; }
.pairs dd { grid-column: 3; grid-row: 1; }
.pairs.fx > div { opacity: 0; transition: opacity .6s ease; }
.pairs.fx.in > div { opacity: 1; }
.pairs.fx.in > div::before { transform: scaleX(1); transition-delay: .3s; }
.pairs.fx.in > div:nth-child(2) { transition-delay: .15s; }
.pairs.fx.in > div:nth-child(3) { transition-delay: .3s; }
.pairs.fx.in > div:nth-child(4) { transition-delay: .45s; }
.pairs.fx.in > div:nth-child(5) { transition-delay: .6s; }
@media (max-width: 560px) {
  .pairs > div { grid-template-columns: 1fr; }
  .pairs dt, .pairs dd { grid-column: 1; text-align: left; }
  .pairs dt { grid-row: 1; } .pairs dd { grid-row: 2; }
  .pairs > div::before { display: none; }
}

/* ---- ティア梯子: モデルやプランの序列を階段で見せる。.top が最上段 ---- */
.ladder { list-style: none; margin: 0 0 2em !important; display: flex; gap: 8px; align-items: flex-end; }
.ladder li { flex: 1; background: var(--box); border-radius: 10px 10px 0 0; border-bottom: 2px solid var(--line); padding: 1em .9em .9em; font-size: 11.5px; line-height: 1.8; color: var(--sub); }
.ladder li b { display: block; font-size: 13px; color: var(--ink); font-weight: 700; letter-spacing: .03em; margin-bottom: .3em; }
.ladder li:nth-child(1) { min-height: 92px; }
.ladder li:nth-child(2) { min-height: 122px; }
.ladder li:nth-child(3) { min-height: 152px; }
.ladder li:nth-child(4) { min-height: 182px; }
.ladder li:nth-child(5) { min-height: 212px; }
.ladder li.top { background: var(--accent-soft); border-bottom-color: var(--accent); }
.ladder li.top b { color: var(--accent); }
.ladder.fx li { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s cubic-bezier(.3,.9,.35,1); }
.ladder.fx.in li { opacity: 1; transform: none; }
.ladder.fx.in li:nth-child(2) { transition-delay: .15s; }
.ladder.fx.in li:nth-child(3) { transition-delay: .3s; }
.ladder.fx.in li:nth-child(4) { transition-delay: .45s; }
.ladder.fx.in li:nth-child(5) { transition-delay: .6s; }
@media (max-width: 560px) {
  .ladder { flex-direction: column-reverse; align-items: stretch; }
  .ladder li { min-height: 0 !important; border-radius: 10px; border-bottom-width: 1px; border-left: 2px solid var(--line); }
  .ladder li.top { border-left-color: var(--accent); }
}

/* ---- 記事フッター ---- */
.foot { margin-top: 8vh; border-top: 1px solid var(--line); padding-top: 4vh; display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
.foot a { color: var(--sub); text-decoration: none; letter-spacing: .06em; line-height: 2; }
.foot a:hover { color: var(--accent); }

@media (max-width: 560px) {
  .wrap { padding: 9vh 16px; }
  .box { padding: 1.3em 1.1em; }
  .box ul, .box ol { margin-left: 1.2em; }
  h1 { font-size: 22px; }
  .body p { font-size: 15.5px; line-height: 2.2; }
  .body ul, .body ol { font-size: 15.5px; }
  .kv .n { font-size: 26px; }
}

/* --- モバイルのタップ表現（ハイライト消し＋押下フィードバック） --- */
* { -webkit-tap-highlight-color: transparent; }
.src:active, .svl a:active, .sv-ocards a:active { transform: scale(.985); transition-duration: .1s; }
.faq summary:active { color: var(--accent); }
.foot a:active, .back:active, li a:active .t { color: var(--accent); }

/* タップハイライト強化（*指定で効かない環境向けに、要素型にも直接指定） */
html { -webkit-tap-highlight-color: rgba(0,0,0,0); }
a, button, summary, input, [role="button"] { -webkit-tap-highlight-color: rgba(0,0,0,0); touch-action: manipulation; }
