/*
  tokens/base.css
  UI品質ベースライン原則 v6.7 準拠。テーマ非依存の基礎トークン
  （余白・角丸・影・タイポグラフィ）。色トークンは themes/<preset>.css 側。
  SSOT検証（§1）はこのファイルと themes/<preset>.css を結合した内容の
  SHA-256ハッシュで行う（このファイル単体のハッシュではない点に注意）。
*/

:root {
  /* 余白スケール（4pxベース） */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* 角丸 */
  --radius-sm: 4px;
  --radius-md: 8px;

  /* 影 */
  --shadow-sm: 0 1px 2px rgba(27, 36, 48, 0.08), 0 1px 1px rgba(27, 36, 48, 0.06);

  /* タイポグラフィ */
  --font-family-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  --font-family-heading: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;

  --font-size-h1: 28px;
  --font-size-h2: 22px;
  --font-size-h3: 18px;
  --font-size-body: 16px;
  --font-size-sm: 14px;

  --font-weight-heading: 700;

  --line-height-body: 1.6;

  --content-reading-max: 70ch;
}

/*
  theme: business-blue
  UI品質ベースライン原則 v6.7 §1 準拠。
  すべてのコントラスト比は実計算値（fact）。計算式: WCAG 2.x 相対輝度
  (sRGB→linear: c<=0.04045 ? c/12.92 : ((c+0.055)/1.055)^2.4,
   L = 0.2126R + 0.7152G + 0.0722B) と (Lmax+0.05)/(Lmin+0.05)。
  再検証: /tmp/verify_contrast.py（同ロジックのPythonスクリプト）で全ペア再計算可能。

  --color-focus (#000000) は accent/accent-hover/success/warning/danger の
  塗り色すべてに対して3:1以上を満たすよう、それらの塗り色の輝度を
  意図的に [0.10, 0.1833] のウィンドウ内に収めて選定している。
  この制約を崩す色変更（accent/success/warning/danger の変更）は
  focusとの再検証必須。
*/

:root[data-theme-preset="business-blue"] {
  /* 面 */
  --color-bg: #F7F8FA;
  --color-surface: #FFFFFF;
  --color-surface-subtle: #EEF1F5;

  /* 文字 */
  --color-text: #1B2430;             /* vs bg 14.73:1 / vs surface 15.65:1 / vs surface-subtle 13.82:1 */
  --color-text-muted: #5B6472;       /* vs bg 5.63:1 / vs surface 5.98:1 */
  --color-text-disabled: #9AA2AC;    /* vs bg-disabled 2.12:1 — 非活性コントロールの意図的な例外（WCAG上、非活性要素は達成基準の対象外） */

  /* 境界線 */
  --color-border: #7E8286;           /* vs bg 3.64:1 / vs surface 3.87:1（非文字コントラスト3:1基準） */

  /* アクセント */
  --color-accent: #3766BF;           /* vs surface 5.50:1 / vs bg 5.18:1 */
  --color-accent-hover: #2C5AB2;
  --color-accent-subtle: #EAF0FD;    /* accent vs accent-subtle 4.82:1（安全マージン確保のため調整済み） */
  --color-on-accent: #FFFFFF;        /* vs accent 5.50:1 / vs accent-hover 6.54:1 */

  /* フォーカスリング（単一トークン、7面すべてに対し3:1以上を実計算で確認済み） */
  --color-focus: #000000;
  /* focus vs bg 19.76:1, vs surface 21.00:1, vs surface-subtle 18.54:1,
     vs accent 3.82:1, vs accent-hover 3.21:1, vs success 4.00:1,
     vs warning 4.01:1, vs danger 3.81:1 */

  /* リンク */
  --color-link: #3766BF;             /* vs bg 5.18:1 / vs surface 5.50:1 */
  --color-link-hover: #2C5AB2;

  /* ステータス */
  --color-success: #247B47;
  --color-on-success: #FFFFFF;       /* vs success 5.25:1 */
  --color-warning: #9B5E16;
  --color-on-warning: #FFFFFF;       /* vs warning 5.24:1 */
  --color-danger: #B93F2E;
  --color-on-danger: #FFFFFF;        /* vs danger 5.51:1 */

  /* その他の面 */
  --color-bg-disabled: #E7E9EC;
  --color-overlay: rgba(27, 36, 48, 0.5);

  /* チャート系列（背景bgに対し全て3:1以上、意図的にやや暗めの輝度ターゲット0.20で再導出） */
  --color-chart-1: #2B7FCC; /* vs bg 3.94:1 */
  --color-chart-2: #238A78; /* vs bg 3.97:1 */
  --color-chart-3: #9666C5; /* vs bg 3.95:1 */
  --color-chart-4: #A96F18; /* vs bg 3.97:1 */
  --color-chart-5: #CC4E8A; /* vs bg 3.93:1 */
  --color-chart-6: #758226; /* vs bg 3.97:1 */
}
