:root {
  --ink: #3B2620;
  --sub: #6E5A52;
  --line: #EDE3DE;
  --soft: #F1E9E5;
  --accent: #B84A33;
  --accent-ink: #8A3A28;
  --accent-soft: #F8ECE7;
  --page: #FAF6F3;
  --pig: #FCE6E0;
  --card: #FFFFFF;
  --ok: #2F6B5E;
  --error: #A3321C;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: 'Zen Maru Gothic', -apple-system, 'Hiragino Maru Gothic ProN', sans-serif;
  font-size: 16px;
  line-height: 1.8;
}

a { color: var(--accent-ink); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.site-header .wrap, .site-footer > .wrap { max-width: 1040px; }

/* ヘッダー */
.site-header { border-bottom: 1px solid var(--line); background: var(--card); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.site-nav { display: flex; gap: 18px; font-size: 14px; }
.site-nav a { color: var(--sub); text-decoration: none; white-space: nowrap; }
.site-nav a[aria-current="page"] { color: var(--accent-ink); font-weight: 700; }

/* トップ */
main.home { max-width: 1040px; }
.hero { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 40px; padding: 64px 0 56px; }
.hero-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 10px 30px rgba(184, 74, 51, 0.14); }
.hero h1 { word-break: auto-phrase; font-size: clamp(36px, 4.4vw, 54px); line-height: 1.3; margin: 22px 0 0; letter-spacing: 0.02em; text-wrap: balance; }
.hero h1 span { color: var(--accent); }
.hero .lead { font-size: 17px; color: var(--sub); margin: 18px 0 26px; line-height: 1.9; }
.badge-soon { display: inline-block; padding: 8px 20px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid #F0D5CB; font-weight: 700; font-size: 15px; }
/* 公開の前後：まもなく公開の札（.before-release）と App Store のボタン（.after-release） */
.appstore-badge { display: inline-block; line-height: 0; }
.appstore-badge img { height: 60px; width: auto; }
/* App Store のボタンのとなりの、Android テスター募集（App Store のボタンと同じ高さ・角の丸み） */
.store-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.android-tester { box-sizing: border-box; height: 60px; display: inline-flex; flex-direction: column; justify-content: center; padding: 0 20px; border-radius: 10px; border: 1.5px solid var(--accent); background: #fff; color: var(--accent-ink); text-decoration: none; line-height: 1.2; }
.android-tester:hover { background: var(--accent-soft); }
.android-tester-small { font-size: 12px; }
.android-tester-big { font-size: 17px; font-weight: 700; }
/* 公開の前は .after-release を隠す。iOS を公開したら、次の 1 行を .before-release { display: none; } に入れかえる */
.before-release { display: none; }
.hero-art { position: relative; isolation: isolate; aspect-ratio: 1; width: 100%; max-width: 440px; justify-self: center; }
.hero-art::before { content: ""; position: absolute; inset: 6% 2% 2% 6%; z-index: -1; border-radius: 46% 54% 44% 56%; background: var(--pig); transform: rotate(-8deg); }
.hero-pig { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }

/* ページ内のリンク */
.jump { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 0 0 24px; }
.jump a { padding: 8px 18px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--sub); text-decoration: none; font-size: 14px; font-weight: 500; }
.jump a:hover { color: var(--accent-ink); border-color: #F0D5CB; }

/* 見出し */
.section-kicker { margin: 0; text-align: center; color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: 0.12em; }
.section-title { margin: 6px 0 40px; text-align: center; font-size: clamp(24px, 3vw, 32px); line-height: 1.5; word-break: auto-phrase; text-wrap: balance; }

/* できること：画面写真と説明を左右交互に */
.showcase { padding: 48px 0 24px; scroll-margin-top: 16px; }
.show { display: grid; grid-template-columns: 1fr 300px; align-items: center; gap: 56px; margin: 0 auto 72px; max-width: 860px; }
.show:nth-of-type(even) { grid-template-columns: 300px 1fr; }
.show:nth-of-type(even) .show-text { order: 2; }
.show-num { margin: 0; font-size: 15px; font-weight: 700; color: var(--accent); letter-spacing: 0.08em; }
.show h3 { margin: 4px 0 14px; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.4; }
.show p { margin: 0 0 12px; color: var(--sub); font-size: 16px; line-height: 1.95; }
.phone { position: relative; margin: 0; width: 300px; justify-self: center; padding: 10px; border-radius: 48px; background: #FFFFFF; box-shadow: 0 1px 0 var(--line), 0 24px 60px rgba(120, 70, 50, 0.16); }
.phone::before { content: ""; position: absolute; inset: -18px -26px; z-index: -1; border-radius: 46% 54% 44% 56%; background: var(--pig); transform: rotate(-6deg); opacity: 0.8; }
.show:nth-of-type(even) .phone::before { transform: rotate(7deg); }
.phone img { display: block; width: 100%; height: auto; border-radius: 38px; user-select: none; -webkit-user-drag: none; }

/* 使い方 */
.howto { padding: 40px 0 56px; scroll-margin-top: 16px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 28px 22px 22px; }
.step-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 18px; }
.steps h3 { margin: 14px 0 6px; font-size: 18px; color: var(--ink); }
.steps p { margin: 0; font-size: 14px; color: var(--sub); line-height: 1.8; }

/* よくある質問 */
.faq { max-width: 760px; margin: 0 auto; padding: 24px 0 48px; scroll-margin-top: 16px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 0 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 28px 18px 0; font-weight: 700; font-size: 16px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "＋"; position: absolute; right: 0; top: 16px; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 18px; color: var(--sub); font-size: 15px; line-height: 1.85; }

.talk { display: flex; align-items: flex-end; gap: 12px; background: var(--pig); border-radius: 22px; padding: 22px 20px; margin: 0 auto 56px; max-width: 760px; }
.talk img { width: 96px; height: 96px; flex: none; }
.bubble { position: relative; background: var(--card); border-radius: 18px; padding: 14px 16px; font-size: 15px; }
.bubble::before { content: ""; position: absolute; left: -8px; bottom: 16px; border: 8px solid transparent; border-right-color: var(--card); border-left: 0; }

/* 下のページの見出し（タイトルとぶたさん） */
.page-hero { display: grid; grid-template-columns: 1fr 200px; align-items: center; gap: 24px; margin: 8px 0 20px; padding: 24px 28px; border-radius: 28px; background: var(--pig); position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; border-radius: 46% 54% 44% 56%; background: #FFFFFF; opacity: 0.45; transform: rotate(-8deg); }
.page-hero-copy { position: relative; z-index: 1; }
.page-hero .section-kicker { text-align: left; }
.page-hero h1 { margin: 4px 0 8px; font-size: clamp(26px, 3.4vw, 34px); border: 0; padding: 0; }
.page-lead { margin: 0; color: var(--sub); font-size: 15px; line-height: 1.85; }
.page-hero-art { position: relative; z-index: 1; width: 200px; height: 200px; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 20px; margin: 16px 0 8px; }
.toc p { margin: 0 0 6px; font-weight: 700; font-size: 14px; color: var(--accent-ink); }
.toc ol { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 28px; font-size: 14px; }
.toc li { break-inside: avoid; margin: 2px 0; }
.toc a { color: var(--sub); text-decoration: none; }
.toc a:hover { color: var(--accent-ink); text-decoration: underline; }
.doc h2 { scroll-margin-top: 16px; }
/* 最終改定日と、変更履歴への近道（規約・ポリシーのいちばん上） */
.doc-revised { margin: 0 0 18px; font-size: 14px; color: var(--sub); }
.doc-revised a { color: var(--accent-ink); }

/* 文書ページ */
.doc { padding: 32px 0 56px; }
.doc h1 { font-size: 28px; margin: 0 0 8px; }
.doc h2 { font-size: 20px; margin: 36px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 17px; margin: 24px 0 6px; }
.doc p, .doc li { font-size: 15px; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc .table-wrap { overflow-x: auto; margin: 12px 0; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--card); }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { background: var(--soft); white-space: nowrap; }
.notice { background: var(--accent-soft); border: 1px solid #F0D5CB; border-radius: 14px; padding: 12px 16px; font-size: 14px; color: var(--accent-ink); margin: 12px 0 8px; }

/* フォーム */
.form { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px 20px; margin-top: 20px; }
.field { margin-bottom: 20px; }
.field label, .field legend { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; padding: 0; }
.req, .opt { font-size: 12px; font-weight: 500; margin-left: 6px; padding: 1px 8px; border-radius: 999px; vertical-align: 2px; }
.req { background: var(--accent); color: #fff; }
.opt { background: var(--soft); color: var(--sub); }
input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #E2D4CE;
  border-radius: 12px;
  padding: 11px 12px;
}
textarea { min-height: 180px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { outline: 3px solid #F3CFC3; border-color: var(--accent); }
.hint { font-size: 13px; color: var(--sub); margin: 6px 0 0; }
.field-error { font-size: 13px; color: var(--error); margin: 6px 0 0; }
.field-error:empty { display: none; }
[aria-invalid="true"] { border-color: var(--error); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 500 !important; }
.check input { width: 20px; height: 20px; margin: 4px 0 0; accent-color: var(--accent); flex: none; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.submit { display: block; width: 100%; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 17px; padding: 14px; cursor: pointer; }
.submit:hover { background: var(--accent-ink); }
.submit:disabled { opacity: 0.6; cursor: wait; }
.form-status { margin: 14px 0 0; font-size: 14px; text-align: center; }
.form-status.error { color: var(--error); }

.thanks { text-align: center; padding: 56px 0 72px; }
.thanks img { width: 140px; height: 140px; }
.thanks h1 { font-size: 26px; margin: 12px 0 8px; }
.thanks p { color: var(--sub); }
.button-link { display: inline-block; margin-top: 16px; padding: 12px 26px; border-radius: 999px; border: 1.5px solid var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 700; }

/* フッター */
.site-footer { background: var(--page); font-size: 13px; color: var(--sub); }
.site-footer > .wrap { padding: 20px 16px 32px; }
.footer-scene { position: relative; isolation: isolate; height: clamp(380px, 40vw, 600px); overflow: hidden; background: #F6EEE8; }
.footer-art { position: absolute; inset: 0; z-index: -2; display: block; }
.footer-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 55%; }
.footer-scene::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(0deg, var(--page), transparent 18%); }
.footer-intro { max-width: 1040px; margin: 0 auto; padding: clamp(64px, 9vw, 140px) 24px 0; }
.footer-brand { font-size: clamp(30px, 3.4vw, 44px); font-weight: 700; color: var(--accent-ink); text-decoration: none; letter-spacing: 0.04em; }
.footer-intro p { max-width: 36%; margin: 14px 0 0; font-size: clamp(13px, 1.3vw, 16px); line-height: 1.9; color: var(--sub); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 8px; }
.site-footer a { color: var(--sub); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 36px 0 28px; text-align: center; }
  .hero-icon { display: none; }
  .hero h1 { font-size: clamp(32px, 8.5vw, 44px); margin-top: 0; }
  .hero .lead { font-size: 15px; }
  .hero-art { max-width: 320px; order: -1; }
  .show, .show:nth-of-type(even) { grid-template-columns: 1fr; gap: 28px; margin-bottom: 64px; text-align: center; }
  .show:nth-of-type(even) .show-text { order: 0; }
  .show p { text-align: left; }
  .show h3 { word-break: auto-phrase; }
  .hero .lead br { display: none; }
  .phone { width: 260px; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .page-hero { grid-template-columns: 1fr; padding: 20px; text-align: center; }
  .page-hero .section-kicker { text-align: center; }
  .page-hero-art { order: -1; width: 150px; height: 150px; justify-self: center; }
  .toc ol { columns: 1; }
  .footer-scene { height: 460px; }
  .footer-art { top: 120px; }
  .footer-art img { object-position: 75% center; }
  .footer-scene::after { background: linear-gradient(180deg, #F6EEE8 110px, transparent 190px), linear-gradient(0deg, var(--page), transparent 60px); }
  .footer-intro { padding: 28px 20px 0; }
  .footer-intro p { max-width: 100%; margin-top: 8px; }
  .features { grid-template-columns: 1fr; }
  .site-nav { gap: 14px; font-size: 13px; }
  .brand span { display: none; }
  .site-header .wrap { gap: 12px; }
  .talk img { width: 72px; height: 72px; }
}

input[type="text"], input[type="email"], select { min-height: 50px; }
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%236E5A52' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }
.doc td { line-height: 1.6; }
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1; width: 100%; }

/* 招待ページ（/i/<token>） */
.invite .button-primary { background: var(--accent); color: #fff; border-color: var(--accent); min-width: 220px; }
.invite .store-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.invite .store-buttons .button-link { min-width: 150px; }
.invite-hint { font-size: 14px; }
.invite-note { font-size: 13px; margin-top: 24px; }

/* Android テスター募集（/tester/） */
.tester-note { background: var(--soft); border-radius: 14px; padding: 10px 14px; text-align: center; font-weight: 700; }
.tester-remaining { text-align: center; font-size: 18px; font-weight: 700; margin: 12px 0; }
.tester-remaining strong { font-size: 30px; color: var(--accent-ink); }
.tester-device-sub { margin-top: 8px; font-size: 14px; font-weight: 400; color: var(--sub, #6E5A52); }
.tester-url { font-weight: 700; white-space: nowrap; }
.tester-closed { text-align: center; background: var(--pig); border-radius: 22px; padding: 24px 16px; font-size: 18px; font-weight: 700; }
/* hidden を display の指定より優先（テスターのページの 出し分け） */
.tester-steps[hidden], .tester-device[hidden], .tester-closed[hidden], .tester-remaining[hidden] { display: none !important; }
.tester-steps { list-style: none; margin: 16px 0 8px; padding: 0; display: grid; gap: 14px; }
.tester-steps li { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px; text-align: center; display: grid; justify-items: center; gap: 4px; }
.tester-steps .step-num { margin-bottom: 4px; }
.tester-steps .button-link { display: block; width: 100%; max-width: 360px; box-sizing: border-box; margin: 4px 0; padding: 16px 20px; font-size: 18px; }
.tester-steps .button-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.tester-steps p { margin: 0; color: var(--sub); }
.tester-steps .tester-sub { font-size: 13px; }
.tester-steps .tester-shot { margin: 12px 0 8px; width: 100%; max-width: 280px; }
.tester-steps .tester-shot img { display: block; width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(59, 38, 32, 0.10); }
.tester-steps .tester-shot-small { max-width: 200px; }
.tester-steps .tester-note { width: 100%; box-sizing: border-box; margin: 10px 0 0; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); display: grid; justify-items: center; gap: 4px; }
.tester-steps .tester-note strong { color: var(--ink); }
.tester-faq { padding: 4px 0 0; max-width: none; }
