/*
 * One stylesheet, no framework, no build step. The whole site is three pages of
 * text whose job is to still be readable in five years and to load before an
 * App Store reviewer loses patience.
 *
 * No web fonts: a font file is another request, another thing that can 404, and
 * another origin to allow in the Content-Security-Policy. The system stack is
 * already the font the reader's OS uses everywhere else.
 */

:root {
  --bg: #fdfdfc;
  --fg: #1c1b19;
  --muted: #5f5c57;
  --rule: #e0ddd6;
  --link: #1a5490;
  --accent: #7a4a1e;
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --fg: #e8e5df;
    --muted: #a19d95;
    --rule: #33312d;
    --link: #8ab4e8;
    --accent: #d8a06a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 1.25rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* One column, centred, capped at a comfortable measure. Everything else in this
   file is a variation on that. */
header,
main,
footer {
  max-width: var(--measure);
  margin: 0 auto;
}

header {
  padding: 2.5rem 0 0;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.masthead a.wordmark {
  font-family: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

nav {
  margin-left: auto;
  font-family: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 0.875rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1rem;
}

nav a:hover,
nav a:focus,
nav a[aria-current="page"] {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

main {
  padding-top: 2.5rem;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.1875rem;
  line-height: 1.3;
  margin: 2.5rem 0 0.75rem;
}

.lede {
  font-size: 1.1875rem;
  color: var(--fg);
}

p,
ul {
  margin: 0 0 1rem;
}

ul {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.5rem;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: color-mix(in srgb, var(--rule) 55%, transparent);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

/* FAQ sub-headings on the support page. These are a class in here rather than a
   style attribute on the element because the Content-Security-Policy is
   `style-src 'self'`, which blocks inline styles -- an inline style attribute
   would silently render unstyled in a browser and look fine in a local file
   preview, which is the worst combination. */
h3 {
  font-family: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 1rem;
  line-height: 1.35;
  margin: 1.75rem 0 0.5rem;
}

/* Used for the "last updated" line and the provenance note under the policy. */
.meta {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* The support page's contact block. Deliberately a link, not a form: a form
   needs a backend, and a backend is a thing that can be down when someone needs
   help. */
.contact {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.contact a {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.0625rem;
  word-break: break-all;
}

footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

footer a {
  color: var(--muted);
}

@media (max-width: 32rem) {
  header {
    padding-top: 1.75rem;
  }

  nav {
    margin-left: 0;
    width: 100%;
  }

  nav a {
    margin: 0 1rem 0 0;
  }
}
