/*
 * NumPath marketing site — styles
 *
 * 全ページ (index / privacy / support / 404) が読み込む単一スタイルシート。
 * ビルドステップはなく、この 1 ファイルで完結する。
 *
 * デザイントークン (:root の custom properties) は iOS アプリの DesignSystem
 * (パレット・角丸・スペーシング) をミラーしている。アプリ側のトークンを変えたら
 * ここも合わせる。
 *
 * 構成:
 *   1. Design tokens      … :root の変数
 *   2. Base / reset       … 要素セレクタの土台
 *   3. Site header / nav  … 全ページ共通のヘッダー
 *   4. Buttons            … .button 系
 *   5. Eyebrow            … アイコン付きの小見出し (全ページ共通)
 *   6. Hero               … index のヒーロー
 *   7. Sections           … index のセクション枠と見出し
 *   8. Feature cards      … index の「特徴」3 枚
 *   9. Story list         … index の「画面」交互レイアウト
 *  10. Tags               … ラベル (TARGET SUM / SMART HINT / CLEAR 等)
 *  11. Status panel       … index のリリースステータス
 *  12. Footer             … 全ページ共通のフッター
 *  13. Legal & support    … privacy.html / support.html
 *  13b. Changelog         … changelog.html のバージョン履歴
 *  14. Responsive         … メディアクエリ (860px / 560px)
 */

/* ============================================================
 * 1. Design tokens
 * ============================================================ */
:root {
  color-scheme: light;

  /* Surfaces */
  --app-background: #ebf6ff;
  --screen-background: #f2faff;
  --surface: #ffffff;
  --surface-subtle: #edf8ff;
  --border: #c5e3f4;
  --separator: #d4edf8;

  /* Text */
  --text-primary: #0a1520;
  --text-secondary: #4a6678;
  --text-muted: #7a96a8;

  /* Accent */
  --accent: #24afff;
  --accent-pressed: #0e9ae8;
  --accent-background: #d9f1ff;
  --accent-border: #99d8ff;
  /* Web 専用のアクセシブルなアクセント (WCAG AA)。--accent 系はアプリの DesignSystem
   * palette をミラーしており非テキスト用途 (枠線/アイコン背景) で使い続けるため据え置き、
   * テキスト/塗りだけこの濃いめの値へ差し替える。white 上 5.91:1・--accent-background 上 5.06:1。 */
  --accent-a11y: #0868a8;
  --accent-a11y-pressed: #065a8c;

  /* Semantic */
  --positive: #18bf8a;
  --positive-background: #e3faf4;
  --warning: #e88830;
  --warning-background: #fff4ea;
  --negative: #e8382e;
  --negative-background: #fff0ee;

  /* Elevation */
  --shadow: rgba(0, 40, 64, 0.08);

  /* Radius */
  --radius-small: 6px;
  --radius-medium: 8px;
  --radius-large: 16px;

  /* Spacing scale */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 24px;
  --space-7: 32px;

  /* Layout */
  --content: 1120px;
  --font-rounded: ui-rounded, "SF Pro Rounded", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

/* ============================================================
 * 2. Base / reset
 * ============================================================ */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--app-background);
  color: var(--text-primary);
  font-family: var(--font-rounded);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

/* ============================================================
 * 3. Site header / nav  (全ページ共通)
 * ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(197, 227, 244, 0.7);
  background: rgba(235, 246, 255, 0.9);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 32px, var(--content));
  margin: 0 auto;
  min-height: 68px;
  gap: var(--space-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-primary);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-medium);
  box-shadow: 0 4px 12px var(--shadow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.nav-links a,
.nav-links span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--space-4);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a:hover {
  background: var(--surface-subtle);
  color: var(--text-primary);
}

.status-pill {
  border: 1px solid var(--accent-border);
  background: var(--accent-background);
  color: var(--accent-a11y);
}

/* ============================================================
 * 4. Buttons
 * ============================================================ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-6);
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  background: var(--accent-a11y);
  color: white;
}

.button.primary:hover {
  background: var(--accent-a11y-pressed);
}

.button.secondary {
  border-color: var(--accent-border);
  background: var(--surface);
  color: var(--accent-a11y);
}

/* ============================================================
 * 5. Eyebrow  (アイコン付きの小見出し・全ページ共通)
 * ============================================================ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
  color: var(--accent-a11y);
  font-size: 14px;
  font-weight: 800;
}

.eyebrow img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-medium);
}

/* ============================================================
 * 6. Hero  (index)
 * ============================================================ */
.hero {
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 18%, rgba(36, 175, 255, 0.14), transparent 28rem),
    linear-gradient(180deg, var(--app-background) 0%, var(--screen-background) 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  width: min(100% - 32px, var(--content));
  margin: 0 auto;
  padding: clamp(32px, 5vw, 56px) 0 clamp(28px, 4vw, 44px);
}

h1 {
  max-width: 10em;
  margin-bottom: var(--space-5);
  font-size: clamp(44px, 8vw, 82px);
  line-height: 1.05;
  font-weight: 900;
  text-wrap: balance;
}

.nowrap {
  white-space: nowrap;
}

.lead {
  max-width: 34rem;
  margin-bottom: var(--space-6);
  color: var(--text-secondary);
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 700;
  line-height: 1.75;
}

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}

.hero-note {
  margin: var(--space-4) 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-7);
  max-width: 560px;
}

.metric {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 30px var(--shadow);
}

.metric strong {
  display: block;
  font-size: 28px;
  line-height: 1.2;
}

.metric span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.hero-shot {
  position: relative;
  justify-self: center;
  width: min(100%, 300px);
}

.hero-shot::before {
  position: absolute;
  inset: 14% -12% auto auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--positive-background);
  content: "";
}

.phone-shot {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  box-shadow: 0 24px 60px rgba(0, 40, 64, 0.16);
}

.phone-shot img {
  width: 100%;
}

/* ============================================================
 * 7. Sections  (index の枠と見出し)
 * ============================================================ */
.section {
  padding: clamp(56px, 8vw, 96px) 0;
}

.hero + .section {
  padding-top: clamp(36px, 5vw, 56px);
}

.section.subtle {
  background: var(--screen-background);
}

.section-inner {
  width: min(100% - 32px, var(--content));
  margin: 0 auto;
}

.section-heading {
  max-width: 720px;
  margin-bottom: var(--space-7);
}

/* section-heading と下位ページ (privacy/support/404/changelog) の見出しは
 * 同じ大見出しスタイルを共有する。素の h1 (LP ヒーロー用・最大 82px) には
 * フォールバックさせない — でないと下位ページのタイトルだけヒーロー級に肥大化する。 */
.section-heading h2,
.policy-article h1,
.support-hero h1,
.changelog-head h1 {
  margin-bottom: var(--space-4);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.14;
  font-weight: 900;
}

.section-heading p,
.policy-article .intro {
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 700;
}

/* ============================================================
 * 8. Feature cards  (index「特徴」)
 * ============================================================ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.feature-card {
  min-height: 100%;
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: 0 10px 30px var(--shadow);
}

.feature-card .number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: var(--space-5);
  border-radius: 50%;
  background: var(--accent-background);
  color: var(--accent-a11y);
  font-weight: 900;
}

/* カード見出しの共有タイポグラフィ (feature / story / status / support / policy) */
.feature-card h3,
.story-copy h3,
.status-panel h2,
.support-card h2,
.policy-article h2,
.changelog-body h2 {
  margin-bottom: var(--space-3);
  font-size: 22px;
  line-height: 1.35;
  font-weight: 900;
}

/* 本文テキストの共有色 */
.feature-card p,
.story-copy p,
.status-panel p,
.support-card p,
.policy-article p,
.policy-article li,
.changelog-changes li {
  color: var(--text-secondary);
}

/* ============================================================
 * 9. Story list  (index「画面」交互レイアウト)
 * ============================================================ */
.story-list {
  display: grid;
  gap: clamp(40px, 8vw, 84px);
}

.story {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
}

.story:nth-child(even) {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
}

.story:nth-child(even) .phone-shot {
  order: 2;
}

/* story-copy の見出しは §8 の共有スタイルより大きくする (順序: 共有ルールの後) */
.story-copy h3 {
  font-size: clamp(28px, 4vw, 44px);
}

/* ============================================================
 * 10. Tags  (TARGET SUM / SMART HINT / CLEAR 等のラベル)
 * ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: var(--space-4);
  padding: 0 var(--space-4);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-background);
  color: var(--accent-a11y);
  font-size: 13px;
  font-weight: 900;
}

.tag.warning {
  border-color: #ffd4a0;
  background: var(--warning-background);
  color: #a95812;
}

.tag.positive {
  border-color: #a8ecd6;
  background: var(--positive-background);
  color: #087a56;
}

/* ============================================================
 * 11. Status panel  (index のリリースステータス)
 * ============================================================ */
.status-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-6);
  align-items: center;
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: 0 10px 30px var(--shadow);
}

.status-panel ul,
.policy-article ul {
  padding-left: 1.2em;
}

/* ============================================================
 * 12. Footer  (全ページ共通)
 * ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  width: min(100% - 32px, var(--content));
  margin: 0 auto;
  padding: var(--space-6) 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ============================================================
 * 13. Legal & support pages  (privacy.html / support.html / 404)
 * ============================================================ */
.page-shell {
  background: linear-gradient(180deg, var(--app-background), var(--screen-background));
  min-height: calc(100svh - 68px);
}

.policy-article,
.support-layout {
  width: min(100% - 32px, 920px);
  margin: 0 auto;
  padding: clamp(40px, 8vw, 80px) 0;
}

.policy-article {
  max-width: 880px;
}

.policy-article header,
.support-hero {
  margin-bottom: var(--space-7);
}

.policy-article section,
.support-card {
  margin-top: var(--space-5);
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: 0 10px 30px var(--shadow);
}

.policy-article .updated {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 800;
}

.policy-article a,
.support-card a {
  color: var(--accent-a11y);
  font-weight: 800;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.support-card ul {
  padding-left: 1.2em;
  color: var(--text-secondary);
}

/* ============================================================
 * 13b. Changelog  (changelog.html)
 * ============================================================ */
.changelog {
  width: min(100% - 32px, 880px);
  margin: 0 auto;
  padding: clamp(40px, 8vw, 80px) 0;
}

.changelog-head {
  margin-bottom: var(--space-7);
}

.changelog-list {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.changelog-entry {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: var(--space-6);
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: 0 10px 30px var(--shadow);
}

.changelog-version {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 var(--space-4);
  border-radius: 999px;
  background: var(--accent-background);
  color: var(--accent-a11y);
  font-size: 18px;
  font-weight: 900;
}

.changelog-date {
  display: block;
  margin-top: var(--space-3);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
}

.changelog-changes {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.changelog-changes .tag {
  margin: 0 var(--space-3) 0 0;
  min-height: 26px;
  vertical-align: middle;
}

/* ============================================================
 * 14. Responsive
 * ============================================================ */
@media (max-width: 860px) {
  .nav {
    align-items: flex-start;
    min-height: auto;
    padding: var(--space-4) 0;
  }

  .nav-links {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .nav-links a,
  .nav-links span {
    min-height: 34px;
    padding: 0 var(--space-3);
    font-size: 13px;
  }

  .hero-inner,
  .story,
  .story:nth-child(even),
  .status-panel,
  .changelog-entry {
    grid-template-columns: 1fr;
  }

  .hero-shot {
    width: min(78vw, 360px);
  }

  .story:nth-child(even) .phone-shot {
    order: 0;
  }

  .feature-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .nav {
    width: min(100% - 24px, var(--content));
  }

  .brand span {
    display: none;
  }

  .nav-links {
    gap: 0;
  }

  .nav-links .optional {
    display: none;
  }

  .hero-inner,
  .section-inner,
  .policy-article,
  .support-layout,
  .footer-inner {
    width: min(100% - 24px, var(--content));
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .metric {
    padding: var(--space-4) var(--space-3);
  }

  .metric strong {
    font-size: 24px;
  }

  .metric span {
    display: block;
    font-size: 12px;
    line-height: 1.45;
  }

  .hero-actions,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  h1 {
    font-size: clamp(38px, 12vw, 48px);
  }

  .phone-shot {
    border-radius: 22px;
  }

  .hero-shot {
    display: none;
  }
}
