/*
  Pericope website. One column of text in the app's own colours and type.

  Colours come from App/Pericope/DesignSystem/Theme.swift. The one change is
  --ink-2 in light mode: the app's #7A7A80 is 4.27:1 on white, below WCAG AA
  for body text, so the site uses #66666C (5.70:1 on white, 5.19:1 on the tile).

  Poppins is the app's typeface. Copyright 2020 The Poppins Project Authors,
  licensed under the SIL Open Font License 1.1 (https://scripts.sil.org/OFL).
  The files in fonts/ are Latin subsets of the app's own font files, served
  from this site so no page loads anything from another website.
*/

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/poppins-300.woff2") format("woff2");
}

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

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/poppins-500.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/poppins-600.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  --paper: #ffffff;
  --ink: #141414;
  --ink-2: #66666c;
  --line: #e4e4e8;
  --tile: #f4f4f6;
  --accent: #0b6b3c;
  --yellow: #f4c025;

  --measure: 680px;
  --inset: 22px;
  --radius: 22px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f0f11;
    --ink: #f2f2f3;
    --ink-2: #9c9ca4;
    --line: #2c2c33;
    --tile: #1a1a1e;
    --accent: #3fa873;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 600px) {
  body {
    font-size: 1.0625rem;
  }
}

.wrap {
  max-width: calc(var(--measure) + 2 * var(--inset));
  margin: 0 auto;
  padding: 0 var(--inset);
}

/* Header: the wordmark, as the app draws it. "Peric", the target mark, "pe". */

.site-header {
  padding-top: 28px;
}

.wordmark {
  display: inline-block;
  padding: 6px 0;
  color: var(--accent);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark .mark {
  display: inline-block;
  width: 0.64em;
  height: 0.64em;
  margin: 0 0.04em;
  vertical-align: -0.032em;
}

/* Text */

main.wrap {
  padding-top: 56px;
  padding-bottom: 72px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

h1 {
  font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.25rem);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}

h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 52px;
  margin-bottom: 12px;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.5;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

b,
strong {
  font-weight: 500;
}

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.lede {
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.3125rem);
  line-height: 1.6;
  margin-bottom: 18px;
}

.soon {
  color: var(--accent);
  font-weight: 500;
}

.meta {
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.muted {
  color: var(--ink-2);
}

.ref {
  white-space: nowrap;
}

/* The number on the home page, set like the large figures in the app. */

.count {
  margin-top: 44px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.count p {
  margin: 0;
}

.count .figure {
  margin-bottom: 10px;
  line-height: 1.2;
}

.count .number {
  display: inline-block;
  margin-right: 0.3em;
  font-size: clamp(3.5rem, 2.5rem + 4vw, 4.75rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
}

.count .unit {
  display: inline-block;
  font-weight: 500;
}

/* The eight parts of a study, numbered the way the study screen numbers them. */

.parts {
  list-style: none;
  margin: 20px 0 18px;
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.parts li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.parts .num {
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.parts p {
  margin: 2px 0 0;
  color: var(--ink-2);
}

/* A flat tile with rows, like the app's Settings screen. */

.tile {
  list-style: none;
  margin: 20px 0 18px;
  padding: 4px 22px;
  background: var(--tile);
  border-radius: var(--radius);
}

.tile li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.tile li:first-child {
  border-top: 0;
}

/* Lists inside the support and privacy text. */

.prose ul {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.prose li {
  margin-bottom: 0.4em;
  padding-left: 0.25em;
}

.prose li::marker {
  color: var(--ink-2);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 44px;
}

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

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

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer a[aria-current="page"] {
  color: var(--accent);
}

.site-footer p {
  color: var(--ink-2);
  font-size: 0.875rem;
}
