/* アプリ（bs-kakeibo.app）と同じ配色・字組みを使う。
   LP とアプリで見た目が変わると、登録した先が別物に見える。
   値の出どころは double-entry-bookkeeping-frontend の
   src/index.css と src/theme/theme.ts。 */
:root {
  --canvas: #f4f2ef;
  --surface: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --text: #1f1f1f;
  --text-dim: #6e6760;
  --accent: #ff9800;
  --accent-strong: #b36b00;
  --accent-soft: #fff8e1;
  --positive: #15803d;
  --negative: #c53030;

  /* 8pt グリッド */
  --s1: 0.5rem;
  --s2: 0.75rem;
  --s3: 1rem;
  --s4: 1.5rem;
  --s5: 2rem;
  --s6: 3rem;
  --s7: 4.5rem;

  --radius: 0.75rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);

  --max: 1080px;

  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro JP', 'Hiragino Sans',
    'Noto Sans JP', 'Yu Gothic', 'Meiryo', system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  line-height: 1.75;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

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

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

img {
  max-width: 100%;
}

/* ─── 共通 ─────────────────────────────────────────────────── */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

section {
  padding: clamp(48px, 8vw, 96px) 0;
}

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

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 600;
}

p {
  margin: 0;
}

.lead {
  color: var(--text-dim);
  font-size: 1rem;
  margin-top: var(--s2);
}

.section-head {
  margin-bottom: var(--s5);
  max-width: 44ch;
}

/* ─── ヘッダー ──────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s4);
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s1);
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
}

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

.nav-links {
  display: flex;
  gap: var(--s4);
  margin-left: auto;
  font-size: 0.9375rem;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  /* 指で押す対象は 44pt 以上。padding だけで高さを確保する */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

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

.nav-cta {
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .nav-cta {
    margin-left: auto;
  }
}

/* ─── ボタン ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  min-height: 44px; /* 指で押せる最小寸法 */
  padding: 0 var(--s4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* オレンジは明るく、白文字だと 2.16:1 まで落ちる。黒文字で 9.74:1。 */
.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  background: #ffa724;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.03);
}

.btn-lg {
  min-height: 52px;
  padding: 0 var(--s5);
  font-size: 1rem;
}

/* ─── ヒーロー ─────────────────────────────────────────────── */
.hero {
  padding-top: clamp(40px, 7vw, 80px);
  padding-bottom: clamp(40px, 7vw, 80px);
}

.hero h1 {
  font-size: clamp(1.875rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero .lead {
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  max-width: 34ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s5);
}

.hero-note {
  margin-top: var(--s3);
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s6);
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

/* B/S の見本 */
.bs-demo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--s4);
}

.bs-demo-title {
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-bottom: var(--s2);
}

.bs-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
}

.bs-col h4 {
  margin: 0 0 var(--s1);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.bs-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s1);
  font-size: 0.8125rem;
  padding: 5px 0;
}

.bs-row span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bs-total {
  margin-top: var(--s1);
  padding-top: var(--s1);
  border-top: 1px solid var(--border);
  font-weight: 700;
}

.bs-net {
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.bs-net strong {
  font-size: 1.375rem;
  font-variant-numeric: tabular-nums;
  color: var(--positive);
}

/* ─── カード群 ─────────────────────────────────────────────── */
.cards {
  display: grid;
  gap: var(--s3);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .cards-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 860px) {
  .cards-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s4);
}

.card h3 {
  margin-bottom: var(--s1);
}

.card p {
  color: var(--text-dim);
  font-size: 0.9375rem;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-soft);
  /* accent-strong は accent-soft の上で 3.94:1。記号を文字として扱うため
     もう一段暗くする。 */
  color: #7a4900;
  display: grid;
  place-items: center;
  margin-bottom: var(--s2);
  font-size: 1rem;
}

/* 悩みの列挙 */
.pains {
  display: grid;
  gap: var(--s2);
}

.pain {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--negative);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--s3) var(--s4);
  font-size: 0.9375rem;
}

/* 機能一覧 */
.features {
  display: grid;
  gap: var(--s2);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s3);
}

.feature strong {
  display: block;
  font-size: 0.9375rem;
  margin-bottom: 2px;
}

.feature span {
  color: var(--text-dim);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ─── 料金 ─────────────────────────────────────────────────── */
.plans {
  display: grid;
  gap: var(--s3);
  grid-template-columns: 1fr;
  align-items: stretch;
}

@media (min-width: 760px) {
  .plans {
    grid-template-columns: repeat(2, 1fr);
  }
}

.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s5);
  display: flex;
  flex-direction: column;
}

.plan-featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.plan-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dim);
}

.plan-price {
  margin: var(--s1) 0 var(--s3);
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plan-price small {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-dim);
}

.plan ul {
  list-style: none;
  margin: 0 0 var(--s4);
  padding: 0;
  display: grid;
  gap: var(--s1);
  font-size: 0.9375rem;
}

.plan li {
  display: flex;
  gap: var(--s1);
  align-items: flex-start;
}

.plan li::before {
  content: '✓';
  color: var(--positive);
  font-weight: 700;
  flex-shrink: 0;
}

.plan .btn {
  margin-top: auto;
}

.plan-note {
  margin-top: var(--s3);
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* ─── FAQ ──────────────────────────────────────────────────── */
.faq {
  display: grid;
  gap: var(--s1);
  max-width: 760px;
}

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s3) var(--s4);
}

summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  list-style: none;
}

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

summary::after {
  content: '+';
  margin-left: auto;
  color: var(--text-dim);
  font-weight: 400;
  font-size: 1.25rem;
}

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

details p {
  margin-top: var(--s2);
  color: var(--text-dim);
  font-size: 0.9375rem;
}

/* ─── 最終CTA ──────────────────────────────────────────────── */
.cta {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.cta .btn {
  margin-top: var(--s4);
}

/* ─── フッター ─────────────────────────────────────────────── */
footer {
  padding: var(--s5) 0;
  font-size: 0.875rem;
  color: var(--text-dim);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-left: auto;
}

.foot a {
  color: var(--text-dim);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.foot a:hover {
  color: var(--text);
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
