/* =====================================================================
   gearte.jp (公式サイト)
   色と書体はアプリと同じ (正本: ios/TakkyuApp/DesignSystem/Tokens.swift / web/src/tokens.css)。
   ⚠️ ここで新しいブランド色を作らない。
   アプリはライト固定なので、サイトもダークモードの分岐は入れない。
   ===================================================================== */

:root {
  color-scheme: light;
  --blue: #0C5BA9;          /* BrandPalette.blue */
  --blue-pressed: #0A4D90;
  --blue-muted: #3D7CBB;
  --ink: #F0F4FF;           /* BrandPalette.inverse (白い面・文字) */
  --ink-pressed: #CEDDF2;
  --ink-sub: #C2D6EA;       /* 紺の上の補助文字 (4.57:1) */
  --line: #84B3DE;

  --f-rounded: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  --f-chakra: "Chakra Petch", ui-monospace, monospace;

  --gutter: 16px;
  --wrap: 1120px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* 紙の粒 (アプリの NoiseStyle の代わり)。白い面にだけ掛ける */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .05 0 0 0 0 .2 0 0 0 0 .45 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; overflow-x: clip; }
body {
  background: var(--blue);
  color: var(--ink);
  font-family: var(--f-rounded);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure, ol, ul, dl, dd { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 760px; }
.pc-only { display: none; }
@media (min-width: 900px) {
  .wrap { padding: 0 32px; }
  .pc-only { display: inline; }
  .sp-only { display: none; }
}

/* ── ヘッダー ─────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(12, 91, 169, .92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(132, 179, 222, .35);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 56px; }
.header-logo img { width: 100px; height: auto; }
.header-cta {
  margin-left: auto; padding: 6px 16px; border-radius: 999px;
  background: var(--ink); color: var(--blue); font-weight: 800; font-size: 13px; text-decoration: none;
}
.header-cta-soon { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
@media (min-width: 900px) {
  .header-inner { height: 68px; }
  .header-logo img { width: 116px; }
}

/* ── ファーストビュー ─────────────────── */
/* スマホ: 見出し → 端末の画面 → 説明 の順。入口は画面の下に固定 (.sp-cta-bar)。
   ★ 2026-10-21 オーナー指示「画像をできるだけ上に、CTA は押しやすく」 */
.hero { position: relative; overflow: hidden; padding: 20px 0 32px; }
/* アプリのアイコンとウェルカム画面の十字の線 */
.hero-line { position: absolute; background: var(--blue-muted); pointer-events: none; }
.hero-line-v { top: 0; bottom: 0; left: 50%; width: 1px; }
.hero-line-h { left: 0; right: 0; top: 64%; height: 1px; }
.hero-inner { position: relative; display: grid; text-align: center; }
/* スマホでは中身をばらして、端末の画面を見出しのすぐ下に差し込む */
.hero-copy { display: contents; }
.hero-tag, .hero-title, .hero-lead, .cta { position: relative; background: var(--blue); }
.hero-tag { order: 1; justify-self: center; padding: 0 8px; }
.hero-title { order: 2; justify-self: center; padding: 2px 8px; }
.hero-visual { order: 3; }
.hero-lead { order: 4; justify-self: center; padding: 4px 8px; }
.cta { order: 5; justify-self: center; padding: 0 8px; }
.hero-tag img { width: 150px; margin: 0 auto 8px; }
.hero-title { font-weight: 800; font-size: 28px; line-height: 1.3; letter-spacing: .02em; }
.hero-lead { margin-top: 20px; color: var(--ink-sub); font-size: 14px; line-height: 1.7; }

/* 端末は 2 台とも枠ごと全部見せる (画面の端で切らない) */
.hero-visual { position: relative; height: 352px; margin: 20px auto 0; width: 100%; max-width: 330px; }
.hero-visual .phone { position: absolute; width: 150px; }
.phone-front { left: 50%; top: 0; transform: translateX(-4%); z-index: 1; }
.phone-back { left: 50%; top: 30px; transform: translateX(-96%) rotate(-5deg); opacity: .92; }

/* スマホの下の固定の入口。安全領域 (ホームバー) の分だけ上げる */
.sp-cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(12, 91, 169, .94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid rgba(132, 179, 222, .35);
}
.sp-cta-bar .cta-btn { display: flex; width: 100%; min-height: 56px; }
body:has(.sp-cta-bar) { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
/* 本文の入口はバーと重なるのでスマホでは出さない (「無料」の表記だけ残す) */
.cta-main > .cta-btn { display: none; }
/* ヘッダーの入口も下のバーと同じなので、スマホでは出さない */
body:has(.sp-cta-bar) .header-cta { display: none; }

@media (min-width: 900px) {
  .sp-cta-bar { display: none; }
  body:has(.sp-cta-bar) { padding-bottom: 0; }
  .cta-main > .cta-btn { display: inline-flex; }
  body:has(.sp-cta-bar) .header-cta { display: inline-block; }
  .hero-copy { display: block; position: relative; background: var(--blue); }
  .hero-tag, .hero-title, .hero-lead, .cta { background: none; padding: 0; justify-self: auto; }
  .hero { padding: 56px 0 0; min-height: calc(100vh - 68px); min-height: calc(100svh - 68px); display: flex; align-items: center; }
  .hero > .wrap { width: 100%; }
  .hero-line-h { top: 50%; }
  .hero-inner { grid-template-columns: 1fr 1fr; align-items: center; text-align: left; gap: 32px; }
  .hero-copy { padding: 24px 24px 24px 0; }
  .hero-tag img { margin: 0 0 22px; width: 200px; }
  .hero-title { font-size: 52px; }
  .hero-lead { font-size: 17px; margin-top: 20px; line-height: 1.8; }
  .hero-visual { height: 600px; max-width: none; }
  .hero-visual .phone { width: 260px; }
  .hero-visual { margin: 0; }
  .phone-front { top: 20px; transform: translateX(-20%); }
  .phone-back { top: 90px; transform: translateX(-100%) rotate(-6deg); }
}

/* 端末の枠 (白い縁 + 紙の粒) */
.phone {
  position: relative; border-radius: 34px; padding: 6px; background: var(--ink);
  box-shadow: 0 24px 48px rgba(0, 20, 60, .35);
}
.phone::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: var(--grain); opacity: .5; mix-blend-mode: multiply;
  -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  padding: 6px;
}
.phone img { border-radius: 28px; width: 100%; }

/* ── アプリへの入口 ───────────────────── */
.cta { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.cta-main { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.store-soon, .cta-btn {
  position: relative; overflow: hidden;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 240px; min-height: 56px; padding: 8px 28px; border-radius: 999px;
  background: var(--ink); color: var(--blue); font-weight: 800; font-size: 17px; line-height: 1.3;
  text-decoration: none;
}
.store-soon { font-size: 16px; }
.store-soon::after, .cta-btn::after {
  content: ""; position: absolute; inset: 0; background-image: var(--grain); opacity: .35; mix-blend-mode: multiply; pointer-events: none;
}
.cta-btn:hover { background: #fff; }
.cta-btn:active { background: var(--ink-pressed); }
.cta-btn-sub { font-weight: 500; font-size: 11px; color: var(--blue-muted); }
.store-soon-label { font-family: var(--f-chakra); font-weight: 600; font-size: 11px; letter-spacing: .14em; color: var(--blue-muted); }

/* 「無料」の小さな表記 */
.cta-note { font-size: 12px; color: var(--ink-sub); line-height: 1.6; }
.free {
  display: inline-block; margin-right: 6px; padding: 0 8px; border: 1px solid var(--ink-sub); border-radius: 999px;
  color: var(--ink); font-weight: 800; font-size: 11px; line-height: 1.6;
}
.cta-note-android { display: none; max-width: 22em; }
html[data-os="android"] .cta-note-ios { display: none; }
html[data-os="android"] .cta-note-android { display: block; }
html[data-os="android"] .cta-btn { opacity: .5; pointer-events: none; }

/* QR は App Store 公開後、マウスで見ている広い画面 (= PC) だけ */
.cta-qr { display: none; }
@media (min-width: 900px) {
  .cta { margin-top: 32px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 24px; }
  .cta-main { align-items: flex-start; }
}
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .cta-qr { display: flex; align-items: center; gap: 12px; padding-left: 24px; border-left: 1px solid rgba(132, 179, 222, .5); }
  .qr { width: 80px; border-radius: 8px; overflow: hidden; color: var(--blue); background: #fff; }
  .qr svg { display: block; width: 100%; height: auto; }
  .qr-caption { font-size: 12px; line-height: 1.6; color: var(--ink-sub); text-align: left; white-space: nowrap; }
}

/* ── 運営会社 ─────────────────────────── */
.company { padding: 40px 0; border-top: 1px solid rgba(132, 179, 222, .35); }
.company-title { font-weight: 800; font-size: 15px; }
.company-table { margin-top: 12px; display: grid; gap: 6px; font-size: 14px; }
.company-table div { display: grid; grid-template-columns: 7em 1fr; gap: 12px; }
.company-table dt { color: var(--ink-sub); }
@media (min-width: 900px) {
  .company .wrap { display: grid; grid-template-columns: 200px 1fr; }
  .company-table { margin-top: 0; }
}

/* ── フッター ─────────────────────────── */
.site-footer { padding: 32px 0 40px; background: var(--blue-pressed); }
.footer-inner { display: flex; flex-direction: column; gap: 18px; }
.footer-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; }
.footer-links a { text-decoration: none; color: var(--ink-sub); }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.copyright { color: var(--ink-sub); font-size: 12px; }
@media (min-width: 900px) {
  .footer-inner { flex-direction: row; align-items: center; gap: 40px; }
  .copyright { margin-left: auto; }
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── 404 ─────────────────────────────── */
.notfound { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px var(--gutter); text-align: center; }
.notfound-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.notfound h1 { font-weight: 800; font-size: 26px; line-height: 1.4; }
.notfound .cta-btn { margin-top: 12px; }

/* ── 利用規約・プライバシーポリシー (/terms・/privacy。build.mjs が src/legal.html から作る) ──
   ★ 見出しは紺の地のまま (ヘッダー・フッターと地続き)、本文だけ明るい紙 (--ink) に載せる。
     ⚠️ 長文を紺の地に白で置かない。読み疲れる (api の /legal と同じ判断)。
   ★ 本文は丸ゴシックではなくシステムの角ゴシック。長文を小さめの字で読ませるので、字面の詰まった丸ゴは避ける。
   ★ 墨 (#18181b / #52525b) はブランド色ではなく、api の /legal と同じ中性色。ブランド色は見出しの罫線とリンクだけ */
.legal { padding: 28px 0 56px; }
.legal-wrap { max-width: 800px; }
.legal-head { padding: 0 4px 20px; }
.legal-title { font-weight: 800; font-size: 26px; line-height: 1.4; }
.legal-updated { margin-top: 4px; color: var(--ink-sub); font-size: 13px; }
.legal-paper {
  --paper-fg: #18181b;
  --paper-muted: #52525b;
  background: var(--ink); color: var(--paper-fg);
  border-radius: var(--r-lg); padding: 8px 20px 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-weight: 400; font-size: 15px; line-height: 1.9;
  -webkit-font-smoothing: auto;
  overflow-wrap: anywhere;
}
.legal-paper h2 {
  font-family: var(--f-rounded); font-weight: 800; font-size: 18px; line-height: 1.5; color: var(--blue);
  margin: 32px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--blue);
}
.legal-paper h3 { font-family: var(--f-rounded); font-weight: 800; font-size: 16px; line-height: 1.5; margin: 24px 0 8px; }
.legal-paper h4 { font-size: 15px; font-weight: 700; margin: 20px 0 8px; }
.legal-paper p { margin: 0 0 14px; }
.legal-paper ul { margin: 0 0 14px; padding-left: 1.4em; }
.legal-paper li { margin-bottom: 6px; }
.legal-paper strong { font-weight: 700; }
.legal-paper a { color: var(--blue); text-underline-offset: 2px; }
.legal-paper a:hover { color: var(--blue-pressed); }
.legal-paper a:focus-visible { outline-color: var(--blue); }
@media (min-width: 900px) {
  .legal { padding: 48px 0 88px; }
  .legal-head { padding: 0 0 28px; }
  .legal-title { font-size: 34px; }
  .legal-paper { border-radius: var(--r-xl); padding: 16px 56px 48px; font-size: 16px; }
  .legal-paper h2 { font-size: 20px; margin-top: 44px; }
}
.footer-links a[aria-current="page"] { color: var(--ink); }
