:root {
  --brand: #ff5a36;
  --brand-ink: #c2381a;
  --bg: #ffffff;
  --surface: #f6f5f3;
  --text: #17171a;
  --muted: #5d5d66;
  --line: #e6e4e0;
  --radius: 14px;
  color-scheme: light dark;
}

/* dark: the system setting, unless the visitor picked light; or the visitor picked dark (theme.js sets data-theme) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-ink: #ff7a5c;
    --bg: #0b0b0d;
    --surface: #17171b;
    --text: #f2f2f4;
    --muted: #a3a3ad;
    --line: #26262c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand-ink: #ff7a5c;
  --bg: #0b0b0d;
  --surface: #17171b;
  --text: #f2f2f4;
  --muted: #a3a3ad;
  --line: #26262c;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--brand-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* header / footer */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; white-space: nowrap; flex-shrink: 0; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-header nav { display: flex; gap: 18px; font-size: 15px; }
.site-header nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--text); }

.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--muted); }

/* documents */
main.doc { padding-top: 40px; }
.doc h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.02em; }
.doc .updated { color: var(--muted); margin: 0 0 28px; font-size: 14px; }
.doc h2 { font-size: 21px; line-height: 1.3; margin: 40px 0 10px; letter-spacing: -0.01em; }
.doc h3 { font-size: 17px; margin: 24px 0 6px; }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; }
.doc li { margin: 4px 0; }
.doc .summary { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 28px; }
.doc .summary p:last-child, .doc .summary ul:last-child { margin-bottom: 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 600; }
.table-scroll { overflow-x: auto; }
.toc { columns: 2; column-gap: 32px; padding-left: 20px; font-size: 15px; }
@media (max-width: 560px) { .toc { columns: 1; } }

/* landing / post */
.hero { text-align: center; padding: 72px 0 24px; }
.hero img.app-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15); }
.hero h1 { font-size: clamp(32px, 7vw, 52px); line-height: 1.1; margin: 24px 0 12px; letter-spacing: -0.03em; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 520px; margin: 0 auto 28px; }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.button.primary { background: var(--brand); color: #fff; }
.button.secondary { background: var(--surface); color: var(--text); }
.soon { color: var(--muted); font-size: 14px; margin-top: 14px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 48px 0 0; }
.feature { background: var(--surface); border-radius: var(--radius); padding: 20px; }
.feature h2 { font-size: 17px; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

@media (max-width: 560px) {
  .site-header nav { gap: 14px; font-size: 14px; }
  .site-header nav .hide-sm { display: none; }
}

/* theme toggle (header): shows the sun in dark mode, the moon in light mode */
.theme-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; transition: background 0.2s, color 0.2s; }
.theme-toggle:hover { background: var(--surface); color: var(--text); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.site-header nav { align-items: center; }

/* official store badges (Apple and Google artwork, unaltered) */
.store-badges { margin-top: 16px; }
.store-badge { display: inline-block; line-height: 0; }
.store-badge img { height: 48px; width: auto; }
