/* FigSync sub-pages: /ios/support and /ios/privacy (the App Store support and privacy URLs).
   The same ground, ink, type and controls as the home page (landing/styles.css): warm paper or night, Geist, the
   footer's mono labels. Both pages are bilingual; /page-lang.js picks the language and theme from the keys the home
   page writes (figsync-language, figsync-theme) and otherwise follows the browser and the system. */

/* Fonts and tokens: /tokens.css, loaded before this file (the same file the home page loads). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--hdr) + 24px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-width: 320px; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--ground); color: var(--ink); font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow-x: hidden;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(a, button, summary, [tabindex]):focus { outline: none; }
:where(a, button, summary):focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
main:focus-visible { outline: none; }
::selection { background: rgba(255, 168, 0, .3); }

.pg-wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.pg-skip { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--ground); font-size: 14px; transition: top .2s; }
.pg-skip:focus { top: 12px; }

/* ---------- header: the home page's bar, always on paper ---------- */
.pg-hdr {
  position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px);
  background: var(--ground-90); -webkit-backdrop-filter: saturate(1.4) blur(18px); backdrop-filter: saturate(1.4) blur(18px);
  box-shadow: 0 1px 0 var(--rule);
}
.pg-hdr-in { height: var(--hdr); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-family: "Archivo Black", "Geist", system-ui, sans-serif; font-size: 18px; line-height: 1; letter-spacing: -.01em; color: var(--ink); }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.pg-hdr-end { display: flex; align-items: center; gap: 12px; }
.pg-nav { display: flex; align-items: center; gap: 2px; }
.pg-nav a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; white-space: nowrap; border-radius: 999px; font-size: 15px; font-weight: 450; letter-spacing: -.01em; color: var(--ink-2); transition: background-color .2s, color .2s; }
.pg-nav a:hover { color: var(--ink); background: var(--surface-2); }
.pg-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); font-weight: 500; }

/* the language switch: the pricing section's billing switch, small */
.pg-lang { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.pg-lang button { position: relative; min-width: 52px; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: background-color .2s var(--ease), color .2s; }
/* the hit area reaches 44px above and below the 32px pill (the review pages' touch-target floor) */
.pg-lang button::after { content: ""; position: absolute; inset: -6px 0; }
.pg-lang button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(40, 30, 15, .1); }

/* ---------- page head ---------- */
.pg-head { padding: clamp(56px, 8vw, 112px) 0 clamp(40px, 5vw, 64px); }
/* Chinese titles break only between phrases (the home page does the same) */
:lang(zh-Hans) :is(.pg-title, .doc-body h2) { word-break: keep-all; overflow-wrap: anywhere; }
.pg-title { max-width: 18ch; font-size: clamp(32px, .9rem + 1.8vw, 44px); line-height: 1.12; font-weight: 500; letter-spacing: -.04em; text-wrap: balance; }
.pg-lede { margin-top: 20px; max-width: 60ch; font-size: clamp(17px, 1rem + .2vw, 19px); line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.pg-meta { margin-top: 20px; font: 400 12.5px/20px var(--mono); color: var(--ink-3); }
/* Chinese dates read badly in a monospace face: set them in the text face */
:lang(zh-Hans) .pg-meta { font-family: var(--font); font-size: 13.5px; letter-spacing: 0; }

/* ---------- document: contents left, text right (the FAQ grid) ---------- */
.doc { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 5vw, 96px); align-items: start; padding-bottom: clamp(80px, 9vw, 140px); }
.doc-toc { position: sticky; top: calc(var(--hdr) + 32px); }
.doc-toc h2, .doc-index summary { font: 400 13px/20px var(--mono); color: var(--ink-3); }
.doc-toc ol { margin-top: 6px; display: flex; flex-direction: column; }
.doc-toc a { display: flex; align-items: center; min-height: 44px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); transition: color .2s; }
.doc-toc a:hover { color: var(--ink); }
.doc-index { display: none; margin-bottom: 8px; border-radius: 18px; background: var(--surface-2); }
.doc-index summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 18px; cursor: pointer; list-style: none; }
.doc-index summary::-webkit-details-marker { display: none; }
.doc-index summary::after { content: ""; width: 12px; height: 12px; background: linear-gradient(currentColor, currentColor) 50% / 12px 1.5px no-repeat, linear-gradient(currentColor, currentColor) 50% / 1.5px 12px no-repeat; transition: transform .35s var(--ease); }
.doc-index[open] summary::after { transform: rotate(135deg); }
.doc-index ol { padding: 0 18px 12px; }
.doc-index a { display: flex; align-items: center; min-height: 44px; font-size: 15px; color: var(--ink-2); }

.doc-body { min-width: 0; }
/* long text keeps a readable measure; the summary card and the contents keep the column width */
.doc-body :is(h2, h3, p, li) { max-width: 66ch; }
:lang(zh-Hans) .doc-body :is(h2, h3, p, li) { max-width: 40em; }
.doc-body section { padding: 32px 0 36px; box-shadow: inset 0 -1px 0 var(--rule); }
.doc-body > section:first-of-type { padding-top: 0; }
.doc-body section:last-child { box-shadow: none; }
.doc-body h2 { font-size: clamp(21px, 1rem + .5vw, 25px); line-height: 1.25; font-weight: 500; letter-spacing: -.02em; color: var(--ink); }
.doc-body h3 { margin-top: 26px; font-size: 17px; line-height: 1.4; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.doc-body p, .doc-body li { font-size: 17px; line-height: 28px; color: var(--ink-2); }
.doc-body h2 + p, .doc-body h2 + ul, .doc-body h2 + ol { margin-top: 14px; }
.doc-body h3 + p { margin-top: 6px; }
.doc-body p + p, .doc-body ul + p, .doc-body p + ul, .doc-body ol + p { margin-top: 14px; }
.doc-body ul > li, .doc-body ol > li { position: relative; padding-left: 22px; }
.doc-body li + li { margin-top: 8px; }
.doc-body ul > li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.doc-body ol { counter-reset: step; }
.doc-body ol > li { counter-increment: step; padding-left: 30px; }
.doc-body ol > li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: .2em; font: 400 12.5px/1.6 var(--mono); color: var(--ink-3); }
.doc-body strong { font-weight: 600; color: var(--ink); }
.doc-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; overflow-wrap: anywhere; }
.doc-body a:hover { text-decoration-color: currentColor; }
/* the summary up top: a paper card, like the plan cards */
.doc-body .doc-summary { margin-bottom: 8px; padding: clamp(22px, 3vw, 32px); border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--rule); }
.doc-body .doc-summary + section { padding-top: 32px; }
.doc-body > section.doc-summary:first-of-type { padding-top: clamp(22px, 3vw, 32px); }

/* ---------- footer: the home page's mono labels ---------- */
.pg-foot { padding: clamp(32px, 4vw, 56px) 0 clamp(48px, 5vw, 80px); box-shadow: inset 0 1px 0 var(--rule); }
.pg-foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.pg-foot nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.pg-foot nav a { display: inline-flex; align-items: center; min-height: 40px; font-size: 15px; color: var(--ink-2); transition: color .2s; }
.pg-foot nav a:hover { color: var(--ink); }
.pg-foot small { width: 100%; font: 400 12.5px/20px var(--mono); color: var(--ink-3); }

/* bilingual pages: one language at a time */
[data-lang] { display: none; }
html[lang="en"] [data-lang="en"], html[lang="zh-Hans"] [data-lang="zh-Hans"] { display: revert; }
html[lang="en"] span[data-lang="en"], html[lang="zh-Hans"] span[data-lang="zh-Hans"] { display: inline; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .doc-toc { display: none; }
  .doc-index { display: block; }
}
@media (max-width: 600px) {
  .pg-hdr-end { gap: 6px; }
  .pg-nav a { padding: 0 10px; font-size: 14.5px; }
}
@media (max-width: 380px) {
  .pg-hdr-in { gap: 8px; }
  .pg-lang button { min-width: 42px; padding: 0 9px; }
  .doc-body .doc-summary, .doc-body > section.doc-summary:first-of-type { padding: 20px 16px; }
  .pg-nav a { padding: 0 8px; }
}
