/*
 * トップページ。アプリ(Flutter theme/tokens.dart)・公開ページ(public.css)と同じ値を使う。
 * 青はCTA・モチーフ・強調だけに使い、画面全体は白とグレーで組む。
 */
:root {
  --brand: #3355ff;
  --brand-dark: #2a47e0;
  --brand-soft: #ebefff;
  --bg: #ffffff;
  --surface: #f5f6f8;
  --text: #15171a;
  --text-sub: #6b7280;
  --text-hint: #a0a6b0;
  --success: #12a150;
  --card: #ffffff;
  --line: #eceef1;
  --shadow: rgba(21, 23, 26, .12);
  color-scheme: light dark;
  --radius-md: 14px;
  --radius-lg: 20px;
}

/* ダークモード(端末の設定に合わせる) */
@media (prefers-color-scheme: dark) {
  :root {
  --brand: #6680ff;
  --brand-dark: #4d68f0;
  --brand-soft: #1e2546;
  --bg: #111316;
  --surface: #1c1f23;
  --surface-strong: #2a2e34;
  --text: #ecedef;
  --text-sub: #a0a6b0;
  --text-hint: #6b717b;
  --danger: #ff6b6f;
  --success: #3dd68c;
  --card: #24282d;
  --line: #2a2e34;
  --shadow: rgba(0, 0, 0, .45);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: inherit; }
br.sp { display: inline; }
@media (min-width: 900px) { br.sp { display: none; } }

/* ---- ヘッダー ---- */
.top { display: flex; align-items: center; justify-content: space-between; max-width: 1120px; margin: 0 auto; padding: 16px 20px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; text-decoration: none; letter-spacing: .02em; }
.logo-mark { width: 30px; height: 30px; display: block; }
.top-login { font-size: 14px; font-weight: 700; color: var(--text-sub); text-decoration: none; padding: 8px 4px; }

/* ---- CTA ---- */
.cta {
  display: flex; align-items: center; justify-content: center; width: 100%; max-width: 380px; height: 58px;
  border-radius: var(--radius-md); background: var(--brand); color: #fff; font-size: 16px; font-weight: 700;
  letter-spacing: .03em; text-decoration: none; transition: transform .12s ease, background .15s ease;
}
.cta:hover { background: var(--brand-dark); }
.cta:active { transform: scale(.98); }
.privacy { margin: 10px 0 0; font-size: 11.5px; color: var(--text-hint); }

/* ---- ヒーロー ----
   スマホ: 見出し → 箱の束(主役)→ 補足とCTA
   PC: 左に見出し・補足・CTA、右に箱の束 */
.hero { max-width: 1120px; margin: 0 auto; padding: 24px 20px 8px; display: grid; gap: 24px; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr 1.05fr; grid-template-areas: "title visual" "body visual"; align-items: end; column-gap: 56px; row-gap: 24px; padding: 64px 20px 48px; }
  .hero-title { grid-area: title; }
  .hero-visual { grid-area: visual; align-self: center; }
  .hero-body { grid-area: body; align-self: start; }
}
.nw { white-space: nowrap; }
.hero-title { margin: 0; font-size: clamp(27px, 7.6vw, 54px); line-height: 1.32; font-weight: 800; letter-spacing: -.01em; }
.hl { color: var(--brand); }
.lead { margin: 0 0 22px; font-size: 15.5px; color: var(--text-sub); }
@media (min-width: 900px) { .lead { font-size: 17px; } }

/* 見本の箱を、ずらして束ねる。後ろの箱は種類のラベルがのぞく */
.hero-visual { position: relative; height: 340px; max-width: 460px; width: 100%; margin: 0 auto; }
.hero-visual .sample-box { position: absolute; left: 4%; right: 4%; }
.hero-visual .is-back-left { top: 58px; transform: translateX(-5%) rotate(-7deg) scale(.9); transform-origin: top center; z-index: 1; }
.hero-visual .is-back-right { top: 122px; transform: translateX(5%) rotate(6deg) scale(.95); transform-origin: top center; z-index: 2; }
.hero-visual .is-front { top: 176px; z-index: 3; background: var(--card); box-shadow: 0 22px 48px var(--shadow), 0 0 0 1px var(--line); }
.hero-visual .is-back-left, .hero-visual .is-back-right { box-shadow: 0 0 0 1px var(--line); }
/* 後ろの箱は種類のラベルを見せるためのもの。名前と件数は隠して、手前の箱と文字が重ならないようにする */
.hero-visual .is-back-left .sample-name, .hero-visual .is-back-left .sample-count,
.hero-visual .is-back-right .sample-name, .hero-visual .is-back-right .sample-count { visibility: hidden; }
.hero-visual .is-front .sample-name { font-size: 20px; }
/* 前の箱へ、メッセージが投函される */
.incoming {
  position: absolute; z-index: 4; right: 0; top: 0; max-width: 64%; padding: 10px 14px; border-radius: 12px;
  background: var(--card); border: 2px solid var(--brand); font-size: 13px; font-weight: 600; line-height: 1.5;
  box-shadow: 0 10px 24px rgba(51, 85, 255, .14); transform: rotate(4deg);
  animation: post 3s cubic-bezier(.5, 0, .75, 0) .6s infinite;
}
@keyframes post {
  0%, 20% { transform: translate(0, 0) rotate(4deg) scale(1); opacity: 1; }
  55% { transform: translate(-30%, 185px) rotate(0) scale(.5); opacity: 0; }
  56%, 100% { transform: translate(0, 0) rotate(4deg) scale(1); opacity: 0; }
}
@media (min-width: 900px) { .hero-visual { height: 380px; max-width: 500px; } .hero-visual .is-back-left { top: 64px; } .hero-visual .is-back-right { top: 132px; } .hero-visual .is-front { top: 192px; } }

/* ---- 見本の箱カード(アプリの BoxCard と同じ見た目) ---- */
.sample-box { margin: 0; padding: 18px 18px 16px; border-radius: var(--radius-lg); background: var(--surface); }
.sample-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sample-kind { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-sub); }
.sample-kind-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--bg); color: var(--brand); }
.sample-box.is-front .sample-kind-icon { background: var(--brand-soft); }
.sample-kind { white-space: nowrap; }
.kind-icon { width: 17px; height: 17px; }
.sample-open { font-size: 11.5px; font-weight: 700; color: var(--success); }
.sample-open::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--success); vertical-align: 1px; }
.sample-name { margin: 10px 0 8px; font-size: 18px; font-weight: 800; line-height: 1.4; }
.sample-count { margin: 0; font-size: 13px; color: var(--text-sub); }
.sample-count b { margin-left: 8px; color: var(--brand); }

/* ---- セクション ---- */
.section { max-width: 1120px; margin: 0 auto; padding: 40px 0 8px; }
.section h2 { margin: 0 20px 6px; font-size: 22px; font-weight: 800; }
.section-lead { margin: 0 20px 22px; font-size: 14px; color: var(--text-sub); }
@media (min-width: 900px) { .section { padding-top: 88px; } .section h2 { font-size: 26px; } }

/* 見本: スマホは横にスワイプ、PCは3列 */
.samples {
  display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 12px; padding: 4px 20px 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.samples::-webkit-scrollbar { display: none; }
.samples .sample-box { scroll-snap-align: center; }
@media (min-width: 900px) { .samples { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; gap: 16px; } }

/* 使い方: 3つの機能ではなく、ひと続きの流れとして見せる */
.steps { list-style: none; margin: 18px 20px 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
.steps li { position: relative; display: grid; grid-template-columns: 56px 1fr; column-gap: 16px; padding-bottom: 28px; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 27px; top: 60px; bottom: 6px; width: 2px; background: var(--brand-soft); }
.step-art { grid-row: span 2; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); }
.step-art svg { width: 34px; height: 34px; }
.steps b { align-self: end; font-size: 17px; }
.steps p { margin: 2px 0 0; font-size: 14px; color: var(--text-sub); }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .steps li { grid-template-columns: 1fr; padding: 0; }
  .steps li:not(:last-child)::after { left: 72px; right: -12px; top: 27px; bottom: auto; width: auto; height: 2px; }
  .step-art { grid-row: auto; margin-bottom: 14px; }
}

/* 最後のCTA */
.closing { max-width: 520px; margin: 0 auto; padding: 72px 20px 56px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.closing-motif { width: 120px; height: 120px; margin-bottom: 4px; }
.closing-motif .motif-card { animation: drop 2.8s cubic-bezier(.5, 0, .75, 0) 1s infinite; }
@keyframes drop { 0%, 25% { transform: none; opacity: 1; } 60% { transform: translate(-6px, 52px) scale(.6); opacity: 0; } 61%, 100% { opacity: 0; } }
.closing-text { margin: 0 0 20px; font-size: 22px; font-weight: 800; }

.foot { padding: 28px 20px 36px; text-align: center; font-size: 12px; color: var(--text-hint); border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) { .incoming, .closing-motif .motif-card { animation: none; } }
.legal { display: flex; justify-content: center; gap: 16px; margin-top: 10px; }
.legal a { color: var(--text-hint); text-decoration: none; }
