/* ============================================
   Design Tokens — 日本人非エンジニア向け
   Boxil / ITreview / freee 風（白+青+オレンジ）
   ============================================ */

:root {
  /* === 背景・サーフェス === */
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --bg-section: #f3f5f9;
  --surface: #ffffff;
  --surface-recessed: #f7f8fa;
  --surface-elevated: #ffffff;

  /* === テキスト === */
  --ink: #0f1729;        /* 主要テキスト（より黒く） */
  --ink-soft: #2d3748;   /* 説明テキスト（コントラスト強化） */
  --muted: #5a6577;      /* 補助情報（薄すぎず読める） */
  --muted-light: #8b95a6;

  /* === ボーダー === */
  --border: #e4e8ee;
  --border-strong: #d0d6df;

  /* === ブランドカラー === */
  --primary: #2563eb;          /* 信頼の青（リンク・CTA） */
  --primary-soft: #dbeafe;
  --primary-dark: #1d4ed8;
  --primary-hover: #1e40af;

  --accent: #f97316;           /* オレンジ（評価・注目） */
  --accent-soft: #fed7aa;
  --accent-dark: #ea580c;

  --rating: #fbbf24;           /* 星評価の金色 */
  --rating-bg: #fef3c7;

  /* === ステータス === */
  --success: #10b981;
  --success-soft: #d1fae5;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --info: #06b6d4;
  --info-soft: #cffafe;

  /* === ランキング === */
  --rank-1: #f59e0b;    /* 金 */
  --rank-2: #94a3b8;    /* 銀 */
  --rank-3: #d97706;    /* 銅 */

  /* === タイポグラフィ === */
  --font-sans: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --font-display: "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", "Courier New", monospace;
  --font-num: "Inter", system-ui, sans-serif;

  /* === レイアウト === */
  --container-max: 1200px;
  --container-pad: 20px;
  --content-max: 960px;

  /* === シャドウ === */
  --shadow-sm: 0 1px 2px rgba(26, 31, 46, 0.04);
  --shadow-md: 0 2px 8px rgba(26, 31, 46, 0.06);
  --shadow-lg: 0 4px 16px rgba(26, 31, 46, 0.08);
  --shadow-hover: 0 8px 24px rgba(37, 99, 235, 0.12);

  /* === radius === */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 999px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --bg-alt: #1a1f2a;
    --bg-section: #161b24;
    --surface: #1a1f2a;
    --surface-recessed: #0f1419;
    --surface-elevated: #232938;

    /* テキスト：高コントラスト寄りに */
    --ink: #ffffff;
    --ink-soft: #e2e8f0;
    --muted: #b0bac9;
    --muted-light: #8b95a6;

    --border: #2a3140;
    --border-strong: #3a4254;

    --primary: #60a5fa;
    --primary-soft: #1e3a8a;
    --primary-dark: #3b82f6;
    --primary-hover: #93c5fd;

    --accent: #fb923c;
    --accent-soft: #7c2d12;
    --accent-dark: #f97316;

    --rating: #fcd34d;
    --rating-bg: #422006;

    --success: #34d399;
    --success-soft: #064e3b;
    --warning: #fbbf24;
    --warning-soft: #422006;
    --danger: #f87171;
    --danger-soft: #7f1d1d;
    --info: #22d3ee;
    --info-soft: #164e63;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 24px rgba(96, 165, 250, 0.2);
  }
}

/* ============================================
   リセット
   ============================================ */

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }

img { max-width: 100%; height: auto; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol { list-style: none; }

/* ============================================
   共通ユーティリティ
   ============================================ */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.content {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ============================================
   見出し（すべてゴシック）
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 { font-size: 28px; font-weight: 900; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
h4 { font-size: 15px; font-weight: 700; }

p { margin-bottom: 12px; }

/* ============================================
   バッジ・チップ
   ============================================ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  background: var(--bg-alt);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.chip--primary { background: var(--primary-soft); color: var(--primary-dark); }
.chip--accent { background: var(--accent-soft); color: var(--accent-dark); }
.chip--success { background: var(--success-soft); color: var(--success); font-weight: 700; }
.chip--warning { background: var(--warning-soft); color: var(--warning); }
.chip--danger { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.chip--rating { background: var(--rating-bg); color: var(--accent-dark); font-weight: 700; }

/* ============================================
   ボタン
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover {
  background: var(--bg-alt);
  color: var(--primary);
  border-color: var(--primary);
}

.btn--accent {
  background: var(--accent);
  border-color: var(--accent);
}
.btn--accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn--lg {
  padding: 14px 28px;
  font-size: 15px;
}

.btn--sm {
  padding: 7px 14px;
  font-size: 12px;
}

/* ============================================
   星評価
   ============================================ */

.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-num);
  font-weight: 700;
  color: var(--accent-dark);
}

.star-rating__icon {
  color: var(--rating);
  font-size: 14px;
  line-height: 1;
}

.star-rating__num {
  font-size: 15px;
  line-height: 1;
}

.star-rating__count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 2px;
}

.star-rating--large .star-rating__icon { font-size: 20px; }
.star-rating--large .star-rating__num { font-size: 22px; }
.star-rating--large .star-rating__count { font-size: 12px; }

/* ============================================
   ランキング表示
   ============================================ */

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  font-family: var(--font-num);
  font-weight: 900;
  font-size: 14px;
  background: var(--bg-alt);
  color: var(--ink-soft);
}
.rank-badge--1 { background: var(--rank-1); color: white; }
.rank-badge--2 { background: var(--rank-2); color: white; }
.rank-badge--3 { background: var(--rank-3); color: white; }

/* ============================================
   セクション見出し
   ============================================ */

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--primary);
}

.section-title__icon {
  width: 6px;
  height: 24px;
  background: var(--primary);
  border-radius: 3px;
}

.section-title__text {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
}

.section-title__count {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* ============================================
   アニメーション
   ============================================ */

@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .animate-fade-up { animation: fadeUp 0.4s ease-out backwards; }
}
