/* Stonefold Labs. One stylesheet, no imports, no fonts from anywhere but the reader's own device.

   The shape is a sibling of longlinelabs.com, the owner's other company: a stripe along the top, the mark
   and a serif wordmark, a headline beside a picture, cards for the apps, hairlines between sections.
   The colours and the mark are Stonefold's own: evergreen #293b36, sage #a9b8a1, warm ivory #f2f0e8,
   amber #d5a96c. Light and dark follow the reader's device until the switch in the header is used; the switch
   is theme.js, the site's one script, and it sets data-theme on <html>. */

:root {
  color-scheme: light dark;
  --page: #f2f0e8;
  --raised: #f9f7f1;
  --text: #293b36;
  --quiet: #4f6057;
  --link: #1f5143;
  --rule: #d8d5c9;
  --fill: #293b36;
  --on-fill: #f2f0e8;
  --stripe: #d5a96c;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark, because the device is, where nobody has chosen with the switch. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #1c2925;
    --raised: #24332e;
    --text: #f2f0e8;
    --quiet: #b2bfb6;
    --link: #a9b8a1;
    --rule: #33443e;
    --fill: #a9b8a1;
    --on-fill: #1c2925;
  }

  :root:not([data-theme="light"]) .mark-light {
    display: none;
  }

  :root:not([data-theme="light"]) .mark-dark {
    display: block;
  }
}

/* Light or dark, chosen with the switch. The same values as above. */
:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #1c2925;
  --raised: #24332e;
  --text: #f2f0e8;
  --quiet: #b2bfb6;
  --link: #a9b8a1;
  --rule: #33443e;
  --fill: #a9b8a1;
  --on-fill: #1c2925;
}

:root[data-theme="dark"] .mark-light {
  display: none;
}

:root[data-theme="dark"] .mark-dark {
  display: block;
}

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 1rem/1.6 var(--sans);
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

img,
svg {
  display: block;
}

.mark-dark {
  display: none;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
}

.skip:focus {
  top: 1rem;
}

/* Links */

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

/* The top of every page */

.top {
  background: var(--raised);
  border-top: 3px solid var(--stripe);
  border-bottom: 1px solid var(--rule);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 2rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font: 500 1.375rem/1.75rem var(--display);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 2.25rem;
  height: 2.25rem;
}

/* The light and dark switch. Hidden until theme.js is running, so it is never a dead button. */

.theme {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin: 0 0 0 auto;
  padding: 0 0.25rem;
  background: none;
  border: 0;
  border-radius: 1rem;
  color: var(--text);
  cursor: pointer;
}

.theme[hidden] {
  display: none;
}

.theme:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.theme-track {
  display: flex;
  align-items: center;
  width: 2.75rem;
  height: 1.5rem;
  padding: 0.125rem;
  background: var(--page);
  border: 1px solid var(--quiet);
  border-radius: 1rem;
}

.theme[aria-checked="true"] .theme-track {
  justify-content: flex-end;
}

.theme-knob {
  display: grid;
  place-items: center;
  width: 1.125rem;
  height: 1.125rem;
  background: var(--fill);
  border-radius: 50%;
  color: var(--on-fill);
}

.theme .moon,
.theme[aria-checked="true"] .sun {
  display: none;
}

.theme[aria-checked="true"] .moon {
  display: block;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a {
  display: inline-block;
  padding: 0.375rem 0;
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

nav a[aria-current="page"] {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

/* Headings and text */

h1,
h2 {
  font-family: var(--display);
  font-weight: 500;
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: 2.75rem;
  line-height: 1.14;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 600;
}

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

.quiet {
  color: var(--quiet);
}

.label {
  margin: 0;
  color: var(--quiet);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Home: the headline beside the mark */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 2rem 3rem;
  align-items: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.kicker {
  margin: 0 0 0.75rem;
  color: var(--link);
  font-size: 1.0625rem;
  font-weight: 600;
}

.lede {
  max-width: 34em;
  margin: 1rem 0 0;
  color: var(--quiet);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 2rem 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.125rem;
  background: var(--fill);
  border-radius: 0.5rem;
  color: var(--on-fill);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  text-decoration: underline;
}

.hero-art img {
  width: 100%;
  max-width: 17rem;
  height: auto;
  margin: 0 auto;
}

/* Sections, parted by a hairline */

.section {
  padding-top: 3rem;
  padding-bottom: 3.5rem;
  border-top: 1px solid var(--rule);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 1.25rem;
  padding: 0;
  list-style: none;
}

.card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.75rem;
  padding: 1.125rem;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
}

.card h3 {
  font: 500 1.25rem/1.75rem var(--display);
}

.card p {
  margin: 0;
  color: var(--quiet);
  font-size: 0.9375rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 3rem;
  align-items: start;
}

.prose {
  max-width: 40rem;
}

.promises {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.promises li {
  padding: 0.875rem 1rem;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
}

.promises p {
  margin: 0.125rem 0 0;
  color: var(--quiet);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Privacy, Support and the "not here" page */

.page {
  padding-top: 3.5rem;
  padding-bottom: 4rem;
}

.page h1 {
  margin-bottom: 1rem;
}

.page h2 {
  margin-top: 2.75rem;
  font-size: 1.5rem;
}

.page p {
  font-size: 1.0625rem;
}

/* The foot of every page */

footer {
  border-top: 1px solid var(--rule);
  color: var(--quiet);
  font-size: 0.875rem;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.foot .brand {
  display: inline-flex;
  padding: 0;
  font-size: 1.0625rem;
}

.foot .brand img {
  width: 1.5rem;
  height: 1.5rem;
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot a {
  display: inline-block;
  padding: 0.375rem 0;
}

.foot ul a {
  color: var(--quiet);
  text-decoration: none;
}

.foot ul a:hover {
  text-decoration: underline;
}

/* Narrower screens */

@media (max-width: 56rem) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 44rem) {
  .wrap {
    padding: 0 1.25rem;
  }

  .theme {
    order: 2;
  }

  .bar nav {
    order: 3;
    flex-basis: 100%;
  }

  h1 {
    font-size: 2.125rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .hero-art {
    display: none;
  }

  .cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .section {
    padding-top: 2.25rem;
    padding-bottom: 2.5rem;
  }

  .page {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
  }
}

@media (max-width: 26rem) {
  .promises {
    grid-template-columns: minmax(0, 1fr);
  }
}
