/* Kaerimi — Slate Reflection（青墨の顧み）
 * v0.2 全画面共通スタイル
 *
 * デザイン方向：
 *   - ベース：青墨（#101f1f）× 紙色（#f2f4f4）× 青鈍（#2e5e5e）+ 黄金（#c8a14a）
 *   - ロゴ準拠のクール・スレート基調（PRJ-006 logo01.svg 全色サンプリング）
 *   - 和文：Zen Kaku Gothic New（見出し）/ Noto Sans JP（本文）
 *     幾何学的・建築的なゴシック体で、ロゴの直線的フォルムと響き合わせる
 *   - 欧文：Inter（見出し・本文兼用）/ JetBrains Mono（コード）
 *     機能的でロゴと同じ建築トーン、italic も完備
 *
 * 真実源：1_projects/PRJ-006_logo/color_palette.md
 * 参照：  1_projects/PRJ-005_derivative_assets/output/lp_preview.html
 *        1_projects/PRJ-007_premium_multi_ai_diagnosis/ui_wireframe.md §7
 */

:root {
  /* ─── Ink（テキスト・暗部 6 段階。ロゴ実色） ─── */
  --sumi:      #101f1f;                  /* 青墨：主テキスト・ロゴ */
  --tetsu:     #283535;                  /* 鉄：強調テキスト */
  --nibi:      #334143;                  /* 鈍：見出し副 */
  --kasumi:    #687579;                  /* 霞：副テキスト */
  --usuzumi:   #8b979b;                  /* 薄墨：三次テキスト */
  --ginnezu:   #bbc8ca;                  /* 銀鼠：divider 強 */

  /* ─── Paper（明部・背景 4 段階） ─── */
  --paper:     #f2f4f4;                  /* 紙：全体背景 */
  --paper-2:   #fafbfb;                  /* 紙明：カード */
  --paper-3:   #ffffff;                  /* 白：入力欄 */
  --mist:      #e6eaea;                  /* 霧：弱 hover・well */

  /* ─── Line ─── */
  --line:        rgba(16, 31, 31, 0.10);
  --line-strong: rgba(16, 31, 31, 0.22);
  --line-dark:   rgba(187, 200, 202, 0.18);

  /* ─── Accent: 青鈍（主アクセント） ─── */
  --seiji:        #2e5e5e;
  --seiji-hover:  #1f4848;
  --seiji-soft:   rgba(46, 94, 94, 0.08);
  --seiji-line:   rgba(46, 94, 94, 0.28);

  /* ─── Accent: 黄金（副アクセント・プレミアム） ─── */
  --kogane:        #c8a14a;
  --kogane-hover:  #a8853a;
  --kogane-soft:   rgba(200, 161, 74, 0.10);

  /* ─── Semantic ─── */
  --warn:       #b94a3e;
  --warn-soft:  rgba(185, 74, 62, 0.08);
  --ok:         var(--seiji);
  --info:       var(--kasumi);

  /* ─── 旧変数 alias（既存 HTML 互換のため残置。color_palette.md §3 参照） ─── */
  --washi:    var(--paper);
  --washi-2:  var(--paper-2);
  --kinari:   var(--mist);
  --suo:      var(--seiji);
  --kogecha:  var(--seiji-hover);
  --tsuchi:   var(--kasumi);

  /* 旧ダークテーマ互換 */
  --bg:        var(--paper);
  --bg-card:   var(--paper-2);
  --bg-input:  var(--paper-3);
  --ink:       var(--sumi);
  --ink-dim:   var(--kasumi);
  --accent:    var(--seiji);

  /* ─── 8 Metals ─── */
  --m01: #D4A748;   /* gold */
  --m02: #C8CAD0;   /* platinum */
  --m03: #A8624A;   /* copper */
  --m04: #2F2F33;   /* iron */
  --m05: #947458;   /* bronze */
  --m06: #B0AC9E;   /* silver */
  --m07: #D8A890;   /* rose gold */
  --m08: #E8E4D8;   /* pure silver */

  --m01-grad: linear-gradient(135deg, #fdf5e0 0%, #f0e4c0 100%);
  --m02-grad: linear-gradient(135deg, #f5f6f8 0%, #dcdee2 100%);
  --m03-grad: linear-gradient(135deg, #f5e0d4 0%, #d8a890 100%);
  --m04-grad: linear-gradient(135deg, #d8d9dc 0%, #8a8b8e 100%);
  --m05-grad: linear-gradient(135deg, #d8c8a0 0%, #948468 100%);
  --m06-grad: linear-gradient(135deg, #f0f0ec 0%, #b0aca0 100%);
  --m07-grad: linear-gradient(135deg, #f5e0d4 0%, #e8b0a0 100%);
  --m08-grad: linear-gradient(135deg, #ffffff 0%, #e8e4d8 100%);

  /* ─── Typography（ロゴ準拠ゴシック体） ─── */
  --f-jp-head: "Zen Kaku Gothic New", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --f-jp-body: "Noto Sans JP", "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --f-en-head: "Inter", "Zen Kaku Gothic New", sans-serif;
  --f-en-body: "Inter", "Noto Sans JP", sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* 大きな表示数字用：ロゴ（幾何学サンセリフ）に最も近い書体 */
  --f-display: "Jost", "Inter", "Zen Kaku Gothic New", sans-serif;

  /* ─── Spacing ─── */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px;

  /* ─── Layout ─── */
  --container: 880px;
  --container-wide: 1080px;
  --container-narrow: 640px;
}

/* ─── Google Fonts は各 HTML の <head> で読み込み ─── */

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--washi);
}

body {
  background: var(--washi);
  color: var(--sumi);
  font-family: var(--f-jp-body);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  padding: 0;
}

/* 紙テクスチャ（控えめ・クール基調） */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    radial-gradient(rgba(16,31,31,0.028) 1px, transparent 1px),
    radial-gradient(rgba(16,31,31,0.016) 1px, transparent 1px);
  background-size: 24px 24px, 16px 16px;
  background-position: 0 0, 12px 12px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ─── コンテナ ─── */
.container, .container-wide, .container-narrow {
  margin: 0 auto;
  padding: 0 var(--s-5);
  position: relative;
  z-index: 2;
}
.container { max-width: var(--container); }
.container-wide { max-width: var(--container-wide); }
.container-narrow { max-width: var(--container-narrow); }

/* body 全体の余白（ヘッダー想定なしの単純レイアウト用） */
body > .container,
body > .container-wide,
body > .container-narrow {
  padding-top: var(--s-8);
  padding-bottom: var(--s-10);
}

/* ─── ヘッダー（共通） ─── */
.site-header {
  position: sticky; top: 0;
  background: rgba(242, 244, 244, 0.92);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}
.site-header .nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.site-header .brand {
  display: flex; align-items: center; gap: var(--s-3);
}
.site-header .brand-icon { width: 28px; height: 28px; }
.site-header .brand-logo { height: 24px; width: auto; }
.site-header .brand-mark {
  font-family: var(--f-jp-head);
  font-weight: 700;
  font-size: 20px;
  color: var(--suo);
  letter-spacing: 0;
}
.site-header .nav-links {
  display: flex; gap: var(--s-5);
  list-style: none;
}
.site-header .nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--tsuchi);
  transition: color 0.2s;
  padding: var(--s-2) 0;
}
.site-header .nav-links a:hover { color: var(--sumi); }

@media (max-width: 767px) {
  .site-header .nav { height: 56px; }
  .site-header .nav-links { display: none; }
}

/* ─── 見出し ─── */
h1, .h1 {
  font-family: var(--f-jp-head);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: var(--s-4);
  color: var(--sumi);
}
h1 em, .h1 em {
  font-style: normal;
  color: var(--suo);
  font-weight: 700;
}

h2, .h2 {
  font-family: var(--f-jp-head);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.4;
  margin-bottom: var(--s-3);
  color: var(--sumi);
  letter-spacing: -0.005em;
}

h3, .h3 {
  font-family: var(--f-jp-head);
  font-weight: 500;
  font-size: 16px;
  margin-bottom: var(--s-3);
  color: var(--sumi);
}

/* eyebrow（小見出し・ラベル） */
.label, .eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--suo);
  text-transform: uppercase;
  margin-bottom: var(--s-4);
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}
.label::before, .eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--suo);
}

.subtitle {
  font-size: 15px;
  line-height: 1.85;
  color: var(--tsuchi);
  margin-bottom: var(--s-7);
  max-width: 560px;
}

/* ─── カード ─── */
.card {
  background: var(--washi-2);
  border: 1px solid var(--line);
  padding: var(--s-6) var(--s-5);
  margin-bottom: var(--s-4);
  border-radius: 0;     /* 角ばった Editorial スタイル */
  transition: border-color 0.2s;
}
.card p, .card li {
  color: var(--tsuchi);
  font-size: 14px;
  line-height: 1.85;
}
.card ul { margin-left: 1.2em; }
.card h2 { color: var(--sumi); }
.card .section-title {
  color: var(--sumi);
  font-weight: 500;
  margin: var(--s-4) 0 var(--s-2);
  font-size: 14px;
}

/* ─── コード／モノスペース ─── */
.code, code {
  font-family: var(--f-mono);
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--line);
  padding: var(--s-3);
  border-radius: 2px;
  color: var(--sumi);
  overflow-x: auto;
  margin-top: var(--s-2);
  word-break: break-all;
  display: block;
}
code.inline {
  display: inline;
  padding: 2px 6px;
  margin: 0;
  background: var(--kinari);
  border: none;
}

/* ─── ステータス ─── */
.status-ok { color: var(--suo); font-weight: 500; }
.status-pending { color: var(--kogecha); }
.status-error { color: var(--warn); }

/* ─── フォーム要素 ─── */
.field { margin-bottom: var(--s-5); }
.field label {
  display: block;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--tsuchi);
  margin-bottom: var(--s-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.field input[type="email"],
.field input[type="text"],
.field textarea,
.field select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--sumi);
  font-size: 15px;
  padding: var(--s-3) var(--s-4);
  border-radius: 2px;
  font-family: var(--f-jp-body);
  transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--suo);
}

/* ─── ボタン ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  background: var(--sumi);
  color: var(--washi);
  border: none;
  padding: var(--s-4) var(--s-6);
  border-radius: 0;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.05em;
  cursor: pointer;
  font-family: var(--f-jp-body);
  transition: background 0.2s, padding 0.2s;
}
.btn::after {
  content: "→";
  font-family: var(--f-en-body);
  font-size: 16px;
  transition: transform 0.25s;
}
.btn:hover:not([disabled]) { background: var(--suo); padding-right: var(--s-7); }
.btn:hover:not([disabled])::after { transform: translateX(4px); }
.btn[disabled] { opacity: 0.35; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--sumi);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover:not([disabled]) { background: var(--sumi); color: var(--washi); border-color: var(--sumi); }

.btn-primary { background: var(--suo); }
.btn-primary:hover:not([disabled]) { background: var(--kogecha); }

/* ─── 同意フォーム ─── */
.consent-group {
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--line);
}
.consent-group:last-child { border-bottom: none; }
.consent-group .group-title {
  font-family: var(--f-jp-head);
  font-weight: 500;
  font-size: 15px;
  color: var(--sumi);
  margin-bottom: var(--s-3);
}
.consent-item {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  align-items: flex-start;
  cursor: pointer;
}
.consent-item input[type="checkbox"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--suo);
  cursor: pointer;
}
.consent-item .text {
  font-size: 14px;
  color: var(--sumi);
  line-height: 1.7;
}
.consent-item .text small {
  display: block;
  color: var(--tsuchi);
  font-size: 12px;
  margin-top: var(--s-1);
}
.consent-badge {
  display: inline-block;
  font-family: var(--f-jp-head);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 3px;
  margin-right: var(--s-2);
  vertical-align: 1px;
  letter-spacing: 0.04em;
}
.consent-badge.req { background: var(--suo); color: #fff; }
.consent-badge.opt { background: var(--washi); color: var(--tsuchi); border: 1px solid var(--line); }
.consent-item .text .title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-1);
}
.doc-btn {
  appearance: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--tsuchi);
  font-family: var(--f-jp-head);
  font-size: 12px;
  padding: 3px 10px;
  margin-top: var(--s-2);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.doc-btn:hover { border-color: var(--seiji); color: var(--sumi); }

/* ─── 同意文書モーダル ─── */
.doc-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
  background: rgba(28, 24, 22, 0.45);
}
.doc-modal.open { display: flex; }
.doc-modal-panel {
  background: var(--washi);
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(28, 24, 22, 0.25);
}
.doc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line);
}
.doc-modal-head h3 {
  font-family: var(--f-jp-head);
  font-size: 16px;
  font-weight: 500;
  color: var(--sumi);
  margin: 0;
}
.doc-modal-close {
  appearance: none;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--tsuchi);
  cursor: pointer;
  padding: 0 4px;
}
.doc-modal-body {
  padding: var(--s-5);
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.85;
  color: var(--sumi);
}
.doc-modal-body .doc-summary {
  background: var(--seiji-soft);
  border-left: 2px solid var(--seiji);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
  font-size: 13px;
  color: var(--kasumi);
}
.doc-modal-body h4 {
  font-family: var(--f-jp-head);
  font-size: 14px;
  font-weight: 500;
  color: var(--sumi);
  margin: var(--s-4) 0 var(--s-2);
}
.doc-modal-body p { margin: 0 0 var(--s-3); }
.doc-modal-body ul { margin: 0 0 var(--s-3) var(--s-4); }
.doc-modal-body li { margin-bottom: var(--s-1); }

/* ─── 注記ボックス ─── */
.notice {
  background: var(--seiji-soft);
  border-left: 2px solid var(--seiji);
  padding: var(--s-4) var(--s-5);
  margin: var(--s-4) 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--kasumi);
}
.notice-warn {
  background: var(--warn-soft);
  border-left-color: var(--warn);
}
.notice-premium {
  background: var(--kogane-soft);
  border-left-color: var(--kogane);
  color: var(--nibi);
}

/* ─── 開発バナー ─── */
.dev-banner {
  background: var(--seiji-soft);
  border: 1px dashed var(--seiji);
  color: var(--seiji-hover);
  padding: var(--s-3) var(--s-4);
  font-size: 12px;
  font-family: var(--f-mono);
  margin-bottom: var(--s-5);
}

/* ─── メッセージ ─── */
.msg {
  margin-top: var(--s-3);
  font-size: 13px;
  line-height: 1.7;
}
.msg.error { color: var(--warn); }
.msg.success { color: var(--suo); }

/* ─── アーキタイプ表示用 8 メタル ─── */
.archetype-medallion {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.archetype-medallion img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
}
.archetype-medallion.m01 { background: var(--m01-grad); }
.archetype-medallion.m02 { background: var(--m02-grad); }
.archetype-medallion.m03 { background: var(--m03-grad); }
.archetype-medallion.m04 { background: var(--m04-grad); }
.archetype-medallion.m05 { background: var(--m05-grad); }
.archetype-medallion.m06 { background: var(--m06-grad); }
.archetype-medallion.m07 { background: var(--m07-grad); }
.archetype-medallion.m08 { background: var(--m08-grad); }

.archetype-medallion.lg { width: 160px; height: 160px; }
.archetype-medallion.sm { width: 48px; height: 48px; }

/* ─── フッター ─── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--s-8) 0 var(--s-7);
  margin-top: var(--s-10);
  background: var(--washi);
  position: relative;
  z-index: 2;
}
.site-footer .footer-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.site-footer .footer-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.site-footer .footer-brand img { height: 28px; }
.site-footer .footer-tagline {
  font-family: var(--f-jp-head);
  font-size: 14px;
  color: var(--tsuchi);
}
.site-footer .footer-links {
  display: flex;
  gap: var(--s-5);
  flex-wrap: wrap;
  font-size: 13px;
}
.site-footer .footer-links a {
  color: var(--tsuchi);
  transition: color 0.2s;
}
.site-footer .footer-links a:hover { color: var(--suo); }
.site-footer .footer-meta {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--kasumi);
  letter-spacing: 0.05em;
}

/* ─── ローディング ─── */
.loading {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--kasumi);
  text-align: center;
  padding: var(--s-6);
  text-transform: uppercase;
}
.loading::after {
  content: " ...";
  animation: dots 1.2s steps(4) infinite;
}
@keyframes dots {
  0%   { content: ""; }
  25%  { content: " ."; }
  50%  { content: " .."; }
  75%  { content: " ..."; }
}

/* ─── Accessibility（2026-06-05 追加） ─── */

/* キーボードフォーカス：マウスクリック時は出さない（:focus-visible） */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--suo);
  outline-offset: 3px;
  border-radius: 2px;
}

/* リンク・ボタンのフォーカス強調 */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--suo);
  outline-offset: 3px;
}

/* チェックボックス・ラジオは囲い込み型 */
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--suo);
  outline-offset: 2px;
}

/* テキスト入力は内側へ */
input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="search"]:focus-visible,
input[type="url"]:focus-visible,
input[type="tel"]:focus-visible,
input[type="number"]:focus-visible,
input[type="password"]:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--suo);
  outline-offset: 0;
  border-color: var(--suo);
}

/* スキップリンク（必要に応じて HTML 側で追加：<a class="skip-link" href="#main">本文へスキップ</a>） */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--sumi);
  color: var(--paper);
  padding: var(--s-3) var(--s-4);
  text-decoration: none;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
}

/* 視覚的に隠してスクリーンリーダーには伝える */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* prefers-reduced-motion：アニメーションを最小化 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}

/* prefers-contrast: more — 高コントラストモード */
@media (prefers-contrast: more) {
  :root {
    --line:        rgba(16, 31, 31, 0.30);
    --line-strong: rgba(16, 31, 31, 0.50);
    --kasumi:      #4a565a;
    --usuzumi:     #5b676b;
  }
}
