/* Kalamos site study: shared tokens, shell and the page styles for every sub-page.
   The wordmark's own motion lives in kalamos-wordmark-motion.css (the approved language, unchanged). */
:root {
  --bg: #ffffff;
  --ink: #141413;
  --ink-2: #3d3c39;
  --muted: #77756f;
  --faint: #aeaca5;
  --line: rgb(20 20 19 / 8%);
  --line-2: rgb(20 20 19 / 13%);
  --card: #f6f5f1;
  --card-2: #efeee9;
  --paper: #faf9f5;
  --side: #f3f2ed;
  --bubble: #efede6;
  --pill: #f0efea;
  --pill-hover: #e7e6e0;
  --solid: #141413;
  --solid-fg: #ffffff;
  --surface: #ffffff;
  --nav: rgb(255 255 255 / 82%);
  --win-shadow: 0 0 0 1px rgb(20 20 19 / 7%), 0 50px 100px -40px rgb(40 36 28 / 28%), 0 10px 28px rgb(40 36 28 / 5%);
  --card-shadow: 0 0 0 1px rgb(20 20 19 / 8%), 0 10px 26px rgb(40 36 28 / 6%);
  --amber-bg: #fbf1de;
  --amber-fg: #9a6a24;
  --ok: #4f9b7f;
  --tone-kala: #8a5538;
  --tone-mos: #63b899;
  --sans: "Cabinet Grotesk", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  /* The calligraphy face of the app's daily lot; visitors without it fall back to a Song face. */
  --brush: "方正黄庭坚行书 简", "FZHuangTJXSJW", "Kalamos Brush", "Songti SC", STSong, serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-snap: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --wrap: 1200px;
  color-scheme: light;
  interpolate-size: allow-keywords;
}
:root[data-theme="dark"] {
  --bg: #0f0f0e;
  --ink: #f2f1ec;
  --ink-2: #d2d0c9;
  --muted: #8f8d86;
  --faint: #5d5b56;
  --line: rgb(242 241 236 / 9%);
  --line-2: rgb(242 241 236 / 15%);
  --card: #181816;
  --card-2: #201f1d;
  --paper: #161514;
  --side: #1b1a18;
  --bubble: #272623;
  --pill: #22211f;
  --pill-hover: #2c2b28;
  --solid: #f2f1ec;
  --solid-fg: #141413;
  --surface: #1e1d1b;
  --nav: rgb(15 15 14 / 78%);
  --win-shadow: 0 0 0 1px rgb(242 241 236 / 8%), 0 50px 100px -40px rgb(0 0 0 / 70%);
  --card-shadow: 0 0 0 1px rgb(242 241 236 / 9%), 0 10px 26px rgb(0 0 0 / 30%);
  --amber-bg: #3a2b14;
  --amber-fg: #f2b54a;
  --ok: #6cc3a1;
  --tone-kala: #7b33df;
  --tone-mos: #f9ad04;
  color-scheme: dark;
}
/* The brush role. A Mac with FZ Huang Tingjian installed uses it (never shipped: no web licence is confirmed);
   everyone else gets "Kalamos Brush", an OFL Zhi Mang Xing subset of the characters the homepage sets in
   this role (tools/subset-brush.py; licence in fonts/ZhiMangXing-OFL.txt). */
@font-face {
  font-family: "Kalamos Brush";
  src: url("fonts/kalamos-brush-lot.woff?v=066f08b544") format("woff");
  font-display: swap;
}
@font-face {
  font-family: "方正黄庭坚行书 简";
  src: local("方正黄庭坚行书 简"), local("FZHuangTingJianXingShuS"), local("FZHuangTJXSJW"), local("FZHUANGTJXSS--GB1-0");
  font-display: swap;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
  transition: background-color 400ms var(--ease-snap), color 400ms var(--ease-snap);
}
a, button, summary, [role="tab"] { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Every wordmark copy keeps the drawing's own proportions, whichever side is sized. */
.kw-slot { display: inline-block; line-height: 0; color: var(--ink); }
.kw-slot .kalamos-wordmark { aspect-ratio: 1982.0555 / 393.4687; width: auto; height: 100%; }
.kw-slot.by-width .kalamos-wordmark { width: 100%; height: auto; }
/* Opening and resting helpers, as on the holding page. */
.kalamos-wordmark.caret-only .kw-part:not([data-part="l"]) { opacity: 0; transition: none; }
.kalamos-wordmark.keep-l [data-part="l"] { animation: none; opacity: 1; }
.kalamos-wordmark.keep-tone .kw-part { fill: var(--kw-tone); }
/* A blink: the o closes like an eye. Only ever added on idle, which has no animation of its own. */
.kalamos-wordmark.blink .kw-o { animation: kw-wink 300ms var(--kw-ease-in-out) both; }
/* Optical centre: the x-height band carries the word, so a wordmark centred by its box reads low.
   Lift it by the gap between the box centre and that band's centre. */
.kw-optical { transform: translateY(-.11em); }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border-radius: 999px; font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: transform 160ms var(--ease-snap), background-color 160ms var(--ease-snap), opacity 160ms;
}
.btn:active { transform: scale(.97); }
.btn-solid, .btn-ink { background: var(--solid); color: var(--solid-fg); }
.btn-solid:hover, .btn-ink:hover { opacity: .86; }
.btn-soft, .btn-line { background: var(--pill); color: var(--ink); }
.btn-soft:hover, .btn-line:hover { background: var(--pill-hover); }
.btn-sm { height: 36px; padding: 0 15px; font-size: 14px; }
.btn .icon { width: 16px; height: 16px; stroke-width: 1.8; }
.link-soft { color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--line-2); padding-bottom: 1px; transition: border-color 160ms; }
.link-soft:hover { border-color: var(--ink); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; background: var(--nav);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent; transition: border-color 300ms;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; height: 68px; gap: 36px; }
.nav-logo { display: flex; align-items: center; height: 20px; }
/* 20px tall: the x-height band's centre sits 2.7px below the box centre; the ascenders pull the eye
   back up a little, so the mark is lifted 2px onto the text's centre line. */
.nav-logo .kw-slot, .foot .brand .kw-slot { height: 20px; transform: translateY(-2px); }
/* Measured ink centroids at 1440px on a 34 centre line: logo 34.0; English links 33.7; Chinese links 31.8,
   because CJK glyphs ride high on the Latin face's baseline, so in Chinese they come down 2px. */
.nav-links { display: flex; gap: 28px; font-size: 15px; color: var(--ink-2); position: relative; }
:lang(zh-Hans) > .nav-links, :lang(zh-Hans) .nav-links { top: 2px; }
.nav-links a { transition: color 150ms; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 12px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.lang:hover { color: var(--ink); background: var(--pill); }

/* Label centring, measured 2026-10-27 in the Owner's own Chrome screenshots (2x) on the visual centre (ink
   centroid), the rule the state labels were approved on. Latin labels, mostly lowercase, carry their weight in
   the x-height band, so the plain symmetric pill already centres them: the earlier top padding, set from the
   ascender-to-baseline box, read 1-1.5px low and is gone. Chinese glyphs sit high on the Latin face's line,
   so Chinese pills keep a little: 2.5px in the 36px ones (measured within 0.4px), 2px in the 44px ones (they
   read 1px low at 4px). The language switch is set in the other language (lang attribute). */
.lang { padding-top: 2px; }
.btn:lang(zh-Hans), .lang:lang(zh-Hans) { padding-top: 2.5px; }
.btn:not(.btn-sm):lang(zh-Hans) { padding-top: 2px; }
/* The arrow is drawn centred; in a Chinese pill it goes back up by the padding's half. Its drawing keeps 2px
   clear on its left, which set the content 0.7px right of centre; the icon takes that back. */
.btn:not(.btn-sm):lang(zh-Hans) > .icon { position: relative; top: -1px; }
.btn > .icon:first-child { margin-left: -1.2px; }
/* The Apple logo on "Download for macOS" (Simple Icons, CC0), drawn to its own bounds, so it needs no side
   bearing back; filled, 14px tall with its leaf. It snaps to whole pixels; one pixel up puts its ink centroid
   0.4px and the apple's body 0.6px from the pill's centre (measured at 2x, 2026-10-27), level with the
   label. The Chinese pill's extra top padding takes one more. */
.btn > .icon.apple { width: auto; height: 14px; aspect-ratio: 19.55 / 24; margin-left: 0; fill: currentColor; stroke: none; position: relative; top: -1px; }
.btn:not(.btn-sm):lang(zh-Hans) > .icon.apple { top: -2px; }
/* Measured ink, left and right: the logo's round edge sat the English label 0.5px left of centre. */
.btn:not(:lang(zh-Hans)) > .icon.apple { margin-left: 1px; }

/* ---------- Dual-platform split download pill & menu (macOS + Windows) ---------- */
.dl-split { position: relative; display: inline-flex; align-items: stretch; vertical-align: middle; }
.dl-split-main { border-top-right-radius: 0; border-bottom-right-radius: 0; padding-right: 16px; }
.dl-split-toggle {
  position: relative; border-top-left-radius: 0; border-bottom-left-radius: 0;
  padding: 0 14px 0 12px; gap: 0;
}
.dl-split-toggle::before {
  content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 1px;
  background: color-mix(in srgb, var(--solid-fg) 24%, transparent); pointer-events: none;
}
.dl-split-toggle .chev { width: 14px; height: 14px; stroke-width: 1.9; transition: transform 180ms var(--ease-snap); }
.dl-split-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.dl-split-toggle:focus-visible, .dl-split-main:focus-visible, .dl-menu-item:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}
.dl-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 45;
  min-width: 262px; padding: 6px; border-radius: 16px; background: var(--surface);
  box-shadow: var(--card-shadow); text-align: left;
  display: flex; flex-direction: column; gap: 3px;
}
.dl-menu[hidden] { display: none; }
.dl-menu-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px;
  color: var(--ink); text-decoration: none;
}
.dl-menu-item:hover, .dl-menu-item:focus-visible { background: var(--pill); }
.dl-menu-item .icon.apple { width: auto; height: 15px; aspect-ratio: 19.55 / 24; fill: currentColor; stroke: none; flex: none; }
.dl-menu-item .icon.win { width: 15px; height: 15px; fill: currentColor; stroke: none; flex: none; }
.dl-menu-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dl-menu-copy strong { font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--ink); }
.dl-menu-copy span { font-size: 12px; line-height: 1.3; color: var(--muted); }
.dl-menu-ext { font: 11.5px var(--mono); color: var(--muted); flex: none; }
.hero-platforms { margin: 14px auto 0; font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; }
.prose .hero-platforms { margin: -4px 0 18px; text-align: left; }
.prose .dl-menu { left: 0; transform: none; }
@media (max-width: 520px) {
  .dl-menu { min-width: min(262px, calc(100vw - 32px)); }
}

/* ---------- Menu (below 981px, where the links leave the bar) ---------- */
/* Only the two lines move: no circle behind them, and no grey tap flash on iOS. */
.menu-toggle { display: none; position: relative; width: 38px; height: 38px; margin-left: -8px; flex: none; -webkit-tap-highlight-color: transparent; }
.menu-toggle i { position: absolute; left: 11px; right: 11px; height: 1.5px; border-radius: 1px; background: var(--ink); transition: transform 360ms var(--ease-snap); }
.menu-toggle i:first-child { top: 15.5px; }
.menu-toggle i:last-child { top: 21.5px; }
.nav.open .menu-toggle i:first-child { transform: translateY(3px) rotate(45deg); }
.nav.open .menu-toggle i:last-child { transform: translateY(-3px) rotate(-45deg); }
/* Opening felt sticky on iPhone: the panel animated inside the bar's backdrop blur, which WebKit redraws every
   frame while the page behind moves, and the links came in one by one over 0.6 s. While the menu is open the
   bar turns solid (one sheet with the panel), and the panel arrives whole in 0.24 s. */
.nav.open { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
.menu { position: absolute; left: 0; right: 0; top: 100%; padding: 6px 0 22px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px -28px rgb(20 20 19 / 28%); animation: menu-in 240ms var(--ease-snap) both; }
.menu[hidden] { display: none; }
/* The bar's own .wrap rules (flex, 60-68px tall) must not reach the panel's. */
.nav .menu .wrap, .nav .menu .wrap:is(*) { display: block; height: auto; }
.menu-links a { display: flex; align-items: center; justify-content: space-between; padding: 15px 2px; border-bottom: 1px solid var(--line); font-size: 19px; font-weight: 500; letter-spacing: -.01em; -webkit-tap-highlight-color: transparent; }
.menu-links a::after { content: "→"; color: var(--faint); font-weight: 400; }
.menu-links a[aria-current="page"] { color: var(--ink); }
.menu-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 980px) { .menu-toggle { display: grid; } }
@media (min-width: 981px) { .menu { display: none !important; } }

/* ---------- Entrances: blur and rise ---------- */
.rise { opacity: 0; }
.ready .rise { animation: rise 1100ms var(--ease-out) calc(var(--d, 0) * 1ms) both; }
.reveal { opacity: 0; }
.reveal.in { animation: rise-soft 1000ms var(--ease-out) calc(var(--d, 0) * 1ms) both; }
@keyframes rise { from { opacity: 0; filter: blur(14px); transform: translateY(22px); } to { opacity: 1; filter: none; transform: none; } }
@keyframes rise-soft { from { opacity: 0; filter: blur(8px); transform: translateY(28px); } to { opacity: 1; filter: none; transform: none; } }
@keyframes enter { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------- Moving between pages ----------
   Same-site page changes cross-fade and the navigation stays put (cross-document view transitions; they need
   the site served over http(s), so open the study through its local server). Later pages of a visit skip
   every intro: content is there with the first frame. */
/* @view-transition is declared in the inline head style (build.mjs), so a page opts in before any sheet arrives. */
.nav { view-transition-name: site-nav; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 240ms; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
.no-intro .rise, .reveal.static, .landed { opacity: 1; animation: none !important; }
.no-intro .kalamos-wordmark.caret-only .kw-part { opacity: 1; }
.no-intro #heroMark .kalamos-wordmark .kw-part { fill: var(--kw-tone); }

/* The loader: the wordmark fills left to right as the page loads (the progress state), turns two-tone and
   flies to the page's own wordmark while the ground fades. It stands at the optical centre rather than the
   middle (build.mjs, painted before this sheet): 42% down a landscape screen, 36% down a tall phone screen,
   where the middle reads low; both are nearer the page wordmark it flies up to. */
.loader { background-color: var(--bg); transition: background-color 700ms var(--ease-snap); }
.loader.leaving { background-color: transparent; }
.loader-mark { width: min(260px, 56vw); color: var(--ink); }
.loader-mark .kalamos-wordmark { overflow: visible; }

/* ---------- Common section type ---------- */
section.block { padding: 150px 0 0; }
h2 { margin: 0; font-weight: 500; font-size: clamp(32px, 3.6vw, 48px); line-height: 1.1; letter-spacing: -.025em; text-wrap: balance; }
.lede { margin: 18px 0 0; font-size: 17px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.center { text-align: center; }
.center .lede { max-width: 620px; margin-inline: auto; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 56px 0 40px; font-size: 14px; margin-top: 150px; }
.closing + footer, .page-end + footer { margin-top: 0; }
.foot { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.foot .brand p { margin: 16px 0 0; color: var(--muted); }
.foot h5 { margin: 0 0 14px; font-size: 14px; font-weight: 600; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; color: var(--muted); }
.foot li a:hover { color: var(--ink); }
.foot-bar { margin-top: 56px; display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 13px; }
.foot-bar .sp { margin-left: auto; }
.round { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }
.round:hover { color: var(--ink); }
.round .icon { width: 16px; height: 16px; }
.round .sun { display: none; }
:root[data-theme="dark"] .round .sun { display: block; }
:root[data-theme="dark"] .round .moon { display: none; }

/* =========================================================================
   Sub-pages. The content comes from the website's own generators, so the
   class names below are theirs; only the look is new.
   ========================================================================= */
.page-hero { padding: 112px 0 0; text-align: center; }
.page-mark { height: 26px; margin-bottom: 30px; }
.page-mark .kw-slot { height: 26px; cursor: default; }
.page-hero h1, .doc-head h1 {
  margin: 0; font-weight: 500; font-size: clamp(40px, 5vw, 68px); line-height: 1.06; letter-spacing: -.03em; text-wrap: balance;
}
.page-hero > p { max-width: 640px; margin: 22px auto 0; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--muted); text-wrap: balance; }

.grid-section {
  width: min(var(--wrap), 100% - 32px); margin: 0 auto; padding-top: 88px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.span-all { grid-column: 1 / -1; }
.grid-section .mono { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); margin: 0; }
.type-xl { font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
.type-lg { font-size: 19px; line-height: 1.55; }
.type-base { font-size: 16px; line-height: 1.65; }
.type-sm { font-size: 14.5px; line-height: 1.6; }
.type-xs { font-size: 12.5px; }
.muted { color: var(--muted); }
.grid-section p { margin: 10px 0 0; }
.grid-section h2.type-xl, .grid-section h3.type-xl { margin: 10px 0 0; font-size: 24px; }

/* Two modes: two cards. */
.path-column { border-radius: 28px; background: var(--card); padding: 40px 40px 36px; display: flex; flex-direction: column; align-items: flex-start; }
.path-column > p:not(.mono) { color: var(--ink-2); line-height: 1.7; }
.path-column .link-soft { margin-top: auto; padding-top: 0; }
.path-column > .link-soft { margin-top: 26px; }
.path-column > p.type-sm { margin-top: 18px; }
.workflow-list { margin: 22px 0 0; width: 100%; display: flex; flex-direction: column; }
.workflow-list > div { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.workflow-list dt { font-weight: 600; font-size: 15px; }
.workflow-list dd { margin: 0; color: var(--muted); font-size: 15px; }
.plain-points, .guide-points { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: pt; display: flex; flex-direction: column; gap: 10px; }
.plain-points li, .guide-points li { position: relative; padding-left: 30px; line-height: 1.65; color: var(--ink-2); }
ol.plain-points li, ol.guide-points li { counter-increment: pt; }
ul.plain-points li::before, ul.guide-points li::before { content: ""; position: absolute; left: 8px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--tone-mos); }
ol.plain-points li::before, ol.guide-points li::before {
  content: counter(pt); position: absolute; left: 0; top: .18em; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font: 600 11px/1 var(--ui); background: var(--solid); color: var(--solid-fg);
}

/* Use cases: two large cards with a live-looking visual. */
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.case-preview { display: flex; flex-direction: column; border-radius: 28px; background: var(--card); overflow: hidden; transition: transform 300ms var(--ease-snap); }
.case-preview:hover { transform: translateY(-3px); }
.case-visual { position: relative; height: 300px; display: grid; place-items: center; padding: 34px; }
.case-arrow { position: absolute; top: 22px; right: 24px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--card-shadow); font-size: 14px; transition: transform 300ms var(--ease-snap); }
.case-preview:hover .case-arrow { transform: translate(2px, -2px); }
.case-notes { width: min(380px, 100%); padding: 22px 24px; border-radius: 18px; background: var(--surface); box-shadow: var(--card-shadow); display: flex; flex-direction: column; gap: 12px; font-family: var(--ui); }
.case-notes p { margin: 0; display: flex; gap: 12px; font-size: 14.5px; color: var(--ink-2); }
.case-num { font: 12px/1.9 var(--mono); color: var(--faint); }
.project-visual { grid-template-rows: auto auto; gap: 22px; align-content: center; }
.case-flow { display: flex; align-items: center; gap: 10px; font: 13px var(--ui); }
.case-flow span { padding: 6px 12px; border-radius: 999px; background: var(--surface); box-shadow: var(--card-shadow); }
.case-flow i { font-style: normal; color: var(--faint); }
.case-chart { display: flex; align-items: flex-end; gap: 10px; height: 110px; width: min(300px, 100%); }
.case-chart i { flex: 1; height: var(--h); border-radius: 6px 6px 2px 2px; background: var(--tone-mos); transform-origin: 50% 100%; }
.reveal.in .case-chart i { animation: bar-grow 800ms var(--ease-out) both; }
.case-chart i:nth-child(2) { animation-delay: 60ms !important; } .case-chart i:nth-child(3) { animation-delay: 120ms !important; }
.case-chart i:nth-child(4) { animation-delay: 180ms !important; } .case-chart i:nth-child(5) { animation-delay: 240ms !important; }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.case-caption { padding: 4px 34px 32px; }
.case-caption > span { display: inline-block; margin-top: 16px; font-weight: 500; font-size: 15px; }

/* Access & usage: three cards. */
.usage-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.usage-list article { border-radius: 28px; background: var(--card); padding: 34px 32px 36px; }
.usage-list article p.type-base { color: var(--ink-2); }
.usage-notes { margin-top: 6px; }
.related-reading { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; margin-top: 30px; }
aside.related-reading { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
aside.related-reading > p { flex-basis: 100%; margin: 0; }
.related-reading-links { display: flex; flex-wrap: wrap; gap: 14px 28px; }

/* Contact. */
.contact-copy { border-radius: 32px; background: var(--card); padding: 56px; text-align: center; }
.contact-copy .contact-email { display: inline-block; margin-top: 14px; font-size: clamp(30px, 4vw, 52px); font-weight: 500; letter-spacing: -.02em; }
.contact-copy .contact-email:hover { opacity: .75; }
.contact-copy > p.type-base { max-width: 480px; margin: 14px auto 0; color: var(--muted); }
.guide-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.contact-copy .guide-links { justify-content: center; }
.support-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.support-columns article { border-radius: 28px; background: var(--card); padding: 36px 36px 34px; }
.support-columns article > .link-soft { display: inline-block; margin-top: 20px; }

/* FAQ page: a question list that opens smoothly. */
.grid-section:has(.faq-list) { grid-template-columns: 1fr 1.4fr; gap: 56px; }
.faq-intro h2 { margin: 0; }
.faq-intro .link-soft { display: inline-block; margin-top: 22px; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { list-style: none; display: flex; align-items: center; gap: 16px; padding: 22px 0; cursor: pointer; font-size: 16.5px; font-weight: 500; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary span:first-child { flex: 1; }
.faq-mark { font-size: 0; position: relative; width: 14px; height: 14px; flex: none; }
.faq-mark::before, .faq-mark::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; margin-top: -.75px; background: var(--ink); border-radius: 1px; transition: transform 300ms var(--ease-snap); }
.faq-mark::after { transform: rotate(90deg); }
details[open] .faq-mark::after { transform: rotate(0deg); }
.faq-list details::details-content { block-size: 0; overflow: hidden; transition: block-size 420ms var(--ease-snap), content-visibility 420ms allow-discrete; }
.faq-list details[open]::details-content { block-size: auto; }
.faq-list details > div { padding: 0 40px 24px 0; }
.faq-list details > div p { margin: 0 0 12px; color: var(--muted); line-height: 1.7; }

/* ---------- Docs: manual, guides, download, data, changelog ---------- */
.doc-head { padding: 104px 0 0; }
.doc-head .page-mark { margin-bottom: 26px; }
.doc-kicker { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.doc-kicker a { color: var(--ink); font-weight: 500; }
.doc-head .lede { max-width: 680px; font-size: 19px; }
.doc-date { margin: 16px 0 0; font-size: 13px; color: var(--faint); }
.doc-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 72px; padding-top: 72px; align-items: start; }
.toc { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.toc .side-label { margin: 0 0 10px; font-size: 12.5px; color: var(--faint); }
.toc > a { padding: 6px 12px; margin-left: -12px; border-radius: 9px; color: var(--muted); transition: color 160ms, background-color 160ms; }
.toc > a:hover { color: var(--ink); }
.toc > a.on { color: var(--ink); background: var(--card); }
.toc .chapters { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.toc .chapters a { padding: 5px 0; color: var(--muted); font-size: 13.5px; }
.toc .chapters a:hover, .toc .chapters a[aria-current="page"] { color: var(--ink); }
.toc .chapters a[aria-current="page"] { font-weight: 600; }
.prose { max-width: 720px; min-width: 0; overflow-wrap: break-word; }
.prose > section { padding-bottom: 56px; scroll-margin-top: 100px; }
.prose > section + section { padding-top: 48px; border-top: 1px solid var(--line); }
.prose h2 { font-size: clamp(26px, 2.4vw, 32px); letter-spacing: -.02em; margin: 0 0 18px; }
.prose h3 { margin: 26px 0 8px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.prose h3.type-xl { font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.prose p { margin: 0 0 14px; font-size: 16.5px; line-height: 1.8; color: var(--ink-2); }
.prose p.type-xs, .prose p.mono { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.prose p.mono { font-family: var(--mono); letter-spacing: .04em; }
.prose .link-soft { display: inline-block; margin: 6px 24px 0 0; }
.prose .guide-points { margin: 16px 0 22px; }
.prose .btn { margin-top: 10px; }
.guide-steps { list-style: none; margin: 20px 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.guide-steps > li { counter-increment: step; position: relative; min-width: 0; border-radius: 22px; background: var(--card); padding: 22px 26px 18px 72px; }
.guide-steps > li::before {
  content: counter(step); position: absolute; left: 22px; top: 22px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font: 600 13px/1 var(--ui); background: var(--solid); color: var(--solid-fg);
}
.guide-steps h3 { margin: 3px 0 6px; font-size: 17px; }
.guide-steps p { margin: 0 0 8px; font-size: 15.5px; line-height: 1.7; }
.guide-steps .guide-code { margin: 12px 0 8px; border-radius: 16px; background: var(--surface); }
.guide-steps .guide-callout { margin: 12px 0 6px; border-radius: 16px; padding: 14px 18px; }
.guide-steps .guide-callout p { margin: 0; font-size: 14.5px; line-height: 1.65; }
.guide-table-hint { display: none; }
.guide-table-wrap { margin: 20px 0 24px; border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line-2); overflow-x: auto; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.6; }
.guide-table th, .guide-table td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.guide-table tr:last-child > * { border-bottom: 0; }
.guide-table thead th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--card); }
.guide-table tbody th { font-weight: 600; color: var(--ink); white-space: nowrap; }
.guide-table td { color: var(--ink-2); }
.guide-callout { margin: 20px 0; border-radius: 20px; background: var(--amber-bg); padding: 18px 22px; }
.guide-callout p { margin: 0; color: var(--ink); font-size: 15.5px; }
.example-brief { margin: 20px 0; border-radius: 20px; background: var(--card); padding: 22px 26px; position: relative; }
.example-brief::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 3px; border-radius: 3px; background: var(--tone-kala); }
.example-brief p { margin: 0; font-size: 16px; color: var(--ink); }
.prose :not(pre) > code {
  font-family: var(--mono); font-size: .86em; padding: 2px 6px; border-radius: 6px;
  background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); overflow-wrap: anywhere;
}
.guide-code {
  margin: 18px 0 24px; border-radius: 20px; background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; min-width: 0;
}
.guide-code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 14px 9px 20px; border-bottom: 1px solid var(--line); background: var(--card-2);
  font: 600 12px/1.4 var(--mono); letter-spacing: .03em; color: var(--muted);
}
.guide-code-head > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-code-copy {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  height: 26px; padding: 0 11px; border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font: 500 12px/1 var(--ui); letter-spacing: 0;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  transition: background-color 160ms var(--ease-snap), color 160ms var(--ease-snap), transform 140ms var(--ease-snap);
}
.guide-code-copy:hover { background: var(--pill-hover); color: var(--ink); }
.guide-code-copy:active { transform: scale(.96); }
.guide-code-copy[data-copied="1"] { background: var(--solid); color: var(--solid-fg); box-shadow: none; }
.guide-code pre {
  margin: 0; padding: 18px 22px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  font: 13.5px/1.68 var(--mono); color: var(--ink); tab-size: 2;
}
.guide-code code { font-family: inherit; font-size: inherit; color: inherit; }
.guide-tabs { margin: 20px 0 26px; min-width: 0; }
.guide-tablist {
  display: flex; align-items: center; gap: 4px; padding: 5px;
  border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; max-width: 100%;
}
.guide-tablist::-webkit-scrollbar { display: none; }
.guide-tab {
  flex: none; height: 34px; padding: 0 14px; border-radius: 10px;
  font: 500 13.5px/1 var(--ui); color: var(--muted); white-space: nowrap;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  transition: background-color 180ms var(--ease-snap), color 180ms var(--ease-snap), box-shadow 180ms var(--ease-snap);
}
.guide-tab:hover { color: var(--ink); }
.guide-tab[aria-selected="true"], .guide-tab.is-active {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgb(20 20 19 / 8%), inset 0 0 0 1px var(--line);
}
.guide-tab:focus-visible, .guide-code-copy:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.guide-tabpanel { margin-top: 12px; min-width: 0; }
.guide-tabpanel[hidden] { display: none; }
.guide-tabpanel > .guide-code:first-child { margin-top: 0; }
.guide-tabpanel > p:first-child { margin-bottom: 10px; font-size: 15px; line-height: 1.65; }
.guide-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 20px; }
.guide-cards:has(> :only-child) { grid-template-columns: 1fr; }
.guide-card { position: relative; display: block; border-radius: 22px; background: var(--card); padding: 24px 56px 24px 26px; transition: background-color 200ms, transform 300ms var(--ease-snap); }
.guide-card:hover { background: var(--card-2); transform: translateY(-2px); }
.guide-card h3 { margin: 0 0 6px; font-size: 19px !important; font-weight: 600 !important; letter-spacing: -.01em; }
.guide-card p { margin: 0; font-size: 14.5px; line-height: 1.6; }
.guide-card > span { position: absolute; top: 22px; right: 22px; color: var(--muted); transition: transform 300ms var(--ease-snap); }
.guide-card:hover > span { transform: translate(2px, -2px); color: var(--ink); }
.manual-pagination { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; padding-top: 28px; border-top: 1px solid var(--line); }
.manual-pagination a { border: 0; font-weight: 500; }
.prose .hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 18px; }

/* Changelog: each release reads as one dated card. */
.release-tag { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 5px 12px 5px 10px; border-radius: 999px; background: var(--card); font: 12.5px var(--mono); color: var(--ink-2); }
.release-tag .kw-slot { height: 11px; }

/* Changelog: each release groups its changes under small labels. */
.change-group { margin-top: 18px; }
.change-group h4 { margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.prose .change-group .guide-points { margin: 8px 0 0; }
.change-group[data-group="added"] li::before { background: var(--tone-mos); }
.change-group[data-group="improved"] li::before { background: var(--tone-kala); }
.change-group[data-group="fixed"] li::before { background: var(--faint); }
.change-group[data-group="notes"] { padding: 14px 18px; border-radius: 16px; background: var(--amber-bg); }
.change-group[data-group="notes"] h4 { color: var(--amber-fg); }
.change-group[data-group="notes"] li::before { background: var(--amber-fg); }

/* Talk to the maker: a grey card with the listening wordmark, and the WeChat QR on a card that stays white in
   both themes. 20px of white keeps a quiet zone of about four modules around the code, so it scans reliably. */
.talk { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 56px; padding: 56px 64px 56px 56px; border-radius: 32px; background: var(--card); }
.talk-mark { height: 22px; margin-bottom: 26px; }
.talk-copy .lede { max-width: 470px; }
.talk-mail { margin: 22px 0 0; font-size: 15px; color: var(--muted); }
.qr { margin: 0; padding: 20px 20px 14px; border-radius: 26px; background: #ffffff; box-shadow: var(--card-shadow); text-align: center; transition: transform 400ms var(--ease-snap), box-shadow 400ms var(--ease-snap); }
.qr:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px rgb(20 20 19 / 8%), 0 24px 48px -18px rgb(40 36 28 / 30%); }
.qr img { display: block; width: 196px; height: 196px; }
.qr figcaption { margin-top: 12px; font: 13px/1.4 var(--ui); color: #77756f; }
.qr .qr-hold { display: none; }
@media (hover: none) { .qr .qr-scan { display: none; } .qr .qr-hold { display: inline; } }
.grid-section > .talk { grid-column: 1 / -1; margin-top: 0; }

/* 404. */
.page-end { padding: 150px 0 160px; text-align: center; }
.page-end .page-mark { height: 64px; }
.page-end .page-mark .kw-slot { height: 64px; }
.page-end h1 { margin: 0; font-weight: 500; font-size: clamp(36px, 4vw, 56px); letter-spacing: -.03em; }
.page-end p { margin: 16px 0 30px; color: var(--muted); font-size: 17px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot .brand { grid-column: 1 / -1; }
  /* minmax(0, 1fr): a long word or a wide table may not stretch the column past the screen. */
  .doc-body { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 48px; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .toc .side-label { flex-basis: 100%; margin-bottom: 2px; }
  .toc > a { margin-left: 0; background: var(--card); }
  .toc .chapters { display: none; }
  .grid-section, .grid-section:has(.faq-list), .usage-list, .support-columns, .case-grid { grid-template-columns: 1fr; gap: 14px; }
  .grid-section:has(.faq-list) { gap: 28px; }
}
@media (max-width: 680px) {
  .talk { grid-template-columns: 1fr; gap: 30px; padding: 34px 28px; border-radius: 26px; }
  .qr { justify-self: center; }
  .nav .wrap { gap: 16px; height: 60px; }
  .nav-right .btn-soft { display: none; }
  section.block { padding-top: 104px; }
  .page-hero { padding-top: 72px; }
  .doc-head { padding-top: 64px; }
  .grid-section { padding-top: 56px; }
  .path-column, .usage-list article, .support-columns article { padding: 30px 26px; border-radius: 24px; }
  .contact-copy { padding: 40px 22px; border-radius: 26px; }
  .case-visual { height: 240px; padding: 22px; }
  .case-caption { padding: 4px 24px 26px; }
  .guide-cards { grid-template-columns: 1fr; }
  .workflow-list > div { grid-template-columns: 80px 1fr; }
  .guide-steps > li { padding: 18px 16px 14px 54px; }
  .guide-steps > li::before { left: 15px; top: 18px; width: 28px; height: 28px; }
  .guide-code-head { padding: 8px 12px 8px 16px; }
  .guide-code pre { padding: 15px 16px; font-size: 12.5px; }
  .guide-tablist { padding: 4px; border-radius: 12px; }
  .guide-tab { height: 32px; padding: 0 12px; font-size: 13px; }
  footer { margin-top: 104px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .reveal { opacity: 1; animation: none !important; }
  .case-chart i { animation: none !important; }
}
