/* ============================================================
   magatama. office — スタイルシート
   トンマナ: ロゴから抽出した色
   背景クリーム #FCFDF7 / 生成り #F7F3E9
   テラコッタ   #B97C67（線・アクセント）
   こげ茶       #3A3B36（文字）
============================================================ */

:root {
  --cream:        #FCFDF7;
  --kinari:       #F7F3E9;
  --terracotta:   #B97C67;
  --terracotta-d: #9C6450; /* 白文字を載せるボタン等はこちら（コントラスト確保のため） */
  --terracotta-l: #E8D5CC;
  --ink:          #3A3B36;
  --ink-soft:     #6B6A62;
  --font-body:  'Zen Maru Gothic', sans-serif; /* 見出しも本文も同じフォントで統一（太さで差をつける） */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.9;
  font-size: 15px;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

.pc-only { display: none; }
.sp-only { display: inline; }

/* ------------------------------------------------------------
   ボタン
------------------------------------------------------------ */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  transition: opacity .25s, transform .25s;
  text-align: center;
}
.btn:active { transform: scale(0.97); }

/* 塗りつぶしボタン（メインの導線：お問い合わせ） */
.btn-fill {
  background: var(--terracotta-d);
  color: #fff;
  box-shadow: 0 4px 14px rgba(156, 100, 80, 0.35);
}
.btn-fill:hover { opacity: 0.85; }

/* 枠線ボタン（控えめな導線：LINE） */
.btn-outline {
  background: transparent;
  color: var(--terracotta-d);
  border: 1.5px solid var(--terracotta);
}
.btn-outline:hover { background: var(--terracotta-l); }

/* ------------------------------------------------------------
   ヒーロー
------------------------------------------------------------ */
.hero {
  position: relative;
  text-align: center;
  padding: 64px 24px 48px;
  background: var(--cream);
}
.hero-logo {
  width: 240px;
  height: auto;
  margin-bottom: 8px;
}
.hero-copy {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 16px;
  letter-spacing: 0.12em;
  line-height: 1.6;
}
.hero-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 10px;
  letter-spacing: 0.14em;
}
.hero-buttons {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.hero-buttons .btn { width: min(280px, 100%); }

.hero-roofline {
  color: var(--terracotta);
  margin-top: 40px;
  opacity: 0.7;
}
.hero-roofline svg { display: block; width: 100%; height: 24px; }

/* ------------------------------------------------------------
   セクション共通
------------------------------------------------------------ */
.section {
  padding: 72px 24px;
  max-width: 880px;
  margin: 0 auto;
}
.section-title {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.18em;
  color: var(--ink);
}
/* 見出し下の手描き風ライン */
.section-deco {
  width: 56px;
  height: 2px;
  margin: 14px auto 44px;
  background: var(--terracotta);
  border-radius: 999px;
  transform: rotate(-1.2deg);
  opacity: 0.8;
}

/* ------------------------------------------------------------
   コンセプト
------------------------------------------------------------ */
.concept { background: var(--cream); }
.concept-text {
  text-align: center;
  font-size: 15px;
  color: var(--ink);
}

/* ------------------------------------------------------------
   サービス
------------------------------------------------------------ */
.services {
  max-width: 100%;
  background: var(--kinari);
  padding-left: 0;
  padding-right: 0;
}
.service-grid {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.service-card {
  background: var(--cream);
  border: 1px solid var(--terracotta-l);
  border-radius: 18px;
  padding: 32px 26px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(58, 59, 54, 0.04);
}
.service-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--terracotta);
}
.service-icon svg { width: 100%; height: 100%; }
.service-card h3 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  color: var(--ink);
}
/* サービスカードの対応エリアバッジ */
.service-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--terracotta-d);
  background: var(--terracotta-l);
  border-radius: 999px;
  padding: 3px 14px;
  margin-bottom: 14px;
  line-height: 1.6;
}
.service-card p {
  font-size: 13.5px;
  color: var(--ink-soft);
  text-align: left;
}

/* ------------------------------------------------------------
   ご相談の流れ
------------------------------------------------------------ */
.flow-steps {
  list-style: none;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
/* ステップをつなぐ縦線 */
.flow-steps::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 16px;
  bottom: 16px;
  width: 1.5px;
  background: var(--terracotta-l);
}
.flow-step {
  position: relative;
  display: flex;
  gap: 20px;
  padding: 18px 0;
}
.flow-num {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cream);
  border: 1.5px solid var(--terracotta);
  color: var(--terracotta-d);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flow-step h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-top: 8px;
}
.flow-step p {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* ------------------------------------------------------------
   対象エリア
------------------------------------------------------------ */
.area { text-align: center; }
.area-blocks {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 560px;
  margin: 0 auto;
}
.area-block {
  background: var(--kinari);
  border: 1px solid var(--terracotta-l);
  border-radius: 16px;
  padding: 22px 18px;
}
.area-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}
.area-text {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--terracotta-d);
  margin-top: 4px;
}
.area-sub {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.area-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 22px;
}

/* ------------------------------------------------------------
   チャットボット
------------------------------------------------------------ */
.chat {
  max-width: 100%;
  background: var(--kinari);
  padding-left: 0;
  padding-right: 0;
}
.chat-lead {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 28px;
  padding: 0 24px;
}
.chat-window {
  width: min(480px, calc(100% - 32px)); /* スマホで画面端にくっつかないよう左右に余白 */
  margin: 0 auto;
  background: var(--cream);
  border: 1px solid var(--terracotta-l);
  border-radius: 22px;
  padding: 24px 18px 20px;
  box-shadow: 0 4px 18px rgba(58, 59, 54, 0.06);
}
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 120px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
}
.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere; /* 長いメールアドレス等が吹き出しからはみ出さないように折り返す */
  animation: bubbleIn .3s ease both;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-bubble.bot {
  align-self: flex-start;
  background: var(--kinari);
  border: 1px solid var(--terracotta-l);
  border-bottom-left-radius: 6px;
}
.chat-bubble.user {
  align-self: flex-end;
  background: var(--terracotta-d);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.chat-bubble.summary {
  align-self: stretch;
  max-width: 100%;
  background: var(--cream);
  border: 1.5px dashed var(--terracotta);
  border-radius: 14px;
  font-size: 13px;
}
.chat-bubble.summary ul {
  list-style: none;
  margin-top: 6px;
}
.chat-bubble.summary li {
  padding-left: 1.2em;
  position: relative;
}
.chat-bubble.summary li::before {
  content: "・";
  position: absolute;
  left: 0;
  color: var(--terracotta);
}
.chat-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}
.chat-choice {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--terracotta);
  background: var(--cream);
  color: var(--terracotta-d);
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.chat-choice:hover { background: var(--terracotta-l); }
.chat-choice:active { transform: scale(0.96); }

/* ---- 入力欄（自由記述・メールアドレス） ---- */
.chat-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-input,
.chat-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px; /* 16px未満だとスマホ(iPhone)で入力時に画面が勝手に拡大されるため */
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--terracotta);
  border-radius: 14px;
  padding: 12px 14px;
}
.chat-textarea {
  min-height: 100px;
  resize: vertical;
}
.chat-input:focus,
.chat-textarea:focus {
  outline: 2px solid var(--terracotta-d);
  outline-offset: 1px;
}
.chat-input::placeholder,
.chat-textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.65;
  font-size: 13px;
}
.chat-input-note {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.chat-input-error {
  display: none;
  font-size: 12.5px;
  color: #A8402C;
  line-height: 1.6;
}

/* 送信・次へボタン */
.chat-send {
  display: inline-block;
  margin: 4px auto 0;
  padding: 13px 30px;
  border: none;
  border-radius: 999px;
  background: var(--terracotta-d);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(156, 100, 80, 0.35);
  transition: opacity .25s, transform .15s;
}
.chat-send:hover { opacity: 0.85; }
.chat-send:active { transform: scale(0.97); }
.chat-send:disabled {
  opacity: 0.55;
  cursor: default;
}

/* 任意質問の「スキップ」ボタン（控えめ） */
.chat-skip {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 12.5px;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 12px;
}

/* 送信後のLINE案内リンク（控えめ） */
.chat-line-link {
  font-size: 12.5px;
  color: var(--ink-soft);
  text-decoration: underline;
  margin-top: 8px;
}

.chat-restart {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 10px;
}

/* ------------------------------------------------------------
   フッター
------------------------------------------------------------ */
.footer {
  text-align: center;
  padding: 56px 24px 110px; /* 下部はsticky-bar分の余白 */
  background: var(--cream);
  border-top: 1px solid var(--terracotta-l);
}
.footer-logo {
  width: 110px;
  border-radius: 12px;
}
.footer-area {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 14px;
}
.footer-privacy {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.footer-copy {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
  letter-spacing: 0.08em;
}

/* ------------------------------------------------------------
   スマホ用固定バー
------------------------------------------------------------ */
.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(252, 253, 247, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--terracotta-l);
  z-index: 100;
}
.sticky-bar .btn {
  flex: 1;
  padding: 12px 8px;
  font-size: 13.5px;
}
/* お問い合わせを広く、LINEは控えめに */
.sticky-bar .btn-fill { flex: 2; }
.sticky-bar .btn-outline { flex: 1; }

/* ------------------------------------------------------------
   動きを抑える設定の端末への配慮（乗り物酔いしやすい方など）
------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chat-bubble { animation: none; }
}

/* ------------------------------------------------------------
   PC（768px以上）
------------------------------------------------------------ */
@media (min-width: 768px) {
  body { font-size: 16px; }
  .pc-only { display: inline; }
  .sp-only { display: none; }

  .hero { padding: 96px 24px 64px; }
  .hero-logo { width: 300px; }
  .hero-copy { font-size: 32px; }
  .hero-sub { font-size: 14px; }
  .hero-buttons { flex-direction: row; justify-content: center; }
  .hero-buttons .btn { width: 240px; }

  .section { padding: 96px 24px; }
  .section-title { font-size: 28px; }
  .area-blocks { flex-direction: row; }
  .area-block { flex: 1; }

  .service-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .service-card { padding: 40px 32px; }

  .sticky-bar { display: none; }
  .footer { padding-bottom: 56px; }
}
