/* ==========================================================================
   HalaMoney 哈啦Money — site design system
   Self-contained (no external CDN). Green primary (app) + amber monster accent.
   Light/dark aware. zh-TW primary, EN via [data-lang] toggle in site.js.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Brand — green primary (matches the app), amber = the monster mascot */
  --green-900: #0f5a30;
  --green-700: #1b7a43;
  --green-600: #1f8a4c;
  --green-500: #27a55c;
  --green-050: #e8f5ec;
  --amber-500: #e9a94d;
  --amber-300: #eecb86;
  --amber-700: #9a6100;   /* AA-legible amber for small text/badges (≈5.3:1 on white) */

  /* Neutrals (light) */
  --bg: #ffffff;
  --bg-soft: #f6f8f6;
  --bg-card: #ffffff;
  --border: #e5eae6;
  --text: #17251c;
  --text-soft: #4d5a52;
  --text-mute: #6b7a70;   /* ≈4.3:1 on white — clears AA for secondary text */

  --brand: var(--green-600);
  --brand-strong: var(--green-700);
  --accent: var(--amber-500);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 24, .06), 0 2px 8px rgba(16, 40, 24, .05);
  --shadow-md: 0 6px 24px rgba(16, 40, 24, .10);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC",
          "Microsoft JhengHei", system-ui, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1512;
    --bg-soft: #182019;   /* lifted so section bands separate from --bg in dark */
    --bg-card: #17201b;
    --border: #26312a;
    --text: #e7eee9;
    --text-soft: #b3c0b8;
    --text-mute: #85958b;
    --brand: var(--green-500);
    --brand-strong: var(--green-500);
    --green-050: #14261b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 8px 30px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--brand-strong); }

/* When switching language the inactive block is [hidden] — respect it hard */
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header / nav ---------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; gap: 18px;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.12rem; letter-spacing: .2px;
  color: var(--text); text-decoration: none; margin-right: auto;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand .mark-money { color: var(--brand); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--text-soft); text-decoration: none; font-size: .96rem;
  font-weight: 600; padding: 8px 12px; border-radius: 999px;
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--green-050); color: var(--brand-strong); }
.nav-links a.active { color: var(--brand-strong); }

.lang-toggle { display: flex; gap: 2px; align-items: center; font-size: .85rem; }
.lang-toggle button {
  border: 0; background: none; cursor: pointer; color: var(--text-mute);
  font: inherit; font-size: .85rem; padding: 4px 8px; border-radius: 999px;
}
.lang-toggle button.active { color: var(--text); font-weight: 800; background: var(--bg-soft); }

.nav-cta {
  background: var(--brand); color: #fff !important; padding: 9px 16px !important;
  border-radius: 999px; font-weight: 700; box-shadow: var(--shadow-sm);
}
.nav-cta:hover { background: var(--brand-strong); }

.nav-toggle { display: none; border: 0; background: none; cursor: pointer; padding: 8px; color: var(--text); }
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 820px) {
  .nav-links {
    position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 12px 16px; box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; border-radius: 12px; }
  .nav-cta { text-align: center; margin-top: 6px; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Buttons --------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  padding: 13px 22px; border-radius: 999px; border: 1.5px solid transparent;
  transition: transform .12s ease, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-strong); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-strong); }

/* Store badges */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 11px; text-decoration: none;
  background: #101613; color: #fff; padding: 10px 18px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08); box-shadow: var(--shadow-sm);
  transition: transform .12s;
}
.store-badge:hover { transform: translateY(-2px); }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge small { display: block; font-size: .68rem; opacity: .8; line-height: 1.2; }
.store-badge b { display: block; font-size: 1.02rem; line-height: 1.15; }
@media (prefers-color-scheme: dark) {
  .store-badge { background: #1f2a23; }
}

/* ---------- Sections -------------------------------------------------- */
section { padding: 72px 0; }
.section-soft { background: var(--bg-soft); }
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand-strong); margin-bottom: 12px;
}
.eyebrow[data-lang="zh"] { letter-spacing: .04em; }  /* .12em over-spaces Han glyphs */
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
.section-title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 0 0 14px; }
.section-lead { color: var(--text-soft); font-size: 1.05rem; max-width: 640px; margin: 0 auto 8px; }
.center { text-align: center; }

/* ---------- Hero ------------------------------------------------------ */
.hero { position: relative; overflow: hidden; padding: 84px 0 72px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 60% at 15% 0%, color-mix(in srgb, var(--green-500) 22%, transparent), transparent 70%),
    radial-gradient(50% 55% at 100% 20%, color-mix(in srgb, var(--amber-300) 26%, transparent), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.2rem); margin: 0 0 18px; }
.hero h1[data-lang="en"] { font-size: clamp(2rem, 5.2vw, 2.8rem); }  /* keep "tracker you" together */
.hero h1 .hl { color: var(--brand); }
.hero p.lead { font-size: 1.18rem; color: var(--text-soft); margin: 0 0 28px; max-width: 34ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 18px; }
.hero-note { font-size: .9rem; color: var(--text-mute); }
.hero-art {
  aspect-ratio: 4/5; border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 50% 8%, #ffffff, var(--green-050) 55%, #dcefe1 100%);
  border: 1px solid color-mix(in srgb, var(--green-500) 22%, var(--border));
  box-shadow: var(--shadow-md);
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.hero-art .mascot { width: 72%; filter: drop-shadow(0 18px 40px rgba(20, 90, 50, .28)); }
.hero-art::after {
  content: ""; position: absolute; width: 150%; height: 45%; bottom: -14%; left: -25%;
  background: radial-gradient(closest-side, rgba(39,165,92,.12), transparent);
}
@media (prefers-color-scheme: dark) {
  .hero-art {
    background: radial-gradient(120% 90% at 50% 8%, #1c2a22, #16211b 60%, #101915 100%);
    border-color: #26372c;
  }
  .hero-art .mascot { filter: drop-shadow(0 18px 40px rgba(0,0,0,.5)); }
}

/* Hero mini-app demo — a faux product screen inside the hero card */
.app-demo {
  width: 86%; max-width: 340px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 22px; padding: 16px 16px 18px;
  box-shadow: 0 24px 60px rgba(20,60,40,.20), 0 4px 12px rgba(20,60,40,.08);
}
@media (prefers-color-scheme: dark) {
  .app-demo { box-shadow: 0 24px 60px rgba(0,0,0,.55); border-color: #2a362e; }
}
.app-demo-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.app-demo-head img { width: 26px; height: 26px; border-radius: 7px; }
.app-demo-title { font-weight: 800; font-size: .95rem; }
.app-demo-title b { color: var(--brand); font-weight: 800; }
.app-demo-bal { margin-left: auto; text-align: right; line-height: 1.1; }
.app-demo-bal small { display: block; font-size: .6rem; color: var(--text-mute); }
.app-demo-bal b { font-size: .95rem; color: var(--brand-strong); }
.app-demo-mic {
  display: flex; align-items: center; gap: 9px; padding: 11px 13px; margin-bottom: 14px;
  border-radius: 14px; background: var(--green-050);
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--border));
}
.mic-dot {
  width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff;
}
.mic-dot svg { width: 16px; height: 16px; }
.mic-text { font-size: .84rem; color: var(--text); }
.mic-text b { color: var(--brand-strong); }
.mic-wave { margin-left: auto; display: flex; align-items: center; gap: 3px; height: 18px; }
.mic-wave i { width: 3px; border-radius: 2px; background: var(--brand); animation: eq 1s ease-in-out infinite; }
.mic-wave i:nth-child(1){ height: 40%; animation-delay: 0s; }
.mic-wave i:nth-child(2){ height: 90%; animation-delay: .15s; }
.mic-wave i:nth-child(3){ height: 60%; animation-delay: .3s; }
.mic-wave i:nth-child(4){ height: 100%; animation-delay: .45s; }
@keyframes eq { 0%,100%{ transform: scaleY(.4); } 50%{ transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .mic-wave i { animation: none; } }
.app-demo-list { list-style: none; margin: 0; padding: 0; }
.app-demo-list li { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-top: 1px solid var(--border); }
.app-demo-list li:first-child { border-top: 0; }
.ad-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 1rem; }
.ad-name { display: flex; flex-direction: column; font-size: .86rem; font-weight: 600; }
.ad-name small { font-size: .66rem; font-weight: 500; color: var(--text-mute); margin-top: 1px; }
.ad-amt { margin-left: auto; font-weight: 800; font-size: .88rem; font-variant-numeric: tabular-nums; }
.ad-amt.out { color: #d1603f; }
.ad-amt.in { color: var(--brand-strong); }
@media (prefers-color-scheme: dark) { .ad-amt.out { color: #f0916f; } }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-art { max-width: 360px; margin: 0 auto; order: -1; aspect-ratio: 1/1; }
  .hero p.lead { max-width: none; }
}

/* ---------- Feature cards --------------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.card .ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--green-050); color: var(--brand-strong); margin-bottom: 16px;
}
.card .ico svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.12rem; margin: 0 0 8px; }
.card p { color: var(--text-soft); margin: 0; font-size: .98rem; }

/* ---------- Pricing --------------------------------------------------- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
@media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }
.plan {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px 28px;
  background: var(--bg-card); box-shadow: var(--shadow-sm); position: relative;
  display: flex; flex-direction: column;
}
.plan ul { flex: 1; }  /* push the CTA to the bottom so both cards align */
.plan.featured { border-color: var(--brand); box-shadow: var(--shadow-md); }
.plan .tag {
  position: absolute; top: -13px; right: 24px; background: var(--brand); color: #fff;
  font-size: .78rem; font-weight: 800; padding: 5px 14px; border-radius: 999px;
}
.plan h3 { font-size: 1.35rem; margin: 0 0 4px; }
.plan .price { font-size: 2rem; font-weight: 800; margin: 10px 0 2px; }
.plan .price small { font-size: .95rem; font-weight: 600; color: var(--text-mute); }
.plan ul { list-style: none; margin: 20px 0 0; padding: 0; }
.plan li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; color: var(--text-soft); }
.plan li svg { width: 20px; height: 20px; flex: none; margin-top: 3px; }
.tick { color: var(--brand); }
.dash { color: var(--text-mute); }

/* Comparison table */
.cmp { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .98rem; }
.cmp th, .cmp td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.cmp th { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); }
.cmp td.col, .cmp th.col { text-align: center; width: 96px; }
.cmp tr:last-child td { border-bottom: 0; }
.cmp .yes { color: var(--brand); font-weight: 800; }
.cmp .no { color: var(--text-mute); }
.cmp .soon { font-size: .72rem; color: var(--amber-700); font-weight: 700; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- FAQ / accordion ------------------------------------------ */
.faq-list { max-width: 760px; margin: 0 auto; }
details.faq {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); margin-bottom: 12px; overflow: hidden;
}
details.faq[open] { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
details.faq summary {
  list-style: none; cursor: pointer; padding: 18px 52px 18px 20px; position: relative;
  font-weight: 700; font-size: 1.03rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--brand); transition: transform .2s;
}
details.faq[open] summary::after { content: "\2212"; }
details.faq .body { padding: 0 20px 20px; color: var(--text-soft); }
details.faq .body p { margin: 0 0 10px; }
.faq-group-title { font-size: 1.15rem; margin: 36px 0 14px; color: var(--brand-strong); }
.faq-group-title:first-of-type { margin-top: 0; }

/* ---------- What's New / changelog ----------------------------------- */
.timeline { max-width: 760px; margin: 0 auto; position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px;
  background: var(--border);
}
.release { position: relative; margin-bottom: 34px; }
.release::before {
  content: ""; position: absolute; left: -25px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--bg);
}
.release .ver { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.release .ver b { font-size: 1.2rem; }
.release .ver .date { color: var(--text-mute); font-size: .9rem; }
.release .badge {
  font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: var(--green-050); color: var(--brand-strong);
}
.release ul { margin: 6px 0 0; padding-left: 20px; color: var(--text-soft); }
.release li { margin-bottom: 6px; }

/* ---------- CTA band -------------------------------------------------- */
.cta-band {
  background: linear-gradient(150deg, var(--green-700), var(--green-900));
  color: #fff; border-radius: var(--radius-lg); padding: 48px 40px; text-align: center;
  box-shadow: var(--shadow-md);
}
.cta-band h2 { color: #fff; font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 10px; }
.cta-band p { color: rgba(255,255,255,.85); margin: 0 auto 24px; max-width: 46ch; }
.cta-band .stores { justify-content: center; }

/* ---------- Footer ---------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 48px 0 40px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.footer-brand { max-width: 280px; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p { color: var(--text-mute); font-size: .92rem; margin: 0; }
.footer-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); margin: 0 0 12px; }
.footer-col a { display: block; color: var(--text-soft); text-decoration: none; font-size: .95rem; padding: 5px 0; }
.footer-col a:hover { color: var(--brand-strong); }
.footer-bottom {
  border-top: 1px solid var(--border); margin-top: 36px; padding-top: 22px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  color: var(--text-mute); font-size: .88rem;
}

/* ---------- Legal / long-form pages ---------------------------------- */
.legal { max-width: 760px; margin: 0 auto; padding: 40px 0 64px; }
.legal h1 { font-size: 1.7rem; margin-bottom: 4px; }
.legal .updated { color: var(--text-mute); font-size: .88rem; margin-bottom: 28px; }
.legal h2 { font-size: 1.2rem; margin-top: 34px; }

/* Utilities */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack-sm > * + * { margin-top: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 600;
  color: var(--brand-strong); background: var(--green-050); padding: 6px 13px; border-radius: 999px;
}

/* ---- Screenshots rail (landing page) ---- */
.shots {
  display: flex; gap: 22px; overflow-x: auto; padding: 10px 6px 22px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.shot { flex: 0 0 auto; width: 216px; scroll-snap-align: center; margin: 0; }
.shot img {
  display: block; width: 100%; height: auto; border-radius: 30px;
  border: 5px solid #131c16; background: #131c16; box-shadow: var(--shadow-md);
}
.shot figcaption { margin-top: 10px; text-align: center; font-size: .85rem; color: var(--text-mute); }
