/* Page Patterns: the About, FAQ, help, privacy and terms pages. Same fonts and colours as the app. */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
}

:root {
  --page: #ffffff;
  --panel: #ffffff;
  --soft: #f4f5f7;
  --text: #14171c;
  --muted: #5a6170;
  --line: #e7e9ed;
  --line-strong: #d3d7de;
  --control: #f1f2f5;
  --brand: #0b7f57;
  --brand-hover: #096b49;
  --on-brand: #ffffff;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #111316; --panel: #17191d; --soft: #17191d; --text: #e8eaee; --muted: #a3a9b4; --line: #262a30; --line-strong: #3a3f48;
    --control: #22252b; --brand: #3fcf8e; --brand-hover: #5ad9a0; --on-brand: #08130e; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #111316; --panel: #17191d; --soft: #17191d; --text: #e8eaee; --muted: #a3a9b4; --line: #262a30; --line-strong: #3a3f48;
  --control: #22252b; --brand: #3fcf8e; --brand-hover: #5ad9a0; --on-brand: #08130e; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 17px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 16px; top: -48px; padding: 8px 12px; border-radius: 8px; background: var(--panel); color: var(--text); z-index: 10; }
.skip:focus { top: 12px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ------------------------------------------------------------------ header and footer */

.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.logo:hover { color: var(--text); }
.logo svg { width: 28px; height: 28px; flex: none; }
.site-nav { display: flex; gap: 22px; margin-right: auto; font-size: 15px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px; border-radius: 8px; font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); color: var(--on-brand); }

.site-foot { margin-top: 96px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; padding-top: 28px; padding-bottom: 40px; }
.site-foot p { margin: 0; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--text); }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .site-head .wrap { flex-wrap: wrap; gap: 0 16px; padding-top: 12px; }
  .logo { margin-right: auto; }
  .site-nav { order: 3; width: 100%; margin: 6px 0 10px; }
  body { font-size: 16px; }
}

/* ------------------------------------------------------------------ text */

main { padding-top: 56px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; }
h1 { margin: 0 0 16px; font-size: clamp(32px, 5vw, 46px); font-weight: 650; letter-spacing: -.025em; }
h2 { margin: 56px 0 12px; font-size: 26px; font-weight: 600; }
h3 { margin: 32px 0 8px; font-size: 19px; font-weight: 600; }
p, ul, ol { margin: 0 0 16px; }
li + li { margin-top: 6px; }
.lead { margin-bottom: 32px; color: var(--muted); font-size: 20px; line-height: 1.55; }
.prose { max-width: 720px; }
.muted { color: var(--muted); }
.updated { color: var(--muted); font-size: 15px; }
hr { margin: 48px 0; border: 0; border-top: 1px solid var(--line); }

code, kbd, pre { font-family: var(--mono); font-size: .86em; }
code { padding: 1px 5px; border-radius: 5px; background: var(--control); }
pre { overflow-x: auto; margin: 0 0 20px; padding: 16px 18px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); line-height: 1.55; }
pre code { padding: 0; background: none; font-size: 14px; }
kbd { display: inline-block; min-width: 24px; padding: 0 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; font-size: 13px; line-height: 21px; text-align: center; background: var(--panel); }

table { width: 100%; margin: 0 0 24px; border-collapse: collapse; font-size: 15.5px; }
th, td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
td:first-child { white-space: nowrap; font-weight: 500; }
@media (max-width: 640px) { td:first-child { white-space: normal; } }

.faq dt { margin: 32px 0 8px; font-size: 19px; font-weight: 600; line-height: 1.3; }
.faq dd { margin: 0; }

/* ------------------------------------------------------------------ examples */

.ex { margin: 16px 0 8px; }
.ex-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.ex-row.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ex-row.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ex-item { margin: 0; }
.ex-pic { position: relative; display: block; overflow: hidden; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); line-height: 0; }
.ex-pic img { display: block; width: 100%; height: auto; }
.ex-pic.checker { background: repeating-conic-gradient(#e3e5e9 0 25%, #ffffff 0 50%) 0 0 / 16px 16px; }
.ex-item figcaption { margin-top: 7px; color: var(--muted); font-size: 14px; line-height: 1.35; }
.ex-item figcaption b { color: var(--text); font-weight: 500; }
.ex-text { position: absolute; display: flex; flex-direction: column; justify-content: center; gap: 7%; }
.ex-text i { display: block; height: 11%; min-height: 6px; border-radius: 99px; background: #fff; }
.ex-text i:first-child { width: 100%; height: 15%; }
.ex-text i:nth-child(2) { width: 72%; opacity: .75; }
.ex-text i:nth-child(3) { width: 34%; height: 15%; background: #fff; opacity: .9; }
.ex-text.centre { align-items: center; }
.ex-text.right { align-items: flex-end; }

/* pictures open larger in an overlay (js/zoom.js) */
button.zoom { width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: zoom-in; }
button.ex-pic.zoom:hover, button.ui-shot.zoom:hover { box-shadow: 0 0 0 1px var(--line-strong), 0 2px 10px rgba(0, 0, 0, .08); }

/* pictures of the app's own controls: the one for the page's theme shows */
/* a control is shown at its size in the app, or smaller where the column is narrower, never stretched */
button.ui-shot.zoom { display: block; width: fit-content; max-width: 100%; overflow: hidden; margin-top: 8px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); line-height: 0; }
.ui-shot img { display: block; max-width: 100%; height: auto; }
.ui-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ui-light { display: none !important; }
  :root:not([data-theme="light"]) .ui-dark { display: block !important; }
}
:root[data-theme="dark"] .ui-light { display: none !important; }
:root[data-theme="dark"] .ui-dark { display: block !important; }
.ui-fig { margin: 20px 0 8px; max-width: 360px; }
.ui-fig.wide { max-width: 100%; }
/* two panels side by side where there is room, such as a group and the inspector it opens */
.ui-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 24px; align-items: start; }
.ui-pair .ui-fig { max-width: none; }
.ui-fig figcaption { margin-top: 7px; color: var(--muted); font-size: 14px; line-height: 1.35; }

.zoom-dlg { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; }
.zoom-dlg[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.zoom-dlg::backdrop { background: rgba(10, 12, 16, .92); }
.zoom-stage { display: flex; justify-content: center; align-items: center; max-width: 100%; }
.zoomed { position: relative; display: block; overflow: hidden; border-radius: 10px; line-height: 0; box-shadow: 0 24px 64px rgba(0, 0, 0, .45); }
.zoomed img { display: block; width: 100%; height: auto; }
.zoom-cap { max-width: min(92vw, 720px); margin: 0; font-size: 15px; line-height: 1.45; text-align: center; }
.zoom-close { position: fixed; top: 14px; right: 14px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.zoom-close:hover { background: rgba(255, 255, 255, .24); }
.zoom-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ------------------------------------------------------------------ help layout */

.help { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 56px; }
.help-nav { position: sticky; top: 24px; align-self: start; font-size: 15px; }
.help-nav h2 { margin: 0 0 8px; color: var(--muted); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.help-nav ul { margin: 0; padding: 0; list-style: none; }
.help-nav li + li { margin-top: 2px; }
.help-nav a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.help-nav a:hover { background: var(--control); color: var(--text); }
.help-nav a[aria-current="page"] { background: var(--control); color: var(--text); font-weight: 500; }
.help-main { min-width: 0; max-width: 760px; }
.help-main > h2:first-of-type { margin-top: 40px; }
.where { color: var(--muted); font-size: 15px; }
.next { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15.5px; }
@media (max-width: 860px) {
  .help { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .help-nav { position: static; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
  .help-nav ul { display: flex; flex-wrap: wrap; gap: 4px 6px; }
  .help-nav li + li { margin-top: 0; }
  .help-nav a { margin-left: 0; padding: 4px 10px; background: var(--control); }
}

/* ------------------------------------------------------------------ about */

.hero-ex { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 8px 0 48px; }
.steps { padding-left: 22px; }

/* ---------------------------------------------------------------- account page */

button.btn { border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); font-family: inherit; cursor: pointer; }
button.btn:hover { background: var(--soft); }
button.btn.primary { border-color: transparent; }
.account-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 24px; }
.key-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 12px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--soft); }
.key-box code { padding: 0; background: none; font-size: 16px; word-break: break-all; }
.account-msg { padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--soft); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
