/* Kerb 公式サイト — ライト基調・ミニマル
   ブランド紫 #6d28d9 は拡張アイコン (apps/extension/public/icon.svg) と揃える。
   日英は 1 ページに両言語を持ち、html[lang] で切り替える（lang.js）。
   JS 無効時は HTML の初期値 lang="ja" のまま日本語が表示される。 */

:root {
  --bg: #ffffff;
  --bg-subtle: #faf9fb;
  --fg: #18181b;
  --fg-muted: #52525b;
  --fg-faint: #71717a;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #6d28d9;
  --accent-hover: #5b21b6;
  --accent-bg: #f5f3ff;
  --accent-border: #ddd6fe;
  --warn: #b45309;
  --danger: #dc2626;
  --info: #2563eb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.05);
  --shadow-md: 0 4px 16px rgba(24, 24, 27, 0.07);
  --shadow-lg: 0 12px 40px rgba(24, 24, 27, 0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP',
    'Yu Gothic UI', Meiryo, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

/* ── 言語切替 ───────────────────────────────────────────────
   html の lang と一致しない言語の要素を隠す。属性セレクタ2つ＝
   クラスセレクタより詳細度が高いので !important は不要。 */
html[lang='ja'] [lang='en'],
html[lang='en'] [lang='ja'] {
  display: none;
}

* {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}

/* ── レイアウト ─────────────────────────────────────────── */
.container {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 24px;
}

.container--narrow {
  max-width: 760px;
}

.section {
  padding-block: 88px;
}

.section--subtle {
  background: var(--bg-subtle);
  border-block: 1px solid var(--border);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ── ヘッダー ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--fg);
  text-decoration: none;
}

/* 言語トグル */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-faint);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 11px;
  cursor: pointer;
  line-height: 1.6;
}

.lang-switch button[aria-pressed='true'] {
  background: var(--accent);
  color: #fff;
}

/* ── ボタン ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--ghost {
  background: #fff;
  color: var(--fg);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  border-color: var(--fg-faint);
}

/* CWS 申請前の「準備中」状態。申請後にリンクへ差し替える（index.html の CWS_URL 参照）*/
.btn--pending {
  background: var(--bg-subtle);
  color: var(--fg-faint);
  border-color: var(--border);
  cursor: default;
}

/* ── ヒーロー ───────────────────────────────────────────── */
.hero {
  padding-block: 96px 80px;
  background:
    radial-gradient(60% 70% at 15% 0%, var(--accent-bg) 0%, transparent 60%),
    radial-gradient(40% 60% at 95% 10%, #eef2ff 0%, transparent 55%);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 800;
  margin-bottom: 20px;
}

.hero__lede {
  font-size: 18px;
  color: var(--fg-muted);
  margin-bottom: 32px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.hero__note {
  font-size: 13px;
  color: var(--fg-faint);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--accent-border);
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ── 警告ダイアログのモック ──────────────────────────────
   実物 (apps/extension/src/components/WarningApp.tsx) の配色・
   文言・ボタン構成に合わせてある。実装を変えたらここも直すこと。 */
.mock {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* OS 中立なブラウザ枠。macOS のトラフィックライト（左上の 3 つの丸）は
   特定 OS を想起させるので使わない。タブ 1 枚だけで「ブラウザ」は伝わる。 */
.mock__chrome {
  display: flex;
  align-items: flex-end;
  padding: 9px 12px 0;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.mock__tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 70%;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock__favicon {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.mock__body {
  padding: 22px 24px 24px;
}

.mock__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--warn);
  margin-bottom: 10px;
}

.mock__text {
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
}

.mock__list {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: 13px;
  color: #374151;
}

.mock__rules {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 18px;
}

.mock__buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.mock__btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid transparent;
  white-space: nowrap;
}

.mock__btn--primary {
  background: var(--info);
  color: #fff;
}

.mock__btn--ghost {
  background: #fff;
  color: #4b5563;
  border-color: #9ca3af;
}

.mock__btn--danger {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
}

.mock__input {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--fg-muted);
  margin-bottom: 16px;
  word-break: break-all;
}

.mock__input b {
  color: var(--warn);
  font-weight: 600;
}

/* ── セクション共通 ─────────────────────────────────────── */
.section__head {
  max-width: 680px;
  margin-bottom: 48px;
}

.section__head h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  margin-bottom: 14px;
}

.section__head p {
  color: var(--fg-muted);
}

.grid {
  display: grid;
  gap: 24px;
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
}

.card p {
  font-size: 15px;
  color: var(--fg-muted);
}

.card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent);
  margin-bottom: 16px;
}

.card__count {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 12px;
}

.card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--fg-muted);
}

.card li {
  margin-bottom: 4px;
}

/* 対応サイト */
.sites {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.site-chip small {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  font-weight: 400;
}

/* 通信先テーブル */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 520px;
}

th,
td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--bg-subtle);
  font-weight: 600;
  font-size: 13px;
  color: var(--fg-muted);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td code {
  white-space: nowrap;
}

/* FAQ */
.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq details:last-child {
  border-bottom: 0;
}

.faq summary {
  padding: 18px 22px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  color: var(--accent);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  flex-shrink: 0;
}

.faq details[open] summary::after {
  content: '−';
}

.faq details > div {
  padding: 0 22px 20px;
  color: var(--fg-muted);
  font-size: 15px;
}

/* 注意書き */
.callout {
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 15px;
  color: var(--fg-muted);
}

.callout strong {
  color: var(--fg);
}

/* ── 法務ページ（privacy / terms）───────────────────────── */
.legal {
  padding-block: 64px 88px;
}

.legal h1 {
  font-size: clamp(1.75rem, 3.4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.legal .updated {
  color: var(--fg-faint);
  font-size: 14px;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.legal h2 {
  font-size: 20px;
  font-weight: 700;
  margin-top: 44px;
  margin-bottom: 14px;
}

.legal h3 {
  font-size: 16px;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 8px;
}

.legal p,
.legal li {
  color: var(--fg-muted);
  font-size: 15.5px;
}

.legal p + p {
  margin-top: 14px;
}

.legal ul,
.legal ol {
  padding-left: 22px;
  margin: 14px 0;
}

.legal li {
  margin-bottom: 8px;
}

.legal .table-wrap {
  margin: 18px 0;
}

.legal .lead {
  font-size: 16px;
  padding: 16px 20px;
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── お問い合わせ ───────────────────────────────────────── */
.form-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.form-frame iframe {
  display: block;
  width: 100%;
  border: 0;
  min-height: 620px;
}

/* ── フッター ───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding-block: 48px;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer a {
  color: var(--fg-muted);
  font-size: 14px;
}

.site-footer small {
  display: block;
  color: var(--fg-faint);
  font-size: 13px;
  margin-top: 12px;
}

/* ── 縁石（kerb）モチーフ ───────────────────────────────
   サーキットの縁石。コースの限界を教えるが走行は止めず、あるからこそ攻められる
   ——要件 §2.1 のビジョン「Kerbがあるから、AIは攻められる。」そのもの。
   F1 の赤白ではなくブランド紫×白にして、拡張アイコンとの整合を保つ。 */
.kerb-stripe {
  height: 12px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 14px, #ffffff 14px 28px);
}

.kerb-stripe--thin {
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--accent-border) 0 10px,
    #ffffff 10px 20px
  );
}

/* ── 提供状況バッジ ─────────────────────────────────────
   色だけで区別せず必ずテキストを持たせる（WCAG 1.4.1 色の使用）。 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}

.badge--live {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.badge--soon {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: var(--accent-border);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.card__head h3 {
  margin-bottom: 0;
}

/* ── 対応状況テーブル ───────────────────────────────────
   「いま使えるもの」と「これから増えるもの」を必ず同じ行に並べ、
   現状が上限ではないと一目で分かるようにする。 */
.status-table td:nth-child(3) {
  color: var(--fg-faint);
}

.status-table strong {
  font-weight: 600;
  color: var(--fg);
}

/* ── ロードマップ ───────────────────────────────────────
   縁石を縦のガイドラインに見立てる。 */
.roadmap {
  position: relative;
  padding-left: 32px;
  margin: 0;
  list-style: none;
}

.roadmap::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 9px;
  border-radius: 5px;
  background: repeating-linear-gradient(
    -45deg,
    var(--accent) 0 9px,
    var(--accent-bg) 9px 18px
  );
}

.roadmap li {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15.5px;
  color: var(--fg-muted);
}

.roadmap li:last-child {
  border-bottom: 0;
}

.roadmap b {
  color: var(--fg);
  font-weight: 600;
}

/* ── 料金プラン ─────────────────────────────────────────*/
.plans {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.plan {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.plan--current {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
}

.plan__name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.plan__price {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.plan__price small {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-faint);
  letter-spacing: 0;
}

.plan p {
  font-size: 15px;
  color: var(--fg-muted);
}

/* ── ユーティリティ ─────────────────────────────────────
   インライン style 属性を使わずに済ませるためのもの。style 属性を残すと
   _headers の CSP に style-src 'unsafe-inline' が必要になるため。 */
.mt-lg {
  margin-top: 28px;
}

.center {
  text-align: center;
}

.actions-center {
  justify-content: center;
}

.cta__title {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  margin-bottom: 14px;
}

.cta__lede {
  color: var(--fg-muted);
  margin-bottom: 28px;
}

/* ── レスポンシブ ───────────────────────────────────────── */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .grid--3,
  .grid--2,
  .plans {
    grid-template-columns: 1fr;
  }
  .section {
    padding-block: 64px;
  }
  .hero {
    padding-block: 64px 56px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15.5px;
  }
  .container {
    padding-inline: 18px;
  }
  .site-nav {
    gap: 14px;
  }
  /* 狭い画面ではナビのテキストリンクを畳み、言語トグルとCTAを優先する */
  .site-nav a:not(.btn) {
    display: none;
  }
  .section {
    padding-block: 52px;
  }
  .card {
    padding: 22px;
  }
  .hero__actions .btn {
    width: 100%;
  }
  .mock__buttons {
    justify-content: stretch;
  }
  .mock__btn {
    flex: 1;
    text-align: center;
  }
}
