/* Quick-start guide (landing/<lang>/guide/, built by landing/tools/guide-page.mjs).
   Layout: a single reading column; each topic pairs a framed iPhone with its numbered steps. */
:root {
  --bg: #F6F1E4;
  --surface: #FFFBF2;
  --ink: #2A2419;
  --muted: #6E6553;
  --rule: #E3D9C2;
  --olive: #738637;
  --terra: #CB6D49;
  --mark: #D9532F;
  --on-mark: #FFFFFF;
  --kbd: #EFE6D1;
  --device: #1C1B1D;
  --device-edge: #4A4850;
  --display: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --pw: 300px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1A14; --surface: #29241C; --ink: #F3ECDC; --muted: #B5AA93; --rule: #3D3528;
    --olive: #A7BE5C; --terra: #E98C67; --mark: #EE6A45; --kbd: #3A3226; --device: #0E0E10; --device-edge: #5B5862;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1E1A14; --surface: #29241C; --ink: #F3ECDC; --muted: #B5AA93; --rule: #3D3528;
  --olive: #A7BE5C; --terra: #E98C67; --mark: #EE6A45; --kbd: #3A3226; --device: #0E0E10; --device-edge: #5B5862;
  color-scheme: dark;
}
/* Script faces load only on their own pages (langs.mjs LANG_FONTS); they lead the stack there. */
:root[lang="ar"] { --display: "Noto Naskh Arabic", "Hanken Grotesk", sans-serif; --body: "Noto Naskh Arabic", "Hanken Grotesk", sans-serif; }
:root[lang="fa"] { --display: "Vazirmatn", "Hanken Grotesk", sans-serif; --body: "Vazirmatn", "Hanken Grotesk", sans-serif; }
:root[lang="ur"] { --display: "Noto Nastaliq Urdu", "Hanken Grotesk", serif; --body: "Noto Nastaliq Urdu", "Hanken Grotesk", serif; }
:root[lang="ur"] body { line-height: 2.1; }

html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.55; }
img { max-width: 100%; }
.wrap { max-width: 1040px; margin: 0 auto; padding-block: 40px 72px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2 { font-family: var(--display); text-wrap: balance; margin: 0; }
p { margin: 0; }
b { font-weight: 700; }
kbd { font: 700 0.85em var(--body); background: var(--kbd); border-radius: 6px; padding: 0 6px; }

/* Top bar: wordmark and the language menu (a plain <details>, no script). */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.wordmark { font: 900 22px/1 "Hanken Grotesk", sans-serif; letter-spacing: -0.01em; color: inherit; text-decoration: none; direction: ltr; }
.wordmark .g { color: var(--olive); } .wordmark .s { color: var(--terra); }
.langs { position: relative; font-size: 15px; }
.langs summary { cursor: pointer; list-style: none; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; font-weight: 600; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }
.langs ul { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 5; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 12px 32px -12px rgba(40, 30, 10, 0.35); columns: 2; column-gap: 4px; width: max-content; max-width: min(92vw, 420px); }
.langs a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.langs a:hover, .langs a[aria-current] { background: var(--kbd); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: center; padding-block: 28px 48px; border-bottom: 1px solid var(--rule); }
.hero h1 { font-size: clamp(40px, 7vw, 68px); font-weight: 900; line-height: 1.08; letter-spacing: -0.025em; }
.hero .intro { font-size: 19px; color: var(--muted); max-width: 34em; margin-top: 18px; }
.legend { display: flex; align-items: center; gap: 10px; margin-top: 22px; font-size: 15px; color: var(--muted); }
.legend .dot { position: static; transform: none; flex: none; }
.pdf { display: inline-block; margin-top: 16px; font-weight: 700; color: var(--terra); }
.pdf:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }
.toc { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 20px; }
.toc a { display: flex; gap: 10px; align-items: baseline; color: var(--ink); text-decoration: none; padding: 5px 0; border-bottom: 1px solid var(--rule); font-weight: 600; font-size: 15.5px; }
.toc a span { color: var(--terra); font-variant-numeric: tabular-nums; font-weight: 800; min-width: 1.2em; }
.toc a:hover { color: var(--terra); }
.toc a:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }

/* Topics */
.topic { padding-top: 64px; }
.topic-head { display: flex; gap: 18px; align-items: baseline; max-width: 720px; margin-bottom: 32px; }
.num { font: 800 15px/1 "Hanken Grotesk", sans-serif; color: var(--terra); font-variant-numeric: tabular-nums; letter-spacing: 0.06em; flex: none; }
.topic h2 { font-size: clamp(27px, 3.6vw, 36px); font-weight: 800; line-height: 1.2; letter-spacing: -0.015em; }
.lede { color: var(--muted); margin-top: 8px; font-size: 18px; }
.pair { display: grid; grid-template-columns: var(--pw) minmax(0, 1fr); gap: 48px; align-items: center; }
.pair + .pair { margin-top: 48px; }
.explain { min-width: 0; max-width: 34em; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; }
.steps li::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; background: var(--mark); color: var(--on-mark); font: 800 14px/26px "Hanken Grotesk", sans-serif; text-align: center; margin-top: 1px; }

/* iPhone frame. The screen is 393 × 852 points: a 54-point status bar, then the app at 393 × 798.
   The frame keeps left-to-right geometry on every page: callouts sit at measured physical positions
   of the (already mirrored) screenshot. */
.phone { margin: 0; width: var(--pw); max-width: 100%; direction: ltr; }
.bezel { background: var(--device); border-radius: calc(var(--pw) * 0.17); padding: calc(var(--pw) * 0.034); box-shadow: 0 0 0 1.5px var(--device-edge), 0 24px 48px -20px rgba(40, 30, 10, 0.45); }
.screen { container-type: inline-size; position: relative; overflow: hidden; border-radius: calc(var(--pw) * 0.138); background: #F4EEDF; }
.status { aspect-ratio: 393 / 54; position: relative; display: flex; align-items: center; justify-content: space-between; padding: 2.5cqw 7.5cqw 0 9cqw; color: #15130E; background: #F4EEDF; }
.status .time { font: 600 4.3cqw/1 -apple-system, "SF Pro Text", "Hanken Grotesk", sans-serif; letter-spacing: -0.01em; }
.status .island { position: absolute; left: 50%; top: 2.8cqw; width: 31.8cqw; height: 9.4cqw; transform: translateX(-50%); background: #000; border-radius: 99px; }
.status .icons { display: flex; gap: 1.5cqw; align-items: center; }
.status svg { width: auto; height: 3cqw; fill: currentColor; }
.app { position: relative; aspect-ratio: 393 / 798; }
.app img { display: block; width: 100%; height: 100%; }
.home { position: absolute; left: 50%; bottom: 2cqw; width: 34cqw; height: 1.3cqw; border-radius: 99px; background: rgba(0, 0, 0, 0.75); transform: translateX(-50%); }
.mark, .dot { position: absolute; width: 7.6cqw; height: 7.6cqw; transform: translate(-50%, -50%); border-radius: 50%; background: var(--mark); color: var(--on-mark); font: 800 4.2cqw/7.6cqw "Hanken Grotesk", sans-serif; text-align: center; box-shadow: 0 0 0 0.8cqw #fff, 0 1.5cqw 3cqw rgba(0, 0, 0, 0.35); }
.dot { width: 22px; height: 22px; font-size: 12.5px; line-height: 22px; box-shadow: 0 0 0 2px #fff; }

.foot { margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 15px; max-width: 40em; }

@media (max-width: 760px) {
  :root { --pw: min(290px, 78vw); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero .phone { justify-self: center; }
  .pair { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .pair .phone { justify-self: center; }
  .topic { padding-top: 52px; }
  .topic-head { flex-direction: column; gap: 8px; }
}

@media print {
  :root { --pw: 52mm; }
  body { font-size: 11pt; background: #fff; }
  .wrap { padding: 0; max-width: none; }
  .langs, .pdf { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr) auto; break-after: page; border-bottom: 0; }
  .toc { grid-template-columns: 1fr 1fr; }
  .topic { padding-top: 0; break-before: page; }
  .topic-head { margin-bottom: 8mm; }
  .pair { gap: 10mm; break-inside: avoid; }
  .pair + .pair { margin-top: 7mm; }
  .phone { break-inside: avoid; }
  .bezel { box-shadow: none; }
  .foot { break-before: avoid; }
}
@page { size: A4; margin: 14mm 16mm; }
