/*
 * 日本語の LP(/)と法務のページ(/legal/)の版面(#1198)。DESIGN.md の「LP」の節に従う。
 * 色・余白・角丸は design-tokens.css(web/src/design-tokens.css の写し。web/src/landingPage.test.ts が
 * 一致を確かめる)の --mb-* だけを使い、値を書き写さない。影・ピル形・円・面塗りの装飾は使わない。
 * 文字の大きさは 6 段(micro 11・caption 13・body 16・subhead 19・heading 24)と、LP の hero 見出し
 * (27〜54px)・節の見出し(28〜40px)だけ。行の高さは和文の長い説明を読む LP の版面に合わせる。
 * CSP の style-src 'self' のため、HTML に style 属性と <style> を書かない。
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: var(--mb-spacing-lg);
}

body {
  margin: 0;
  background: var(--mb-color-surface);
  color: var(--mb-color-on-surface);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.85;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--mb-color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--mb-color-primary);
  outline-offset: 2px;
}

/* 「本文へ移動」の先。tabindex="-1" で focus を受け、次の Tab を本文の最初の操作へ進める。 */
main:focus {
  outline: none;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--mb-spacing-md);
}

.skip {
  position: absolute;
  left: var(--mb-spacing-md);
  top: -80px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--mb-spacing-sm);
  border: 2px solid var(--mb-color-primary);
  background: var(--mb-color-surface);
}

.skip:focus {
  top: var(--mb-spacing-sm);
}

/* ---- 段(DESIGN.md の 6 段) ---- */
.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.09em;
}

.caption {
  font-size: 13px;
  line-height: 1.7;
}

.muted {
  color: var(--mb-color-muted);
}

.numeric {
  font-variant-numeric: tabular-nums;
}

/* ---- ヘッダーとフッター ---- */
.header {
  border-bottom: 1px solid var(--mb-color-line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mb-spacing-md);
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--mb-spacing-sm);
  min-height: 44px;
  color: var(--mb-color-on-surface);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.018em;
  text-decoration: none;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: var(--mb-spacing-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 文中の link も操作領域を 44×44px 以上にする(DESIGN.md の「Layout」と「LP」)。文字の大きさは周りのまま。 */
.inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}

.navlinks a,
.footer-links a,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  font-size: 13px;
  line-height: 1.45;
}

.footer {
  margin-top: var(--mb-spacing-2xl);
  border-top: 1px solid var(--mb-color-line);
  padding: var(--mb-spacing-lg) 0 var(--mb-spacing-xl);
}

.footer-name {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--mb-spacing-lg);
  margin: var(--mb-spacing-sm) 0;
  padding: 0;
  list-style: none;
}

/* ---- 操作 ---- */
/* 主の操作は DESIGN.md の primary: primary の面、surface の文字、角 action、太字、高さ 48px。 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--mb-spacing-lg);
  border: 1px solid var(--mb-color-primary);
  border-radius: var(--mb-rounded-action);
  background: var(--mb-color-primary);
  color: var(--mb-color-surface);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.55;
  text-decoration: none;
}

/* ---- hero ---- */
.hero {
  display: grid;
  gap: var(--mb-spacing-xl);
  padding-top: var(--mb-spacing-xl);
  padding-bottom: var(--mb-spacing-xl);
}

.hero h1 {
  margin: var(--mb-spacing-sm) 0 var(--mb-spacing-md);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.03em;
}

/* 見出しは句の途中で折り返さない。 */
.phrase {
  display: inline-block;
}

.lead {
  margin: 0;
  font-size: 16px;
  line-height: 2;
}

.hero-actions {
  margin: var(--mb-spacing-lg) 0 0;
}

.hero-note {
  margin: var(--mb-spacing-sm) 0 0;
}

/*
 * 最初の画面の「会話 → 帳簿の 1 行」の図(DESIGN.md の「LP」、#1388)。話した一文(subhead)から
 * 矢印と行き先の名前(body)で、帳簿の 1 行(時刻・品数・kcal と印「済」)へつなぐ。帳簿の行は
 * アプリと同じく 1px の罫の間に置き、角丸・影・面塗りを使わない。
 */
.hero-figure {
  margin: 0;
}

.hero-spoken {
  margin: var(--mb-spacing-xs) 0 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: -0.012em;
}

.hero-arrow {
  margin: var(--mb-spacing-md) 0;
}

.hero-ledger {
  border-top: 1px solid var(--mb-color-line);
  border-bottom: 1px solid var(--mb-color-line);
  padding: var(--mb-spacing-sm) 0;
}

.hero-ledger-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--mb-spacing-xs) var(--mb-spacing-md);
  margin: var(--mb-spacing-xs) 0 0;
  min-height: 44px;
}

.hero-ledger-state {
  display: inline-flex;
  align-items: center;
  gap: var(--mb-spacing-sm);
}

/* 帳簿の印「済」(DESIGN.md の「帳簿の印」): 22px 以上の四角、1px の枠、角丸なし、on-surface の塗りに surface の文字。
   四角は字の大きさ(13px)に比例させ、文字だけを拡大しても字が塗りの中に収まるようにする(#1404)。 */
.mark-done {
  display: inline-grid;
  place-items: center;
  width: max(22px, calc(22em / 13));
  height: max(22px, calc(22em / 13));
  border: 1px solid var(--mb-color-on-surface);
  background: var(--mb-color-on-surface);
  color: var(--mb-color-surface);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.hero-figure figcaption {
  margin: var(--mb-spacing-sm) 0 0;
}

/* 会話の例(作り値)。 */
.example {
  margin: 0;
  border: 1px solid var(--mb-color-line);
  border-radius: var(--mb-rounded-action);
  padding: var(--mb-spacing-md);
}

.example-turn {
  margin: 0 0 var(--mb-spacing-md);
}

.example-turn dt {
  margin: 0 0 var(--mb-spacing-xs);
}

.example-turn dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
}

.example-user dd {
  border: 1px solid var(--mb-color-line);
  border-radius: var(--mb-rounded-action);
  padding: var(--mb-spacing-sm) var(--mb-spacing-md);
}

.example-caption {
  margin: var(--mb-spacing-sm) 0 0;
}

/* 節の中の会話の例は、本文と同じ幅にそろえる。 */
.example-next {
  max-width: 40rem;
  margin-top: var(--mb-spacing-lg);
}

/* ---- 節 ---- */
.section {
  border-top: 1px solid var(--mb-color-line);
  padding-top: var(--mb-spacing-xl);
  padding-bottom: var(--mb-spacing-xl);
}

.section h2 {
  margin: var(--mb-spacing-sm) 0 var(--mb-spacing-md);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.65;
  letter-spacing: -0.03em;
}

.section p {
  max-width: 40rem;
}

.scenes {
  display: grid;
  gap: var(--mb-spacing-sm);
  margin: var(--mb-spacing-lg) 0 0;
  padding: 0;
  list-style: none;
}

.scenes li {
  border-left: 1px solid var(--mb-color-line);
  padding: 2px 0 2px var(--mb-spacing-md);
}

.steps {
  display: grid;
  gap: var(--mb-spacing-lg);
  margin: var(--mb-spacing-lg) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  border-top: 1px solid var(--mb-color-line);
  padding-top: var(--mb-spacing-md);
}

.steps h3 {
  margin: var(--mb-spacing-xs) 0 var(--mb-spacing-sm);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
}

.steps p {
  margin: 0;
}

/* ---- 価格と申込の条件 ---- */
.price-headline {
  margin: var(--mb-spacing-sm) 0 var(--mb-spacing-sm);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.018em;
}

.price-summary {
  margin: 0 0 var(--mb-spacing-lg);
}

.terms {
  margin: 0;
  border-top: 1px solid var(--mb-color-line);
}

.terms > div {
  display: grid;
  gap: var(--mb-spacing-xs) var(--mb-spacing-md);
  border-bottom: 1px solid var(--mb-color-line);
  padding: 12px 0;
}

.terms dt {
  font-weight: 700;
}

.terms dd {
  margin: 0;
}

.caution {
  margin: var(--mb-spacing-lg) 0 0;
  border-left: 1px solid var(--mb-color-line);
  padding: var(--mb-spacing-md);
}

.caution p {
  margin: 0;
}

.price-actions {
  margin: var(--mb-spacing-lg) 0 0;
}

/* 入口と見送り理由の後に置く、残りの条件の表。 */
.terms-rest {
  margin-top: var(--mb-spacing-xl);
}

/* 試用と再申込の確定文(#1197「初回の試用と接続できない場合」「通常の再申込」)。拡大したときに mail address の途中でも折り返す。 */
.trial-notes {
  margin: var(--mb-spacing-lg) 0 0;
  overflow-wrap: anywhere;
}

.trial-notes p {
  margin: 0 0 var(--mb-spacing-sm);
}

/* 見送り理由の 1 問(任意)。選ぶと 1 回送る。自由記述は持たない。 */
.skip-reason {
  margin: var(--mb-spacing-xl) 0 0;
  border: 0;
  padding: 0;
}

.skip-reason legend {
  padding: 0;
  font-weight: 700;
}

.skip-reason label {
  display: flex;
  align-items: center;
  gap: var(--mb-spacing-sm);
  min-height: 44px;
}

.skip-reason input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--mb-color-primary);
}

.skip-reason-status {
  min-height: 1.7em;
  margin: var(--mb-spacing-sm) 0 0;
}

/* ---- 法務のページ ---- */
.legal h1 {
  margin: var(--mb-spacing-xl) 0 var(--mb-spacing-md);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.018em;
}

.legal-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--mb-color-line);
}

.legal-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--mb-spacing-md);
  min-height: 56px;
  border-bottom: 1px solid var(--mb-color-line);
  padding: var(--mb-spacing-xs) 0;
}

/* 提供条件とプライバシーの方針の本文(docs/legal/ の md と一字一致。web/src/landingPage.test.ts)。
   長い和文を読む幅に収め、狭い幅では mail address・URL・表の中でも折り返す。 */
.legal-text {
  max-width: 48rem;
  overflow-wrap: anywhere;
}

.legal-text h2 {
  margin: var(--mb-spacing-xl) 0 var(--mb-spacing-sm);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.012em;
}

.legal-text p {
  margin: 0 0 var(--mb-spacing-sm);
}

.legal-text ol,
.legal-text ul {
  margin: 0 0 var(--mb-spacing-sm);
  padding-left: var(--mb-spacing-lg);
}

.legal-text li ul {
  margin: var(--mb-spacing-xs) 0 0;
}

.legal-text li + li {
  margin-top: var(--mb-spacing-xs);
}

.legal-text code {
  font: inherit;
}

.legal-text table {
  width: 100%;
  margin: var(--mb-spacing-sm) 0 var(--mb-spacing-md);
  border-collapse: collapse;
  border-top: 1px solid var(--mb-color-line);
  font-size: 13px;
  line-height: 1.7;
}

/* 和文はどの字の間でも折り返せるので、最小幅が無いと 390px 幅で短い列が 1 字の幅に潰れる。 */
.legal-text th,
.legal-text td {
  min-width: 5em;
  border-bottom: 1px solid var(--mb-color-line);
  padding: var(--mb-spacing-sm) var(--mb-spacing-sm) var(--mb-spacing-sm) 0;
  text-align: left;
  vertical-align: top;
}

@media (min-width: 48rem) {
  .wrap {
    padding: 0 var(--mb-spacing-xl);
  }

  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    padding-top: var(--mb-spacing-2xl);
    padding-bottom: var(--mb-spacing-2xl);
  }

  .hero h1 {
    font-size: 46px;
  }

  .section {
    padding-top: var(--mb-spacing-2xl);
    padding-bottom: var(--mb-spacing-2xl);
  }

  .section h2 {
    font-size: 36px;
  }

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

  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .terms > div {
    grid-template-columns: 11rem minmax(0, 1fr);
  }
}

@media (min-width: 72rem) {
  .hero h1 {
    font-size: 53px;
  }

  .section h2 {
    font-size: 40px;
  }
}
