/* =====================================================================
   Elaine Coach · 舞動原動力  —  全站共用樣式 (single source of truth)
   設計系統：溫暖療癒 × 活力動能，字級放大、對比充足，適合初學與熟齡族群
   ===================================================================== */

/* ---------- 1. 設計變數 (Design Tokens) ---------- */
:root {
  /* 品牌色：珊瑚橘=動力、鼠尾草綠=安定、暖金=亮點 */
  --color-primary: #D96846;
  --color-primary-dark: #B74E30;
  --color-primary-soft: #F6E2D7;
  --color-secondary: #5C8A6E;
  --color-secondary-dark: #456B54;
  --color-secondary-soft: #E3EDE5;
  --color-accent: #E6A23B;

  /* 中性色 */
  --color-cream: #FBF6EF;
  --color-cream-2: #F4EADD;
  --color-ink: #312D28;
  --color-ink-soft: #6C6458;
  --color-line: #E7DDCF;
  --color-white: #ffffff;

  /* 字體 */
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Noto Serif TC", "Songti TC", serif;

  /* 字級階層 (clamp 讓手機→桌機平滑縮放) */
  --fs-hero: clamp(2.3rem, 1.4rem + 4.2vw, 4rem);
  --fs-h2: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  --fs-h3: clamp(1.25rem, 1.05rem + 0.9vw, 1.6rem);
  --fs-lead: clamp(1.05rem, 0.98rem + 0.5vw, 1.3rem);
  --fs-body: 1.125rem;      /* 18px 基準，熟齡友善 */
  --fs-small: 0.95rem;

  /* 版面 */
  --container: 1200px;
  --container-narrow: 820px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-y: clamp(3.5rem, 7vw, 6rem);

  /* 圓角 / 陰影 / 動態 */
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --shadow-sm: 0 4px 14px rgba(49, 45, 40, 0.08);
  --shadow: 0 14px 38px rgba(49, 45, 40, 0.12);
  --shadow-lg: 0 24px 60px rgba(49, 45, 40, 0.18);
  --ease: 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. Reset / 基礎 ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--color-ink);
  background: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: 0.01em; }
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { color: var(--color-ink); }

:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 3px; border-radius: 4px; }

/* ---------- 3. 版面容器 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section--cream { background: var(--color-cream); }
.section--sand { background: var(--color-cream-2); }
.section--green { background: var(--color-secondary-soft); }
.section--white { background: var(--color-white); }

/* ---------- 4. 共用元件：標題區塊 ---------- */
.eyebrow {
  display: inline-block;
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}
.section-head { max-width: 760px; margin-inline: auto; text-align: center; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head p { color: var(--color-ink-soft); font-size: var(--fs-lead); margin-top: 1rem; }

/* ---------- 5. 按鈕 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.8em 1.7em;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  transition: transform var(--ease), background var(--ease), box-shadow var(--ease), color var(--ease);
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--color-primary); color: var(--color-white); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--color-primary-dark); box-shadow: var(--shadow); }
.btn--secondary { background: var(--color-secondary); color: var(--color-white); box-shadow: var(--shadow-sm); }
.btn--secondary:hover { background: var(--color-secondary-dark); box-shadow: var(--shadow); }
.btn--outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn--outline:hover { background: var(--color-primary); color: var(--color-white); }
.btn--ghost-light { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.6); }
.btn--ghost-light:hover { background: #fff; color: var(--color-primary-dark); }
.btn--lg { padding: 0.95em 2.1em; font-size: 1.1rem; }

/* ---------- 6. 頁首 Header / 導覽 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 246, 239, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; }
.brand__mark {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff; font-weight: 900; font-size: 1.25rem; flex: none;
  box-shadow: var(--shadow-sm);
}
.brand__name { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name b { font-size: 1.15rem; font-weight: 900; letter-spacing: 0.02em; }
.brand__name span { font-size: 0.78rem; color: var(--color-ink-soft); letter-spacing: 0.14em; }

.nav__list { display: flex; align-items: center; gap: clamp(0.5rem, 1.5vw, 1.75rem); }
.nav__link {
  position: relative;
  font-weight: 500;
  padding: 0.4em 0.2em;
  color: var(--color-ink);
  transition: color var(--ease);
}
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 2px; background: var(--color-primary);
  transform: scaleX(0); transform-origin: left; transition: transform var(--ease);
}
.nav__link:hover { color: var(--color-primary); }
.nav__link:hover::after,
.nav__link--active::after { transform: scaleX(1); }
.nav__link--active { color: var(--color-primary); font-weight: 700; }
.nav__cta { margin-left: 0.5rem; }

.nav-toggle {
  display: none;
  width: 46px; height: 46px; border: 1px solid var(--color-line);
  border-radius: var(--radius-sm); background: #fff;
  position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 22px; height: 2px; background: var(--color-ink);
  transform: translate(-50%, -50%); transition: var(--ease);
}
.nav-toggle span::before { transform: translate(-50%, -8px); }
.nav-toggle span::after { transform: translate(-50%, 6px); }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translate(-50%, 0) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translate(-50%, 0) rotate(-45deg); }

/* ---------- 7. Hero (首頁大圖) ---------- */
.hero {
  position: relative;
  color: #fff;
  background:
    linear-gradient(100deg, rgba(49,45,40,0.72) 0%, rgba(49,45,40,0.35) 55%, rgba(49,45,40,0.15) 100%),
    var(--color-ink);
  background-size: cover;
  background-position: center;
}
.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: min(82vh, 680px);
  padding-block: clamp(3.5rem, 8vw, 6rem);
  max-width: 680px;
}
.hero .eyebrow { color: #ffdcae; }
.hero__title { color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,0.3); }
.hero__subtitle {
  font-size: var(--fs-lead);
  margin-top: 1.25rem;
  max-width: 44ch;
  color: rgba(255,255,255,0.94);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

/* 內頁 Banner */
.page-hero {
  position: relative;
  color: #fff;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(49,45,40,0.6), rgba(49,45,40,0.6)),
    linear-gradient(120deg, var(--color-primary), var(--color-secondary));
  background-size: cover;
  background-position: center;
}
.page-hero__inner { padding-block: clamp(3rem, 7vw, 5rem); }
.page-hero h1 { color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,0.25); }
.page-hero p { color: rgba(255,255,255,0.95); font-size: var(--fs-lead); margin-top: 1rem; max-width: 60ch; margin-inline: auto; }
.breadcrumb { font-size: var(--fs-small); color: rgba(255,255,255,0.85); margin-top: 1.25rem; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }

/* ---------- 8. 格線 ---------- */
.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

/* 圖文並排 */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.split__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow); width: 100%; object-fit: cover; }
.split__body h2 { margin-bottom: 1rem; }
.split__body p + p { margin-top: 1rem; }
.split__body p { color: var(--color-ink-soft); }

/* ---------- 9. 卡片 ---------- */
.card {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--ease), box-shadow var(--ease);
  border: 1px solid var(--color-line);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card__media img { transform: scale(1.05); }
.card__body { padding: clamp(1.4rem, 2.5vw, 1.9rem); display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.card__icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  font-size: 1.6rem; background: var(--color-primary-soft); color: var(--color-primary-dark);
}
.card__title { font-size: var(--fs-h3); }
.card__body p { color: var(--color-ink-soft); }
.card__link { margin-top: auto; color: var(--color-primary); font-weight: 700; }
.card__link:hover { color: var(--color-primary-dark); }

/* 功能/特色小卡 (無圖) */
.feature { text-align: center; padding: clamp(1.5rem, 3vw, 2rem); }
.feature .card__icon { margin-inline: auto; margin-bottom: 1rem; }

/* ---------- 10. 數據 / 步驟 ---------- */
.stats { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); text-align: center; }
.stat b { display: block; font-size: clamp(2rem, 1.2rem + 3vw, 3rem); font-weight: 900; color: var(--color-primary); line-height: 1; }
.stat span { color: var(--color-ink-soft); font-size: var(--fs-small); }

.steps { counter-reset: step; display: grid; gap: clamp(1.25rem, 3vw, 2rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.step { position: relative; background: #fff; border: 1px solid var(--color-line); border-radius: var(--radius); padding: 2rem 1.5rem 1.5rem; box-shadow: var(--shadow-sm); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -22px; left: 1.5rem;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--color-primary); color: #fff; font-weight: 900; font-size: 1.3rem;
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.step h3 { margin: 0.5rem 0; }
.step p { color: var(--color-ink-soft); }

/* ---------- 11. 方案 / 價目卡 ---------- */
.plan {
  background: #fff; border: 1px solid var(--color-line); border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3vw, 2.5rem); display: flex; flex-direction: column; gap: 1.1rem;
  box-shadow: var(--shadow-sm); transition: transform var(--ease), box-shadow var(--ease); position: relative;
}
.plan:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.plan--featured { border-color: var(--color-primary); border-width: 2px; }
.plan__tag {
  position: absolute; top: -14px; right: 1.75rem; background: var(--color-primary); color: #fff;
  font-size: 0.8rem; font-weight: 700; padding: 0.35em 1em; border-radius: var(--radius-pill);
}
.plan h3 { color: var(--color-primary-dark); }
.plan__meta { color: var(--color-ink-soft); font-size: var(--fs-small); }
.plan__price { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.3rem); font-weight: 900; color: var(--color-ink); }
.plan__price small { font-size: 0.9rem; font-weight: 500; color: var(--color-ink-soft); }
.feature-list { display: flex; flex-direction: column; gap: 0.7rem; }
.feature-list li { display: flex; gap: 0.6rem; align-items: flex-start; color: var(--color-ink-soft); }
.feature-list li::before { content: "✓"; color: var(--color-secondary); font-weight: 900; flex: none; }
.plan .btn { margin-top: auto; }

/* ---------- 12. 引言 / 見證 ---------- */
.quote {
  background: #fff; border-left: 5px solid var(--color-primary); border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem); box-shadow: var(--shadow-sm);
}
.quote p { font-size: var(--fs-lead); font-style: italic; color: var(--color-ink); }
.quote footer { margin-top: 1rem; font-weight: 700; color: var(--color-primary-dark); font-style: normal; }
.quote footer span { display: block; font-weight: 500; color: var(--color-ink-soft); font-size: var(--fs-small); }

/* ---------- 13. CTA 色帶 ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--color-primary), var(--color-primary-dark));
  color: #fff; border-radius: var(--radius-lg); text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter);
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.92); font-size: var(--fs-lead); margin: 1rem auto 2rem; max-width: 52ch; }
.cta-band .hero__actions { justify-content: center; margin-top: 0; }

/* ---------- 14. 表單 / 聯絡 ---------- */
.form { display: flex; flex-direction: column; gap: 1.2rem; }
.form__row { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-weight: 700; font-size: var(--fs-small); }
.field input, .field select, .field textarea {
  font: inherit; padding: 0.75em 0.9em; border: 1.5px solid var(--color-line);
  border-radius: var(--radius-sm); background: #fff; color: var(--color-ink); width: 100%;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.field textarea { min-height: 130px; resize: vertical; }
.form__note {
  margin: 0; padding: 0.9em 1.1em; border-radius: var(--radius-sm);
  background: var(--color-secondary-soft); color: var(--color-secondary-dark);
  border: 1px solid var(--color-secondary); font-weight: 700;
}

.info-list { display: flex; flex-direction: column; gap: 1.25rem; }
.info-list li { display: flex; gap: 1rem; align-items: flex-start; }
.info-list .ic {
  width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center;
  font-size: 1.3rem; background: var(--color-secondary-soft); color: var(--color-secondary-dark);
}
.info-list b { display: block; }
.info-list span { color: var(--color-ink-soft); }

/* ---------- 15. 雜項 ---------- */
.lead { font-size: var(--fs-lead); color: var(--color-ink-soft); }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tag { background: var(--color-secondary-soft); color: var(--color-secondary-dark); font-size: var(--fs-small); font-weight: 700; padding: 0.4em 1em; border-radius: var(--radius-pill); }
.prose p { margin-bottom: 1.1rem; color: var(--color-ink-soft); }
.prose h3 { margin: 1.75rem 0 0.75rem; color: var(--color-primary-dark); }

/* ---------- 16. 頁尾 Footer ---------- */
.site-footer { background: #2A2621; color: #cfc7bb; padding-block: clamp(3rem, 6vw, 4.5rem) 1.75rem; }
.footer-grid { display: grid; gap: clamp(2rem, 4vw, 3rem); grid-template-columns: 1.4fr 1fr 1fr 1.3fr; }
.site-footer .brand__name b { color: #fff; }
.site-footer .brand__name span { color: #a79e90; }
.footer__about { margin-top: 1rem; color: #a79e90; font-size: var(--fs-small); max-width: 36ch; }
.footer h4 { color: #fff; font-size: 1.05rem; margin-bottom: 1rem; }
.footer-links li { margin-bottom: 0.6rem; }
.footer-links a { color: #cfc7bb; transition: color var(--ease); }
.footer-links a:hover { color: var(--color-accent); }
.footer-contact li { margin-bottom: 0.8rem; color: #a79e90; }
.footer-contact b { color: #e9e2d7; font-weight: 500; }
.footer__bottom {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between;
  font-size: var(--fs-small); color: #8f877b;
}

/* ---------- 17. 動效 (可及性：尊重減少動態偏好) ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 18. RWD 斷點 ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; inset: 74px 0 auto 0;
    background: var(--color-cream);
    border-bottom: 1px solid var(--color-line);
    box-shadow: var(--shadow);
    transform: translateY(-120%);
    transition: transform var(--ease);
    max-height: calc(100vh - 74px); overflow-y: auto;
  }
  .nav.is-open { transform: translateY(0); }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem var(--gutter) 1.5rem; }
  .nav__link { padding: 0.9em 0; border-bottom: 1px solid var(--color-line); font-size: 1.15rem; }
  .nav__link::after { display: none; }
  .nav__cta { margin: 1rem 0 0; }
  .nav__cta .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero__inner { align-items: flex-start; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero__actions { width: 100%; }
  .hero__actions .btn { width: 100%; }
  .footer__bottom { flex-direction: column; }
}
