/* Marketing / legal pages — landing (/welcome), /terms, /privacy.
 * Reuses the calculator's dark design tokens (see styles.css) but is a
 * scrollable document layout, not the fixed app shell. Self-contained:
 * no external assets, no CDNs. Mobile-responsive.
 */
:root {
  /* background layers */
  --bg: #0e131a;
  --surface: #151c25;
  --surface-2: #1b2430;
  --surface-3: #212c3a;
  --elevated: #1e2837;

  /* lines & text */
  --border: #2b3846;
  --border-soft: #24303d;
  --text: #e7edf4;
  --muted: #94a3b6;
  --faint: #6b7889;

  /* one accent */
  --accent: #4f8ef7;
  --accent-strong: #3a78e0;
  --accent-ink: #ffffff;
  --accent-soft: rgba(79, 142, 247, .15);

  /* semantic */
  --ok: #34d399;
  --warn: #f5b544;
  --danger: #f06a6a;

  /* radii */
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 14px;

  /* shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 6px 22px rgba(0, 0, 0, .38);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);

  --ring: 0 0 0 3px var(--accent-soft);

  --maxw: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background:
    radial-gradient(1200px 640px at 80% -10%, rgba(79, 142, 247, .09), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ------------------------------------------------------------ site header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(21, 28, 37, .88);
  backdrop-filter: blur(8px);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--accent); flex: 0 0 auto; }
.brand-name { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.brand-name span { color: var(--muted); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav a.navlink { color: var(--muted); font-weight: 600; padding: 6px 10px; border-radius: var(--r-sm); }
.nav a.navlink:hover { color: var(--text); background: var(--surface-3); text-decoration: none; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 18px; font-size: 14px; font-weight: 650; font-family: inherit;
  cursor: pointer; background: var(--surface-3); color: var(--text);
  text-decoration: none; line-height: 1.2;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .06s;
}
.btn:hover { border-color: #45586c; background: #263241; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.lg { padding: 13px 24px; font-size: 15px; }
.btn.primary {
  background: var(--accent); border-color: var(--accent-strong); color: var(--accent-ink);
  box-shadow: 0 2px 12px rgba(79, 142, 247, .28);
}
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { background: transparent; }

/* ------------------------------------------------------------ hero */
.hero { padding: 84px 0 64px; text-align: center; }
.hero .eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-strong);
  border-radius: 999px; padding: 5px 14px; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(30px, 6vw, 48px); font-weight: 780; line-height: 1.1;
  letter-spacing: -.02em; max-width: 860px; margin: 0 auto;
}
.hero h1 .accent { color: var(--accent); }
.hero .lede {
  font-size: clamp(16px, 2.4vw, 20px); color: var(--muted);
  max-width: 640px; margin: 20px auto 0; line-height: 1.55;
}
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.hero .cta-note { margin-top: 16px; font-size: 13px; color: var(--faint); }

/* ------------------------------------------------------------ sections */
.section { padding: 56px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(24px, 4vw, 32px); font-weight: 720; letter-spacing: -.01em; }
.section-head p { color: var(--muted); margin-top: 12px; font-size: 16px; }
.divider { border: none; border-top: 1px solid var(--border-soft); margin: 0; }

/* feature cards */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm);
  transition: border-color .14s, transform .14s;
}
.card:hover { border-color: #3a4a5c; transform: translateY(-2px); }
.card .ico {
  width: 42px; height: 42px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 14px;
}
.card h3 { font-size: 16px; font-weight: 680; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14px; line-height: 1.55; }

/* ------------------------------------------------------------ pricing */
.pricing-banner {
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface-2);
  border: 1px solid var(--accent-strong); border-radius: var(--r-lg);
  padding: 26px 28px; text-align: center; margin-bottom: 32px;
}
.pricing-banner .tag {
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ok);
}
.pricing-banner h3 { font-size: clamp(22px, 3.4vw, 28px); font-weight: 740; margin: 8px 0 6px; }
.pricing-banner p { color: var(--muted); font-size: 15px; }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tier {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column;
}
.tier.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-md); }
.tier .tier-name { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tier .price { margin: 12px 0 4px; font-size: 30px; font-weight: 780; letter-spacing: -.02em; }
.tier .price .per { font-size: 14px; font-weight: 500; color: var(--faint); }
.tier .price-sub { font-size: 13px; color: var(--faint); min-height: 18px; }
.tier .soon {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--warn); background: rgba(245, 181, 68, .12);
  border: 1px solid var(--warn); border-radius: 999px; padding: 2px 9px; margin-left: 8px;
}
.tier .now {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ok); background: rgba(52, 211, 153, .12);
  border: 1px solid var(--ok); border-radius: 999px; padding: 2px 9px; margin-left: 8px;
}
.tier ul { list-style: none; margin: 18px 0 22px; display: flex; flex-direction: column; gap: 10px; }
.tier li { position: relative; padding-left: 24px; font-size: 14px; color: var(--text); }
.tier li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700;
}
.tier li.muted { color: var(--muted); }
.tier li.muted::before { content: "•"; color: var(--faint); }
.tier .tier-cta { margin-top: auto; }
.tier .tier-cta .btn { width: 100%; }
.tier .tier-cta .disabled {
  width: 100%; text-align: center; padding: 11px; border: 1px dashed var(--border);
  border-radius: var(--r-sm); color: var(--faint); font-size: 13px; font-weight: 600;
}
.pricing-foot { text-align: center; color: var(--faint); font-size: 13px; margin-top: 24px; }

/* ------------------------------------------------------------ CTA strip */
.cta-strip { text-align: center; padding: 64px 0; }
.cta-strip h2 { font-size: clamp(24px, 4vw, 32px); font-weight: 740; }
.cta-strip p { color: var(--muted); margin: 12px auto 26px; max-width: 520px; }

/* ------------------------------------------------------------ legal pages */
.legal { padding: 48px 0 24px; max-width: 800px; }
.legal h1 { font-size: clamp(26px, 5vw, 36px); font-weight: 760; letter-spacing: -.01em; }
.legal .updated { color: var(--faint); font-size: 13px; margin-top: 8px; }
.legal .intro { color: var(--muted); margin-top: 18px; font-size: 15px; }
.legal h2 {
  font-size: 19px; font-weight: 700; margin: 34px 0 10px;
  padding-top: 20px; border-top: 1px solid var(--border-soft);
}
.legal h3 { font-size: 15px; font-weight: 680; margin: 18px 0 6px; color: var(--text); }
.legal p { color: var(--muted); margin: 10px 0; }
.legal ul { margin: 10px 0 10px 22px; color: var(--muted); }
.legal li { margin: 6px 0; }
.legal strong { color: var(--text); }
.legal .placeholder {
  display: inline-block; background: rgba(245, 181, 68, .12); border: 1px dashed var(--warn);
  color: var(--warn); border-radius: var(--r-sm); padding: 1px 8px; font-weight: 650;
}

/* ------------------------------------------------------------ footer */
.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  margin-top: 40px; padding: 28px 0;
}
.site-footer .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.site-footer .copy { color: var(--faint); font-size: 13px; }
.site-footer .flinks { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer .flinks a { color: var(--muted); font-size: 13px; }
.site-footer .flinks a:hover { color: var(--text); }

/* ------------------------------------------- Simplified Chinese (/zh/ pages)
 * The Chinese pages use the same markup and the same classes as the English
 * ones. Only the typography differs, and only where Latin settings actively
 * hurt hanzi:
 *   - a CJK system-font stack (the Segoe UI stack above has no Chinese glyphs,
 *     so the browser substitutes a font nobody chose);
 *   - letter-spacing reset to 0 — the negative tracking on headings visibly
 *     collides square glyphs, and the wide .12em tracking on the small-caps
 *     labels shears a Chinese word apart;
 *   - line-height opened up, because hanzi have no descenders to breathe into;
 *   - headings pinned to 700, since CJK system fonts have no 650/720/780
 *     weights and round them apart unevenly.
 * No colour, spacing or layout rule is repeated here on purpose: re-skinning
 * the design stays a single edit in the blocks above.
 */
[lang|="zh"] body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC",
               "Noto Sans CJK SC", "Microsoft YaHei", "Hiragino Sans GB",
               system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.75;
}
[lang|="zh"] h1,
[lang|="zh"] h2,
[lang|="zh"] h3 { letter-spacing: 0; font-weight: 700; }
[lang|="zh"] .hero h1 { line-height: 1.3; }
[lang|="zh"] .hero .lede { line-height: 1.75; }
[lang|="zh"] .brand-name { letter-spacing: 0; }
[lang|="zh"] .tier .price { letter-spacing: 0; font-weight: 700; }
[lang|="zh"] .eyebrow,
[lang|="zh"] .pricing-banner .tag,
[lang|="zh"] .tier .tier-name,
[lang|="zh"] .tier .soon,
[lang|="zh"] .tier .now { letter-spacing: .04em; }
[lang|="zh"] .legal p,
[lang|="zh"] .legal li,
[lang|="zh"] .card p { line-height: 1.8; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 860px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .tiers { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 44px; }
  /* The language switch survives the narrow-screen nav cull: it is the only way
     to the other language's site, and a phone is where most of this audience reads. */
  .nav a.navlink:not(.lang) { display: none; }
  .nav .btn { padding: 8px 14px; }
}
