/* The look of the site in one place: every colour and size is named here, and components use only the names
   (tests/unit/ui/styles.test.ts). Another set of colours is another file like this one.
   Sizes are in rem, so that all of it grows with the letters that a person asks their browser for. */
:root {
  color-scheme: light;

  /* Colours. Which may be written on which is checked by tests/unit/ui/styles.test.ts. */
  --page: #f4f2ee;
  --card: #ffffff;
  --card-quiet: #f8f7f4;
  --line: #dfdcd6;
  --line-strong: #777169;
  --text: #191919;
  --text-quiet: #56524c;
  --accent: #0a66c2;
  --accent-dark: #004182;
  --accent-soft: #e7f0fa;
  --on-accent: #ffffff;
  --good: #057642;
  --good-soft: #e5f3ec;
  --danger: #cc1016;
  --danger-dark: #960b10;
  --danger-soft: #fdecec;
  --waiting: #7a4a00;
  --waiting-soft: #fdf1da;
  --focus: #191919;
  --shade: rgb(0 0 0 / 0.6);
  --avatar-1: #2f5d8a;
  --avatar-2: #7a3e6d;
  --avatar-3: #3f6b43;
  --avatar-4: #8a4b2a;
  --avatar-5: #4d4a8c;
  --avatar-6: #5f5b52;

  /* Letters. */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --small: 0.875rem;
  --base: 1rem;
  --large: 1.125rem;
  --title: 1.25rem;
  --heading: 1.625rem;
  --hero: 2.125rem;
  --line-height: 1.5;
  --line-height-tight: 1.25;
  --bold: 600;

  /* Spaces, from the smallest. */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;

  /* Shapes. */
  --hairline: 1px;
  --thick: 2px;
  --border: 1px solid var(--line);
  --corner: 0.5rem;
  --round: 100rem;
  --shadow: 0 0.25rem 1rem rgb(0 0 0 / 0.12);

  /* Sizes. A finger needs a --target. */
  --target: 2.75rem;
  --icon: 1.5rem;
  --avatar: 3rem;
  --narrow: 28rem;
  --reading: 46rem;
  --wide: 70.5rem;
  --side: 18rem;
  --header: 3.5rem;
  --bottom-bar: 4rem;
  --menu-letters: 0.75rem;
  --count: 1.25rem;

  --quick: 0.15s;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--base);
  line-height: var(--line-height);
  /* A long word or address breaks rather than pushing the page wider than the phone. */
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
fieldset,
legend {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3 {
  font-size: inherit;
  line-height: var(--line-height-tight);
  text-wrap: balance;
}

ul,
ol {
  list-style: none;
}

fieldset {
  min-width: 0;
  border: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-dark);
}

/* Where the keyboard is. Two rings, so that one shows on every background. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--card);
}

/* A heading is given the focus when a page opens, for screen readers. It is nothing to click. */
h1:focus,
main:focus {
  outline: none;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  header,
  nav,
  footer,
  button {
    display: none;
  }

  body {
    background: none;
  }
}
