/* Crisp site — shared design system. Auto light/dark, macOS-native, flat. */

:root {
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --card: #ffffff;
  --border: rgba(0,0,0,.10);
  --hairline: rgba(0,0,0,.14);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0066cc;
  --btn-bg: #1d1d1f;
  --btn-fg: #ffffff;
  --nav-bg: rgba(255,255,255,.8);
  --shadow-lg: 0 30px 60px rgba(0,0,0,.12);
  --code-bg: #f5f5f7;
  --good: #248a3d;
  --pro: #9a6a00;
  --no: #a1a1a8;
  --tint: rgba(0,102,204,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0b;
    --bg-2: #101012;
    --card: #141416;
    --border: rgba(255,255,255,.09);
    --hairline: rgba(255,255,255,.16);
    --text: #f5f5f7;
    --muted: #9c9ca3;
    --accent: #4ea1ff;
    --btn-bg: #f5f5f7;
    --btn-fg: #0a0a0b;
    --nav-bg: rgba(10,10,11,.72);
    --shadow-lg: 0 30px 70px rgba(0,0,0,.55);
    --code-bg: #151517;
    --good: #30d158;
    --pro: #ffb340;
    --no: #6c6c74;
    --tint: rgba(78,161,255,.08);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Looser leading for Chinese body copy */
html[lang^="zh"] .prose p,
html[lang^="zh"] .prose li,
html[lang^="zh"] .page-head .lead { line-height: 1.85; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 24px; }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1000px; margin: 0 auto; padding: 0 24px;
  height: 52px; display: flex; align-items: center; justify-content: space-between;
}
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; letter-spacing: -.01em; color: var(--text); }
.wordmark:hover { text-decoration: none; }
.wordmark img { width: 23px; height: 23px; border-radius: 6px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a[aria-current] { color: var(--text); font-weight: 600; }
@media (max-width: 560px) { .nav-links { gap: 18px; } .nav-links .hide-sm { display: none; } }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 28px; border-radius: 980px; font-size: 16px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer;
  transition: opacity .18s ease, border-color .18s ease, background .18s ease;
}
.btn.primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn.primary:hover { opacity: .84; text-decoration: none; }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn.secondary:hover { border-color: var(--muted); text-decoration: none; }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== Landing hero ===== */
.hero { text-align: center; padding: 100px 0 84px; }
.hero .icon { width: 84px; height: 84px; }
.hero h1 {
  font-size: clamp(44px, 7.5vw, 82px); font-weight: 700; letter-spacing: -.035em;
  line-height: 1.03; margin-top: 30px; max-width: 15ch; margin-left: auto; margin-right: auto;
}
.hero .sub {
  color: var(--muted); font-size: clamp(18px, 2.1vw, 21px); line-height: 1.5;
  margin: 22px auto 0; max-width: 42ch;
}
.hero .actions { margin-top: 38px; }
.brew {
  margin: 22px auto 0; display: inline-flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; font: 13.5px ui-monospace, "SF Mono", Menlo, monospace; color: var(--text);
  cursor: pointer;
}
.brew .prompt { color: var(--muted); }
.brew .hint { color: var(--muted); font-size: 12px; }
.hero .note { margin-top: 16px; }

/* ===== Media frame ===== */
.frame {
  border-radius: 16px; overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); background: var(--card);
}
.hero .frame { margin: 56px auto 0; max-width: 900px; }
.demo { display: block; width: 100%; height: auto; }

/* ===== Landing sections ===== */
section.block { padding: 104px 0; }
.story { max-width: 720px; margin: 0 auto; text-align: center; }
.story p { font-size: clamp(19px, 2.5vw, 24px); line-height: 1.5; font-weight: 500; letter-spacing: -.015em; }
section.tint { background: var(--bg-2); }
h2 {
  text-align: center; font-size: clamp(30px, 4vw, 46px); font-weight: 640;
  letter-spacing: -.025em; line-height: 1.08;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 16px; margin-top: 56px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 28px 26px;
}
.card h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; line-height: 1.55; }
.showcase { margin: 56px auto 0; max-width: 440px; }
.shot { display: block; width: 100%; height: auto; }

/* ===== Article / document pages ===== */
.doc { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.page-head { text-align: center; padding: 72px 0 8px; }
.page-head .icon { width: 76px; height: 76px; }
.kicker { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; margin-top: 18px; }
.page-head h1 {
  font-size: clamp(30px, 4.6vw, 46px); font-weight: 700; letter-spacing: -.025em;
  line-height: 1.12; margin-top: 12px; max-width: 20ch; margin-left: auto; margin-right: auto;
}
.byline { color: var(--muted); font-size: 13.5px; margin-top: 16px; }
.byline a { color: var(--muted); }
.page-head .lead { color: var(--muted); font-size: clamp(17px, 2vw, 19px); line-height: 1.5; margin: 18px auto 0; max-width: 36em; }

.prose { padding-bottom: 8px; }
.prose > .lead { color: var(--muted); font-size: 19px; line-height: 1.55; margin: 18px 0 0; }
.prose h2 { text-align: left; font-size: clamp(22px, 3vw, 28px); font-weight: 640; letter-spacing: -.02em; line-height: 1.2; margin: 52px 0 16px; }
.prose p { color: var(--text); margin: 16px 0; }
.prose ul { margin: 16px 0; padding-left: 22px; color: var(--text); }
.prose li { margin: 8px 0; }
.prose strong { color: var(--text); font-weight: 600; }
.prose .shot { margin: 28px auto; max-width: 406px; border-radius: 12px; border: 1px solid var(--border); }
.note { color: var(--muted); font-size: 14px; }
pre {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; margin: 18px 0; overflow-x: auto;
  font: 14px/1.7 ui-monospace, "SF Mono", Menlo, monospace; color: var(--text);
}
pre .prompt { color: var(--muted); }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; background: var(--code-bg); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
pre code { background: none; border: none; padding: 0; }

.cta {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 24px; margin: 56px 0 0; text-align: center;
}
.cta h3 { font-size: 19px; font-weight: 640; margin-bottom: 6px; }
.cta p { color: var(--muted); font-size: 14.5px; margin-bottom: 18px; }

/* ===== Comparison table ===== */
.tablewrap { overflow-x: auto; margin: 28px 0; border: 1px solid var(--border); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 14.5px; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--border); }
thead th { background: var(--bg-2); font-size: 14px; white-space: nowrap; font-weight: 600; }
thead th.me { color: var(--accent); }
tbody th { font-weight: 600; color: var(--text); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: none; }
td { color: var(--muted); }
td.c { text-align: center; }
.yes { color: var(--good); font-weight: 700; }
.no { color: var(--no); }
.pro { color: var(--pro); font-weight: 600; font-size: 13px; }
.col-me { background: var(--tint); }
.legend { color: var(--muted); font-size: 13px; margin-top: 10px; }
.legend .yes, .legend .pro, .legend .no { margin-right: 4px; }

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border); padding: 48px 0 72px;
  color: var(--muted); font-size: 14px; text-align: center;
}
footer p { margin: 8px 0; }
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }

/* ===== Scroll reveal — JS + motion-safe only ===== */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}

/* ===== FAQ accordion (native details/summary; JS adds height animation) ===== */
.prose details { border-bottom: 1px solid var(--border); }
.prose details:first-of-type { border-top: 1px solid var(--border); }
.js .prose details { overflow: hidden; }
.prose summary {
  cursor: pointer; list-style: none; padding: 20px 6px;
  font-weight: 600; font-size: 17px; color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  transition: color .15s ease;
}
.prose summary::-webkit-details-marker { display: none; }
.prose summary::marker { content: ""; }
.prose summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin-right: 6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform .25s ease, border-color .15s ease;
}
/* Open state: driven by [open] without JS, by .faq-open with JS so the chevron
   flips the instant you click, instead of waiting for the collapse to finish. */
.prose details[open] summary,
.prose details.faq-open summary { color: var(--accent); }
.prose details[open] summary::after,
.prose details.faq-open summary::after { transform: translateY(2px) rotate(-135deg); border-color: var(--accent); }
.js .prose details[open]:not(.faq-open) summary { color: var(--text); }
.js .prose details[open]:not(.faq-open) summary::after { transform: translateY(-2px) rotate(45deg); border-color: var(--muted); }
.prose summary:hover { color: var(--accent); }
.prose summary:hover::after { border-color: var(--accent); }
.prose details > p { margin: -2px 6px 22px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .prose summary, .prose summary::after { transition: none; }
}

/* ===== Split FAQ (landing pages) ===== */
.faq-split { display: grid; grid-template-columns: 1fr 1.8fr; gap: 24px 72px; align-items: start; }
.faq-split h2 { text-align: left; }
.faq-split .faq-intro { color: var(--muted); font-size: 17px; line-height: 1.5; margin-top: 14px; }
.faq-split .prose { padding-bottom: 0; }
@media (max-width: 800px) {
  .faq-split { grid-template-columns: 1fr; gap: 0; }
  .faq-split h2 { text-align: center; }
  .faq-split .faq-intro { text-align: center; margin: 12px 0 28px; }
}
