/* =========================================================================
   komavideo ポータル 共有スタイル
   DESIGN.md（Lovable 風：温かいクリーム地・チャコール文字・ボーダー基調）を
   実装し、純日本語サイト向けに日本語タイポグラフィを補完したもの。
   ========================================================================= */

/* ---- デザイントークン ---- */
:root {
  /* 基調色 */
  --cream: #f7f4ed;          /* ページ背景・カード面 */
  --charcoal: #1c1c1c;       /* 主要テキスト・見出し・濃ボタン */
  --offwhite: #fcfbf8;       /* 濃地の上のテキスト */
  --border: #eceae4;         /* カードボーダー・区切り線 */
  --muted: #5f5f5d;          /* 補助テキスト・キャプション */

  /* 不透明度ベースのグレー（すべて charcoal 由来） */
  --charcoal-83: rgba(28, 28, 28, 0.83);
  --charcoal-82: rgba(28, 28, 28, 0.82);
  --charcoal-40: rgba(28, 28, 28, 0.40);
  --charcoal-08: rgba(28, 28, 28, 0.08);
  --charcoal-04: rgba(28, 28, 28, 0.04);
  --charcoal-03: rgba(28, 28, 28, 0.03);

  /* 影 */
  --inset-shadow: rgba(255,255,255,0.2) 0px 0.5px 0px 0px inset,
                  rgba(0,0,0,0.2) 0px 0px 0px 0.5px inset,
                  rgba(0,0,0,0.05) 0px 1px 2px 0px;
  --focus-shadow: rgba(0,0,0,0.1) 0px 4px 12px;

  /* 角丸スケール */
  --r-micro: 4px;
  --r-std: 6px;
  --r-comfy: 8px;
  --r-card: 12px;
  --r-container: 16px;
  --r-pill: 9999px;

  /* 余白スケール（8px ベース） */
  --s-1: 8px;  --s-2: 12px; --s-3: 16px; --s-4: 24px;
  --s-5: 32px; --s-6: 40px; --s-7: 56px; --s-8: 80px;
  --s-9: 96px; --s-10: 128px;

  /* タイポグラフィ（日本語フォントスタックを補完） */
  --font-jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
             "BIZ UDPGothic", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --font-brand: "Camera Plain Variable", ui-sans-serif, system-ui, var(--font-jp);

  /* チェックリスト用チェックマーク（Lucide check / ISC）。mask で使うため色は無関係 */
  --icon-check: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20%206%209%2017l-5-5'/%3E%3C/svg%3E");

  --maxw: 1200px;
}

/* ---- リセット & ベース ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.7;
  color: var(--charcoal-82);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--charcoal); text-decoration: none; }
h1, h2, h3, h4 { color: var(--charcoal); font-weight: 600; line-height: 1.25; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* インライン SVG アイコン（システム依存の絵文字を置換）。stroke は currentColor で文字色を継承 */
.icon { width: 24px; height: 24px; display: inline-block; vertical-align: middle; flex: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-4); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid rgba(59,130,246,0.6); outline-offset: 2px; }

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-jp); font-size: 16px; font-weight: 400; line-height: 1.5;
  padding: 10px 18px; border-radius: var(--r-std); cursor: pointer;
  border: 1px solid transparent; transition: opacity .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { opacity: .8; }
.btn-dark { background: var(--charcoal); color: var(--offwhite); box-shadow: var(--inset-shadow); }
.btn-dark:hover { box-shadow: var(--inset-shadow), var(--focus-shadow); }
.btn-ghost { background: transparent; color: var(--charcoal); border-color: var(--charcoal-40); }
.btn-ghost:hover { box-shadow: var(--focus-shadow); }
.btn-sm { font-size: 14px; padding: 8px 14px; }
.btn-block { width: 100%; }

/* ---- ナビ ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247,244,237,0.86); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .2s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; }
.brand-mark {
  font-family: var(--font-brand); font-weight: 600; font-size: 22px;
  letter-spacing: -0.5px; color: var(--charcoal);
}
.brand-tag { font-size: 12px; color: var(--muted); display: none; }
.nav-links { display: flex; align-items: center; gap: var(--s-4); }
.nav-links a { font-size: 15px; color: var(--charcoal); }
.nav-links a:hover { text-decoration: underline; }
.nav-toggle {
  display: none; background: var(--cream); border: 1px solid var(--border);
  border-radius: var(--r-std); width: 40px; height: 40px; cursor: pointer; color: var(--charcoal);
}
.nav-toggle .icon { width: 22px; height: 22px; }

/* ---- ヒーロー ---- */
.hero { position: relative; padding: var(--s-9) 0 var(--s-8); text-align: center; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 80%;
  background:
    radial-gradient(40% 60% at 20% 20%, rgba(255,179,153,0.30), transparent 70%),
    radial-gradient(45% 55% at 80% 25%, rgba(153,196,255,0.28), transparent 70%),
    radial-gradient(50% 60% at 55% 70%, rgba(255,221,153,0.26), transparent 70%);
  filter: blur(8px); z-index: 0; pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(34px, 6vw, 60px); font-weight: 600; line-height: 1.12;
  letter-spacing: -0.04em; color: var(--charcoal);
}
.hero .lead {
  margin: var(--s-3) auto 0; max-width: 640px; font-size: clamp(16px, 2.2vw, 19px);
  color: var(--muted); line-height: 1.6;
}
.hero-cta { margin-top: var(--s-5); display: flex; gap: var(--s-2); justify-content: center; flex-wrap: wrap; }

/* ---- 統計バー ---- */
.stats { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4);
  padding: var(--s-6) 0; text-align: center;
}
.stat-num { font-family: var(--font-brand); font-size: clamp(28px, 4vw, 44px); font-weight: 600; letter-spacing: -0.03em; color: var(--charcoal); }
.stat-label { margin-top: 4px; font-size: 14px; color: var(--muted); }

/* ---- セクション共通 ---- */
.section { padding: var(--s-8) 0; }
.section-head { max-width: 720px; margin-bottom: var(--s-5); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.03em; }
.section-head p { margin-top: var(--s-2); color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

/* ---- フィルターチップ ---- */
.filters { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-bottom: var(--s-5); }
.chip {
  font-family: var(--font-jp); font-size: 14px; color: var(--charcoal);
  background: var(--cream); border: 1px solid var(--border);
  padding: 7px 16px; border-radius: var(--r-pill); cursor: pointer; transition: all .15s ease;
}
.chip:hover { background: var(--charcoal-04); }
.chip[aria-pressed="true"] { background: var(--charcoal); color: var(--offwhite); border-color: var(--charcoal); }

/* ---- アプリカードグリッド ---- */
.cat-block { margin-bottom: var(--s-7); }
.cat-block.is-hidden { display: none; }
.cat-title { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-4); }
.cat-title h3 { font-size: 20px; }
.cat-title .count { font-size: 13px; color: var(--muted); background: var(--charcoal-04); border-radius: var(--r-pill); padding: 2px 10px; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.app-card {
  display: flex; flex-direction: column; background: var(--cream);
  border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.app-card.is-hidden { display: none; }
.app-card:hover { border-color: var(--charcoal-40); transform: translateY(-2px); box-shadow: var(--focus-shadow); }
.app-card a.card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.card-banner { aspect-ratio: 1200 / 630; background: var(--charcoal-04); border-bottom: 1px solid var(--border); }
.card-banner img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: var(--s-3); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-icon { width: 36px; height: 36px; border-radius: var(--r-comfy); border: 1px solid var(--border); flex: none; background: #fff; }
.card-title { font-size: 17px; font-weight: 600; color: var(--charcoal); }
.card-catch { font-size: 14px; color: var(--muted); line-height: 1.55; flex: 1; }

/* プラットフォームバッジ */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--charcoal-82);
  background: var(--charcoal-04); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 2px 9px;
}
.badge.web { color: #1f6f50; }
.badge.ios { color: #2b4d8c; }
.badge.steam { color: #3a3a6a; }

/* ---- 「共通の約束」 ---- */
.promise-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.promise {
  background: var(--cream); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: var(--s-4); text-align: center;
}
.promise .ico { line-height: 0; }
.promise .ico .icon { width: 30px; height: 30px; color: var(--charcoal); }
.promise h3 { font-size: 17px; margin-top: 8px; }
.promise p { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* ---- About ---- */
.about { background: var(--charcoal-03); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.about .container { max-width: 760px; text-align: center; }

/* ---- フッター ---- */
.site-footer { padding: var(--s-7) 0 var(--s-6); }
.footer-inner { border: 1px solid var(--border); border-radius: var(--r-container); padding: var(--s-6); background: var(--cream); }
.footer-grid { display: grid; grid-template-columns: 1.4fr .9fr 1fr 1fr; gap: var(--s-5); }
.footer-brand .brand-mark { font-size: 20px; }
.footer-brand p { margin-top: 10px; font-size: 14px; color: var(--muted); max-width: 320px; }
.footer-col h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.footer-col a { display: block; font-size: 14px; color: var(--charcoal); padding: 4px 0; }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom { margin-top: var(--s-5); padding-top: var(--s-3); border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* =========================================================================
   個別アプリページ
   ========================================================================= */
.app-hero { padding: var(--s-7) 0 var(--s-6); border-bottom: 1px solid var(--border); }
.app-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); align-items: center; }
.app-hero-media { border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; aspect-ratio: 1200/630; background: var(--charcoal-04); }
.app-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.app-hero-head { display: flex; align-items: center; gap: 14px; margin-bottom: var(--s-2); }
.app-hero-head img { width: 56px; height: 56px; border-radius: var(--r-comfy); border: 1px solid var(--border); background: #fff; }
.app-hero h1 { font-size: clamp(28px, 4.5vw, 40px); letter-spacing: -0.03em; }
.app-catch { margin-top: var(--s-2); font-size: 18px; color: var(--charcoal-82); line-height: 1.6; }
.app-hero-cta { margin-top: var(--s-4); display: flex; gap: var(--s-2); flex-wrap: wrap; }

.breadcrumb { font-size: 13px; color: var(--muted); padding: var(--s-3) 0 0; }
.breadcrumb a { color: var(--muted); } .breadcrumb a:hover { text-decoration: underline; }

.lead-text { font-size: 18px; line-height: 1.8; color: var(--charcoal-82); max-width: 760px; }

/* 使い方 3 ステップ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); counter-reset: step; }
.step { position: relative; background: var(--cream); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s-4); }
.step .ico { line-height: 0; }
.step .ico .icon { width: 28px; height: 28px; color: var(--charcoal); }
.step h3 { font-size: 17px; margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.step h3::before { counter-increment: step; content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; font-size: 13px; background: var(--charcoal); color: var(--offwhite); border-radius: var(--r-pill); }
.step p { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* 主な機能 */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
.feature { background: var(--cream); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s-4); }
.feature h3 { font-size: 16px; }
.feature p { font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

/* おすすめ（チェックリスト） */
.checklist { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2) var(--s-4); }
.checklist li { display: flex; gap: 10px; font-size: 15px; color: var(--charcoal-82); }
/* チェックマークは絵文字をやめ、data-URI の SVG を mask で描画（色は background-color で指定） */
.checklist li::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px;
  background-color: #1f6f50;
  -webkit-mask: var(--icon-check) center / contain no-repeat;
  mask: var(--icon-check) center / contain no-repeat;
}

/* 強み */
.strength-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.strength { border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s-4); background: var(--cream); }
.strength h3 { font-size: 15px; } .strength p { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* CTA バンド */
.cta-band { background: var(--charcoal); color: var(--offwhite); border-radius: var(--r-container); padding: var(--s-6); text-align: center; }
.cta-band h2 { color: var(--offwhite); font-size: clamp(22px, 3vw, 30px); }
.cta-band p { color: rgba(252,251,248,0.7); margin-top: 10px; }
.cta-band .btn-ghost { color: var(--offwhite); border-color: rgba(252,251,248,0.4); }
.cta-band .hero-cta { margin-top: var(--s-4); }

/* 関連アプリ（小カード） */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }

/* =========================================================================
   レスポンシブ
   ========================================================================= */
@media (min-width: 720px) { .brand-tag { display: inline; } }

@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2);
    position: absolute; top: 64px; left: 0; right: 0; padding: var(--s-3) var(--s-4);
    background: var(--cream); border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .card-grid, .related-grid { grid-template-columns: repeat(2, 1fr); }
  .app-hero-grid { grid-template-columns: 1fr; }
  .app-hero-media { order: -1; }
}

@media (max-width: 600px) {
  .container { padding: 0 var(--s-3); }
  .section { padding: var(--s-7) 0; }
  .hero { padding: var(--s-7) 0 var(--s-6); }
  .stats-grid { grid-template-columns: 1fr; gap: var(--s-3); }
  .card-grid, .related-grid, .promise-grid, .steps, .feature-grid, .checklist, .strength-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-inner { padding: var(--s-4); }
}
