/* Clarivy landing page — design system
 * Goals: Stripe/Cloudflare-style trust, no decorative fluff, accessible (WCAG AA),
 *        dogfooding section is data-first, pricing is in plain tables.
 */

:root {
  --bg: #0b1020;
  --bg-2: #0f1530;
  --bg-3: #131a3a;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #eceff7;
  --ink: #0a0e1c;
  --ink-2: #2a3050;
  --ink-3: #5a6080;
  --muted: #7d8299;
  --line: #e3e6ef;
  --line-2: #cdd2e0;
  --brand: #0ea5b7;          /* teal-cyan, distinct from typical SaaS blue */
  --brand-2: #14c1d4;
  --brand-ink: #0b1020;
  --accent: #ffb547;          /* warm orange — only for "Most bought" badge */
  --shipped: #0a8f5a;
  --shipped-bg: #def6e8;
  --beta: #b8550a;
  --beta-bg: #fde8d2;
  --roadmap: #5a6080;
  --roadmap-bg: #e3e6ef;
  --warn: #b8550a;
  --shadow: 0 1px 2px rgba(10,14,28,0.04), 0 4px 12px rgba(10,14,28,0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[data-lang="zh"] body { line-height: 1.7; }

a { color: var(--brand-ink); text-decoration: underline; text-decoration-color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand); }

h1, h2, h3, h4 { font-family: inherit; color: var(--ink); margin: 0 0 0.5em; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; margin-top: 1.6em; }
h3 { font-size: 1.1rem; font-weight: 600; margin-top: 1.4em; }
h4 { font-size: 0.95rem; font-weight: 600; margin: 0 0 0.6em; }
p  { margin: 0 0 0.8em; }
ul, ol { margin: 0 0 0.8em; padding-left: 1.4em; }
li { margin: 0.2em 0; }

code, pre { font-family: "SF Mono", "JetBrains Mono", "Menlo", ui-monospace, monospace; font-size: 0.92em; }
code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--surface-3); padding: 0.8rem 1rem; border-radius: var(--radius-sm); overflow-x: auto; }
pre code { background: none; padding: 0; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.2rem; }
.row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.muted { color: var(--ink-3); font-size: 0.92em; }
.aside { color: var(--ink-3); font-size: 0.92em; margin-top: 0.8em; }

.skip {
  position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip:focus { position: static; width: auto; height: auto; padding: 0.5rem 1rem; background: var(--ink); color: #fff; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .row { justify-content: space-between; padding: 0.7rem 0; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px;
  background: var(--ink); color: #7dd3fc; font-weight: 700;
}
.brand-name { font-weight: 700; }
.brand-tag { color: var(--ink-3); font-size: 0.85em; border-left: 1px solid var(--line-2); padding-left: 0.6rem; }
@media (max-width: 720px) { .brand-tag { display: none; } }

.nav { display: flex; gap: 1.2rem; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95em; }
.nav a:hover { color: var(--brand); }
@media (max-width: 820px) { .nav { display: none; } }

.lang { display: inline-flex; align-items: center; gap: 0.4rem; }
.lang-btn {
  background: none; border: 0; padding: 0.2rem 0.4rem; cursor: pointer;
  color: var(--ink-2); font-weight: 600;
}
.lang-btn[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--brand); }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(1200px 500px at 50% -20%, rgba(20,193,212,0.18), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, #11173a 100%);
  color: #f3f5ff;
  padding: 5rem 0 4rem;
}
.hero .eyebrow { color: #7dd3fc; font-size: 0.95em; letter-spacing: 0.04em; text-transform: uppercase; }
.hero h1 { color: #fff; }
.hero .lede { color: #cdd2e0; max-width: 60ch; font-size: 1.15em; }
.hero .hero-aside { color: #a8aec8; font-size: 0.9em; margin-top: 0.6em; }
.hero .cta-row { margin-top: 1.6rem; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 0.7rem 1.2rem; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 600; font-size: 0.98em; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #000; }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.hero .btn-ghost { color: #cdd2e0; border-color: rgba(255,255,255,0.3); }
.hero .btn-ghost:hover { border-color: #fff; color: #fff; }
.band .btn-ghost { color: var(--ink-2); border-color: var(--line-2); }
.band .btn-ghost:hover { color: var(--ink); border-color: var(--ink); }

.cta-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ── Bands / sections ────────────────────────────────────────────────── */
.band { padding: 4rem 0; }
.band-alt { background: var(--surface-2); }
.section-lede { color: var(--ink-2); max-width: 70ch; font-size: 1.05em; margin-bottom: 1.6em; }

/* ── Grids ───────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 820px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── Method section ─────────────────────────────────────────────────── */
.engines { list-style: none; padding-left: 0; }
.engines li { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 0.94em; }
thead { background: var(--surface-3); }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }

/* ── Pricing ─────────────────────────────────────────────────────────── */
.pricing { align-items: stretch; }
.tier {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; display: flex; flex-direction: column; gap: 0.6rem;
  position: relative;
}
.tier-featured { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset, var(--shadow); }
.tier .badge {
  position: absolute; top: -10px; right: 14px; background: var(--accent); color: var(--ink);
  padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78em; font-weight: 700;
}
.tier h3 { margin: 0; font-size: 1.05em; color: var(--ink-2); }
.tier .price { margin: 0.2rem 0 0.6rem; }
.tier .price .amount { font-size: 2.4rem; font-weight: 700; color: var(--ink); }
.tier .price .per { color: var(--ink-3); font-size: 0.85em; margin-left: 0.4em; }
.tier .who { color: var(--ink-2); font-size: 0.92em; }
.tier .feat { list-style: none; padding-left: 0; }
.tier .feat li { position: relative; padding-left: 1.3em; color: var(--ink-2); }
.tier .feat li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px;
  background: var(--brand); border-radius: 2px;
}
.tier .guarantee { color: var(--ink-3); font-size: 0.85em; font-style: italic; margin-top: auto; }
.tier .btn { width: 100%; text-align: center; margin-top: 0.6rem; }

.pricing-promise {
  margin-top: 1.6rem; padding: 1rem 1.2rem; background: #fff; border: 1px dashed var(--line-2);
  border-radius: var(--radius); color: var(--ink-2); font-size: 0.95em;
}

/* ── Capability matrix ───────────────────────────────────────────────── */
.state {
  display: inline-block; padding: 0.18em 0.6em; border-radius: 999px; font-size: 0.82em; font-weight: 600;
}
.state-shipped { background: var(--shipped-bg); color: var(--shipped); }
.state-beta { background: var(--beta-bg); color: var(--beta); }
.state-roadmap { background: var(--roadmap-bg); color: var(--roadmap); }

/* ── Company section (kv) ───────────────────────────────────────────── */
.kv { display: grid; grid-template-columns: 14rem 1fr; gap: 0.3rem 1rem; margin: 0; }
.kv dt { color: var(--ink-3); font-size: 0.92em; }
.kv dd { margin: 0; color: var(--ink); }
@media (max-width: 720px) { .kv { grid-template-columns: 1fr; } }

/* ── Dogfooding KPIs ─────────────────────────────────────────────────── */
.kpi { list-style: none; padding-left: 0; }
.kpi li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--line);
}
.kpi li:last-child { border-bottom: 0; }
.kpi li span:first-child { color: var(--ink-3); }
.kpi li strong { color: var(--ink); font-weight: 700; }

.plan { padding-left: 1.4em; }
.plan li { padding-left: 0.2em; }

/* ── Trust ───────────────────────────────────────────────────────────── */
.trust ul { list-style: none; padding-left: 0; }
.trust .links li, .trust .checks li {
  padding: 0.35rem 0; border-bottom: 1px solid var(--line); color: var(--ink-2);
}
.trust .links li:last-child, .trust .checks li:last-child { border-bottom: 0; }

/* ── FAQ ─────────────────────────────────────────────────────────────── */
details {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.8rem 1.2rem; margin-bottom: 0.6rem;
}
details summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; display: inline-block; width: 1.2em; color: var(--brand); font-weight: 700; }
details[open] summary::before { content: "−"; }
details p { margin: 0.6rem 0 0; color: var(--ink-2); }

/* ── CTA strip ───────────────────────────────────────────────────────── */
.cta-strip {
  background: var(--ink); color: #f3f5ff; padding: 2.4rem 0;
}
.cta-strip h3 { color: #fff; margin: 0; }
.cta-strip p { color: #cdd2e0; margin: 0.2rem 0 0; }
.cta-strip .row { justify-content: space-between; }
.cta-strip .btn-primary { background: var(--brand); color: var(--ink); border-color: var(--brand); }
.cta-strip .btn-primary:hover { background: var(--brand-2); }
.cta-strip .btn-ghost { color: #cdd2e0; border-color: rgba(255,255,255,0.3); }
.cta-strip .btn-ghost:hover { color: #fff; border-color: #fff; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer { background: var(--surface-2); border-top: 1px solid var(--line); padding: 2.4rem 0 1.6rem; }
.foot-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1.6rem; }
@media (max-width: 820px) { .foot-cols { grid-template-columns: 1fr 1fr; } }
.foot-cols h4 { color: var(--ink-2); }
.foot-cols ul { list-style: none; padding: 0; }
.foot-cols li { padding: 0.2rem 0; }
.foot-cols a { color: var(--ink-2); text-decoration: none; }
.foot-cols a:hover { color: var(--brand); }
.copyright { text-align: center; color: var(--ink-3); font-size: 0.85em; margin-top: 1.6rem; }

/* ── Legal page styling (privacy/terms/dpa) ─────────────────────────── */
.legal { max-width: 760px; margin: 0 auto; padding: 3rem 1.2rem 4rem; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.3rem; margin-top: 1.8em; }
.legal h3 { font-size: 1.05rem; margin-top: 1.4em; }
.legal .meta { color: var(--ink-3); font-size: 0.9em; }
.legal .toc { background: var(--surface-2); padding: 1rem 1.2rem; border-radius: var(--radius); margin: 1.6rem 0; }
.legal .toc ol { margin: 0; }
.legal .updated { color: var(--ink-3); font-size: 0.85em; margin-top: 2.4rem; border-top: 1px solid var(--line); padding-top: 1rem; }

/* ── Audit page (1-pager mirror of the PDF) ─────────────────────────── */
.audit-page { max-width: 820px; margin: 0 auto; padding: 3rem 1.2rem 4rem; }
.audit-page h1 { font-size: 1.8rem; }
.audit-page .meta { color: var(--ink-3); font-size: 0.9em; }
.audit-page .data-provenance {
  background: var(--surface-3); border-left: 4px solid var(--brand);
  padding: 1rem 1.2rem; border-radius: var(--radius-sm);
  font-size: 0.92em; color: var(--ink-2); margin: 1.4rem 0;
}
.audit-page .results { margin: 1.6rem 0; }
.audit-page .results table { font-size: 0.88em; }
.audit-page .conclusions { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
