/* =============================================================================
   base.css — リセット / タイポグラフィ / body
   tokens.css を前提に読み込むこと（@import 順：tokens → base → components → pages）
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------------------------------------------------------------------------
   リセット（モック冒頭と同じ最小リセット）
   --------------------------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ---------------------------------------------------------------------------
   body — アプリ地色 / 日本語前提のタイポ基礎
   --------------------------------------------------------------------------- */
body {
  background: var(--paper);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-feature-settings: "palt";          /* 日本語の詰めを有効化 */
  font-size: var(--fs-body);              /* 13px */
  line-height: var(--lh-body);            /* 1.8 ← 日本語本文は 1.7-1.8 を死守 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 見出し・段落の既定マージンは持たせず、レイアウト側で制御（モック流儀） */
h1, h2, h3, h4, h5, h6, p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  list-style: none;
}

/* ---------------------------------------------------------------------------
   メディア / フォーム要素の継承
   --------------------------------------------------------------------------- */
img, svg, video, canvas {
  display: block;
  max-width: 100%;
}

svg {
  flex-shrink: 0;          /* アイコンが潰れない */
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

textarea {
  resize: vertical;
}

a {
  color: var(--navy);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   フォーカスリング（§6-3 navy 3px ハロー）
   マウス操作では出さず、キーボード操作時のみ表示
   --------------------------------------------------------------------------- */
:focus {
  outline: none;
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-md);
}

/* ---------------------------------------------------------------------------
   タイポグラフィ ユーティリティ（§4-2 スケール）
   用途が1対1なので weight 込みで型を当てる
   --------------------------------------------------------------------------- */
.t-display {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  color: var(--navy);
}
.t-section {
  font-size: var(--fs-section);
  font-weight: 700;
  line-height: var(--lh-section);
  letter-spacing: var(--ls-section);
  color: var(--navy);
}
.t-client {
  font-size: var(--fs-client);
  font-weight: 700;
  line-height: var(--lh-client);
  color: var(--text);
}
.t-card {
  font-size: var(--fs-card);
  font-weight: 600;
  line-height: var(--lh-card);
  color: var(--text);
}
.t-body {
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--text-body);
}
.t-meta {
  font-size: var(--fs-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
  letter-spacing: var(--ls-meta);
  color: var(--text-muted);
}
.t-label {
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------------------------------------------------------------------------
   数字・日付・ID は固定幅（§4-2）
   .num を付与すると JetBrains Mono ＋ tabular-nums で揺れない
   --------------------------------------------------------------------------- */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ---------------------------------------------------------------------------
   テキストカラー ユーティリティ
   --------------------------------------------------------------------------- */
.text-navy   { color: var(--navy); }
.text-gold   { color: var(--gold); }
.text-body   { color: var(--text-body); }
.text-muted  { color: var(--text-muted); }
.text-faint  { color: var(--text-faint); }

/* ---------------------------------------------------------------------------
   アクセシビリティ補助
   --------------------------------------------------------------------------- */
/* スクリーンリーダー専用（視覚的に隠すがSRには読ませる） */
.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;
}

/* アニメーションを控える設定のユーザーには動きを止める */
@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;
  }
}
