/* ============================================================
   Emma Sweet Rice — 設計 token
   配色:暖霧粉 + 米白 + 抹茶點綴,手寫食譜小卡視覺主軸
============================================================ */
:root {
  --cream: #FBF1E7;
  --paper: #FFFDF9;
  --rose: #C97C82;
  --rose-deep: #A85C63;
  --blush: #F3D3CE;
  --ink: #4A2E2B;
  --ink-soft: rgba(74, 46, 43, 0.7);
  --sage: #8C9A6B;
  --sage-deep: #6F7D52;
  --gold: #D4A24C;

  --font-display: 'Noto Serif TC', serif;
  --font-hand: 'Caveat', cursive;
  --font-body: 'Noto Sans TC', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

h1, h2, h3 { font-family: var(--font-display); margin: 0; color: var(--ink); }

/* ============ 共用元件 ============ */
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  text-align: center;
  margin-bottom: 0.4rem;
}
.section-sub {
  text-align: center;
  color: var(--ink-soft);
  margin-top: 0;
  margin-bottom: 2.2rem;
  font-size: 0.95rem;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--rose);
  color: var(--paper);
  box-shadow: 0 6px 0 var(--rose-deep);
}
.btn-primary:hover { background: var(--rose-deep); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--rose-deep); }
.btn-ghost {
  background: transparent;
  color: var(--rose-deep);
  border-color: var(--rose);
}
.btn-ghost:hover { background: var(--blush); }

/* 紙卡片(用在測驗、老闆故事) */
.card-paper {
  background: var(--paper);
  border-radius: 18px;
  padding: 2rem;
  box-shadow:
    0 1px 0 var(--blush),
    0 10px 24px rgba(74, 46, 43, 0.12);
  position: relative;
}

/* 手寫食譜小卡(用在測驗結果、轉盤結果、商品卡) */
.recipe-card {
  background: var(--paper);
  border: 1.5px dashed var(--rose);
  border-radius: 14px;
  padding: 1.4rem 1.4rem 1.2rem;
  position: relative;
  box-shadow: 0 8px 18px rgba(74, 46, 43, 0.1);
}
.recipe-card::before {
  /* washi tape 紙膠帶 */
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 70px;
  height: 26px;
  background: var(--gold);
  opacity: 0.55;
  border-radius: 2px;
}

/* 米粒分隔線 */
.rice-divider {
  height: 22px;
  margin: 0 auto;
  max-width: 300px;
  background-image: radial-gradient(ellipse 6px 3px at center, var(--rose) 45%, transparent 46%);
  background-size: 26px 22px;
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.55;
}

/* ============ 導覽列 ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(251, 241, 231, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--blush);
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--rose-deep);
}
.nav-links { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.nav-links a { font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--rose-deep); }
.nav-ig { font-size: 1.2rem; }

/* ============ HERO ============ */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}
.eyebrow {
  font-family: var(--font-hand);
  color: var(--rose-deep);
  font-size: 1.3rem;
  margin: 0 0 0.4rem;
  letter-spacing: 0.05em;
}
.hero-text h1 {
  font-size: clamp(2.1rem, 5vw, 3rem);
  line-height: 1.25;
}
.hero-sub {
  color: var(--ink-soft);
  margin: 1.1rem 0 1.6rem;
  max-width: 42ch;
}
.hero-cta { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.hero-ig-label {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  color: var(--sage-deep);
  margin: 0 0 0.6rem;
}
.ig-feed { display: flex; gap: 1rem; }
.ig-card {
  flex: 1;
  aspect-ratio: 1;
  background: var(--paper);
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(74, 46, 43, 0.15);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.ig-card:nth-child(1) { transform: rotate(-4deg); }
.ig-card:nth-child(2) { transform: rotate(3deg); }
.ig-card::before {
  content: "";
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 40px; height: 16px;
  background: var(--blush);
  opacity: 0.8;
}
.ig-card img { width: 100%; height: 100%; object-fit: cover; }
.ig-more {
  display: block;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--rose-deep);
}

/* ============ 甜點測驗 ============ */
.quiz-section { max-width: 640px; margin: 0 auto; padding: 3rem 1.5rem; }
.quiz-box { text-align: center; }
.quiz-progress { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1.6rem; }
.quiz-progress .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--blush);
}
.quiz-progress .dot.active { background: var(--rose); }

.quiz-q-title { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 1.2rem; }
.quiz-options { display: grid; gap: 0.7rem; }
.quiz-option {
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  border: 1.5px solid var(--blush);
  background: var(--cream);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-option:hover { border-color: var(--rose); background: var(--blush); }

.quiz-result-label { font-family: var(--font-hand); font-size: 1.3rem; color: var(--rose-deep); }
.quiz-retry { margin-top: 1.2rem; }

/* ============ 商品區 ============ */
.products-section { max-width: 1100px; margin: 0 auto; padding: 3rem 1.5rem; }
.category-tabs {
  display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap;
  margin-bottom: 2rem;
}
.tab-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid var(--rose);
  background: transparent;
  color: var(--rose-deep);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.tab-btn.active { background: var(--rose); color: var(--paper); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.6rem;
}
.product-card {
  background: var(--paper);
  border-radius: 16px;
  padding: 1.3rem;
  box-shadow: 0 8px 20px rgba(74, 46, 43, 0.1);
  text-align: center;
}
.product-grid .product-card:nth-child(3n+1) { transform: rotate(-1.2deg); }
.product-grid .product-card:nth-child(3n+2) { transform: rotate(0.8deg); }
.product-grid .product-card:nth-child(3n+3) { transform: rotate(-0.5deg); }

.product-image {
  width: 88px; height: 88px;
  margin: 0 auto 0.9rem;
  background: var(--blush);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.product-name { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 0.3rem; }
.product-tags { display: flex; gap: 0.35rem; justify-content: center; flex-wrap: wrap; margin-bottom: 0.6rem; }
.tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(140, 154, 107, 0.15);
  color: var(--sage-deep);
  font-weight: 700;
}
.tag-gf { background: rgba(212, 162, 76, 0.18); color: #8a651f; }
.product-price { font-family: var(--font-hand); font-size: 1.5rem; color: var(--rose-deep); margin-bottom: 0.7rem; }
.product-card .btn { width: 100%; padding: 0.65rem; font-size: 0.85rem; }

.products-note {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 2.2rem;
}

/* ============ 幸運轉盤 ============ */
.wheel-section { max-width: 500px; margin: 0 auto; padding: 3rem 1.5rem; text-align: center; }
.wheel-wrap { position: relative; width: 260px; height: 260px; margin: 0 auto 1.6rem; }
.wheel-pointer {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  font-size: 1.4rem; color: var(--rose-deep); z-index: 2;
}
.wheel {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 6px solid var(--paper);
  box-shadow: 0 10px 24px rgba(74, 46, 43, 0.25);
  transition: transform 4.5s cubic-bezier(0.15, 0.85, 0.1, 1);
  position: relative;
}
.wheel-result { margin-top: 1.8rem; }
.wheel-note { margin-top: 1rem; font-size: 0.85rem; color: var(--ink-soft); }
.wheel-note a { color: var(--rose-deep); font-weight: 700; }

/* ============ 顧客曬單牆 ============ */
.wall-section {
  background: var(--blush);
  padding: 3.5rem 1.5rem;
}
.corkboard {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.8rem;
}
.wall-card {
  background: var(--paper);
  padding: 1.2rem;
  border-radius: 4px;
  box-shadow: 0 10px 20px rgba(74, 46, 43, 0.18);
  position: relative;
}
.corkboard .wall-card:nth-child(odd) { transform: rotate(-2.5deg); }
.corkboard .wall-card:nth-child(even) { transform: rotate(2deg); }
.wall-card::before {
  content: "";
  position: absolute;
  top: -7px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.wall-photo {
  width: 100%; aspect-ratio: 1;
  background: var(--cream);
  border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem;
  margin-bottom: 0.8rem;
}
.wall-quote { font-size: 0.9rem; margin: 0 0 0.5rem; }
.wall-name { font-family: var(--font-hand); font-size: 1.15rem; color: var(--rose-deep); margin: 0; }

/* ============ 老闆故事 ============ */
.story-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
}
.story-photo {
  width: 100%; aspect-ratio: 1;
  background: var(--sage);
  color: var(--paper);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}
.story-signature { font-family: var(--font-hand); font-size: 1.4rem; color: var(--rose-deep); margin-top: 0; }
.story-sign { font-family: var(--font-hand); font-size: 1.6rem; text-align: right; color: var(--ink-soft); }

/* ============ 頁尾 ============ */
.footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  background: var(--ink);
  color: var(--cream);
}
.footer a { font-weight: 700; }
.footer-note { opacity: 0.6; font-size: 0.78rem; margin-top: 1rem; }
.footer-copyright { opacity: 0.5; }

/* ============ RWD ============ */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; }
  .story-section { grid-template-columns: 1fr; }
  .story-photo { width: 140px; margin: 0 auto; }
}

/* 尊重使用者「減少動態效果」設定 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
