/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green:  #1A4334;
  --dgreen: #0F2E22;
  --mint:   #D2EBD9;
  --lmint:  #E4F4E9;
  --yellow: #F7C73C;
  --coral:  #E8784E;
  --white:  #FFFFFF;
  --ink:    #1B2B22;
  --status: #3DDC84;
  --bean:   #9B7BC4;
  --veg:    #2E9E5B;
  --grain:  #B8945A;
  --oil:    #F4C430;
  --fruit:  #E8784E;
  --dairy:  #4A90D9;
  --r44: 44px;
}
html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: #f7faf8;
  color: var(--ink);
  overflow-x: hidden;
}

/* ── Typography ── */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 6px 18px;
  font-weight: 700; font-size: 15px; letter-spacing: .02em;
}
.tag-coral  { background: var(--coral);  color: #fff; }
.tag-green  { background: var(--green);  color: #fff; }
.tag-yellow { background: var(--yellow); color: var(--green); }

.hl {
  background: var(--yellow); color: var(--green);
  border-radius: 8px; padding: 0 8px; display: inline;
}
.hl-y { color: var(--yellow); }

/* ── Phone Mockup ── */
.phone-wrap {
  position: relative;
  flex-shrink: 0;
}
.phone {
  position: relative;
  width: 220px;
  background: #1C1C1E;
  border-radius: 44px;
  padding: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35), 0 8px 20px rgba(0,0,0,.2);
}
.phone::before {
  /* notch */
  content: '';
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 8px;
  background: #111;
  border-radius: 99px;
  z-index: 10;
}
.phone-screen {
  border-radius: 34px;
  overflow: hidden;
  display: block;
  width: 100%;
  aspect-ratio: 9/19.5;
  object-fit: cover;
  object-position: top;
}
.phone-side-btn {
  position: absolute;
  right: -4px; top: 120px;
  width: 4px; height: 60px;
  background: #3a3a3c; border-radius: 2px;
}
.phone-vol {
  position: absolute;
  left: -4px;
  width: 4px; border-radius: 2px;
  background: #3a3a3c;
}
.phone-vol.v1 { top: 100px; height: 36px; }
.phone-vol.v2 { top: 148px; height: 50px; }
.phone .status-dot {
  position: absolute;
  top: 16px; right: 20px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--status);
  z-index: 11;
}
/* tilt variants */
.phone-wrap.tilt-l .phone { transform: rotate(-3deg); }
.phone-wrap.tilt-r .phone { transform: rotate(3deg);  }

/* ── Section base ── */
section { padding: 100px 0; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 40px; }

/* ── Hero ── */
#hero {
  background: linear-gradient(145deg, var(--dgreen) 0%, var(--green) 100%);
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh; /* mobile: adapts to dynamic address-bar height */
  display: flex; align-items: center;
  position: relative; overflow: hidden;
}
#hero .deco-circle {
  position: absolute;
  border-radius: 50%;
  opacity: .07;
  background: #fff;
}
#hero .deco-circle.c1 { width: 500px; height: 500px; top: -120px; right: -100px; }
#hero .deco-circle.c2 { width: 300px; height: 300px; bottom: 60px; left: -60px; }
#hero .hero-inner {
  width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 40px;
  display: grid; grid-template-columns: 1fr 380px;
  gap: 60px; align-items: center;
  min-height: 100vh; min-height: 100dvh;
  padding-top: 80px; padding-bottom: 80px;
}
#hero .hero-text h1 {
  font-size: 76px; font-weight: 900;
  line-height: 1.1; letter-spacing: -.03em;
  color: #fff; margin: 24px 0 20px;
}
#hero .hero-text p {
  font-size: 20px; font-weight: 500;
  color: rgba(255,255,255,.75); line-height: 1.7; margin-bottom: 40px;
}
#hero .hero-chips { display: flex; flex-wrap: wrap; gap: 10px; }
#hero .hero-phone-col {
  display: flex; justify-content: center; align-items: center;
  height: 100%;
}

/* ── Overview strip ── */
#overview {
  background: var(--lmint);
  padding: 80px 0;
}
#overview .cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  margin-top: 48px;
}
.feat-card {
  background: #fff; border-radius: 20px; padding: 28px 24px;
  box-shadow: 0 4px 24px rgba(26,67,52,.08);
  transition: transform .2s, box-shadow .2s;
}
.feat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 36px rgba(26,67,52,.14); }
.feat-card .icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin-bottom: 16px;
}
.feat-card h3 { font-weight: 900; font-size: 20px; margin-bottom: 8px; color: var(--green); }
.feat-card p  { font-size: 15px; color: #5a7060; line-height: 1.6; }

/* ── Feature sections (alternating) ── */
.feature-section {
  padding: 100px 0;
}
.feature-section.bg-green {
  background: linear-gradient(135deg, var(--dgreen), var(--green));
  color: #fff;
}
.feature-section.bg-mint {
  background: linear-gradient(160deg, var(--lmint), var(--mint));
}
.feature-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px;
  align-items: center;
}
.feature-inner.reverse { direction: rtl; }
.feature-inner.reverse > * { direction: ltr; }

.feature-text .section-tag { margin-bottom: 20px; }
.feature-text h2 {
  font-size: 52px; font-weight: 900;
  line-height: 1.15; letter-spacing: -.03em;
  margin-bottom: 20px;
}
.feature-text p {
  font-size: 18px; line-height: 1.8;
  margin-bottom: 16px; opacity: .85;
}
.feature-text .bullet-list {
  list-style: none; margin-top: 24px;
}
.feature-text .bullet-list li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 17px; line-height: 1.6; margin-bottom: 14px;
}
.bullet-list .dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 7px;
}

/* phone column */
.phone-col {
  display: flex; justify-content: center; align-items: center; gap: 20px;
}
.phone-col .phone-wrap + .phone-wrap { margin-top: 40px; }
.phone-stack {
  display: flex; flex-direction: column; gap: 0;
  align-items: center;
}

/* staggered two phones */
.phones-duo {
  display: flex; align-items: flex-start; gap: 16px;
}
.phones-duo .phone-wrap:nth-child(2) { margin-top: 48px; }

/* ── AI Chat ── */
#ai-chat .chat-bubbles {
  display: flex; flex-direction: column; gap: 12px;
}
.chat-q, .chat-a {
  padding: 14px 18px; border-radius: 16px; max-width: 88%;
  font-size: 16px; line-height: 1.6;
}
.chat-q {
  background: var(--lmint); color: var(--green);
  align-self: flex-end; border-bottom-right-radius: 4px;
  font-weight: 500;
}
.chat-a {
  background: #fff; color: var(--ink);
  align-self: flex-start; border-bottom-left-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
}
.chat-a .yumi { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.chat-a .yumi-name { font-weight: 900; font-size: 14px; color: var(--green); }

/* ── Stats row ── */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px;
}
.stat-block { text-align: center; }
.stat-block .num {
  font-size: 64px; font-weight: 900; color: var(--yellow);
  line-height: 1; letter-spacing: -.04em;
}
.stat-block .lbl { font-size: 16px; font-weight: 700; margin-top: 6px; color: rgba(255,255,255,.8); }

/* ── Traffic lights ── */
.lights { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.light-row { display: flex; align-items: center; gap: 14px; }
.light-dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.light-row h4 { font-weight: 900; font-size: 17px; margin-bottom: 2px; }
.light-row p  { font-size: 15px; opacity: .8; }

/* ── Data section ── */
#data .data-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 48px;
}

/* ── Records section ── */
#records .record-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px;
}
.record-item {
  background: rgba(255,255,255,.12); border-radius: 16px; padding: 20px;
  display: flex; align-items: center; gap: 14px;
}
.record-item .rec-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
}
.record-item h4 { font-weight: 900; font-size: 17px; color: #fff; }
.record-item p  { font-size: 14px; color: rgba(255,255,255,.7); margin-top: 2px; }

/* ── FAQ ── */
#faq { background: var(--lmint); padding: 100px 0 120px; }
#faq h2 { font-size: 52px; font-weight: 900; color: var(--green); margin-bottom: 8px; }
#faq .faq-subtitle { font-size: 18px; color: #5a7060; margin-bottom: 48px; }
.faq-list { max-width: 800px; }
.faq-item {
  background: #fff; border-radius: 16px;
  margin-bottom: 16px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(26,67,52,.07);
}
.faq-q {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px; cursor: pointer;
  font-weight: 900; font-size: 17px; color: var(--green);
  user-select: none; gap: 12px;
}
.faq-q:hover { background: var(--lmint); }
.faq-q .q-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--yellow); color: var(--green);
  font-size: 14px; font-weight: 900; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.faq-q .chevron {
  width: 20px; height: 20px; flex-shrink: 0; transition: transform .3s;
  fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linecap: round;
}
.faq-item.open .chevron { transform: rotate(180deg); }
.faq-a {
  display: none; padding: 0 28px 22px 68px;
  font-size: 16px; color: #5a7060; line-height: 1.8;
}
.faq-item.open .faq-a { display: block; }

/* ── CTA footer ── */
#cta {
  background: linear-gradient(135deg, var(--dgreen), var(--green));
  padding: 100px 0; text-align: center;
}
#cta h2 { font-size: 56px; font-weight: 900; color: #fff; margin-bottom: 16px; line-height: 1.2; }
#cta p  { font-size: 20px; color: rgba(255,255,255,.75); margin-bottom: 40px; }
.cta-btn {
  display: inline-block; background: var(--yellow); color: var(--green);
  font-weight: 900; font-size: 20px; padding: 18px 52px; border-radius: 99px;
  text-decoration: none; box-shadow: 0 8px 30px rgba(247,199,60,.4);
  transition: transform .2s, box-shadow .2s;
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(247,199,60,.5); }

/* ── Nav ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(15,46,34,.92); backdrop-filter: blur(12px);
  padding: 16px 40px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-weight: 900; font-size: 22px; color: var(--yellow); letter-spacing: -.02em; }
.nav-links { display: flex; gap: 32px; }
.nav-links a { color: rgba(255,255,255,.8); text-decoration: none; font-weight: 700; font-size: 15px; }
.nav-links a:hover { color: var(--yellow); }


/* Mobile nav toggle */
@media (max-width: 900px) {
  #navToggle { display: block !important; }
  #mobileMenu { display: flex !important; flex-direction: column; max-height: 0; overflow: hidden; transition: max-height .3s ease; }
  #mobileMenu.open { max-height: 400px; }
}
/* ══ RESPONSIVE ════════════════════════════════════════════════════════ */

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {
  /* Nav */
  nav { padding: 14px 20px; }
  .nav-links { display: none; }

  /* Layout */
  section { padding: 64px 0; }
  .container { padding: 0 24px; }

  /* Hero */
  #hero .hero-inner {
    grid-template-columns: 1fr;
    padding: 100px 24px 60px;
    min-height: auto;
    gap: 36px;
  }
  #hero .hero-phone-col {
    display: flex;
    width: 100%;
    justify-content: center;
  }
  #hero .hero-phone-col > div {
    width: 100%;
    max-width: 480px;
    margin-bottom: 12px;
  }
  #hero .hero-phone-col > div > div:first-child img {
    border-radius: 14px;
  }
  #hero .hero-text h1 { font-size: 52px; }
  #hero .hero-text p { font-size: 18px; margin-bottom: 28px; }

  /* Overview */
  #overview { padding: 64px 0; }
  #overview .cards { grid-template-columns: repeat(2,1fr); gap: 16px; }

  /* Feature sections */
  .feature-section { padding: 64px 0; }
  .feature-inner { grid-template-columns: 1fr !important; gap: 40px; }
  .feature-inner.reverse { direction: ltr; }
  .feature-text h2 { font-size: 38px; }
  .feature-text p { font-size: 16px; }

  /* Phones-duo: show only one phone, centered */
  .phones-duo { justify-content: center; }
  .phones-duo .phone-wrap:nth-child(2) { display: none; }
  .phone-col { justify-content: center; }

  /* AI Chat — stack to single column */
  .ai-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  /* Floating cards: make them a static row instead of absolute */
  .ai-cards-col {
    height: auto !important;
    position: static !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0;
    margin-top: 24px;
  }
  .ai-card {
    position: static !important;
    max-width: 100% !important;
    top: auto !important; left: auto !important; right: auto !important;
  }
  /* Hide darkened phone in chat section on mobile */
  #ai-chat .phone-wrap { display: none; }

  /* Data section */
  .data-inner-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .data-charts-row { gap: 16px; }

  /* Records */
  #records .record-grid { grid-template-columns: repeat(2,1fr); gap: 14px; }

  /* FAQ */
  #faq { padding: 64px 0 80px; }
  #faq h2 { font-size: 38px; }
  .faq-q { font-size: 15px; padding: 18px 20px; }
  .faq-a { padding: 0 20px 18px 56px; font-size: 15px; }

  /* CTA */
  #cta { padding: 72px 0; }
  #cta h2 { font-size: 38px; }
  #cta p { font-size: 17px; }
}

/* ── Mobile (≤600px) ── */
@media (max-width: 600px) {
  /* Nav */
  nav { padding: 12px 16px; }
  .nav-logo { font-size: 18px; }

  /* Layout */
  section { padding: 52px 0; }
  .container { padding: 0 16px; }

  /* Hero */
  #hero .hero-inner { padding: 90px 16px 52px; gap: 28px; }
  #hero .hero-text h1 { font-size: 38px; letter-spacing: -.02em; }
  #hero .hero-text p { font-size: 16px; }
  #hero .hero-phone-col > div { max-width: 100%; }

  /* Overview */
  #overview .cards { grid-template-columns: 1fr; gap: 14px; }

  /* Feature */
  .feature-text h2 { font-size: 32px; }
  .feature-text p { font-size: 15px; }
  .feature-text .bullet-list li { font-size: 15px; }

  /* Phone */
  .phone { width: 180px; }

  /* AI Chat cards: single column on small screens */
  .ai-cards-col { grid-template-columns: 1fr; }

  /* Records */
  #records .record-grid { grid-template-columns: 1fr; }
  .record-item { padding: 16px; }

  /* FAQ */
  #faq h2 { font-size: 32px; }
  .faq-q { font-size: 14px; padding: 16px 18px; }
  .faq-a { padding: 0 18px 16px 50px; font-size: 14px; }

  /* CTA */
  #cta h2 { font-size: 32px; }
  #cta p { font-size: 16px; }

  /* Charts */
  .data-charts-row { flex-direction: column; }
}

/* Nutrition phone: keep absolute on right side of photo — combined visual */
@media (max-width: 900px) {
  /* Outer container */
  #hero .hero-phone-col > div {
    padding-bottom: 36px !important;
    overflow: visible !important;
  }
  /* Photo: leave right margin for phone overlap */
  #hero .hero-phone-col > div > div:first-child {
    margin-right: 56px;
  }
  /* Phone wrapper: keep absolute at right */
  #hero .hero-phone-col > div > div:last-child {
    position: absolute !important;
    right: 0 !important;
    bottom: 0 !important;
    display: block !important;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,.4)) !important;
  }
  /* Phone body — proportionate border-radius & padding for 120px wide */
  #hero .hero-phone-col > div > div:last-child .phone {
    width: 120px !important;
    border-radius: 28px !important;  /* 23% of 120px ≈ 195px→44px ratio */
    padding: 7px !important;
  }
  /* Inner screen wrapper — override inline border-radius:34px */
  #hero .hero-phone-col > div > div:last-child .phone > div {
    border-radius: 22px !important;  /* proportionate to 34px@195px */
    overflow: hidden !important;
  }
  /* Screen image — fix border-radius from .phone-screen class */
  #hero .hero-phone-col > div > div:last-child .phone-screen {
    border-radius: 22px !important;
  }
  /* Side buttons */
  #hero .hero-phone-col > div > div:last-child .phone-side-btn {
    width: 2px !important; height: 32px !important; top: 60px !important;
  }
  #hero .hero-phone-col > div > div:last-child .phone-vol.v1 {
    width: 2px !important; height: 20px !important; top: 52px !important;
  }
  #hero .hero-phone-col > div > div:last-child .phone-vol.v2 {
    width: 2px !important; height: 30px !important; top: 78px !important;
  }
}

@media (max-width: 600px) {
  #hero .hero-phone-col > div > div:first-child {
    margin-right: 48px;
  }
  #hero .hero-phone-col > div > div:last-child .phone {
    width: 108px !important;
    border-radius: 24px !important;
    padding: 6px !important;
  }
  #hero .hero-phone-col > div > div:last-child .phone > div {
    border-radius: 19px !important;
  }
  #hero .hero-phone-col > div > div:last-child .phone-screen {
    border-radius: 19px !important;
  }
}

/* ── Small phone (≤390px) ── */
@media (max-width: 390px) {
  #hero .hero-text h1 { font-size: 32px; }
  .feature-text h2 { font-size: 28px; }
  .phone { width: 160px; }
  #faq h2, #cta h2 { font-size: 28px; }
}

/* ── Mobile notch: scale down to ~1/3 of phone width ── */
@media (max-width: 900px) {
  #hero .hero-phone-col > div > div:last-child .phone::before {
    width: 38px !important;
    height: 6px !important;
    top: 10px !important;
  }
}
@media (max-width: 600px) {
  #hero .hero-phone-col > div > div:last-child .phone::before {
    width: 34px !important;
    height: 5px !important;
    top: 8px !important;
  }
}
