/* ===== SayNiHao marketing site — design tokens mirror the Flutter app ===== */
:root {
  --red: #E8453C;
  --red-light: #FDECAA;
  --gold: #F0A500;
  --gold-light: #FEF6E4;
  --ink: #1C1410;
  --ink-grad-end: #3D2015;
  --smoke: #F5F2EE;
  --muted: #9C8E82;
  --border: #E5DDD4;
  --success: #2D7D52;
  --white: #ffffff;

  --r-card: 14px;
  --r-btn: 10px;
  --r-pill: 999px;

  --maxw: 1120px;
  --shadow-card: 0 10px 30px rgba(28, 20, 16, 0.08);
  --shadow-pill: 0 8px 22px rgba(232, 69, 60, 0.28);

  --font-serif: 'Noto Serif TC', Georgia, serif;
  --font-sans: 'Noto Sans TC', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; line-height: 1.25; margin: 0 0 .4em; }
p { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 84px 0; }
.section--smoke { background: var(--smoke); }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--red);
  background: var(--gold-light); padding: 6px 14px; border-radius: var(--r-pill); margin-bottom: 16px;
}
.section-title { font-size: clamp(26px, 3.4vw, 38px); text-align: center; }
.section-sub { text-align: center; color: var(--muted); max-width: 620px; margin: 0 auto 48px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font-family: var(--font-sans); font-weight: 600; font-size: 15px;
  padding: 13px 26px; border-radius: var(--r-pill); border: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--red); color: #fff; box-shadow: var(--shadow-pill); }
.btn--primary:hover { background: #d63a31; }
.btn--gold { background: var(--gold); color: #2a1d05; box-shadow: 0 8px 22px rgba(240,165,0,.3); }
.btn--gold:hover { background: #d99500; }
.btn--ghost { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.btn--ghost:hover { background: rgba(255,255,255,.18); }

/* App store badge buttons */
.store-row { display: flex; flex-wrap: wrap; gap: 14px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: var(--r-btn);
  border: 1px solid rgba(255,255,255,.12); transition: transform .15s, opacity .15s;
}
.store-btn:hover { transform: translateY(-2px); }
.store-btn .store-ico { width: 26px; height: 26px; flex: none; }
.store-btn .store-txt small { display: block; font-size: 10px; opacity: .8; letter-spacing: .04em; }
.store-btn .store-txt b { display: block; font-size: 16px; font-weight: 600; line-height: 1.1; }

/* ===== Navbar ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand .brand__cn { font-family: var(--font-serif); }
.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a { color: var(--ink); font-size: 15px; font-weight: 500; opacity: .82; }
.nav__links a:hover { opacity: 1; color: var(--red); }
.nav__actions { display: flex; align-items: center; gap: 12px; }

/* Language switcher */
.lang { position: relative; }
.lang__btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap;
  background: var(--smoke); border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink);
}
.lang__btn svg { width: 18px; height: 18px; }
.lang__cur { display: none; }   /* language switcher is icon-only everywhere */
.lang__menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: 6px; display: none; max-height: 320px; overflow: auto;
}
.lang__menu.open { display: block; }
.lang__menu button {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: none; border: none; font: inherit; font-size: 14px; color: var(--ink);
  padding: 10px 12px; border-radius: 8px;
}
.lang__menu button:hover { background: var(--smoke); }
.lang__menu button[aria-current="true"] { background: var(--gold-light); color: var(--red); font-weight: 600; }

.nav__toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.nav__toggle svg { width: 26px; height: 26px; }
.nav__dl-ico { display: none; width: 18px; height: 18px; }

/* ===== Dark gradient header pattern (shared with app) ===== */
.dark-header {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(150deg, var(--ink) 0%, var(--ink-grad-end) 100%);
}
.dark-header .watermark {
  position: absolute; font-family: var(--font-serif); font-weight: 700;
  color: rgba(255,255,255,.05); line-height: 1; pointer-events: none; user-select: none;
}
.dark-header .sparkle { position: absolute; color: var(--gold); opacity: .5; pointer-events: none; }
.gold-dash { width: 56px; height: 3px; border-radius: 3px; background: var(--gold); margin: 18px 0; }

/* ===== Hero ===== */
.hero { padding: 64px 0 90px; }
.hero .watermark { font-size: 360px; top: -40px; right: -60px; }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; position: relative; z-index: 2; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); }
.hero h1 .hl { color: var(--gold); }
.hero__sub { font-size: 18px; color: rgba(255,255,255,.82); max-width: 520px; }
.hero .store-row { margin-top: 30px; }
.hero__note { margin-top: 16px; font-size: 13px; color: rgba(255,255,255,.6); }

/* Phone mockup */
.phone {
  width: 280px; margin: 0 auto; aspect-ratio: 9 / 19;
  border-radius: 38px; background: #0f0b08; padding: 12px;
  border: 1px solid rgba(255,255,255,.14); box-shadow: 0 30px 70px rgba(0,0,0,.45);
  position: relative;
}
.phone::before {
  content: ""; position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 22px; background: #0f0b08; border-radius: var(--r-pill); z-index: 3;
}
.phone__screen {
  width: 100%; height: 100%; border-radius: 28px; overflow: hidden;
  background: linear-gradient(160deg, #fff 0%, var(--smoke) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: var(--ink); text-align: center; padding: 24px;
}
.phone__screen .big-cn { font-family: var(--font-serif); font-size: 76px; color: var(--red); line-height: 1; }
.phone__screen .pinyin { font-family: var(--font-mono); color: var(--muted); letter-spacing: .08em; }
.phone__screen .lives { font-size: 24px; letter-spacing: 6px; }

/* ===== Feature grid ===== */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 26px; box-shadow: var(--shadow-card); transition: transform .18s ease, box-shadow .18s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: 0 16px 38px rgba(28,20,16,.12); }
.feature__ico {
  width: 52px; height: 52px; border-radius: var(--r-btn); display: grid; place-items: center;
  font-size: 26px; background: var(--gold-light); margin-bottom: 16px;
}
.feature h3 { font-size: 19px; }
.feature p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* ===== Steps (learning flow) ===== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step { text-align: center; padding: 10px; }
.step__num {
  width: 46px; height: 46px; border-radius: var(--r-pill); background: var(--red); color: #fff;
  font-family: var(--font-serif); font-weight: 700; font-size: 20px;
  display: grid; place-items: center; margin: 0 auto 16px;
}
.step h3 { font-size: 18px; }
.step p { color: var(--muted); font-size: 14.5px; }

/* ===== Multilingual band ===== */
.lang-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; position: relative; z-index: 2; }
.lang-band .watermark { font-size: 240px; bottom: -70px; left: -30px; }
.stat { text-align: center; padding: 24px; }
.stat b { font-family: var(--font-serif); font-size: 52px; color: var(--gold); display: block; }
.stat span { color: rgba(255,255,255,.78); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; position: relative; z-index: 2; }
.chip {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  color: #fff; padding: 8px 16px; border-radius: var(--r-pill); font-size: 14px;
}

/* ===== CTA band ===== */
.cta { padding: 80px 0; text-align: center; }
.cta .watermark { font-size: 300px; top: -50px; left: 50%; transform: translateX(-50%); }
.cta h2 { font-size: clamp(28px, 4vw, 44px); position: relative; z-index: 2; }
.cta p { color: rgba(255,255,255,.8); position: relative; z-index: 2; }
.cta .store-row { justify-content: center; margin-top: 28px; position: relative; z-index: 2; }

/* ===== Footer ===== */
.footer { background: var(--ink); color: rgba(255,255,255,.7); padding: 56px 0 36px; }
.footer__top { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; align-items: flex-start; }
.footer .brand { color: #fff; }
.footer__links { display: flex; flex-wrap: wrap; gap: 30px; }
.footer__col h4 { color: #fff; font-family: var(--font-sans); font-size: 14px; letter-spacing: .04em; margin: 0 0 12px; }
.footer__col a { display: block; font-size: 14px; padding: 4px 0; opacity: .75; }
.footer__col a:hover { opacity: 1; color: var(--gold); }
.footer__bottom {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center;
  font-size: 13px; opacity: .7;
}

/* ===== Legal / doc pages ===== */
.doc { max-width: 760px; margin: 0 auto; padding: 56px 20px 90px; }
.doc h1 { font-size: clamp(28px, 4vw, 40px); }
.doc .updated { color: var(--muted); font-size: 14px; margin-bottom: 36px; }
.doc h2 { font-size: 22px; margin-top: 44px; padding-bottom: 12px; border-bottom: 1.5px solid var(--border); }
.doc p, .doc li { color: #3a2f28; }
.doc ul { padding-left: 20px; margin: 12px 0 16px; }
.doc li { margin-bottom: 8px; }
.doc strong { color: var(--ink); }
.doc a.inline, .doc a[href^="mailto"] { color: var(--red); text-decoration: underline; }
.doc .eff { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.doc .highlight {
  background: var(--gold-light); border-left: 3px solid var(--red);
  padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 20px 0; font-size: 15px;
}
.doc .highlight ul { margin-top: 8px; }
.doc .warning-box {
  background: #FFF8F0; border: 1px solid #FDE8C8; border-radius: var(--r-btn);
  padding: 18px 22px; margin: 18px 0; font-size: 14px; color: #92400E; font-weight: 500; letter-spacing: .01em;
}
.doc .contact-box {
  background: linear-gradient(150deg, var(--ink), var(--ink-grad-end)); color: #fff;
  border-radius: var(--r-card); padding: 32px; margin-top: 48px;
}
.doc .contact-box h2 { color: #fff; border-bottom-color: rgba(255,255,255,.15); margin-top: 0; }
.doc .contact-box p { color: rgba(255,255,255,.78); margin-bottom: 8px; }
.doc .contact-box a { color: var(--gold); }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 4px 20px; margin-bottom: 14px; box-shadow: var(--shadow-card);
}
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 16px; padding: 16px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--red); font-size: 22px; }
.faq details[open] summary::after { content: "–"; }
.faq details > p { color: var(--muted); padding-bottom: 16px; margin: 0; }

.contact-card {
  max-width: 540px; margin: 40px auto 0; text-align: center;
  background: var(--gold-light); border: 1px solid var(--border); border-radius: var(--r-card); padding: 32px;
}
.contact-card a { color: var(--red); font-weight: 600; font-size: 18px; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero .store-row, .hero__sub { margin-left: auto; margin-right: auto; }
  .hero__media { order: -1; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .nav.open .nav__links {
    display: flex; flex-direction: column; gap: 0; position: absolute; top: 64px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border); padding: 8px 20px 16px;
  }
  .nav.open .nav__links a { padding: 12px 0; border-bottom: 1px solid var(--border); }
}
@media (max-width: 620px) {
  .section { padding: 56px 0; }
  .feature-grid, .steps, .lang-band { grid-template-columns: 1fr; }
  .stat b { font-size: 44px; }
  .footer__top { flex-direction: column; }

  /* Compact navbar so it never overflows on phones */
  .nav__inner { gap: 10px; flex-wrap: nowrap; }
  .brand { font-size: 16px; min-width: 0; flex: 0 1 auto; }
  .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand img { width: 30px; height: 30px; flex: none; }
  .brand__cn { display: none; }
  .nav__actions { gap: 8px; margin-left: auto; flex: none; }
  .nav__toggle { flex: none; }
  .lang { flex: none; }
  .lang__btn { padding: 8px 11px; flex: none; }
  /* Download button becomes icon-only so no language ever wraps/overflows */
  .nav__dl { padding: 10px 12px; flex: none; }
  .nav__dl span { display: none; }
  .nav__dl-ico { display: block; }

  /* Hero */
  .hero { padding: 44px 0 66px; }
  .hero h1 { font-size: 28px; line-height: 1.22; overflow-wrap: break-word; }
  .hero .watermark { font-size: 220px; top: -20px; right: -40px; }
  .hero__sub { font-size: 16px; }
  .phone { width: 230px; }
  .phone__screen .big-cn { font-size: 62px; }

  /* Store buttons stretch full width and stack tidily */
  .store-row { gap: 10px; }
  .store-btn { flex: 1 1 200px; justify-content: center; }

  /* Section watermarks shouldn't dwarf small screens */
  .dark-header .watermark { font-size: 160px !important; }
  .cta .watermark, .hero .watermark { font-size: 200px !important; }

  /* Legal / doc pages */
  .doc { padding: 40px 18px 72px; }
  .doc h2 { font-size: 20px; }
  .doc .contact-box { padding: 24px; }
  .faq summary { font-size: 15px; }
}

@media (max-width: 380px) {
  .brand span { font-size: 15px; }
  .store-btn { flex-basis: 100%; }
  .hero h1 { font-size: 26px; }
}
