/*
 * The design system for strangecalculus.com.
 *
 * PROVENANCE, because the next person will otherwise assume these are in sync:
 * this file began as a copy of vanessa-web's site/shared/style.css and HAS
 * DIVERGED. It is now maintained here and only here. Nothing syncs it, nothing
 * checks it against the other repos, and a fix made in one will not appear in
 * the others. Structure (one column, one measure, the masthead, the contact
 * block) is shared ancestry; the palette is this site's own and is deliberately
 * neither repo's.
 *
 * Why the palette had to change rather than be inherited:
 *
 *   Anchorframe's site is warm brown on off-white. The Vanessa sites are navy
 *   and gold, from the Sprinter the apps are named after, and they share one
 *   stylesheet with each site overriding only --accent -- they are a family on
 *   purpose. This site is neither. Borrowing either palette would make that
 *   product look like the parent, which is exactly backwards: the company does
 *   not belong to any of its products, and the one that is currently furthest
 *   along should not get to define what the company looks like.
 *
 *   So: cool neutral paper, one deep green accent, no motif. There is no van
 *   here and nothing photographic. Those belong to the products that earned
 *   them.
 *
 * ONE stylesheet, no theme.css split. vanessa-web has that split because two
 * sites share one file and each needs its own accent; this repo serves one site,
 * so the split would be indirection with nothing on the other end.
 *
 * IF SEVERAL SITES LATER WANT ONE SYSTEM, the pattern to reach for is the
 * sync-workflow approach in vanessa-web/.github/workflows/sync-privacy-policy.yml
 * -- render or copy from a source of truth and open a pull request a human
 * merges -- not a git submodule, and not a cross-repo build dependency. A
 * submodule makes every checkout of every repo depend on a fourth one being
 * reachable, to share a few hundred lines of CSS. Noted, and deliberately not
 * built today: there is one site here and nothing to sync with.
 *
 * No framework, no build step, no web fonts. A font file is another request,
 * another thing that can 404, and another origin to allow in the
 * Content-Security-Policy -- which is `default-src 'none'` and stays that way.
 */

:root {
  /* Light. Every colour below is checked against its background for at least
     4.5:1 where it can carry text, and 3:1 for the mark. */
  --bg: #f6f6f7;
  --surface: #ffffff;
  --fg: #17181c;
  --muted: #5c5f68;
  --rule: #dcdce0;
  --link: #2a4d8f;
  --accent: #35635a;

  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131417;
    --surface: #1b1d21;
    --fg: #e7e7e4;
    --muted: #9a9da5;
    --rule: #2c2f35;
    --link: #8fb5ea;
    --accent: #7fb8a6;
  }
}

*,
*::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: center;
  gap: 0.5rem 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.masthead a.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  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;
}

/* An <img> rather than inline SVG, so the glyph is one file rather than one
   copy per page. Its colour is baked into the file: an SVG loaded through <img>
   is an isolated document and never sees this stylesheet's custom properties or
   the page's `color`, so `currentColor` in there would render as black. See the
   comment in mark.svg for how one baked colour serves both themes. */
.masthead a.wordmark img {
  display: block;
  width: 1.375rem;
  height: 1.375rem;
}

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-decoration-color: var(--accent);
  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;
}

/* Sub-headings on the support page and in the policy. 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
   renders fine in a local file preview and is silently dropped once served,
   which is the worst combination. There is a test asserting no page carries
   one. */
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;
}

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

/* The list of published apps on the home page.
 *
 * A plain list, not a card grid and not a table. The visual weight of every
 * entry is identical on purpose: the products have nothing to do with each other
 * and none of them is the flagship, so any layout that gives one entry more room
 * than another would be making a claim this company cannot support. It also has
 * to stay legible as the list grows, which a grid stops doing at an awkward
 * count. */
.products {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.products li {
  margin-bottom: 1.5rem;
}

.products a {
  font-family: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-weight: 650;
  font-size: 1.0625rem;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
}

.products p {
  margin: 0.25rem 0 0;
}

/* 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;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  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: 3.5rem;
  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;
  }
}
