/* The public site's whole stylesheet.
 *
 * The tokens below are the app's, copied from docs/design-system.md so the
 * site, the app and the emails read as one product. The app's own rules apply
 * here too: flat and bordered rather than shadowed, and no colour or size
 * written anywhere but here.
 */

:root {
  --bg: #f7f1e8;
  --surface: #fffdf9;
  --surface-alt: #efe6d8;
  --border: #ded2bc;
  --ink: #22271f;
  --ink-soft: #4b5142;
  --muted: #7a7566;
  --primary: #1f4433;
  --primary-strong: #163326;
  --primary-soft: #e1eadd;
  --on-primary: #ffffff;
  --accent: #b5652f;
  --accent-strong: #8c4a21;

  --gutter: 24px;
  --measure: 34rem;
  --radius-md: 12px;
  --radius-lg: 14px;
  --hairline: 1px;

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

@font-face {
  font-family: "Work Sans";
  src: url("fonts/work-sans-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Work Sans";
  src: url("fonts/work-sans-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}

/* Everything on the site sits in one column. Nothing here needs a grid, and a
 * single measure keeps long policy text readable without a second layout. */
.shell {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- Skip link ------------------------------------------------------------ */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: var(--on-primary);
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
  z-index: 10;
}

/* --- Header --------------------------------------------------------------- */

.masthead {
  border-bottom: var(--hairline) solid var(--border);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 20px;
  padding-bottom: 20px;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1875rem;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark:hover,
.wordmark:focus-visible {
  color: var(--primary-strong);
}

.masthead nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.masthead nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 0;
  display: inline-block;
}

.masthead nav a:hover,
.masthead nav a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

.masthead nav a[aria-current="page"] {
  color: var(--primary);
}

/* --- Typography ----------------------------------------------------------- */

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.625rem, 5vw, 2.125rem);
  margin: 0 0 16px;
}

h2 {
  font-size: 1.25rem;
  margin: 40px 0 12px;
}

h3 {
  font-size: 1.0625rem;
  margin: 28px 0 8px;
}

p,
ul,
ol,
dl {
  margin: 0 0 16px;
}

/* The one line under a page title, set larger than body text. */
.lede {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover,
a:focus-visible {
  color: var(--accent-strong);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

strong {
  font-weight: 600;
}

ul,
ol {
  padding-left: 22px;
}

/* Prose lists only. The nav and footer lists lay themselves out with `gap`,
   and this rule was landing on them too - which is why every link after the
   first sat six pixels lower than the one before it. */
main li + li {
  margin-top: 6px;
}

small {
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* --- Page furniture ------------------------------------------------------- */

main {
  padding-top: 48px;
  padding-bottom: 64px;
}

/* A dated policy states when it last changed; a policy that does not is hard
 * to trust and hard to audit. */
.stamp {
  display: block;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin: -8px 0 28px;
}

.hero {
  padding-top: 64px;
  padding-bottom: 8px;
}

.hero p {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  max-width: 30rem;
}

.card {
  background: var(--surface);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 0 0 24px;
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.card--quiet {
  background: var(--surface-alt);
}

/* Says a page is not yet reviewed. Loud on purpose: an unreviewed policy that
 * looks reviewed is worse than no policy. */
.notice {
  border: var(--hairline) solid var(--accent);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  background: #f3e1cf;
  color: var(--accent-strong);
  padding: 16px 20px;
  margin: 0 0 32px;
  font-size: 0.9375rem;
}

.notice > :last-child {
  margin-bottom: 0;
}

.notice strong {
  color: var(--accent-strong);
}

/* --- Definition-style lists, used for the data tables in the policy -------- */

.facts {
  border-top: var(--hairline) solid var(--border);
  margin: 0 0 24px;
}

.facts > div {
  border-bottom: var(--hairline) solid var(--border);
  padding: 14px 0;
}

.facts dt {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.facts dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* --- Buttons -------------------------------------------------------------- */

.button {
  display: inline-block;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: var(--radius-md);
  min-height: 48px;
  line-height: 22px;
}

.button:hover,
.button:focus-visible {
  background: var(--primary-strong);
  color: var(--on-primary);
}

/* --- Footer --------------------------------------------------------------- */

.footer {
  border-top: var(--hairline) solid var(--border);
  padding-top: 28px;
  padding-bottom: 48px;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.footer a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 0;
  display: inline-block;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

/* --- Narrow viewports ----------------------------------------------------- */

@media (max-width: 30rem) {
  :root {
    --gutter: 16px;
  }

  .masthead__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-bottom: 12px;
  }

  main {
    padding-top: 32px;
  }

  .hero {
    padding-top: 40px;
  }

  .card {
    padding: 20px;
  }
}

/* The site is light-only, as the app is. Honouring a dark preference here
 * without a dark palette to honour it with would only break the contrast the
 * tokens guarantee. */

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