/* ========================================================================
   SOUND BOX 設計フロー中ブック — 「あなたの防音室ができるまで」物語型LP
   ノウル(S-3)。5ページをペラペラめくる体験。金額は出さない。
   選ぶ → 設計 → 製作 → お届け → 暮らし
   タブレット主対象 / スマホ・PCもフォロー。
   ======================================================================== */

:root {
  --orange: #ff6b1a;
  --navy: #1a2942;
  --cream: #f5f0eb;     /* レンダリング地色と一致 */
  --cream-2: #efe7dc;
  --text: #2a2620;
  --text-dim: #877f72;
  --line: #e3dccf;
  --line-green: #06c755;
  --shadow-lg: 0 20px 60px rgba(40, 32, 20, 0.16);
  --maxw: 1100px;
  font-synthesis: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  word-break: auto-phrase;
  text-wrap: pretty;
  overflow: hidden; /* ページ単位スクロール */
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ───────── 本(book)コンテナ ───────── */
.book { position: fixed; inset: 0; overflow: hidden; }
.pages {
  display: flex; height: 100%; width: 100%;
  transition: transform 0.62s cubic-bezier(0.7, 0, 0.18, 1);
  will-change: transform;
}
.page {
  flex: 0 0 100%; height: 100%; position: relative;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}
.page-inner {
  max-width: var(--maxw); width: 100%; margin: 0 auto;
  padding: clamp(48px, 7vh, 96px) clamp(22px, 5vw, 56px) 120px;
  flex: 1; display: flex; flex-direction: column; justify-content: center;
}

/* 章ヘッダー */
.chapter { display: flex; align-items: baseline; gap: 14px; margin-bottom: 6px; }
.chapter .no {
  font-size: clamp(34px, 7vw, 58px); font-weight: 800; line-height: 1;
  color: var(--orange); letter-spacing: -0.02em; font-feature-settings: "tnum";
}
.chapter .ja { font-size: clamp(20px, 4vw, 30px); font-weight: 800; color: var(--navy); }
.lead {
  font-size: clamp(22px, 4.4vw, 38px); font-weight: 800; color: var(--navy);
  letter-spacing: -0.01em; line-height: 1.4; margin: 10px 0 14px;
}
.sub { font-size: clamp(14px, 2.6vw, 17px); color: var(--text-dim); max-width: 40em; }

/* アニメーション(ページ表示時) */
.page.is-active .anim {
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.page.is-active .anim.d1 { animation-delay: 0.06s; }
.page.is-active .anim.d2 { animation-delay: 0.14s; }
.page.is-active .anim.d3 { animation-delay: 0.22s; }
.page.is-active .hero-img { animation: zoom 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes zoom { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }

/* ヒーロー画像 */
.hero-img {
  width: 100%; max-height: 46vh; object-fit: contain; margin: 8px 0 18px;
  filter: drop-shadow(0 24px 40px rgba(40,32,20,0.14));
}

/* ───────── Page1: 選ぶ ───────── */
.strip-label { font-size: 13px; font-weight: 800; color: var(--navy); margin: 22px 0 10px; letter-spacing: 0.04em; }
.size-strip, .mat-strip, .style-strip {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.size-strip::-webkit-scrollbar, .mat-strip::-webkit-scrollbar, .style-strip::-webkit-scrollbar { height: 6px; }
.size-strip::-webkit-scrollbar-thumb, .mat-strip::-webkit-scrollbar-thumb, .style-strip::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

.size-cell {
  flex: 0 0 auto; width: 132px; scroll-snap-align: start;
  background: #fff; border-radius: 14px; border: 1px solid var(--line); overflow: hidden;
  box-shadow: 0 2px 10px rgba(40,32,20,0.05);
}
.size-cell .plan-wrap { aspect-ratio: 4/3; background: var(--cream); position: relative; }
.size-cell .plan { width: 100%; height: 100%; display: block; }
.size-cell .kousei { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,0.92);
  color: var(--navy); font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); }
.size-cell .cap { padding: 8px 10px; }
.size-cell .cap b { font-size: 14px; color: var(--navy); display: block; }
.size-cell .cap span { font-size: 11px; color: var(--text-dim); }

.style-card { flex: 0 0 auto; width: 220px; scroll-snap-align: start; border-radius: 16px; overflow: hidden;
  background: var(--cream); box-shadow: 0 6px 18px rgba(40,32,20,0.08); position: relative; }
.style-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.style-card .t { position: absolute; left: 12px; bottom: 10px; color: #fff; font-weight: 800; font-size: 14px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5); }

.mat-strip .sw { flex: 0 0 auto; width: 88px; scroll-snap-align: start; }
.mat-strip .sw .img { width: 88px; height: 88px; border-radius: 12px; background: var(--line) center/cover no-repeat;
  box-shadow: 0 2px 8px rgba(40,32,20,0.08); }
.mat-strip .sw .nm { font-size: 10.5px; color: var(--text-dim); margin-top: 5px; text-align: center; }

/* ───────── 製作: プロセスのタイムライン ───────── */
.flow-img { width: 100%; max-height: 40vh; object-fit: contain; margin: 6px 0 16px; filter: drop-shadow(0 18px 30px rgba(40,32,20,0.12)); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 8px; }
.steps .st { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.steps .st .ic { font-size: 24px; }
.steps .st b { display: block; color: var(--navy); font-size: 15px; margin: 6px 0 2px; }
.steps .st span { font-size: 12.5px; color: var(--text-dim); }

/* ───────── 暮らし: 最終ページ ───────── */
.life-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0 8px; }
.life-grid figure { border-radius: 16px; overflow: hidden; background: var(--cream); box-shadow: 0 8px 22px rgba(40,32,20,0.1); position: relative; }
.life-grid img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.life-grid figcaption { position: absolute; left: 12px; bottom: 10px; color: #fff; font-weight: 800; font-size: 14px; text-shadow: 0 1px 8px rgba(0,0,0,0.55); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.cta {
  display: inline-flex; align-items: center; gap: 10px; padding: 16px 26px; border-radius: 999px;
  font-size: 16px; font-weight: 800; text-decoration: none; transition: 0.18s; box-shadow: 0 8px 22px rgba(40,32,20,0.12);
}
.cta:hover { transform: translateY(-2px); }
.cta.primary { background: var(--orange); color: #fff; }
.cta.line { background: var(--line-green); color: #fff; }
.cta.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); }

/* ───────── ナビ(めくる)───────── */
.nav-arrow {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 40;
  width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.86);
  backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgba(40,32,20,0.16);
  display: grid; place-items: center; font-size: 22px; color: var(--navy); transition: 0.16s;
}
.nav-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.nav-arrow:disabled { opacity: 0; pointer-events: none; }
.nav-arrow.prev { left: clamp(8px, 2vw, 28px); }
.nav-arrow.next { right: clamp(8px, 2vw, 28px); }

.dots {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.82);
  backdrop-filter: blur(8px); padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 20px rgba(40,32,20,0.12);
}
.dots .dot { display: flex; flex-direction: column; align-items: center; gap: 5px; opacity: 0.45; transition: 0.2s; }
.dots .dot .d { width: 8px; height: 8px; border-radius: 50%; background: var(--navy); transition: 0.2s; }
.dots .dot .l { font-size: 10px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.dots .dot.on { opacity: 1; }
.dots .dot.on .d { width: 26px; border-radius: 999px; background: var(--orange); }

.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: flex; align-items: center;
  padding: 14px clamp(16px, 4vw, 32px); pointer-events: none; }
.topbar .brand { font-size: 15px; font-weight: 800; color: var(--navy); letter-spacing: 0.04em; }
.topbar .brand span { color: var(--text-dim); font-weight: 600; font-size: 12px; margin-left: 8px; }

/* スワイプヒント(初回) */
.swipe-hint { position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%); z-index: 41;
  font-size: 12.5px; color: var(--text-dim); background: rgba(255,255,255,0.9); padding: 7px 16px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(40,32,20,0.1); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

/* 共通相談ウィジェット(embed.js)を、ドット/矢印ナビの上に逃がす */
.tsbcf-fab { bottom: 84px !important; }

@media (max-width: 720px) {
  .tsbcf-fab { bottom: 138px !important; }
  .nav-arrow { width: 46px; height: 46px; font-size: 19px; bottom: 80px; top: auto; transform: none; }
  .nav-arrow:hover { transform: scale(1.06); }
  .nav-arrow.prev { left: 14px; }
  .nav-arrow.next { right: 14px; }
  .dots .dot .l { display: none; }
  .hero-img { max-height: 38vh; }
  .page-inner { padding-top: 64px; padding-bottom: 140px; justify-content: flex-start; }
}
