/* 小芽日記官網。色彩對應 ../Budlumi/docs/design/tokens.json；間距一律在 4px 刻度上。 */

:root {
  color-scheme: light;
  --sprout: #557535;
  --sprout-hover: #4A672E;
  --sprout-soft: #EAF1DF;
  --on-sprout: #FFFFFF;
  --bg: #F6F0E8;
  --card: #FFFCF7;
  --sunk: #EFE6DA;
  --line: rgb(42 33 28 / 10%);
  --ink: #2A211C;
  --muted: #6B5F56;
  --shadow: 0 12px 32px rgb(42 33 28 / 10%);

  --feeding: #E0782F;
  --sleep: #4D5BC0;
  --measure: #B0558F;
  --life: #C08F12;
  --feeding-soft: #FBE5D3;
  --sleep-soft: #E6E8F6;
  --measure-soft: #F5E6EF;
  --life-soft: #F6EDD3;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", system-ui, sans-serif;
}

/* 官網固定使用淺色的奶油米白；App 本身仍有深色模式。 */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: 80px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--sprout); text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--sprout); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

.shell { width: min(100% - 48px, 1120px); margin-inline: auto; }

.skip-link {
  position: absolute;
  z-index: 20;
  top: 12px;
  left: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--card);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* 頁首 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
}
.wordmark img { width: 28px; height: 28px; }

.nav-right { display: flex; align-items: center; gap: 4px; }

.nav-link {
  display: none;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-decoration: none;
  transition: color 200ms var(--ease), background-color 200ms var(--ease);
}
.nav-link:hover { color: var(--ink); background: var(--sunk); }
.nav-link[aria-current="page"] { color: var(--ink); }

@media (min-width: 720px) {
  .nav-link { display: inline-flex; }
  .nav-right .button { margin-left: 8px; }
}

/* 按鈕 */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--sprout);
  color: var(--on-sprout);
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 200ms var(--ease), transform 200ms var(--ease);
}
.button:hover { background: var(--sprout-hover); }
.button:active { transform: scale(0.98); }
.button-sm { min-height: 40px; padding: 8px 16px; border-radius: 10px; font-size: 0.875rem; line-height: 1.25rem; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  transition: color 200ms var(--ease);
}
.text-link:hover { color: var(--sprout); }
.text-link svg { width: 18px; height: 18px; transition: transform 200ms var(--ease); }
.text-link:hover svg { transform: translateX(2px); }

/* 招牌細節：App 時間軸上的分類色小圓點 */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.feeding { background: var(--feeding); }
.dot.sleep { background: var(--sleep); }
.dot.measure { background: var(--measure); }
.dot.life { background: var(--life); }

/* 首頁主視覺 */
.hero { padding-block: 40px 64px; }

.hero-grid { display: grid; gap: 48px; align-items: center; }

.hero h1 { font-size: 2rem; line-height: 1.4; letter-spacing: 0.01em; }
.line { display: block; }
.ph { display: inline-block; }
@media (min-width: 400px) { .hero h1 { font-size: 2.25rem; } .hero h1 .line { white-space: nowrap; } }

.hero-lede { max-width: 30rem; margin-top: 24px; color: var(--muted); font-size: 1.125rem; line-height: 1.8; }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 32px; }

.hero-scene {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 32px;
  background: var(--sunk);
}
.hero-scene > img { width: 100%; height: 100%; object-fit: cover; object-position: 46% 50%; }

.hero-phone {
  position: absolute;
  right: 20px;
  bottom: -72px;
  width: 34%;
  max-width: 168px;
}

.phone {
  overflow: hidden;
  padding: 6px;
  border-radius: 34px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.phone img { border-radius: 28px; }

.hero-text, .hero-scene { animation: rise 700ms var(--ease) both; }
.hero-scene { animation-delay: 80ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (min-width: 900px) {
  .hero { padding-block: 56px 80px; }
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 56px; }
  .hero h1 { font-size: 3rem; line-height: 1.3; }
  .hero-scene { aspect-ratio: auto; height: 440px; }
}

/* 區段 */
.section { padding-block: 64px; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: 1.875rem; line-height: 1.4; }
.section-head p { margin-top: 16px; color: var(--muted); font-size: 1.125rem; line-height: 1.8; }

@media (min-width: 900px) {
  .section { padding-block: 80px; }
  .section-head h2 { font-size: 2.25rem; line-height: 1.35; }
}

/* 大字標語 */
.statement { padding-block: 56px; background: var(--sprout-soft); }
.statement p { max-width: 760px; color: var(--sprout); font-size: 1.5rem; line-height: 1.55; font-weight: 600; }
.statement .soft { color: var(--ink); font-weight: 500; }
@media (min-width: 600px) { .statement p { font-size: 1.875rem; } }
@media (min-width: 900px) { .statement { padding-block: 72px; } .statement p { font-size: 2.75rem; line-height: 1.45; } }

/* 功能：兩欄小卡片 */
.features { display: grid; gap: 20px; }
@media (min-width: 760px) { .features { grid-template-columns: 1fr 1fr; } }

.feature {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 32px;
  background: var(--card);
  border: 1px solid var(--line);
}

.feature-text { padding: 28px 28px 24px; }

.label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}

.feature h3 { font-size: 1.25rem; line-height: 1.5; }
.feature p { margin-top: 8px; color: var(--muted); line-height: 1.8; }

.feature-media { flex: 1; display: flex; justify-content: center; align-items: flex-end; margin: 0 12px 12px; padding: 28px 24px 0; border-radius: 20px; }
.feature-media .phone { width: min(100%, 188px); padding: 5px 5px 0; border-radius: 28px 28px 0 0; box-shadow: 0 -4px 20px rgb(42 33 28 / 8%); }
.feature-media .phone img { border-radius: 23px 23px 0 0; aspect-ratio: 800 / 1000; object-fit: cover; object-position: top; }
.feature-media.feeding { background: var(--feeding-soft); }
.feature-media.sleep { background: var(--sleep-soft); }
.feature-media.measure { background: var(--measure-soft); }
.feature-media.life { background: var(--life-soft); }

/* 比較表 */
.compare-band { padding-top: 0; }
.compare { overflow-x: auto; border-radius: 24px; border: 1px solid var(--line); background: var(--card); }
.compare table { width: 100%; }

.compare th, .compare td { padding: 16px 20px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare thead th { background: transparent; color: var(--muted); font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; }
.compare thead th:last-child { color: var(--sprout); font-weight: 600; }
.compare tbody th { width: 30%; font-weight: 500; background: transparent; }
.compare td { color: var(--muted); }
.compare td:last-child { color: var(--ink); font-weight: 500; background: color-mix(in srgb, var(--sprout-soft) 55%, transparent); }
@media (max-width: 719px) {
  .compare thead { display: none; }
  .compare tr, .compare th, .compare td { display: block; width: auto; }
  .compare tbody tr { padding: 16px 20px; border-bottom: 1px solid var(--line); }
  .compare tbody tr:last-child { border-bottom: 0; }
  .compare tbody th, .compare td { padding: 0; border: 0; }
  .compare tbody th { width: auto; margin-bottom: 8px; }
  .compare td { display: grid; grid-template-columns: 88px 1fr; gap: 8px; margin-top: 4px; }
  .compare td::before { content: attr(data-label); color: var(--muted); font-size: 0.75rem; line-height: 1.75rem; font-weight: 400; }
  .compare td:last-child { background: transparent; }
  .compare td:last-child::before { color: var(--sprout); font-weight: 600; }
}

/* 開始使用 */
.steps { display: grid; gap: 32px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 24px; border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 12px;
  color: var(--sprout);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.steps h3 { font-size: 1.25rem; line-height: 1.6; }
.steps p { margin-top: 8px; color: var(--muted); }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; } }

/* 承諾 */
.promise-band { background: var(--sprout-soft); }
.promises { display: grid; gap: 32px 48px; margin: 0; padding: 0; list-style: none; }
.promises li { display: grid; grid-template-columns: 24px 1fr; gap: 4px 12px; }
.promises svg { width: 20px; height: 20px; margin-top: 4px; color: var(--sprout); }
.promises h3 { font-size: 1.125rem; line-height: 1.75rem; }
.promises p { grid-column: 2; color: var(--muted); }
.promise-more { margin-top: 40px; }
@media (min-width: 720px) { .promises { grid-template-columns: repeat(2, 1fr); } }

/* 常見問題 */
.faq-wrap { display: grid; gap: 32px; }
@media (min-width: 900px) { .faq-wrap { grid-template-columns: 1fr 2fr; gap: 64px; } .faq-wrap .section-head { margin: 0; } }

.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 1.0625rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  transition: color 200ms var(--ease);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary:hover { color: var(--sprout); }
.faq-list summary svg { flex: none; width: 18px; height: 18px; color: var(--muted); transition: transform 300ms var(--ease); }
.faq-list details[open] summary svg { transform: rotate(45deg); }
.faq-list details p { padding-bottom: 24px; color: var(--muted); max-width: 40rem; }

/* 結尾 */
.final {
  display: grid;
  gap: 24px;
  padding: 48px 24px;
  border-radius: 24px;
  background: var(--sprout);
  color: var(--on-sprout);
}
.final h2 { font-size: 1.875rem; line-height: 1.4; }
.final p { margin-top: 12px; opacity: 0.86; font-size: 1.0625rem; }
.final .button { background: var(--on-sprout); color: var(--sprout); justify-self: start; }
.final .button:hover { background: var(--card); }
@media (min-width: 900px) {
  .final { grid-template-columns: 1fr auto; align-items: center; padding: 64px; }
  .final .button { justify-self: end; }
}

/* 文件頁 */
.document {
  width: min(100% - 32px, 760px);
  margin: 40px auto 80px;
  padding: 32px 24px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
}
.document h1 { margin-bottom: 24px; font-size: 1.875rem; line-height: 1.4; }
.document h2 { margin: 40px 0 16px; font-size: 1.25rem; line-height: 1.6; }
.document h3 { margin: 24px 0 8px; font-size: 1.125rem; line-height: 1.6; }
.document p, .document ul, .document ol { margin: 0 0 16px; }
.document ul, .document ol { padding-left: 24px; }
.document li + li { margin-top: 8px; }
@media (min-width: 720px) { .document { padding: 48px 56px; margin-top: 56px; } .document h1 { font-size: 2.25rem; } }

.policy-header .brand { color: var(--sprout); font-weight: 600; }
.policy-header .meta, .policy-signoff { color: var(--muted); }
.policy-signoff { margin-top: 24px; }

.table-wrap { margin: 0 0 24px; overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { background: var(--sunk); font-weight: 600; }
th:first-child { width: 34%; }

/* 404 */
.notfound { padding-block: 96px; text-align: center; }
.notfound img { width: 64px; margin: 0 auto 24px; }
.notfound h1 { font-size: 1.875rem; line-height: 1.4; }
.notfound p { margin-top: 16px; color: var(--muted); }
.notfound .hero-actions { justify-content: center; }

/* 頁尾 */
.site-footer {
  padding-block: 48px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.footer-grid { display: grid; gap: 24px; }
.footer-brand p { margin-top: 8px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; transition: color 200ms var(--ease); }
.footer-nav a:hover { color: var(--sprout); }
.footer-nav a[aria-current="page"] { color: var(--ink); }
.footer-legal { margin-top: 24px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1fr auto; align-items: center; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* 柔和、帶點寶寶感的細節 */
.hero h1 .accent { color: var(--sprout); }
.hero-scene { border-radius: 40px; }
.button { border-radius: 16px; }
.button-sm { border-radius: 12px; }
.statement-mark { width: 40px; height: 40px; margin-bottom: 16px; }
.dot { width: 10px; height: 10px; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 0%, transparent); }
.label .dot.feeding { box-shadow: 0 0 0 4px var(--feeding-soft); }
.label .dot.sleep { box-shadow: 0 0 0 4px var(--sleep-soft); }
.label .dot.measure { box-shadow: 0 0 0 4px var(--measure-soft); }
.label .dot.life { box-shadow: 0 0 0 4px var(--life-soft); }
.steps li::before { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sprout-soft); }
