/* Afar Window website. Colours follow marketing/BRAND.md (the app's own palette). */
:root {
  --bg: #F3F1EC;
  --surface: #FBFAF7;
  --line: #E2DED6;
  --text: #1E2326;
  --muted: #6A7075;
  --accent: #3D6A72;
  --accent-soft: #DCE7E6;
  --glow: #ACCDD0;
  --stage: #000;
  --stage-text: #ECE9E3;
  --stage-muted: #9AA1A6;
  --radius: 22px;
  --wide: 1080px;
  --narrow: 720px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141719;
    --surface: #1D2124;
    --line: #2C3236;
    --text: #ECE9E3;
    --muted: #9AA1A6;
    --accent: #8DB5BA;
    --accent-soft: #24363A;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
:lang(zh) body, body:lang(zh) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", sans-serif; }
:lang(ja) body, body:lang(ja) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK JP", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.015em; margin: 0; font-weight: 700; }
:lang(zh) h1, :lang(zh) h2, :lang(ja) h1, :lang(ja) h2 { letter-spacing: 0; line-height: 1.25; }
/* Japanese headings break between phrases (marked with <wbr>), never inside a word. */
:lang(ja) :is(h1, h2, h3, .say) { word-break: keep-all; overflow-wrap: anywhere; }
@supports (word-break: auto-phrase) { :lang(ja) :is(h1, h2, h3, .say) { word-break: auto-phrase; } }
p { margin: 0; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 max(16px, calc((100% - var(--wide)) / 2));
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  font-size: 14px;
}
.brand { display: flex; align-items: center; gap: 8px; color: inherit; font-weight: 600; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.bar nav { display: flex; align-items: center; gap: 22px; }
.bar nav > a { color: inherit; opacity: .82; }
.bar nav > a:hover { opacity: 1; text-decoration: none; }
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; opacity: .82; padding: 4px; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.lang .menu {
  position: absolute; right: 0; top: 34px; min-width: 140px; padding: 6px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px #0003; display: grid;
}
.lang .menu a { color: inherit; padding: 7px 10px; border-radius: 8px; }
.lang .menu a:hover { background: var(--accent-soft); text-decoration: none; }
.lang .menu a[aria-current] { font-weight: 600; }

/* ---------- shared ---------- */
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 16px; }
.eyebrow { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 10px; }
.lead { font-size: clamp(19px, 2.2vw, 22px); line-height: 1.5; color: var(--muted); }
.button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 22px;
  border-radius: 999px; font-size: 17px; font-weight: 500;
  background: var(--accent); color: #fff;
}
.button:hover { text-decoration: none; filter: brightness(1.08); }
.button.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; opacity: .9; }
.button[aria-disabled="true"] { pointer-events: none; opacity: .5; }

/* ---------- plain pages (download, privacy, support, articles) ---------- */
.page { padding-top: 72px; padding-bottom: 96px; }
.page h1 { font-size: clamp(34px, 5vw, 48px); margin-bottom: 18px; }
.page h2 { font-size: 26px; margin: 48px 0 14px; }
.page h3 { font-size: 19px; margin: 28px 0 8px; }
.page [id] { scroll-margin-top: 76px; }
.page p, .page li { color: var(--text); }
.page p + p { margin-top: 14px; }
.page ol, .page ul { padding-left: 1.3em; }
.page li + li { margin-top: 8px; }
.page .meta { color: var(--muted); font-size: 15px; }
.page .intro { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 36em; }
.page-head { display: grid; justify-items: start; gap: 4px; }
.page-head img { width: 88px; height: 88px; border-radius: 20px; margin-bottom: 22px; box-shadow: 0 0 0 1px var(--line), 0 18px 40px -18px #0006; }

/* The two apps, side by side. */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 44px; }
.duo article { border-radius: 22px; padding: 28px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); display: grid; gap: 10px; align-content: start; }
.duo article.here { box-shadow: 0 0 0 1.5px var(--accent); }
.duo .kind { font: 600 12px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.duo h2 { font-size: 26px; margin: 0; }
.duo p { color: var(--muted); font-size: 15px; }
.duo .button { justify-self: start; margin-top: 8px; }
@media (max-width: 680px) { .duo { grid-template-columns: 1fr; } }

/* Numbered steps. */
.steps { list-style: none; padding: 0 !important; margin: 28px 0 0; display: grid; gap: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 52px 1fr; gap: 4px 16px; padding: 22px 0; border-top: 1px solid var(--line); margin: 0 !important; }
.steps li::before { content: counter(step); grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 15px; background: var(--accent-soft); color: var(--accent); }
.steps li.optional::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }
.steps h3 { margin: 4px 0 2px !important; font-size: 19px; }
.steps p { color: var(--muted) !important; }
.steps .tag { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 8px; }

/* Key and value rows. */
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 12px 28px; margin: 20px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }

/* ---------- footer: the mark and name, the places, the languages ---------- */
.foot { border-top: 1px solid var(--line); padding: 48px max(16px, calc((100% - var(--wide)) / 2)) 36px; font-size: 14px; color: var(--muted); background: var(--bg); }
.foot-main { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-bottom: 40px; }
.foot-brand { display: flex; align-items: center; gap: 16px; color: var(--text); }
.foot-brand:hover { text-decoration: none; }
.foot-brand img { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 0 0 1px var(--line); }
.foot-brand strong { display: block; font-size: 20px; }
.foot-brand small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.foot-cols { display: flex; gap: clamp(40px, 8vw, 96px); }
.foot-cols div { display: grid; gap: 10px; align-content: start; }
.foot-cols h2 { font: 600 12px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.foot-cols a { color: var(--text); }
.foot-langs a[aria-current] { color: var(--accent); }
.foot-base { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 20px; font-size: 13px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .bar nav { gap: 16px; }
}
