/*
 * abc — shared styles for every page.
 * Tokens, header, footer, buttons and the legal-page layout live here so a new page
 * only needs `<link rel="stylesheet" href="/assets/site.css">` plus its own few rules.
 * Page-specific layout stays inline in that page's <style>.
 *
 * Colours are chosen for WCAG AA (4.5:1) on both --paper and --raise: --muted is body copy,
 * --faint is small labels and placeholders, and --paper text on --accent is used by selected
 * chips. Re-check contrast before changing any of them.
 */
:root{
  --paper:#fbfaff;
  --raise:#ffffff;
  --ink:#100b1a;
  --muted:#544c63;
  --faint:#685f78;
  --line:#ece7f6;
  --line-strong:#dbd2ee;
  --accent:#5b21b6;
  --accent-ink:#4c1d95;
  --ok:#3f7a4a;
  --shadow:24px 40px 80px -48px rgba(60,20,120,.4);
  --mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --sans:"Hanken Grotesque",system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  --serif:"Fraunces",Georgia,"Times New Roman",serif;
  --ease:cubic-bezier(.2,.8,.2,1);
}
/* Dark theme: follows the device unless the visitor picked one with the header switch
   (assets/theme.js sets <html data-theme>). Keep both blocks identical. */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --paper:#0f0b16;
    --raise:#17121f;
    --ink:#ece8f4;
    --muted:#a9a0b9;
    --faint:#9c93ac;
    --line:#2a2238;
    --line-strong:#3a2f4c;
    --accent:#c4b5fd;
    --accent-ink:#d6ccfe;
    --ok:#8cc596;
    --shadow:24px 44px 90px -50px rgba(0,0,0,.65);
  }
}
:root[data-theme="dark"]{
    --paper:#0f0b16;
    --raise:#17121f;
    --ink:#ece8f4;
    --muted:#a9a0b9;
    --faint:#9c93ac;
    --line:#2a2238;
    --line-strong:#3a2f4c;
    --accent:#c4b5fd;
    --accent-ink:#d6ccfe;
    --ok:#8cc596;
    --shadow:24px 44px 90px -50px rgba(0,0,0,.65);
}
:root{color-scheme:light}
:root[data-theme="dark"]{color-scheme:dark}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){color-scheme:dark}}

/* Chinese pages: Fraunces and Hanken Grotesque have no CJK glyphs, so name CJK faces explicitly.
   Noto Serif SC is loaded by the zh pages; body text uses the system's CJK sans. */
:root:lang(zh){
  --serif:"Fraunces","Noto Serif SC","Songti SC","STSong",serif;
  --sans:"Hanken Grotesque","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC",system-ui,sans-serif;
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:var(--paper);color:var(--ink);
  font-family:var(--sans);font-size:17px;line-height:1.65;font-weight:400;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
}
.wrap{width:min(1080px,100% - 44px);margin-inline:auto}
a{color:inherit}
::selection{background:var(--accent);color:var(--paper)}
h1,h2,h3,h4{font-family:var(--serif);font-weight:560;letter-spacing:-.015em;text-wrap:balance;margin:0}

.eyebrow{
  font-family:var(--mono);font-size:12px;letter-spacing:.16em;text-transform:uppercase;
  color:var(--accent-ink);font-weight:400;
}
.skip{position:absolute;left:12px;top:-60px;z-index:10;background:var(--ink);color:var(--paper);
  padding:10px 16px;border-radius:999px;text-decoration:none;font-weight:600;font-size:15px}
.skip:focus{top:12px}

/* header */
header{position:sticky;top:0;z-index:5;background:color-mix(in srgb,var(--paper) 82%,transparent);
  backdrop-filter:saturate(1.4) blur(10px);border-bottom:1px solid var(--line)}
.bar{display:flex;align-items:center;justify-content:space-between;height:64px;gap:16px}
.mark{display:inline-flex;align-items:center;gap:11px;font-family:var(--serif);font-weight:560;
  font-size:19px;letter-spacing:-.02em;text-decoration:none;color:var(--ink)}
/* Logo preview (abc): the c is drawn, so it carries the tick and can shrink to the tab icon. */
.mark .wm{display:block;height:34px;width:auto}
/* Two logo files, because Safari ignores colour-scheme rules inside an SVG shown with <img>. */
.mark .wm-d{display:none}
:root[data-theme="dark"] .mark .wm-l{display:none}
:root[data-theme="dark"] .mark .wm-d{display:block}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .mark .wm-l{display:none}
  :root:not([data-theme="light"]) .mark .wm-d{display:block}
}
.bar-end{display:flex;align-items:center;gap:16px}
/* Light/dark switch: shows the moon in light mode, the sun in dark mode. */
.theme-toggle{display:inline-grid;place-items:center;width:36px;height:36px;flex:none;padding:0;
  border:1px solid var(--line-strong);border-radius:999px;background:transparent;color:var(--ink);cursor:pointer;
  transition:border-color .2s}
.theme-toggle:hover{border-color:var(--accent)}
.theme-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.theme-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .sun{display:none}
:root[data-theme="dark"] .theme-toggle .sun{display:block}
:root[data-theme="dark"] .theme-toggle .moon{display:none}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .theme-toggle .sun{display:block}
  :root:not([data-theme="light"]) .theme-toggle .moon{display:none}
}
.mark{gap:0}
.glyph{width:26px;height:26px;flex:none;border-radius:7px;background:
  radial-gradient(120% 120% at 30% 20%,var(--accent),var(--accent-ink));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35)}
.bar .mono,.back{font-family:var(--mono);font-size:12px;letter-spacing:.14em;text-transform:uppercase;
  color:var(--muted);text-decoration:none}
.back:hover{color:var(--ink)}

/* buttons */
.btn{display:inline-flex;align-items:center;gap:10px;background:var(--accent);color:var(--paper);
  text-decoration:none;font-family:var(--sans);font-weight:600;font-size:16px;padding:15px 24px;
  border:0;border-radius:999px;cursor:pointer;
  transition:transform .25s var(--ease),box-shadow .25s,opacity .2s}
.btn .arw{transition:transform .25s var(--ease)}
.btn:hover{transform:translateY(-2px);box-shadow:0 14px 30px -14px color-mix(in srgb,var(--ink) 60%,transparent)}
.btn:hover .arw{transform:translateX(4px)}
.btn[disabled]{opacity:.55;cursor:default;transform:none;box-shadow:none}
.btn.alt{background:transparent;color:var(--ink);border:1px solid var(--line-strong)}
.btn.alt:hover{border-color:var(--accent);box-shadow:none}

/* footer */
footer{border-top:1px solid var(--line);padding:30px 0 46px}
@media (max-width:640px){footer{padding-bottom:84px}} /* room for the chat button, so the last line is never stuck under it */
.foot{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;
  font-family:var(--mono);font-size:12px;letter-spacing:.06em;color:var(--muted);text-transform:uppercase}
.foot a{color:var(--muted);text-decoration:none}
.foot a:hover{color:var(--ink)}

/* entrance animation — only where scripts run, so link-preview crawlers and no-JS readers (which
   may never advance the animation) get the text instead of a blank hero. Browsers without the
   `scripting` media feature skip the animation entirely, which is the safe side. */
@media (prefers-reduced-motion:no-preference) and (scripting:enabled){
  .rise{opacity:0;transform:translateY(14px);animation:rise .8s var(--ease) forwards}
  .d1{animation-delay:.05s}.d2{animation-delay:.14s}.d3{animation-delay:.23s}.d4{animation-delay:.32s}
  @keyframes rise{to{opacity:1;transform:none}}
}
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible{
  outline:2px solid var(--accent);outline-offset:3px;border-radius:6px}

/* long-form pages (terms, privacy, refunds, 404): add class="doc" to <body> */
.doc{font-size:16.5px;line-height:1.7}
.doc .wrap{width:min(720px,100% - 44px)}
.doc main{padding:clamp(44px,7vw,72px) 0 40px}
.doc main a{color:var(--accent-ink)}
.doc h1{font-size:clamp(30px,5vw,42px);margin:0 0 10px}
.doc h2{font-size:21px;letter-spacing:-.01em;margin:36px 0 10px}
.doc p,.doc li{color:var(--muted)}
.doc ul{padding-left:22px;margin:10px 0}
.doc strong{color:var(--ink);font-weight:600}
.doc .updated{font-family:var(--mono);font-size:12px;letter-spacing:.12em;text-transform:uppercase;
  color:var(--muted);margin:0 0 36px}
.doc footer{margin-top:48px}

/* Light/dark switch animation (assets/theme.js). Browsers with view transitions cross-fade the
   whole page; the rest ease colours while .theme-fade is on. Reduced motion skips both. */
::view-transition-old(root),::view-transition-new(root){animation-duration:.35s}
.theme-fade,.theme-fade *,.theme-fade *::before,.theme-fade *::after{
  transition:background-color .35s ease,color .35s ease,border-color .35s ease,fill .35s ease,stroke .35s ease !important}
