/* SyncHz site. Tokens follow the app's own (Views/Theme.swift), so the page and
   the screenshots share one palette; the muted text, moss and amber are a step
   darker in light mode to clear WCAG AA on the web. System fonts on purpose: the app is set
   in SF, and no third-party font request stands between a visitor and the page. */

:root {
  --bg: #F5F4F0;
  --card: #FFFFFF;
  --fill: #ECEBE6;
  --line: rgba(28, 27, 24, .10);
  --line-strong: rgba(28, 27, 24, .18);
  --text: #1C1B18;
  --text-2: #5F5C55;
  --text-3: #6E6B64;
  --accent: #646C36;
  --on-accent: #F5F4F0;
  --accent-soft: rgba(100, 108, 54, .12);
  --indigo: #4F6373;
  --key-a: rgba(79, 99, 115, .09);
  --key-b: rgba(79, 99, 115, .17);
  --ok: #33734A;
  --ok-soft: rgba(62, 135, 88, .12);
  --warn: #8F560C;
  --shadow: 0 1px 0 rgba(28, 27, 24, .04), 0 24px 60px -28px rgba(28, 27, 24, .28);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC",
          "Hiragino Sans", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "PingFang SC",
             "Hiragino Sans", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 34rem;
  --page: 72rem;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18181A;
    --card: #222224;
    --fill: #2D2D30;
    --line: rgba(255, 255, 255, .09);
    --line-strong: rgba(255, 255, 255, .16);
    --text: #EDEBE6;
    --text-2: #B3AFA6;
    --text-3: #8E8B83;
    --accent: #B6C07A;
    --on-accent: #18181A;
    --accent-soft: rgba(182, 192, 122, .14);
    --indigo: #8FA3B3;
    --key-a: rgba(143, 163, 179, .10);
    --key-b: rgba(143, 163, 179, .19);
    --ok: #7BCB93;
    --ok-soft: rgba(123, 203, 147, .14);
    --warn: #E8B467;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 30px 70px -30px rgba(0, 0, 0, .7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--display); color: var(--text); }
code { font-family: var(--mono); font-size: .88em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */

.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.brand img { width: 30px; height: 30px; margin: -3px; }
.brand .tag { font-weight: 500; font-size: 13px; color: var(--text-3); letter-spacing: .04em; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 14px; color: var(--text-2); }
.top nav a { text-decoration: none; }
.top nav a:hover { color: var(--text); }
.top .get { padding: 7px 14px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.top .get:hover { color: var(--on-accent); filter: brightness(1.06); }
@media (max-width: 720px) { .top nav .wide { display: none; } }

/* ---------- Hero ---------- */

.hero { padding: clamp(48px, 9vw, 112px) 0 clamp(40px, 6vw, 72px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 920px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } }

.hero h1 {
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -.028em;
  text-wrap: balance;
}
/* Chinese breaks only at the space, the comma and the <wbr>, never inside 采样率. */
:lang(zh) .hero h1 { font-size: clamp(30px, 4vw, 48px); letter-spacing: 0; line-height: 1.2; word-break: keep-all; text-wrap: wrap; }
.hero .lede { margin-top: 24px; max-width: var(--measure); font-size: clamp(17px, 1.6vw, 19px); color: var(--text-2); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 20px; border-radius: 10px;
  font-weight: 600; font-size: 16px; text-decoration: none;
  border: 1px solid var(--line-strong); color: var(--text); background: var(--card);
  transition: transform .12s ease, filter .2s ease;
}
.button:active { transform: scale(.98); }
.button.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.button.primary:hover { filter: brightness(1.06); }
.button svg { width: 18px; height: 18px; flex: none; }
.fine { margin-top: 16px; font-size: 14px; color: var(--text-3); }

/* The readout: the app's signal card, live. */
.readout {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(18px, 2.4vw, 26px);
  box-shadow: var(--shadow);
  container-type: inline-size;
}
.readout-head { display: flex; align-items: center; gap: 12px; min-height: 28px; }
.readout-track { min-width: 0; flex: 1; font-size: 15px; line-height: 1.3; }
.readout-track b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-track span { color: var(--text-2); font-size: 13px; }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 600;
  color: var(--ok); background: var(--ok-soft);
  transition: color .3s ease, background-color .3s ease;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.readout[data-state="switching"] .pill { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }

.rates { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; margin-top: 22px; }
.side { display: flex; flex-direction: column; }
.side.out { align-items: flex-end; text-align: right; }
.side small { font-size: 13px; color: var(--text-3); margin-bottom: 2px; }
.rate { display: flex; align-items: baseline; gap: 6px; font-family: var(--display); font-variant-numeric: tabular-nums; }
/* Sized to the card so 176.4 → 176.4 always fits: two readouts, the arrow and
   the gaps take 5 number-widths plus ~140px. */
.rate .num { font-size: 44px; font-size: clamp(28px, calc(19cqi - 28px), 68px); font-weight: 650; letter-spacing: -.03em; line-height: 1; }
.rate .unit { font-size: 17px; color: var(--text-2); }
.side.out .num { transition: opacity .25s ease; }
.readout[data-state="switching"] .side.out .num { opacity: .35; }

.flow { width: 56px; height: 20px; margin-bottom: .2em; color: var(--ok); }
@container (min-width: 460px) { .flow { width: 80px; } }
.flow .track { stroke: currentColor; opacity: .28; }
.flow .dots { stroke: currentColor; stroke-dasharray: 0 14; stroke-dashoffset: 0; animation: flow 1.1s linear infinite; }
.readout[data-state="switching"] .flow { color: var(--warn); }
@keyframes flow { to { stroke-dashoffset: -14; } }

.format { margin-top: 14px; font-size: 14px; color: var(--text-2); }
.format .eq { float: right; color: var(--text-3); }

/* Six rates as piano keys, alternating shades like the app's spectrum. */
.keys { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); margin: 20px 0 0; padding: 0; }
.keys li:first-child { border-radius: 8px 0 0 8px; }
.keys li:last-child { border-radius: 0 8px 8px 0; }
.keys li {
  position: relative;
  padding: 34px 0 8px; text-align: center;
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-3);
  background: var(--key-a);
  transition: background-color .35s ease, color .35s ease;
}
.keys li:nth-child(even) { background: var(--key-b); }
.keys li.src { color: var(--text); }
.keys li.src::after {
  content: ""; position: absolute; left: 50%; top: 10px; width: 8px; height: 8px; margin-left: -4px;
  border-radius: 50%; border: 1.5px solid var(--accent);
}
.keys li.out { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.keys li.out::after { border-color: var(--on-accent); background: var(--on-accent); }

/* ---------- Product shot ---------- */

.shot { padding: 0 0 clamp(64px, 9vw, 120px); }
.shot picture img {
  margin: 0 auto;
  width: 811px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.shot figcaption { margin: 16px auto 0; max-width: 40rem; text-align: center; font-size: 14px; color: var(--text-3); }

/* ---------- Sections ---------- */

.section { padding: clamp(64px, 9vw, 112px) 0; border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; font-weight: 700; letter-spacing: -.025em; max-width: 18ch; text-wrap: balance; }
:lang(zh) .section h2 { letter-spacing: 0; line-height: 1.2; }
.section .intro { margin-top: 18px; max-width: var(--measure); color: var(--text-2); font-size: 18px; }

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 72px); margin-top: 48px; }
@media (max-width: 820px) { .duo { grid-template-columns: 1fr; } }
.duo h3 { font-size: 22px; font-weight: 650; letter-spacing: -.015em; }
.duo p { margin-top: 10px; color: var(--text-2); max-width: var(--measure); }
.facts { list-style: none; margin: 20px 0 0; padding: 0; border-top: 1px solid var(--line); }
.facts li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--text-2); }
.facts b { color: var(--text); font-weight: 600; }

/* Workbench notes: a narrow label column and a reading column. */
.note { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: clamp(20px, 5vw, 72px); margin-top: 56px; }
.note + .note { padding-top: 56px; border-top: 1px solid var(--line); }
@media (max-width: 820px) { .note { grid-template-columns: 1fr; } }
.note h3 { font-size: 21px; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
.note .body > p { max-width: 38rem; color: var(--text-2); }
.note .body > p + p { margin-top: 14px; }
.note .body p b { color: var(--text); font-weight: 600; }

.bars { margin: 28px 0 8px; max-width: 38rem; display: grid; gap: 14px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; font-size: 14px; }
.bar .name { color: var(--text-2); }
.bar .name code { color: var(--text); }
.bar .value { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar .meter { grid-column: 1 / -1; height: 10px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.bar .meter i { display: block; height: 100%; min-width: 3px; border-radius: 3px; background: var(--text-3); }
.bar.ours .meter i { background: var(--accent); }
.bar.bad .name { color: var(--warn); }
.bars + p { font-size: 15px; }

.ticks { list-style: none; margin: 18px 0 0; padding: 0; max-width: 38rem; }
.ticks li { position: relative; padding: 0 0 12px 22px; color: var(--text-2); font-size: 15.5px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--key-b); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ticks b { color: var(--text); font-weight: 600; }

/* Languages */
.langs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); margin-top: 44px; }
.langs figure { margin: 0; }
.langs img { border-radius: 10px; border: 1px solid var(--line); }
.langs figcaption { margin-top: 10px; font-size: 14px; color: var(--text-3); }
.langlist { margin-top: 28px; color: var(--text-2); font-size: 15px; max-width: 46rem; }
@media (max-width: 640px) { .langs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .langs figure:nth-child(3) { display: none; } }

/* Install */
.steps { list-style: none; counter-reset: step; margin: 44px 0 0; padding: 0; display: grid; gap: 0; max-width: 46rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.steps li:first-child { border-top: 1px solid var(--line); }
.steps li::before { content: counter(step); font-family: var(--display); font-weight: 650; font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.2; }
.steps h3 { font-size: 18px; font-weight: 600; }
.steps p { margin-top: 4px; color: var(--text-2); font-size: 15.5px; }
.code { position: relative; margin-top: 12px; display: flex; align-items: center; gap: 8px; background: var(--fill); border-radius: 8px; padding: 10px 10px 10px 14px; }
.code code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 13.5px; }
.copy { flex: none; font: 600 13px/1 var(--sans); padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); cursor: pointer; }
.copy[data-done] { color: var(--ok); }

/* FAQ */
.faq { margin-top: 40px; max-width: 46rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 32px 18px 0; position: relative; font-weight: 600; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details p { padding: 0 0 18px; color: var(--text-2); font-size: 15.5px; max-width: 40rem; }

/* Footer */
.foot { padding: 48px 0 64px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-3); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between; }
.foot p { max-width: 36rem; }
.foot nav { display: flex; gap: 20px; }

@media (prefers-reduced-motion: reduce) {
  .flow .dots { animation: none; }
  .keys li, .pill, .side.out .num { transition: none; }
  .button { transition: none; }
}
