/*
 * LoopHouse website — on the App's design system (2026-11-11, founder: 「官网风格也按照我们新的 app 风格给改造一下」).
 *
 * The :root blocks below MIRROR packages/app/src/renderer/src/styles/01-tokens.css — same names, same values,
 * light in :root, dark in the prefers-color-scheme block (the App's :root[data-theme='dark']). The site can't
 * import App files, so the subset it needs is copied here: when a value changes there, change it here in the
 * same PR. scripts/test/site-styles-check.mjs compares the two files and fails on any drift.
 *
 * Rules (design/ui/SYSTEM.md, the same law as the App):
 *  - every declaration outside :root reads tokens only — sizes, weights, spacing, radii, colours, shadows,
 *    durations. No raw px font-size, no #hex / rgb(numbers), no raw radius (the check enforces it).
 *  - ink and paper: primary buttons are ink (--accent-fill + --on-accent); the quiet blue --focus is only for
 *    focus rings and text links; hairlines (--line) draw blocks, never a hairline AND a shadow.
 *  - eyebrows are sentence case at --fs-caption / --fw-medium — no all-caps tracking.
 *
 * Site-only tokens (marked `site-only` where they are declared — the check requires the mark):
 *  - --fs-hero / --lh-hero: ONE display step above the App's 22, for the home page headline only. A marketing
 *    hero is read across a room, at 1440 wide 22 px reads like a dialog title; 40 is the smallest size that
 *    still leads the page. Everything else uses the App's six steps.
 *  - --sp-16 / --sp-20: two page-rhythm steps on the same 4pt grid (section and hero padding). An App window
 *    never needs more than 48; a long page needs air between sections.
 *  - --site-col / --prose-col / --touch: layout widths (the page column, a reading column, the 44 px hit area).
 *  - --brand-discord / --brand-telegram: the channels' own logo colours (the App writes them guard-ok).
 *
 * Font: the App's system stack (--sans: SF Pro on a Mac). The Manrope webfont is gone — the site and the App
 * should read as one product, and the App's own welcome screen sets the wordmark in --font-round, so the
 * site's brand face is that, too. Body reading text is --fs-message (15, the App's reading size); chrome
 * (nav, footer, meta) is --fs-body (13).
 */

/* ---------- tokens: light (mirrors the App's :root) ---------- */

:root {
  --bg0: #ffffff;
  --bg1: #fafaf9;
  --bg2: #ffffff;
  --bg3: #f3f3f2;
  --sel: rgb(var(--ink) / 6%);
  --hov: rgb(var(--ink) / 4%);
  --fill: #f3f3f2;

  --line: rgb(var(--ink) / 8%);
  --line-strong: rgb(var(--ink) / 14%);
  --shadow-pop: 0 12px 32px rgb(0 0 0 / 8%);
  --pop-border: var(--line);

  --text: #151515;
  --text-2: #525252;
  --text-muted: #737373;
  --text-faint: #a3a3a3;

  --accent: #151515;
  --accent-strong: #000000;
  --accent-fill: #151515;
  --accent-tint: rgb(var(--accent-ch) / 10%);
  --tint-border: rgb(var(--accent-ch) / 24%);
  --on-accent: #ffffff;

  --focus: #2f6fe0;
  --focus-tint: rgb(var(--focus-ch) / 10%);
  --focus-ring: rgb(var(--focus-ch) / 32%);

  --ink: 21 21 21;
  --accent-ch: var(--ink);
  --focus-ch: 47 111 224;

  color-scheme: light;

  --radius-xs: 6px;
  --radius-s: 8px;
  --radius-row: 10px;
  --radius-m: 12px;
  --radius-l: 14px;
  --radius-pill: 999px;

  --fs-caption: 11px;
  --fs-small: 12px;
  --fs-body: 13px;
  --fs-title-s: 15px;
  --fs-message: 15px;
  --fs-title: 17px;
  --fs-display: 22px;
  --lh-caption: 1.45;
  --lh-small: 1.5;
  --lh-body: 1.55;
  --lh-title-s: 1.4;
  --lh-message: 1.5;
  --lh-title: 1.35;
  --lh-display: 1.3;
  --fs-glyph-m: 14px;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;

  --sp-0-5: 2px;
  --sp-1: 4px;
  --sp-1-5: 6px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --font-round: ui-rounded, -apple-system, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 120ms;
  --dur-2: 180ms;
  --dur-3: 260ms;

  --ls-tight: -0.02em;
  --ls-code: 0.04em;

  --content-col: 860px;
  --gutter: var(--sp-6);

  --z-sticky: 10;
  --z-dropdown: 40;

  /* site-only (see the header) */
  --fs-hero: 40px; /* site-only: the home hero headline, one step above --fs-display */
  --lh-hero: 1.15; /* site-only: the hero's line height */
  --sp-16: 64px; /* site-only: page rhythm, section padding */
  --sp-20: 80px; /* site-only: page rhythm, hero padding */
  --site-col: 1080px; /* site-only: the page column */
  --shot-col: 1120px; /* site-only: the App screenshot under the hero, a little wider than the page column */
  --prose-col: 680px; /* site-only: a reading column (privacy, 404, community, section heads) */
  --touch: 44px; /* site-only: the touch minimum every link and button clears */
  --brand-discord: #5865f2; /* site-only: Discord's own logo colour */
  --brand-telegram: #26a5e4; /* site-only: Telegram's own logo colour */
}

/* ---------- the same house at night (mirrors the App's :root[data-theme='dark']) ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bg0: #1a1a1a;
    --bg1: #1f1f1f;
    --bg2: #242424;
    --bg3: #2c2c2c;
    --fill: #2c2c2c;
    --line: rgb(236 236 236 / 9%);
    --line-strong: rgb(236 236 236 / 16%);
    --shadow-pop: 0 12px 32px rgb(0 0 0 / 45%);
    --pop-border: var(--line-strong);
    --text: #ececec;
    --text-2: #b4b4b4;
    --text-muted: #8f8f8f;
    --text-faint: #707070;
    --accent: #ececec;
    --accent-strong: #ffffff;
    --accent-fill: #ececec;
    --on-accent: #151515;
    --focus: #6c9cff;
    --ink: 236 236 236;
    --focus-ch: 108 156 255;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* a short page (404, community) still ends in the footer's --bg1, not in a white strip under it */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-message);
  font-weight: var(--fw-regular);
  line-height: var(--lh-message);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--focus-tint);
}

/* text links are the quiet blue (the App's .md a) */
a {
  color: var(--focus);
  text-decoration: none;
  transition: color var(--dur-1) var(--ease-out);
}

a:hover {
  text-decoration: underline;
}

img,
svg {
  max-width: 100%;
}

/* the App's focus blue, drawn solid: a public page needs the ring at 3:1 against every ground (the App's 32 %
   --focus-ring wash is 1.6:1 on white), so the site uses --focus itself, offset off the edge */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.wrap {
  width: 100%;
  max-width: var(--site-col);
  margin: 0 auto;
  padding-inline: clamp(var(--sp-5), 5vw, var(--sp-10));
}

/* Keyboard users get past the header in one tab. Visible only on focus. */
.skip {
  position: absolute;
  left: var(--sp-3);
  top: var(--sp-3);
  z-index: var(--z-dropdown);
  transform: translateY(-200%);
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 var(--sp-4);
  border-radius: var(--radius-s);
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
}

.skip:focus {
  transform: translateY(0);
  color: var(--on-accent);
  text-decoration: none;
}

/* The vendor-mark <symbol> sprite must never take layout space. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg0);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: var(--sp-1);
  min-height: var(--sp-16);
}

/* the wordmark, set the way the App's welcome screen sets it (.welcome-brand) */
.brand {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  color: var(--text);
  font-family: var(--font-round);
  font-size: var(--fs-title);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand-loop {
  color: var(--accent);
}

/* LoopHouse's mark before the wordmark (founder 11-12; the drawing is assets/logo/house-eyes.svg, the same three
   elements as the App's / web's HouseMark — `node scripts/make-logo.mjs --check`): paper tile + hairline, ink house */
.brand {
  gap: var(--sp-2);
}

.house-mark {
  flex: none;
  display: block;
}

.house-mark-tile {
  fill: var(--bg0);
  stroke: var(--line-strong);
  stroke-width: 1;
}

.house-mark-line {
  fill: none;
  stroke: var(--text);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.house-mark-eye {
  fill: var(--text);
}

/* the home page's hero opens with the mark where the small grey 「LoopHouse」 was (founder 11-12 09:56) */
.hero-mark {
  margin: 0 auto var(--sp-4);
}

.nav-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-3) var(--sp-1);
}

/* Every header control clears the 44px touch minimum: the visual box is 32 tall (the same key as Download)
   and ::before stretches the hit area 6px above and below. */
.nav-link,
.nav-cta {
  position: relative;
}

.nav-link::before,
.nav-cta::before {
  content: '';
  position: absolute;
  inset: calc(var(--sp-1-5) * -1) 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--sp-8);
  padding-inline: var(--sp-3);
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  transition:
    color var(--dur-1) var(--ease-out),
    background var(--dur-1) var(--ease-out);
}

.nav-link:hover {
  color: var(--text);
  background: var(--hov);
  text-decoration: none;
}

/* the page you are on: ink label + aria-current in the markup */
.nav-link[aria-current='page'] {
  color: var(--text);
  background: var(--sel);
}

/* the App's primary button: solid ink, white glyphs, --radius-s */
.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: var(--sp-8);
  margin-left: var(--sp-2);
  padding: 0 var(--sp-3);
  border-radius: var(--radius-s);
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  transition: opacity var(--dur-1) var(--ease-out);
}

.nav-cta:hover {
  color: var(--on-accent);
  opacity: 0.9;
  text-decoration: none;
}

/* ---------- sections ---------- */

main {
  display: block;
  flex: 1 0 auto;
}

.section {
  padding-block: clamp(var(--sp-12), 7vw, var(--sp-16));
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: var(--prose-col);
}

/* the App's eyebrow: caption, medium, sentence case, no tracking */
.eyebrow,
.band-label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  line-height: var(--lh-caption);
  color: var(--text-muted);
}

h1,
h2,
h3 {
  letter-spacing: var(--ls-tight);
}

h2 {
  margin-top: var(--sp-2);
  font-size: var(--fs-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-display);
}

.sec-line {
  margin-top: var(--sp-2);
  color: var(--text-2);
}

/* ---------- hero ---------- */

.hero {
  padding-top: clamp(var(--sp-12), 8vw, var(--sp-20));
  padding-bottom: clamp(var(--sp-10), 6vw, var(--sp-16));
  text-align: center;
}

.hero h1 {
  max-width: 22em;
  margin: var(--sp-3) auto 0;
  font-size: clamp(var(--fs-display), 6.4vw, var(--fs-hero));
  font-weight: var(--fw-semibold);
  line-height: var(--lh-hero);
  text-wrap: balance;
}

/* Clause units: the headline may wrap BETWEEN clauses, never inside one.
   LOO-67: three sentences, one per line where the width allows. */
.hero h1 .seg {
  display: inline-block;
}

.cta-row {
  display: flex;
  align-items: center; /* the arch text-link must sit on the button's centerline */
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-8);
}

/* a secondary key beside the two-line primary takes its height, so the pair shares top and bottom edges */
.cta-row .btn-2 {
  align-self: stretch;
}

/* LOO-87: shown by site.js to an Intel visitor while x64 builds are paused */
.cta-arch-note {
  margin-top: var(--sp-3);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-2);
}

.cta-note {
  margin-top: var(--sp-4);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--text-muted);
}

/* the Web beta line under the hero's download buttons — quiet, the app stays the main ask */
.cta-web {
  margin-top: var(--sp-2);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

/* ---------- buttons: the App's .btn — ink primary, quiet --fill secondary, --radius-s ---------- */

.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--sp-12);
  padding: var(--sp-1-5) var(--sp-6);
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font-size: var(--fs-message);
  font-weight: var(--fw-medium);
  line-height: var(--lh-small);
  transition:
    background var(--dur-1) var(--ease-out),
    opacity var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    transform var(--dur-1) var(--ease-out);
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-fill);
  color: var(--on-accent);
}

.btn-primary:hover {
  opacity: 0.9;
  color: var(--on-accent);
}

/* V21 .b2: a secondary button is a quiet fill, no outline */
.btn-2 {
  background: var(--fill);
  color: var(--text);
}

/* a --sel wash over the resting fill: one step darker by day, one lighter at night (a --line ground alone
   comes out the same grey as --fill in the dark) */
.btn-2:hover {
  background: linear-gradient(var(--sel), var(--sel)), var(--fill);
  color: var(--text);
}

.btn-chip {
  font-size: var(--fs-caption);
  font-weight: var(--fw-regular);
  line-height: var(--lh-caption);
  opacity: 0.7;
}

/* Pressed feedback — the click lands before the download starts. */
@media (prefers-reduced-motion: no-preference) {
  .btn:active,
  .nav-cta:active,
  .comm-item:active,
  .chan-btn:active {
    transform: translateY(1px);
  }
}

/* ---------- the App, under the hero ---------- */

/* a floating surface in the design system's sense: --shadow-pop + the --pop-border hairline, --radius-l.
   Wider than the page column on a desktop; on a phone it runs nearly edge to edge. */
.app-shot {
  max-width: var(--shot-col);
  margin: 0 auto;
  padding: 0 clamp(var(--sp-3), 4vw, var(--sp-10)) clamp(var(--sp-12), 7vw, var(--sp-16));
}

.app-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--pop-border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-pop);
}

/* ---------- vendor band ---------- */

.band {
  border-top: 1px solid var(--line);
  background: var(--bg1);
  padding-block: var(--sp-5);
}

.band .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-6);
}

.hm {
  width: 22px;
  height: 22px;
  fill: var(--text-2);
}

.cm {
  width: 18px;
  height: 18px;
  fill: var(--text-2);
}

/* ---------- recent changes ---------- */

.changes {
  margin-top: var(--sp-6);
  border-top: 1px solid var(--line);
}

.change-row {
  display: grid;
  grid-template-columns: 96px 132px 1fr;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-5);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--line);
}

.change-ver {
  font-family: var(--mono);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--text);
}

.change-date {
  font-size: var(--fs-body);
  color: var(--text-muted);
}

.change-text {
  color: var(--text-2);
}

.changes-more {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  margin-top: var(--sp-2);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
}

/* ---------- community entries (home) ---------- */

.chan-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  max-width: var(--prose-col);
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

/* a card in the page: --bg2 + hairline + --radius-m, no shadow */
.chan-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--sp-16);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  font-size: var(--fs-message);
  font-weight: var(--fw-medium);
  transition:
    background var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    transform var(--dur-1) var(--ease-out);
}

.chan-btn:hover {
  background: var(--bg3);
  border-color: var(--line-strong);
  color: var(--text);
  text-decoration: none;
}

.chan-btn .cm {
  width: 22px;
  height: 22px;
  flex: none;
}

.cm-discord {
  fill: var(--brand-discord);
}

.cm-telegram {
  fill: var(--brand-telegram);
}

/* ---------- closing ---------- */

.closing {
  text-align: center;
}

.closing .cta-row {
  justify-content: center;
}

/* ---------- U1: three steps after a download click (#install) ---------- */

.install-steps {
  display: grid;
  gap: var(--sp-3);
  max-width: var(--prose-col);
  margin-top: var(--sp-6);
  padding: 0;
  list-style: none;
  counter-reset: install;
}

.install-steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-5) var(--sp-4) var(--sp-12);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg2);
  counter-increment: install;
}

/* the App's count badge: ink disc, paper numeral, caption / medium */
.install-steps li::before {
  content: counter(install);
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg0);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  line-height: 1;
}

.install-steps strong {
  font-weight: var(--fw-medium);
}

.install-steps span {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-2);
}

.install-next {
  margin-top: var(--sp-4);
  color: var(--text-2);
}

#install-title:focus {
  outline: none;
}

/* .install-steps sets display: grid, which would beat the hidden attribute (an Intel Mac saw the steps beside the note) */
#install [hidden] {
  display: none;
}

/* ---------- footer ---------- */

footer {
  padding-block: var(--sp-8) var(--sp-12);
  border-top: 1px solid var(--line);
  background: var(--bg1);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-muted);
}

.foot-tag {
  color: var(--text-2);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--sp-4);
  margin-top: var(--sp-2);
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  color: var(--text-muted);
}

.foot-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.foot-copy {
  margin-top: var(--sp-0-5);
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* ---------- page titles (privacy, 404, changelog, community) ---------- */

.prose h1,
.cl-head h1,
.community-page h1 {
  font-size: var(--fs-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-display);
}

/* ---------- prose pages (privacy, 404) ---------- */

.prose {
  max-width: var(--site-col);
  padding-block: clamp(var(--sp-10), 6vw, var(--sp-16)) var(--sp-16);
}

.prose .lede {
  margin-top: var(--sp-3);
  font-size: var(--fs-title);
  line-height: var(--lh-body);
  color: var(--text-2);
}

.prose h2 {
  margin-top: var(--sp-10);
  font-size: var(--fs-title);
  line-height: var(--lh-title);
}

.prose h3 {
  margin-top: var(--sp-6);
  font-size: var(--fs-title-s);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-title-s);
}

.prose p {
  margin-top: var(--sp-3);
  color: var(--text-2);
}

.prose ul {
  margin-top: var(--sp-3);
  padding-left: var(--sp-5);
}

.prose li {
  margin-top: var(--sp-2);
  color: var(--text-2);
}

.prose li::marker {
  color: var(--text-faint);
}

.prose li strong {
  font-weight: var(--fw-medium);
  color: var(--text);
}

.prose .meta {
  margin-top: var(--sp-10);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-muted);
}

/* Every page shares the index's left edge (the wordmark's): main is the full page column, and the reading
   width is set on its children, so a narrower column never re-centres the title. */
.prose > *,
.community-page > * {
  max-width: var(--prose-col);
}

.changelog > * {
  max-width: var(--content-col);
}

.notfound {
  text-align: center;
}

.notfound > * {
  margin-inline: auto;
}

.notfound .cta-row {
  justify-content: center;
}

/* ---------- changelog ---------- */

.changelog {
  max-width: var(--site-col);
  padding-block: clamp(var(--sp-10), 6vw, var(--sp-16)) var(--sp-16);
}

.cl-sub {
  margin-top: var(--sp-3);
  color: var(--text-2);
}

.cl-list {
  margin-top: var(--sp-8);
  list-style: none;
}

/* Each release: a date rail on the left, the changes on the right. */
.cl-entry {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: var(--sp-3) var(--sp-8);
  padding: var(--sp-6) 0;
  border-top: 1px solid var(--line);
}

.cl-entry:first-child {
  border-top: none;
  padding-top: var(--sp-1);
}

.cl-meta {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.cl-version {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-title);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-title);
  color: var(--text);
}

/* a tinted chip: --accent-tint ground, --tint-border hairline (the App's one 「tinted chip」) */
.cl-badge {
  padding: 0 var(--sp-2);
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  border: 1px solid var(--tint-border);
  color: var(--text);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  line-height: var(--lh-caption);
  letter-spacing: 0;
}

.cl-date {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-muted);
}

.cl-changes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.cl-changes li {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  color: var(--text-2);
}

/* One width for all four tags, so the prose column has a single left edge
   whether the row says New, Fixed, Improved or Note. Tags are --radius-xs, sentence case. */
.cl-tag {
  flex-shrink: 0;
  min-width: 72px;
  padding: 0 var(--sp-2);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  text-align: center;
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  line-height: var(--lh-small);
}

/* 四档标签不借状态色(状态色铁律:红/琥珀/绿/蓝语义唯一)——用形状区分:
   New=墨色浅染+线,Improved=发丝线描边,Fixed=墨色浅洗,Note=发丝虚线描边。 */
.cl-tag.new {
  background: var(--accent-tint);
  border-color: var(--tint-border);
  color: var(--text);
}

.cl-tag.improved {
  border-color: var(--line-strong);
  color: var(--text-2);
}

.cl-tag.fixed {
  background: var(--sel);
  color: var(--text-2);
}

.cl-tag.note {
  border: 1px dashed var(--text-faint);
  color: var(--text-2);
}

/* ---------- community page ---------- */

.community-page {
  max-width: var(--site-col);
  padding-block: clamp(var(--sp-10), 6vw, var(--sp-16)) var(--sp-16);
}

.community-lead {
  margin-top: var(--sp-3);
  color: var(--text-2);
}

.community-items {
  margin-top: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* a card in the page: --bg2 + hairline + --radius-m, no shadow */
.comm-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: var(--sp-16);
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  color: var(--text);
  transition:
    border-color var(--dur-1) var(--ease-out),
    background var(--dur-1) var(--ease-out),
    transform var(--dur-1) var(--ease-out);
}

.comm-item:hover {
  border-color: var(--line-strong);
  background: var(--bg3);
  color: var(--text);
  text-decoration: none;
}

.comm-icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: currentColor;
}

.comm-icon-discord {
  color: var(--brand-discord);
}

.comm-icon-telegram {
  color: var(--brand-telegram);
}

.comm-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-0-5);
}

.comm-name {
  font-size: var(--fs-title-s);
  font-weight: var(--fw-medium);
  line-height: var(--lh-title-s);
  color: var(--text);
}

.comm-sub {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-muted);
}

/* lucide arrow-up-right, 16 (a lone icon), muted until the card is hovered */
.comm-arrow {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--text-muted);
  transition: color var(--dur-1) var(--ease-out);
}

.comm-item:hover .comm-arrow {
  color: var(--text-2);
}

/* ---------- scroll reveals (JS adds html.js; visible without it) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(var(--sp-2));
    transition:
      opacity var(--dur-3) var(--ease-out),
      transform var(--dur-3) var(--ease-out);
  }

  .js .reveal.in {
    opacity: 1;
    transform: none;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .chan-row {
    grid-template-columns: 1fr;
  }

  .change-row {
    grid-template-columns: auto 1fr;
    gap: var(--sp-0-5) var(--sp-3);
  }

  .change-text {
    grid-column: 1 / -1;
  }

  .cl-entry {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
  }

  /* on a phone the tag runs in at the start of its line, so an item stays one paragraph, not a chip row + text */
  .cl-changes li {
    display: block;
  }

  .cl-tag {
    display: inline-block;
    min-width: 0;
    margin-right: var(--sp-2);
    vertical-align: baseline;
  }

  .cl-meta {
    flex-direction: row;
    align-items: baseline;
    gap: var(--sp-3);
  }

  /* the label takes its own row, so the marks stay on one */
  .band-label {
    flex-basis: 100%;
    text-align: center;
  }

  .band .wrap {
    gap: var(--sp-2) var(--sp-5);
  }
}

@media (max-width: 420px) {
  .nav-link {
    padding-inline: var(--sp-2);
  }
}

/* phones: the changelog link steps back to the footer so the header keeps to one row */
@media (max-width: 480px) {
  .nav-link[href='/changelog'] {
    display: none;
  }

  /* stacked keys share one width */
  .cta-row > .btn {
    width: 100%;
  }
}

/* ---------------------------------------------------------------------------
   Download CTA — arch detection. site.js marks the row `arch-known` and one
   button `arch-match`; any other shrinks to a quiet text link (still
   clickable — detection can be wrong under Rosetta). No JS: the buttons as
   written, which is also the correct fallback on non-Macs. While x64 builds
   are paused (LOO-87) there is one arch button; these rules come back into
   play when the Intel button does.
   --------------------------------------------------------------------------- */

.cta-row.arch-known .btn.arch-match {
  order: -1;
}

.cta-row.arch-known .btn[data-arch]:not(.arch-match) {
  /* a quiet text link that still clears the 44px touch minimum */
  min-height: var(--touch);
  padding: var(--sp-1) var(--sp-3);
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
}

.cta-row.arch-known .btn[data-arch]:not(.arch-match):hover {
  color: var(--text);
  text-decoration: underline;
}

/* Collapsed: the arch chip becomes the whole label, so the quiet link reads
   "Intel Mac" rather than a second, identical "Download for macOS". */
.cta-row.arch-known .btn[data-arch]:not(.arch-match) .btn-label {
  display: none;
}

.cta-row.arch-known .btn[data-arch]:not(.arch-match) .btn-chip {
  font-size: var(--fs-body);
  opacity: 1;
}

/* =====================================================================================================
   v2 (老板 11-25: 「像 usemagpie.ai 那样现代、完成度高」) — a left-aligned two-column hero with a two-tone
   headline, chips for the harnesses, a quiet meta line; the nav gets small bordered icon buttons; sections
   read as bordered cards with small centred eyebrows. Preview only (staging site) until signed off.
   ===================================================================================================== */
:root {
  --fs-hero2: 60px; /* site-only: v2 hero */
  --hero2-gap: 56px; /* site-only */
}

.brand { font-size: var(--fs-title); gap: var(--sp-2); }
.brand-mark .house-mark-line { stroke-width: 2.6; }

.nav { background: color-mix(in srgb, var(--bg0) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.nav-right { gap: var(--sp-1); }
.nav-link { color: var(--text-muted); padding-inline: var(--sp-2-5, 10px); }
.nav-sep { width: 1px; height: var(--sp-4); background: var(--line); margin-inline: var(--sp-2); }
.nav-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--sp-8); height: var(--sp-8);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  color: var(--text-2);
  transition: color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
}
.nav-icon svg { width: 15px; height: 15px; fill: currentColor; }
.nav-icon:hover { color: var(--text); border-color: var(--line-strong); background: var(--hov); text-decoration: none; }
.nav-cta { margin-left: var(--sp-2); }

/* hero */
.hero2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: var(--hero2-gap);
  align-items: center;
  padding-block: var(--sp-20) var(--sp-16);
}
.hero2 h1 {
  margin: 0;
  font-size: var(--fs-hero2);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: var(--fw-semibold);
  color: var(--text);
  text-wrap: balance;
}
.hero2 h1 .dim { color: var(--text-faint); }
.hero2-lead {
  margin: var(--sp-5, 20px) 0 0;
  max-width: 34em;
  font-size: var(--fs-message);
  line-height: 1.6;
  color: var(--text-2);
}
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-5, 20px); }
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-1-5);
  height: 28px; padding-inline: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--bg1);
  font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--text);
}
.chip-mark { width: 13px; height: 13px; fill: currentColor; }
.hero2-cta { justify-content: flex-start; margin-top: var(--sp-6); gap: var(--sp-2); }
.btn2 {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  height: 40px; padding-inline: var(--sp-4);
  border-radius: var(--radius-s);
  font-size: var(--fs-body); font-weight: var(--fw-semibold);
  transition: background var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), opacity var(--dur-1) var(--ease-out);
}
.btn2:hover { text-decoration: none; }
.btn2-primary { background: var(--accent-fill); color: var(--on-accent); }
.btn2-primary:hover { opacity: 0.88; color: var(--on-accent); }
.btn2-ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn2-ghost:hover { background: var(--hov); color: var(--text); }
.btn-apple { width: 15px; height: 15px; fill: currentColor; margin-top: -2px; }
.hero2-meta { margin: var(--sp-3) 0 0; font-size: var(--fs-small); color: var(--text-muted); }
.hero2-meta a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.hero2-shot {
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--bg2);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 45%);
}
.hero2-shot img { display: block; width: 100%; height: auto; }
@media (max-width: 900px) {
  .hero2 { grid-template-columns: 1fr; padding-block: var(--sp-12) var(--sp-10); }
  :root { --fs-hero2: 42px; }
}

/* the harness band → a centred eyebrow over chips-like marks */
.band { background: none; border: 0; }
.band .wrap { flex-direction: column; gap: var(--sp-3); }
.eyebrow, .band-label {
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: var(--fs-caption); color: var(--text-muted);
}
.section-head { text-align: left; }

/* changes → one bordered card, rows divided, an arrow at the end */
.changes { border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: var(--bg1); }
.change-row { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); margin: 0; }
.change-row:last-child { border-bottom: 0; }
.change-ver { font-family: var(--mono, ui-monospace, monospace); }

/* community buttons read as cards */
.chan-btn { border: 1px solid var(--line); background: var(--bg1); border-radius: var(--radius-m); }
.hero2 h1 .dim { color: var(--text-muted); }
.btn2-sm { height: 32px; padding-inline: var(--sp-3); font-size: var(--fs-small); font-weight: var(--fw-medium); }
.section-head-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.section-head-row h2 { margin: 0; }
.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.feat { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--bg1); padding: var(--sp-5, 20px); }
.feat h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-message); font-weight: var(--fw-semibold); color: var(--text); }
.feat p { margin: 0; font-size: var(--fs-body); line-height: 1.6; color: var(--text-2); }
@media (max-width: 900px) { .feats { grid-template-columns: 1fr; } }
.section-head:has(.section-head-row) { max-width: none; }
.feats { margin-top: var(--sp-2); }
