/* The app guides (/guides/<app>/) and the guides list (/guides/). One light design for every guide; each app brings its
   accents as a few tokens in its own <style> (see kit/template/guide/index.html and kit/GUIDE.md):

     --app        the app's dark colour: the hero band, headings' marks, links      (Murmur: dusk purple)
     --app-2      a second stop for the hero gradient                                (Murmur: mauve)
     --app-3      a third, lighter stop at the bottom of the hero                    (Murmur: dusk peach)
     --app-ink    text on the hero band
     --c1 … --c8  the app's section colours (Murmur: its six tab colours), used as chips and section marks

   Paper, ink, type and layout are fixed here so every guide reads the same. Lexend is shared with the homepage. */

@font-face { font-family: "Lexend"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/lexend-300.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/lexend-500.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/lexend-700.woff2") format("woff2"); }

:root {
  /* fixed: the paper */
  --paper: #faf8f4;
  --paper-2: #f2eee7;          /* wells, table heads */
  --card: #ffffff;
  --ink: #1c1922;              /* 16:1 on paper */
  --body: #3b3743;             /* 10:1 */
  --muted: #625d6b;            /* 6.2:1 */
  --line: rgba(28, 25, 34, 0.10);
  --line-2: rgba(28, 25, 34, 0.18);
  --radius: 14px;
  --radius-lg: 22px;
  --gutter: clamp(16px, 4vw, 40px);
  --toc-w: 220px;
  --measure: 920px;
  --top-h: 60px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* per app: defaults, overridden in each guide */
  --app: #03495e;
  --app-2: #036a7e;
  --app-3: #45d49a;
  --app-ink: #f4f8f8;
  --c1: #45d49a; --c2: #94cbff; --c3: #ffe08e; --c4: #ffb883; --c5: #cdb0ff; --c6: #ff9090; --c7: #a3e3b4; --c8: #f2c6e0;
  --link: color-mix(in srgb, var(--app) 82%, black);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 20px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--body);
  font-family: "Lexend", system-ui, sans-serif; font-weight: 300; font-size: 17px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
:focus-visible { outline: 2px solid var(--app); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; height: auto; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.g-top {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  display: flex; align-items: center; gap: 14px; padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.g-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; white-space: nowrap; }
.g-crumbs a { color: var(--muted); text-decoration: none; }
.g-crumbs a:hover { color: var(--ink); }
.g-crumbs .brand { font-weight: 700; letter-spacing: -0.04em; font-size: 19px; color: var(--ink); }
.g-crumbs .sep { color: var(--line-2); }
.g-crumbs .here { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.g-top .sp { flex: 1; }
.g-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 99px;
  font: 500 14px/1 "Lexend", system-ui, sans-serif; text-decoration: none; white-space: nowrap; cursor: pointer;
  background: var(--app); color: var(--app-ink); border: 1px solid transparent;
  transition: transform .2s var(--ease), background .2s;
}
.g-btn:hover { background: color-mix(in srgb, var(--app) 86%, white); }
.g-btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.g-btn.ghost:hover { background: var(--card); }
.g-btn svg { width: 14px; height: 14px; flex: none; }
.g-toc-btn { display: none; }

/* ---------- hero: the app's colours, the one dark moment on the page ---------- */
.g-hero {
  position: relative; overflow: hidden; color: var(--app-ink);
  background: linear-gradient(160deg, var(--app) 0%, var(--app-2) 70%, var(--app-3) 140%);
  padding: clamp(28px, 4.5vw, 56px) var(--gutter);
}
.g-hero-in {
  max-width: 1240px; margin: 0 auto; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 56px);
}
.g-hero h1 { margin: 0; font-weight: 700; font-size: clamp(34px, 5vw, 56px); line-height: 1; letter-spacing: -0.045em; color: var(--app-ink); }
.g-hero .lede { margin: 18px 0 0; max-width: 34ch; font-size: clamp(17px, 1.8vw, 20px); line-height: 1.55; color: color-mix(in srgb, var(--app-ink) 88%, transparent); }
.g-hero-shot { margin: 0; }
.g-hero-shot img { border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 24px 60px rgba(0, 0, 0, .35); }

/* ---------- layout: contents + article ---------- */
.g-layout {
  max-width: 1320px; margin: 0 auto; padding: clamp(36px, 5vw, 64px) var(--gutter) 40px;
  display: grid; grid-template-columns: var(--toc-w) minmax(0, var(--measure)); gap: clamp(32px, 5vw, 72px); justify-content: center;
}
.g-toc { position: sticky; top: calc(var(--top-h) + 24px); align-self: start; max-height: calc(100vh - var(--top-h) - 48px); overflow: auto; padding: 6px 6px 20px; margin: -6px 0 0 -6px; font-size: 14.5px; line-height: 1.4; }
.g-toc h2 { margin: 0 0 10px; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.g-toc ol { list-style: none; margin: 0; padding: 0; }
.g-toc li { margin: 0; }
.g-toc a { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.g-toc a:hover { color: var(--ink); background: var(--paper-2); }
.g-toc a.on { color: var(--ink); font-weight: 500; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.g-toc ol ol a { padding-left: 22px; font-size: 14px; }
.g-toc .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--line-2)); flex: none; }
.g-toc .grp { margin: 16px 0 4px 10px; font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* find: jump to any control or topic */
.g-find { position: relative; margin-bottom: 18px; }
.g-find input {
  width: 100%; height: 40px; padding: 0 12px 0 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card);
  font: 300 15px "Lexend", system-ui, sans-serif; color: var(--ink);
}
.g-find input::placeholder { color: var(--muted); }
.g-find svg { position: absolute; left: 12px; top: 13px; width: 14px; height: 14px; color: var(--muted); }
.g-find kbd { position: absolute; right: 10px; top: 10px; }
.g-hits { position: absolute; left: 0; right: 0; top: 46px; z-index: 5; margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px rgba(28, 25, 34, .14); max-height: 320px; overflow: auto; }
.g-hits[hidden] { display: none; }
.g-hits a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.g-hits a small { display: block; color: var(--muted); font-size: 12.5px; }
.g-hits a.on, .g-hits a:hover { background: var(--paper-2); }
.g-hits .none { padding: 8px 10px; color: var(--muted); font-size: 14px; }

/* ---------- article type ---------- */
.g-doc { min-width: 0; }
.g-doc > section { padding-bottom: 24px; }
.g-doc > section + section { margin-top: 36px; padding-top: 40px; border-top: 1px solid var(--line); }
.g-doc h2 { position: relative; margin: 0; font-weight: 700; font-size: clamp(27px, 3.4vw, 34px); line-height: 1.15; letter-spacing: -0.035em; color: var(--ink); }
.g-doc h3 { margin: 36px 0 0; font-weight: 500; font-size: 20px; line-height: 1.3; letter-spacing: -0.015em; color: var(--ink); }
.g-doc h4 { margin: 24px 0 0; font-weight: 500; font-size: 16px; color: var(--ink); }
.g-doc p, .g-doc ul, .g-doc ol, .g-doc dl, .g-doc table, .g-doc figure, .g-doc details { margin: 14px 0 0; }
.g-doc .intro { font-size: 19px; line-height: 1.6; color: var(--ink); margin-top: 12px; }
.g-doc ul, .g-doc ol { padding-left: 1.25em; }
.g-doc li + li { margin-top: 6px; }
.g-doc strong, .g-doc b { font-weight: 500; color: var(--ink); }
.g-doc a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: color-mix(in srgb, var(--app) 40%, transparent); }
.g-doc a:hover { text-decoration-color: currentColor; }
.g-doc hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.anchor { position: absolute; left: -1.1em; top: 0; padding-right: .3em; color: var(--line-2); text-decoration: none !important; opacity: 0; font-weight: 300; }
h2:hover .anchor, h3:hover .anchor, .ctl:hover .anchor, .anchor:focus { opacity: 1; }
h3 { position: relative; }

kbd {
  display: inline-block; min-width: 1.7em; padding: 1px 6px; border-radius: 6px; text-align: center;
  font: 500 .8em/1.5 "Lexend", system-ui, sans-serif; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-2); box-shadow: 0 1px 0 var(--line-2);
}
/* a word exactly as the app shows it (a button, a tab, a value) */
.ui { font-weight: 500; color: var(--ink); white-space: nowrap; }
.ui::before, .ui::after { content: ""; }

/* chips: a tab or section, in its colour */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 99px; white-space: nowrap;
  font-size: .86em; font-weight: 500; color: var(--ink); background: color-mix(in srgb, var(--c, var(--c1)) 42%, white);
  border: 1px solid color-mix(in srgb, var(--c, var(--c1)) 70%, black 6%);
}
.badge { display: inline-block; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; letter-spacing: .04em; vertical-align: .12em; color: var(--muted); background: var(--paper-2); border: 1px solid var(--line); }
.badge.ipad { color: #12415a; background: #e3f1fb; border-color: #bcdcf1; }
.badge.web { color: #4a3a12; background: #fbf1d8; border-color: #ecd9a6; }

/* section mark: a reference chapter carries its colour */
.g-doc section[data-c] > h2::before { content: ""; display: block; width: 44px; height: 6px; border-radius: 3px; background: var(--c); margin-bottom: 16px; }
.g-doc section[data-c] > h2 .chip { font-size: 15px; vertical-align: .3em; margin-left: 10px; letter-spacing: 0; }

/* ---------- steps ---------- */
.steps { list-style: none; padding: 0 !important; counter-reset: s; display: grid; gap: 12px; }
.steps > li { counter-increment: s; position: relative; margin: 0 !important; padding: 16px 18px 16px 62px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.steps > li::before {
  content: counter(s); position: absolute; left: 16px; top: 15px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--app-ink); background: var(--app);
}
.steps > li > b:first-child { display: block; color: var(--ink); }

/* ---------- callouts ---------- */
.note {
  margin-top: 20px; padding: 16px 20px; border-radius: var(--radius); font-size: 15.5px; line-height: 1.6;
  background: color-mix(in srgb, var(--c, var(--app)) 12%, var(--paper));
}
.note > :first-child { margin-top: 0; }
.note .lbl { display: block; font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.note.tip { --c: var(--c3); }
.note.ipad { --c: #62a8d6; }
.note.warn { --c: #e07a5f; }

/* ---------- controls: one card per control ---------- */
.ctls { display: grid; gap: 0; margin-top: 18px !important; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.ctl { position: relative; padding: 15px 20px 16px; scroll-margin-top: calc(var(--top-h) + 20px); }
.ctl + .ctl { border-top: 1px solid var(--line); }
.ctl > .k { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0; font-weight: 500; color: var(--ink); line-height: 1.45; }
.ctl > .k .anchor { left: auto; right: 100%; top: 0; }
.ctl > .k small { margin-left: auto; font-weight: 300; font-size: 13px; line-height: 1.45; color: var(--muted); text-align: right; }
.ctl > .v { margin: 4px 0 0; font-size: 16px; line-height: 1.6; }
.ctl > .v p { margin: 0; }
.ctl > .v p + p, .ctl > .v ul + p, .ctl > .v p + ul { margin-top: 8px; }
.ctl > .v ul { margin: 6px 0 0; }
.ctl > .v .tip { display: block; margin-top: 8px; font-size: 14.5px; color: var(--muted); }
.ctl > .v .tip::before { content: "Tip: "; font-weight: 500; color: var(--ink); white-space: pre; }
.ctl:target, .ctl.flash { background: color-mix(in srgb, var(--c, var(--c3)) 18%, white); }
.ctls h4 { margin: 0; padding: 12px 20px 10px; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); background: var(--paper-2); border-top: 1px solid var(--line); }
.ctls h4:first-child { border-top: 0; }

/* ---------- figures ---------- */
figure { margin: 22px 0 0; }
.shot { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; width: 100%; }
.shot img { border-radius: var(--radius); background: var(--app); box-shadow: 0 1px 2px rgba(28, 25, 34, .12), 0 12px 30px rgba(28, 25, 34, .12); }
figure.narrow { max-width: 440px; }
figure.phone { max-width: 300px; }
/* a tab: control cards beside its screenshot, which stays in view while you read down the cards */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; margin-top: 22px; }
.pair > .ctls { margin-top: 0 !important; }
.pair > figure { margin: 0; position: sticky; top: calc(var(--top-h) + 20px); }
.pair > figure img { max-height: calc(100vh - var(--top-h) - 60px); width: auto; margin: 0 auto; }
.clear { clear: both; }
figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.fig-row { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; align-items: start; }
.fig-row figure { margin-top: 0; }
.fig-row .shot img { aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.art { padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.art svg { display: block; width: 100%; height: auto; }

/* an annotated screenshot: numbered markers over the image, each linked to its explanation */
.map { position: relative; }
.map .pin {
  position: absolute; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font: 700 12px/1 "Lexend", system-ui, sans-serif; color: var(--ink); text-decoration: none !important;
  background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--c3)) 85%, white), 0 4px 14px rgba(0, 0, 0, .35);
  transition: transform .2s var(--ease);
}
.map .pin:hover, .map .pin:focus { transform: translate(-50%, -50%) scale(1.15); }
.legend { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 28px; counter-reset: l; }
.legend > li { counter-increment: l; position: relative; padding-left: 38px; margin: 0 !important; padding-block: 6px; font-size: 15.5px; line-height: 1.55; }
.legend > li::before {
  content: counter(l); position: absolute; left: 0; top: 7px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: var(--ink); background: color-mix(in srgb, var(--c, var(--c3)) 55%, white);
}
.legend b { color: var(--ink); }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15.5px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 10px 16px; border-top: 1px solid var(--line); }
.tbl thead th { border-top: 0; background: var(--paper-2); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tbl td:first-child { white-space: nowrap; color: var(--ink); width: 34%; }
.tbl-wrap { overflow-x: auto; }

/* ---------- questions ---------- */
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
details + details { margin-top: 0 !important; }
summary { cursor: pointer; list-style: none; padding: 16px 40px 16px 0; position: relative; font-weight: 500; color: var(--ink); line-height: 1.45; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 13px; font-size: 22px; font-weight: 300; color: var(--muted); transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details > :not(summary) { margin: 0 40px 0 0; font-size: 16px; }
details > :last-child { padding-bottom: 18px; }
details > p + p { margin-top: 10px; }
details + p { margin-top: 24px !important; }

/* recipes */
.recipes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.recipe { padding: 18px 20px 20px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.recipe h3 { margin: 0; font-size: 18px; }
.recipe p { font-size: 15px; margin-top: 6px !important; }
.recipe ol { font-size: 15px; margin-top: 10px !important; padding-left: 1.15em; }
.recipe li + li { margin-top: 4px; }

/* ---------- footer ---------- */
.g-foot { border-top: 1px solid var(--line); margin-top: 40px; }
.g-foot-in { max-width: 1180px; margin: 0 auto; padding: 28px var(--gutter) 44px; display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; font-size: 13.5px; color: var(--muted); }
.g-foot a { color: inherit; }
.g-foot p { margin: 0; }

/* ---------- the guides list (/guides/) ---------- */
.g-list { max-width: 1180px; margin: 0 auto; padding: clamp(28px, 4vw, 48px) var(--gutter) 40px; }
.g-list ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.g-card { display: grid; grid-template-rows: auto 1fr; height: 100%; border-radius: var(--radius-lg); overflow: hidden; background: var(--card); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: transform .3s var(--ease), box-shadow .3s; }
a.g-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(28, 25, 34, .12); }
.g-card .pic { aspect-ratio: 16 / 10; background: var(--app); overflow: hidden; }
.g-card .pic img { width: 100%; height: 100%; object-fit: cover; }
.g-card .txt { padding: 16px 18px 18px; }
.g-card h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.g-card p { margin: 4px 0 0; font-size: 15px; line-height: 1.5; }
.g-card .state { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 500; color: var(--link); }
.g-card.soon { opacity: .72; }
.g-card.soon .pic img { filter: grayscale(.5); }
.g-card.soon .state { color: var(--muted); }

/* ---------- lightbox ---------- */
.g-lb { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 3vmin; background: rgba(16, 14, 20, .86); cursor: zoom-out; }
.g-lb[hidden] { display: none; }
.g-lb img { max-width: 100%; max-height: 100%; width: auto; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }

/* ---------- small screens: the contents become a sheet ---------- */
@media (max-width: 960px) {
  .pair { grid-template-columns: minmax(0, 1fr); }
  .pair > figure { position: static; order: -1; max-width: 240px; }
  .g-layout { grid-template-columns: minmax(0, 1fr); }
  .g-toc-btn { display: inline-flex; }
  .g-toc {
    position: fixed; z-index: 30; top: var(--top-h); left: 0; right: 0; bottom: 0; max-height: none; padding: 20px var(--gutter) 40px;
    background: var(--paper); border-top: 1px solid var(--line); transform: translateY(8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .25s var(--ease), visibility 0s .25s;
  }
  body.toc-open { overflow: hidden; }
  body.toc-open .g-toc { opacity: 1; transform: none; visibility: visible; transition: opacity .2s, transform .25s var(--ease); }
  .anchor { display: none; }
}
@media (max-width: 760px) {
  .g-hero-in { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .g-crumbs .brand, .g-crumbs .sep:first-of-type { display: none; }
  .g-top .g-btn.open-app span { display: none; }
  .ctl { padding: 14px 16px; }
  .tbl td:first-child { white-space: normal; }
}

@media print {
  .g-top, .g-toc, .anchor, .g-lb { display: none !important; }
  .g-layout { display: block; padding: 0; }
  .g-hero { background: none; color: var(--ink); padding: 0; }
  .g-hero h1, .g-hero .lede { color: var(--ink); }
  details { break-inside: avoid; } details > * { display: block !important; }
  .ctl, figure, .note { break-inside: avoid; }
}
