@charset "utf-8";
/* ==========================================================================
   METASYSTEM — ポートフォリオ
   組み：上の帯 ／ 左にフォルダのツリー ／ 中央にページ ／ 右に要点
   色：墨（文字と線）・生成り（地）・砂（枠線）に、差し色はオレンジ（主）と青（従）の2つだけ
     オレンジ … いまいる所、押せる所、強調（ボタン・いまのタブとファイル・いまの工程・まとめの帯）
     青     … 添えもの（アイコンの台・チェック・読んだしるし・済んだ工程）
   ========================================================================== */

:root {
  --ink: #1e1c19;      /* 墨 */
  --paper: #f5ede1;    /* 生成り：ページの地 */
  --card: #fbf5ec;     /* 生成りの明るい方：カードの地 */
  --line: #dcd1c1;     /* 砂：枠線 */
  --accent: #f39c4e;   /* オレンジ：主の差し色 */
  --accent-soft: #fadcbf; /* オレンジを生成りに薄めたもの：広い面（まとめの帯、マーカー） */
  --accent2: #6f9fea;  /* 青：従の差し色 */
  --mute: #6d655a;     /* 墨を薄めた色：補助の文字 */

  --top-h: 52px;
  --side-w: 264px;
  --panel-w: 304px;
  --r: 12px;
  --pop: 1.5px 2.5px 0 0 var(--ink);   /* 押せるものの影（ずらしただけの、ぼかさない影） */

  --f: "JetBrains Mono", "M PLUS 1 Code", ui-monospace, "SFMono-Regular", Menlo, "Hiragino Kaku Gothic ProN", "Noto Sans JP", monospace;
}

/* ───────── 土台 ───────── */
*, *::before, *::after { box-sizing: border-box; }
/* scroll-padding：#id へ飛んだとき、ページの上の端が帯のすぐ下に来る位置（＝いちばん上）で止める */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 12px); }
body { margin: 0; font-family: var(--f); font-size: 14px; line-height: 1.8; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
mark { color: inherit; background: linear-gradient(transparent 62%, var(--accent-soft) 0); }

.defs { position: absolute; width: 0; height: 0; }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i--fill { fill: currentColor; }
.skip { position: fixed; left: 8px; top: -80px; z-index: 60; padding: 8px 12px; background: var(--ink); color: var(--paper); text-decoration: none; border-radius: 8px; }
.skip:focus { top: 8px; }

/* ───────── 共通の部品 ───────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-weight: 700; font-size: 13px; line-height: 1.3; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .12s, box-shadow .12s, border-color .12s; }
.btn:hover { border-color: var(--ink); }
.btn--go { background: var(--accent); border: 1.5px solid var(--ink); box-shadow: var(--pop); }
.btn--go:hover { transform: translate(1px, 1.5px); box-shadow: .5px 1px 0 0 var(--ink); }
.btn--sq { width: 36px; padding: 0; }
.btn:disabled, .btn[aria-disabled="true"] { color: var(--line); border-color: var(--line); cursor: default; pointer-events: none; }

.tag { display: inline-block; padding: 1px 9px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); font-style: normal; font-size: 11px; font-weight: 700; line-height: 1.6; letter-spacing: .04em; white-space: nowrap; }
.fine { margin-top: 12px; font-size: 12px; color: var(--mute); }
.sub { margin: 24px 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--mute); }
.text { max-width: 46em; }
.callout { margin-top: 16px; padding: 12px 16px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--accent-soft); }
.callout b { font-weight: 800; }

/* ───────── 上の帯 ───────── */
.top { position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 20px; padding: 0 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.top__menu { display: none; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; place-items: center; }
.top__menu .i { width: 18px; height: 18px; }
.top__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; margin-right: 12px; }
.top__logo svg { width: 26px; height: 26px; }
.top__logo b { font-size: 16px; font-weight: 800; letter-spacing: .02em; }
.tabs { display: flex; gap: 6px; flex: 1; min-width: 0; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border: 1.5px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.tabs a:hover { background: var(--card); }
.tabs a.is-on { background: var(--accent); border-color: var(--ink); box-shadow: var(--pop); font-weight: 700; }
.top__cta { flex: none; min-height: 32px; }

/* ───────── 全体の組み ───────── */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: 12px; max-width: 1560px; margin: 0 auto; padding: 12px 16px 48px 8px; }

/* ───────── 左：フォルダのツリー ───────── */
.side { position: sticky; top: calc(var(--top-h) + 12px); align-self: start; display: flex; flex-direction: column; height: calc(100vh - var(--top-h) - 24px); overflow-y: auto; padding: 4px 4px 0 8px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.side__head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; font-size: 13px; }
.side__head .i { width: 18px; height: 18px; }
.side__head b { font-weight: 800; }
.side__head span { margin-left: auto; font-size: 11px; color: var(--mute); }
.dir__btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 0 8px; border: 0; border-radius: 8px; background: none; cursor: pointer; text-align: left; font-weight: 500; }
.dir__btn:hover { background: var(--card); }
.dir__btn .chev { width: 12px; height: 12px; color: var(--mute); transition: transform .15s; }
.dir.is-open > .dir__btn .chev { transform: rotate(90deg); }
.dir__btn span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dir__btn em { font-style: normal; font-size: 11px; color: var(--mute); }
/* 枝の線：縦の線と、各ファイルへの横の線 */
.dir > ul { display: none; margin: 2px 0 8px 21px; border-left: 1px solid var(--line); }
.dir.is-open > ul, html:not(.js) .dir > ul { display: block; }
.dir > ul > li { position: relative; padding-left: 14px; }
.dir > ul > li::before { content: ""; position: absolute; left: 0; top: 15px; width: 10px; border-top: 1px solid var(--line); }
.file { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 8px; border: 1.5px solid transparent; border-radius: 8px; font-size: 13px; text-decoration: none; }
.file .i { width: 14px; height: 14px; color: var(--mute); }
.file span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file:hover { background: var(--card); }
.file.is-on { background: var(--accent); border-color: var(--ink); box-shadow: var(--pop); font-weight: 700; }
.file.is-on .i { color: var(--ink); }
/* 読んだページには、小さな点 */
.file.is-read:not(.is-on)::after { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent2); }

.progress { display: flex; align-items: center; gap: 10px; margin: auto 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); font-size: 11px; font-weight: 700; letter-spacing: .08em; position: sticky; bottom: 0; }
.progress > i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > i > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.progress b { font-weight: 500; letter-spacing: 0; }
.shade { display: none; }
/* JavaScript がないときは、進み具合と「何番目か」は出さない（数えられないので） */
html:not(.js) .progress, html:not(.js) .crumb { display: none; }

/* ───────── 中央と右 ───────── */
.main { min-width: 0; outline: 0; }
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 24px; }
.js .page { display: none; margin-bottom: 0; }
.js .page.is-on { display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); align-items: start; animation: in .22s ease-out; }
/* 位置は動かさない（#id へ飛ぶときに、動いている途中の位置へスクロールしてしまうので） */
@keyframes in { from { opacity: 0; } }

/* 中央：ページ */
.lesson { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; padding: 18px 20px 20px; }
.crumb { grid-column: 1 / -1; min-height: 1.6em; font-size: 12px; color: var(--mute); }
.title { grid-column: 1; margin-top: 4px; font-size: 22px; font-weight: 800; line-height: 1.4; outline: 0; }
.title small { margin-left: 10px; font-size: 13px; font-weight: 500; color: var(--mute); }
.chips { grid-column: 2; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 6px; }
.chips li { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); font-size: 11px; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.chips li:first-child { background: var(--accent); }
.chips .i { width: 12px; height: 12px; }
.lead { grid-column: 1 / -1; margin-top: 6px; font-size: 13px; color: var(--mute); }
.stage { grid-column: 1 / -1; margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }

/* 右：要点 */
.panel { display: grid; gap: 12px; min-width: 0; }
.js .page.is-on .panel { position: sticky; top: calc(var(--top-h) + 12px); }
.note { padding: 16px 18px 18px; }
.note__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.note h2 { margin-top: 12px; font-size: 16px; font-weight: 800; line-height: 1.5; }
.note > p:not([class]) { margin-top: 8px; font-size: 13px; }
.idea { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.idea > .i { width: 26px; height: 26px; padding: 5px; border: 1px solid var(--ink); border-radius: 6px; background: var(--accent2); }
.idea small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--mute); line-height: 1.6; }
.idea p { font-size: 12.5px; line-height: 1.7; }
.nav { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin-top: 18px; }
.nav .btn--go { justify-content: space-between; min-width: 0; }
.nav .btn--go span { overflow: hidden; text-overflow: ellipsis; }
.keys { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: 11px; color: var(--mute); }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); font: inherit; font-size: 10px; }
.learn { padding: 16px 18px 18px; }
.learn h2 { font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.learn ul { margin-top: 10px; display: grid; gap: 8px; }
.learn li { position: relative; padding-left: 24px; font-size: 12.5px; line-height: 1.6; }
.learn li::before { content: ""; position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--accent2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e1c19' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 10px no-repeat; }

/* ───────── ページの中身 ───────── */
/* 数字のタイル */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stats--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
.stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats li { padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.stats span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--mute); }
.stats b { display: block; font-size: 26px; font-weight: 800; line-height: 1.3; }
.stats small { margin-left: 4px; font-size: 12px; font-weight: 500; }
.stats em { display: block; font-style: normal; font-size: 12px; color: var(--mute); }
.stats .stats__text { margin-top: 8px; font-size: 14px; line-height: 1.6; }

.toc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.toc a { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-decoration: none; transition: border-color .12s, background .12s; }
.toc a .i { grid-row: span 2; margin-top: 4px; }
.toc b { font-size: 13px; font-weight: 700; }
.toc span { font-size: 12px; color: var(--mute); line-height: 1.6; }
.toc a:hover { border-color: var(--ink); background: var(--accent-soft); }
.toc a:hover span { color: var(--ink); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pills li { padding: 1px 12px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); font-size: 12px; font-weight: 700; }

.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cards3 li { padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.cards3 .i { width: 32px; height: 32px; padding: 7px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--accent2); }
.cards3 h2 { margin-top: 12px; font-size: 14px; font-weight: 800; line-height: 1.5; }
.cards3 p { margin-top: 4px; font-size: 12.5px; color: var(--mute); line-height: 1.75; }

/* 工程・ステップの図：丸がつながり、いまの所まで線がのびる */
.pipe { --n: 6; --p: 0; position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); padding: 8px 0 4px; }
.pipe--4 { --n: 4; }
.pipe::before, .pipe::after { content: ""; position: absolute; top: 31px; left: calc(50% / var(--n)); height: 2px; background: var(--line); width: calc(100% - 100% / var(--n)); }
.pipe::after { background: var(--accent2); width: calc((100% - 100% / var(--n)) * var(--p)); transition: width .35s ease; }
.pipe li { position: relative; z-index: 1; display: grid; justify-items: center; align-content: start; gap: 8px; padding: 0 4px; text-align: center; cursor: pointer; }
.pipe li > .i { width: 46px; height: 46px; padding: 12px; border: 1.5px solid var(--line); border-radius: 50%; background: var(--card); color: var(--mute); transition: transform .15s, background .15s, border-color .15s, box-shadow .15s; }
.pipe b { font-size: 12.5px; font-weight: 700; line-height: 1.5; color: var(--mute); }
.pipe p { font-size: 11.5px; color: var(--mute); line-height: 1.65; max-width: 12em; }
.pipe li.is-done > .i { border-color: var(--ink); background: var(--accent2); color: var(--ink); }
.pipe li.is-done b { color: var(--ink); }
.pipe li.is-on > .i { border-color: var(--ink); background: var(--accent); color: var(--ink); box-shadow: var(--pop); transform: scale(1.08); }
.pipe li.is-on b, .pipe li.is-on p { color: var(--ink); }
.pipe li:hover > .i { border-color: var(--ink); }

/* ───────── ページの図（scenes.js の絵を、main.js が SVG に描いて動かす） ───────── */
.stage + .stage { margin-top: 12px; }
html:not(.js) .stage--viz, html:not(.js) .viz { display: none; }
/* ページの中身の上に置く図 */
.stage > .viz:not(:only-child) { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.viz__cap { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 12px; }
.viz__cap b { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.viz__cap span { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 図と、いっしょに光る項目 */
.is-pickable { cursor: pointer; }
:is(.works, .cards3, .contacts, .stats) > li { transition: border-color .2s, box-shadow .2s; }
:is(.works, .cards3, .contacts, .stats) > li.is-lit, .toc > li.is-lit > a { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--accent); }
.ba li, .stack > div, .spec > div { transition: background .2s; }
.ba li.is-lit, .stack > div.is-lit, .spec > div.is-lit { background: var(--accent-soft); }
.steps__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.steps__head span { font-weight: 500; letter-spacing: 0; color: var(--mute); }
.js .stage--steps .pipe p { display: none; }

/* 上：ここまでにできた成果物 */
.viz__tiles { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.viz__tiles li { min-width: 0; padding: 6px 10px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); transition: border-color .2s, box-shadow .2s; }
.viz__tiles small { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--mute); white-space: nowrap; overflow: hidden; }
.viz__tiles small .i { width: 12px; height: 12px; }
.viz__tiles b { display: block; margin-top: 2px; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--line); }
.viz__tiles li.is-done b { color: var(--ink); }
.viz__tiles li.is-new { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--accent); }

/* 中：図 */
.viz__svg { display: block; width: 100%; height: auto; font-family: var(--f); }
.viz__tiles + .viz__svg { margin-top: 10px; }
.viz svg .grid { fill: none; stroke: var(--line); stroke-width: 1; opacity: .6; }
.viz svg :is(polygon, path, ellipse, circle, rect) { stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.viz svg [transform] * { vector-effect: non-scaling-stroke; }
.viz svg .f-top { fill: var(--card); }
.viz svg .f-l { fill: #ece1cf; }
.viz svg .f-r { fill: #dfd1bb; }
.viz svg :is(.band, .ln, .wf) { fill: none; }
.viz svg .scr { fill: var(--paper); stroke-width: 1; }
/* いまの工程：オレンジ */
.viz svg .is-hot .f-top { fill: var(--accent); }
.viz svg .is-hot .f-l { fill: var(--accent-soft); }
.viz svg .is-hot .f-r { fill: #eca469; }
.viz svg .is-hot .scr { fill: var(--accent-soft); }
.viz svg .is-hot :is(.cell, .cta) { fill: var(--accent); }
.viz svg .is-hot .win { fill: var(--accent-soft); }
/* 参画前・まだないもの：灰色の破線 */
.viz svg :is(.before, .ghost) :is(.f-top, .f-l, .f-r) { fill: var(--paper); stroke: var(--mute); stroke-dasharray: 3 3; }
.viz svg .before .pill rect { fill: var(--paper); stroke: var(--mute); stroke-dasharray: 3 3; }
.viz svg .before .pill text, .viz svg .q { fill: var(--mute); }
/* 設計中：青い破線（図面のまま、まだ作っていない） */
.viz svg .is-draft :is(.f-top, .f-l, .f-r) { fill: rgba(111, 159, 234, .12); stroke: var(--accent2); stroke-dasharray: 4 4; }
.viz svg .is-draft .band { stroke: var(--accent2); stroke-dasharray: 4 4; }
/* 地面の線（お客さま → 画面 → アプリ → DB）と、流れるデータ */
.viz svg .link { fill: none; stroke-width: 2; marker-end: url(#vArr); }
.viz svg .link.is-hot, .viz svg .link--hot { stroke: var(--accent); stroke-width: 2.5; marker-end: url(#vArrO); }
.viz svg .link--soft { stroke: var(--mute); stroke-width: 1.5; stroke-dasharray: 4 5; marker-end: none; }
.viz svg .link--soft.is-hot { stroke-dasharray: none; }
.viz svg .tunnel { fill: none; stroke: var(--line); stroke-width: 14; opacity: .7; }
.viz svg .tunnel.is-hot { stroke: var(--accent-soft); opacity: 1; }
.viz svg .frame { fill: rgba(111, 159, 234, .06); stroke: var(--accent2); stroke-dasharray: 6 5; }
.viz svg .is-hot .frame { fill: rgba(243, 156, 78, .10); stroke: var(--accent); stroke-width: 2; stroke-dasharray: none; }
.viz svg .link.is-draft { stroke: var(--accent2); stroke-dasharray: 5 5; marker-end: url(#vArrB); }
.viz svg .pk { fill: var(--accent2); }
.viz svg .chk circle { fill: var(--accent2); }
.viz svg .chk path { fill: none; stroke-width: 2; }
.viz svg .mon { fill: none; stroke-dasharray: 3 5; animation: vDash 1s linear infinite; }
/* 名札・書類・吹き出し・コード */
.viz svg .pill rect { fill: var(--card); }
.viz svg .pill text { font-size: 12px; font-weight: 700; text-anchor: middle; fill: var(--ink); stroke: none; }
.viz svg .pill.is-hot rect { fill: var(--accent); }
.viz svg .bubble path { fill: var(--card); }
.viz svg .td { fill: var(--ink); stroke: none; animation: vBlink 1.2s ease-in-out infinite; }
.viz svg .dotb { fill: var(--line); stroke: none; }
.viz svg .cl { fill: var(--ink); stroke: none; transform-box: fill-box; transform-origin: 0 50%; animation: vType 2.6s steps(8, end) infinite; }
.viz svg .cl:nth-of-type(2n) { fill: var(--accent2); }
.viz svg .pulse { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 1; animation: vDraw 1.6s linear infinite; }
.viz svg .lamp { fill: var(--accent2); stroke-width: 1; animation: vBlink 1.4s ease-in-out infinite; }
.viz svg .lamp--2 { fill: var(--accent); animation-delay: .45s; }
.viz svg .lamp--3 { animation-delay: .9s; }
.viz svg .spin { transform-box: fill-box; transform-origin: center; animation: vSpin 3s linear infinite; }
.viz svg .spin .ln { stroke-width: 2; }
.viz svg .spin--slow { animation-duration: 8s; }
.viz svg .ln--b { stroke-width: 2; }
.viz svg .ln--dash { stroke-dasharray: 3 4; }
.viz svg .ln--thin { stroke: var(--line); stroke-width: 1; }
.viz svg .hole { fill: var(--paper); }
.viz svg .kc { fill: var(--accent2); stroke-width: 1; }
.viz svg :is(.cell, .win) { fill: var(--paper); stroke-width: 1; }
.viz svg .cta { fill: var(--accent2); stroke-width: 1; }
.viz svg .track { fill: var(--line); stroke-width: 1; }
.viz svg .grow { fill: var(--accent2); stroke-width: 1; transform-box: fill-box; transform-origin: 0 50%; }
.viz svg .tick { fill: none; stroke: var(--accent2); stroke-width: 2; }
.viz svg .eye { fill: var(--ink); stroke: none; }
.viz svg .knob { fill: var(--accent2); animation: vSlide 2.4s ease-in-out infinite alternate; }
.viz svg .blink { animation: vBlink .8s ease-in-out infinite; }
.viz svg :is(.ai, .sign, .q) { stroke: none; text-anchor: middle; font-weight: 800; }
.viz svg .ai { font-size: .5px; fill: var(--ink); }
.viz svg .sign { font-size: 10px; fill: var(--ink); }
.viz svg .q { font-size: 24px; }
/* 光っている間だけ動くもの */
.viz svg .is-hot .bob { transform-box: fill-box; animation: vBob 1.4s ease-in-out infinite; }
.viz svg .lift { transition: transform .35s cubic-bezier(.2, 1.3, .4, 1); }
.viz svg .lift.is-hot { transform: translateY(-8px); }
/* 出る・消える・出てくるときの動き */
.viz svg .is-out { display: none; }
.viz svg .is-new { transform-box: fill-box; transform-origin: 50% 100%; animation: vPop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.viz svg .link.is-new, .viz svg .mon.is-new { animation: vFade .5s ease both; }
.viz svg .wf { stroke-dasharray: 1; }
.viz svg .is-new .wf { animation: vDraw 1.1s ease .35s both; }
/* data-pop の付いたものは、それ自体は動かさず、中の .seq を順に出す */
.viz svg [data-pop].is-new { animation: none; }
.viz svg .is-new .seq { transform-box: fill-box; transform-origin: 50% 100%; animation: vPop .5s cubic-bezier(.2, 1.4, .4, 1) var(--d, 0s) both; }
.viz svg .is-new .late { transform-box: fill-box; transform-origin: center; animation: vPop .4s cubic-bezier(.2, 1.4, .4, 1) 1.1s both; }
.viz svg .is-new .leave { transform-box: fill-box; animation: vLeave 1.2s ease .2s both; }
.viz svg .is-new .grow, .viz svg .grow.is-new { animation: vGrow 2.6s ease .3s both; }
.viz.is-paused svg * { animation-play-state: paused !important; }
@keyframes vPop { from { opacity: 0; transform: translateY(-14px) scale(.92); } }
@keyframes vFade { from { opacity: 0; } }
@keyframes vDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes vDash { to { stroke-dashoffset: -16; } }
@keyframes vBlink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes vType { 0% { transform: scaleX(0); } 55%, 100% { transform: scaleX(1); } }
@keyframes vSpin { to { transform: rotate(360deg); } }
@keyframes vBob { 50% { transform: translateY(-5px); } }
@keyframes vLeave { to { opacity: 0; transform: translateY(-22px); } }
@keyframes vGrow { from { transform: scaleX(0); } }
@keyframes vSlide { to { transform: translateX(12px); } }

/* 下：凡例と、もう一度・一時停止 */
.viz__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 8px; }
.viz__legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--mute); }
.viz__legend li { display: flex; align-items: center; gap: 6px; }
.viz__legend i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink); }
.viz__legend .lg-hot { background: var(--accent); }
.viz__legend .lg-draft { border-style: dashed; border-color: var(--accent2); background: rgba(111, 159, 234, .12); }
.viz__legend .lg-flow { background: var(--accent2); }
.viz__ctl { display: flex; gap: 8px; }
.btn--sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn--sm .i { width: 14px; height: 14px; }
.btn[aria-pressed="true"] { border-color: var(--ink); background: var(--accent-soft); }

/* 実績 */
.works { display: grid; gap: 10px; }
.works--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.works li { padding: 12px 16px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.works .tag { margin-bottom: 6px; }
.works h2 { font-size: 14px; font-weight: 800; line-height: 1.5; }
.works p { margin-top: 2px; font-size: 12.5px; color: var(--mute); line-height: 1.75; }
.works dl { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px; font-size: 12px; }
.works dl div { display: flex; gap: 8px; }
.works dt { color: var(--mute); }
.works dd { font-weight: 700; }

/* 参画前 → 参画後 */
.ba { border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; }
.ba__head, .ba li { display: grid; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 16px; }
.ba__head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 44px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--mute); border-bottom: 1px solid var(--line); }
.ba li + li { border-top: 1px solid var(--line); }
.ba li p:first-child { font-size: 12.5px; color: var(--mute); }
.ba li p:last-child { font-size: 13px; font-weight: 700; }

/* 使用技術・仕様 */
.stack > div, .spec > div { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: 6px; }
.stack > div + div, .spec > div + div { box-shadow: inset 0 1px 0 var(--line); }
.stack dt, .spec dt { font-size: 12px; font-weight: 700; color: var(--mute); padding-top: 2px; }
.stack dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.stack dd span { padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font-size: 12.5px; font-weight: 500; line-height: 1.9; }
.stack dd em { font-style: normal; font-size: 12px; color: var(--mute); margin-left: 4px; }
.spec dd { font-size: 13px; }
.spec dd a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-underline-offset: 3px; }
.spec dd a .i { width: 13px; height: 13px; }
.spec__links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.stats + .fine + .spec, .stats + .spec { margin-top: 16px; }

/* 紹介資料（スライド） */
.deck__track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.deck__track::-webkit-scrollbar { display: none; }
.deck__slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.deck__slide a { display: block; background: #fff; }
.deck__slide img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.deck__bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.deck__count { flex: none; min-width: 5.4em; text-align: center; font-size: 12px; color: var(--mute); }
.deck__count b { font-size: 14px; font-weight: 800; color: var(--ink); }
/* 目盛り：いま見ている1枚がオレンジ、見た分が青。押すと、その1枚へ飛ぶ */
.deck__ticks { flex: 1; min-width: 0; display: flex; align-items: center; gap: 3px; height: 36px; }
.deck__ticks i { flex: 1; height: 100%; cursor: pointer; background: linear-gradient(var(--line), var(--line)) center / 100% 4px no-repeat; }
.deck__ticks i.is-past { background-image: linear-gradient(var(--accent2), var(--accent2)); }
.deck__ticks i.is-on { background-image: linear-gradient(var(--accent), var(--accent)); background-size: 100% 14px; }
.deck__cap { margin-top: 6px; min-height: 1.8em; font-size: 13px; font-weight: 700; }
.deck__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.deck__foot span { font-size: 12px; color: var(--mute); }
html:not(.js) .deck__bar, html:not(.js) .deck__cap { display: none; }

/* お問い合わせ */
.contacts { display: grid; gap: 10px; }
.contacts li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.contacts li > .i { width: 34px; height: 34px; padding: 8px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--accent2); }
.contacts small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--mute); line-height: 1.5; }
.contacts p a { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; text-underline-offset: 3px; }
.contacts__act { display: flex; flex-wrap: wrap; gap: 8px; }

/* ───────── せまい画面 ───────── */
@media (max-width: 1239px) {
  .js .page.is-on { grid-template-columns: minmax(0, 1fr); }
  .js .page.is-on .panel { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 859px) {
  .top { gap: 10px; padding: 0 10px; }
  .top__menu { display: grid; }
  .top__logo { margin-right: 0; }
  .top__logo b { font-size: 15px; }
  .tabs { display: none; }
  .top__cta { margin-left: auto; padding: 0 10px; }

  .app { grid-template-columns: minmax(0, 1fr); padding: 10px 10px 88px; }
  .side { position: fixed; z-index: 38; left: 0; top: var(--top-h); bottom: 0; align-self: stretch; width: min(300px, 86vw); height: auto; padding: 12px 10px 10px; background: var(--paper); border-right: 1px solid var(--line); transform: translateX(-104%); transition: transform .2s ease-out; }
  .side.is-open { transform: none; }
  .shade { position: fixed; inset: var(--top-h) 0 0 0; z-index: 37; border: 0; padding: 0; background: rgba(30, 28, 25, .35); }
  .side.is-open + .shade { display: block; }
  html:not(.js) .side { position: static; transform: none; width: auto; border: 0; }

  .lesson { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 16px; }
  .title { font-size: 20px; }
  .chips { grid-column: 1; justify-content: flex-start; margin-top: 8px; }
  .stage { padding: 12px; }
  .js .page.is-on .panel { grid-template-columns: minmax(0, 1fr); }
  .keys { display: none; }
  /* 戻る・次へは、画面の下に固定する */
  .nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
  .nav .btn { min-height: 44px; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats--3 li { padding: 8px 8px 10px; }
  .stats--3 b { font-size: 18px; }
  .toc, .cards3, .works--2 { grid-template-columns: minmax(0, 1fr); }
  .cards3 li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; }
  .cards3 .i { grid-row: span 2; }
  .cards3 h2 { margin-top: 0; }
  /* 図は、たてに並べる */
  .pipe { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 0; }
  .pipe::before, .pipe::after { display: none; }
  .pipe li { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; column-gap: 12px; padding: 6px 8px; border: 1.5px solid transparent; border-radius: 10px; text-align: left; }
  .pipe li > .i { width: 36px; height: 36px; padding: 9px; }
  .pipe li.is-on { background: var(--card); border-color: var(--line); }
  .pipe li.is-on > .i { transform: none; }
  .pipe p { grid-column: 2; max-width: none; font-size: 12px; }
  /* 対応工程の図のある所では、工程は横一列の丸だけにする（いまの工程の名前は、上の見出しに出る） */
  .js .stage--steps .pipe { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 0; padding: 2px 0 0; }
  .js .stage--steps .pipe::before, .js .stage--steps .pipe::after { display: block; top: 19px; }
  .js .stage--steps .pipe li { grid-template-columns: none; justify-items: center; padding: 0; border: 0; background: none; }
  .js .stage--steps .pipe li > .i { width: 36px; height: 36px; padding: 9px; }
  .js .stage--steps .pipe b { display: none; }
  .viz__tiles { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 116px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
  .viz__tiles::-webkit-scrollbar { display: none; }
  .ba__head { display: none; }
  .ba li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ba li .i { transform: rotate(90deg); width: 14px; height: 14px; color: var(--mute); }
  .stack > div, .spec > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .contacts li { grid-template-columns: auto minmax(0, 1fr); }
  .contacts__act { grid-column: 1 / -1; }
  .contacts__act .btn { flex: 1; }
  .deck__foot .btn { width: 100%; }
  .deck__ticks { gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .viz svg .leave { display: none; }
  .deck__track { scroll-behavior: auto; }
}

@media print {
  .top, .side, .nav, .keys { display: none !important; }
  .app { display: block; padding: 0; }
  .js .page { display: block !important; break-after: page; margin-bottom: 16px; }
}
