/* ============================================================
   AI社員名鑑 v2
   方向: 昭和の人事興信録・紳士録。活版の名簿組版。
   トークン: 生成り紙×墨、アクセントは朱1色のみ。明朝主体。全直角。
   カードグリッドとカラータグは廃止（anti-ai-design準拠）。
   ============================================================ */

:root {
  --ink: #20242c;         /* 墨 */
  --ink-soft: #50555f;
  --ink-faint: #8b8e95;
  --paper: #f4f1e8;       /* 生成り */
  --paper-deep: #ece8db;
  --white: #faf8f2;
  --shu: #b3382c;         /* 朱。唯一のアクセント */
  --rule: #b7b2a3;        /* 罫 */
  --rule-light: #d6d2c4;

  --font-mincho: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-mono: "IBM Plex Mono", monospace;
  --font-sans: "IBM Plex Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-mincho);
  color: var(--ink);
  background: var(--paper);
  line-height: 2;
  font-size: 16px;
}
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--shu); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--shu); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-weight: 700; line-height: 1.5; word-break: auto-phrase; }

/* ---------- 印章。姓一字の朱印 ---------- */
.logo-seal, .seal-mark {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--shu); color: var(--white);
  font-family: var(--font-mincho); font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}
.logo-seal { width: 1.5em; height: 1.5em; font-size: 0.85em; margin-right: 9px; }

/* ---------- ヘッダー。紙に墨罫 ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--ink); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.site-header .logo { font-weight: 800; font-size: 1.12rem; letter-spacing: 0.14em; display: inline-flex; align-items: center; text-decoration: none; }
.site-header nav ul { display: flex; gap: 20px; list-style: none; }
.site-header nav a { font-size: 0.84rem; text-decoration: none; }
.site-header nav a:hover { color: var(--shu); }
.nav-pending { color: var(--ink-faint); font-size: 0.84rem; cursor: default; }
.nav-pending small { font-size: 0.7em; margin-left: 3px; }

/* ---------- 巻頭（表紙） ---------- */
.cover { border-bottom: 3px double var(--ink); background: var(--paper); }
.cover .wrap { padding: 56px 24px 44px; }
.cover-title {
  font-size: clamp(2.6rem, 7vw, 4.2rem); font-weight: 800; letter-spacing: 0.22em;
  line-height: 1.2; color: var(--ink);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.cover-title .edition {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.2em; color: var(--ink-soft);
  border: 1px solid var(--rule); padding: 6px 10px; writing-mode: vertical-rl; text-orientation: upright;
  align-self: center;
}
.cover h1 {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem); font-weight: 600; color: var(--ink-soft);
  margin-top: 20px; max-width: 42em; text-wrap: balance;
}
.cover .lede { margin-top: 16px; max-width: 40em; font-size: 0.95rem; color: var(--ink-soft); }
.cover .issue-line { margin-top: 26px; font-size: 0.82rem; color: var(--ink-faint); letter-spacing: 0.08em; border-top: 1px solid var(--rule-light); padding-top: 12px; display: flex; gap: 28px; flex-wrap: wrap; }

/* ---------- 凡例と目次 ---------- */
.front-matter { border-bottom: 1px solid var(--rule); }
.front-matter .wrap { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; padding: 34px 24px; }
.front-matter h2 { font-size: 0.95rem; letter-spacing: 0.3em; margin-bottom: 14px; }
.legend p { font-size: 0.88rem; color: var(--ink-soft); }
.legend .legend-live { color: var(--ink); }
.legend .legend-live::before { content: "◉"; color: var(--shu); margin-right: 6px; font-size: 0.8em; }
.toc ol { list-style: none; column-count: 2; column-gap: 36px; }
.toc li { font-size: 0.9rem; break-inside: avoid; border-bottom: 1px dotted var(--rule-light); }
.toc a { text-decoration: none; display: flex; justify-content: space-between; align-items: baseline; padding: 5px 2px; }
.toc a:hover { color: var(--shu); }
.toc .toc-count { font-family: var(--font-mono); font-size: 0.78em; color: var(--ink-faint); white-space: nowrap; flex-shrink: 0; margin-left: 12px; }

/* ---------- 名簿本体 ---------- */
.register { padding-bottom: 24px; }
.dept-block { border-bottom: 1px solid var(--rule); }
.dept-block .wrap { padding: 0 24px; }
.dept-head {
  display: baseline; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  padding: 30px 0 6px;
}
.dept-head .dept-no { font-size: 0.8rem; letter-spacing: 0.25em; color: var(--shu); font-weight: 700; }
.dept-head h2 { font-size: 1.45rem; letter-spacing: 0.12em; }
.dept-head .dept-count { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-faint); }
.dept-desc { font-size: 0.87rem; color: var(--ink-soft); margin-bottom: 14px; }

.member-rows { list-style: none; border-top: 2px solid var(--ink); margin-bottom: 34px; }
.member-rows li { border-bottom: 1px solid var(--rule-light); }
.member-row {
  display: grid; grid-template-columns: 34px 15em 1fr; gap: 14px; align-items: baseline;
  padding: 10px 4px;
}
.member-row .seal-mark { width: 26px; height: 26px; font-size: 0.8rem; align-self: center; }
.member-row .mr-name { font-size: 1.04rem; font-weight: 700; letter-spacing: 0.04em; }
.member-row .mr-name a { text-decoration: none; border-bottom: 1px solid var(--shu); padding-bottom: 1px; }
.member-row .mr-name a::after { content: "詳"; font-size: 0.62em; color: var(--white); background: var(--shu); padding: 1px 4px; margin-left: 8px; vertical-align: 2px; letter-spacing: 0; }
.member-row .mr-id { font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-faint); margin-left: 10px; letter-spacing: 0; }
.member-row .mr-position { font-family: var(--font-sans); font-size: 0.86rem; color: var(--ink-soft); }

/* ---------- 編集記（人の声） ---------- */
.editors-note { border-bottom: 3px double var(--ink); }
.editors-note .wrap { padding: 36px 24px 40px; }
.editors-note h2 { font-size: 0.95rem; letter-spacing: 0.3em; margin-bottom: 14px; }
.editors-note p { max-width: 42em; font-size: 0.93rem; color: var(--ink-soft); }
.editors-note .sign { margin-top: 14px; font-size: 0.85rem; color: var(--ink); text-align: right; max-width: 44em; }

/* ---------- 社員個別ページ（身上書） ---------- */
.member-page { padding: 44px 0 64px; }
.breadcrumb { font-size: 0.76rem; color: var(--ink-faint); margin-bottom: 24px; letter-spacing: 0.06em; }
.breadcrumb a { text-decoration: none; }
.breadcrumb .sep { margin: 0 7px; }

.sheet { background: var(--white); border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--paper-deep); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 30px 34px 24px; border-bottom: 2px solid var(--ink); }
.sheet-head .sh-left { flex: 1; }
.sheet-head .sh-kind { font-size: 0.76rem; letter-spacing: 0.3em; color: var(--ink-faint); margin-bottom: 10px; }
.sheet-head h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); font-weight: 800; letter-spacing: 0.1em; }
.sheet-head h1 .ph-position { display: block; font-size: 0.44em; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.14em; margin-top: 8px; }
.sheet-head .seal-mark { width: 72px; height: 72px; font-size: 2.1rem; flex-shrink: 0; }

.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table th, .sheet-table td { border-bottom: 1px solid var(--rule-light); vertical-align: top; text-align: left; }
.sheet-table th {
  width: 8.5em; padding: 16px 18px 16px 34px;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.35em; color: var(--ink);
  border-right: 1px solid var(--rule); white-space: nowrap;
}
.sheet-table td { padding: 16px 34px 16px 22px; font-size: 0.94rem; }
.sheet-table tr:last-child th, .sheet-table tr:last-child td { border-bottom: none; }
.sheet-table td .mono { font-family: var(--font-mono); font-size: 0.8em; color: var(--ink-faint); }

.duty-list { list-style: none; }
.duty-list li { display: flex; gap: 14px; padding: 3px 0; }
.duty-list li::before { content: attr(data-no); font-family: var(--font-mono); font-size: 0.76rem; color: var(--shu); padding-top: 5px; flex-shrink: 0; }
.plain-list { list-style: none; }
.plain-list li { padding: 2px 0; }
.plain-list li::before { content: "、"; color: var(--rule); }
.plain-list li:first-child::before { content: ""; }
.plain-list.inline li { display: inline; }
.gokui li { padding: 3px 0; }
.gokui li::before, .plain-list.gokui li:first-child::before { content: "一、"; color: var(--shu); margin-right: 2px; }
.origin-note { font-size: 0.9rem; color: var(--ink-soft); }
.origin-note strong { color: var(--ink); }

.colleague-line { font-family: var(--font-sans); font-size: 0.87rem; color: var(--ink-soft); }
.colleague-line .c-name { font-family: var(--font-mincho); color: var(--ink); font-weight: 700; margin-right: 2px; }

.sheet-foot { padding: 18px 34px; font-size: 0.78rem; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- 架空である旨の明示 ---------- */
.fiction-note { background: var(--paper-deep); border-top: 1px solid var(--rule); }
.fiction-note .wrap { padding: 20px 24px; }
.fiction-note p { font-size: 0.8rem; color: var(--ink-soft); max-width: 56em; font-family: var(--font-sans); }

/* ---------- フッター ---------- */
.site-footer { background: var(--paper); border-top: 1px solid var(--ink); }
.site-footer .wrap { padding: 30px 24px 40px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer-logo { font-weight: 800; letter-spacing: 0.1em; display: inline-flex; align-items: center; }
.site-footer nav ul { display: flex; gap: 18px; list-style: none; }
.site-footer nav a { font-size: 0.82rem; text-decoration: none; }
.site-footer .nav-pending { font-size: 0.82rem; }
.site-footer .copyright { font-size: 0.76rem; color: var(--ink-faint); font-family: var(--font-mono); }

/* ---------- モーション。表紙の題字のみ、静かに ---------- */
@media (prefers-reduced-motion: no-preference) {
  .cover-title { animation: settle 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
  @keyframes settle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 720px) {
  .front-matter .wrap { grid-template-columns: 1fr; gap: 26px; }
  .toc ol { column-count: 1; }
  .member-row { grid-template-columns: 30px 1fr; }
  .member-row .mr-position { grid-column: 2; margin-top: -4px; }
  .sheet-head { padding: 22px 20px 18px; }
  .sheet-table th { width: auto; padding: 12px 10px 12px 16px; letter-spacing: 0.15em; }
  .sheet-table td { padding: 12px 16px; }
  .sheet-foot { padding: 14px 20px; }
  .cover .wrap { padding: 40px 24px 34px; }
}
