/*
  Page styles for the website. Every value is a token from the generated theme.css (spec §14.5), except the two
  breakpoints: media queries can't read custom properties, so 600px and 840px repeat breakpoint.medium and
  breakpoint.expanded.
*/

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

:root { --gutter: var(--size-gutter-compact); }
@media (min-width: 600px) { :root { --gutter: var(--size-gutter-medium); } }
@media (min-width: 840px) { :root { --gutter: var(--size-gutter-expanded); } }

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

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: var(--type-body-family);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line-height);
  font-weight: var(--type-body-weight);
}

.wrap {
  max-width: calc(var(--size-readable-width) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Type roles (spec §6.1): titles in content use screenTitle and sectionTitle; nothing is larger. */
h1 {
  margin: var(--space-12) 0 var(--space-4);
  font-size: var(--type-screen-title-size);
  line-height: var(--type-screen-title-line-height);
  font-weight: var(--type-screen-title-weight);
}
h2 {
  margin: var(--space-12) 0 var(--space-4);
  font-size: var(--type-section-title-size);
  line-height: var(--type-section-title-line-height);
  font-weight: var(--type-section-title-weight);
}
h3 {
  margin: 0;
  font-size: var(--type-body-size);
  line-height: var(--type-body-line-height);
  font-weight: var(--type-section-title-weight);
}
p, ul { margin: var(--space-4) 0; }
li + li { margin-top: var(--space-2); }

.lede, .muted { color: var(--color-text-secondary); }

a { color: var(--color-accent-text); text-underline-offset: 0.2em; }

:focus-visible {
  outline: var(--size-focus-ring-width) solid var(--color-focus);
  outline-offset: var(--size-focus-ring-offset);
  border-radius: var(--radius-small);
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-primary);
  border-radius: var(--radius-standard);
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

/* Header and navigation */
.site-header { border-bottom: 1px solid var(--color-divider); }
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-3);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: var(--type-section-title-size);
  line-height: var(--type-section-title-line-height);
  font-weight: var(--type-section-title-weight);
}
.wordmark__glyph {
  inline-size: var(--size-icon-standard);
  block-size: var(--size-icon-standard);
  fill: none;
  stroke: var(--color-accent-strong);
}
.site-nav { display: flex; gap: var(--space-1); }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-hit-target-web-pointer);
  padding-inline: var(--space-2);
  border-radius: var(--radius-small);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--type-label-size);
  line-height: var(--type-label-line-height);
  font-weight: var(--type-label-weight);
}
@media (any-pointer: coarse) { .site-nav a { min-height: var(--size-hit-target-web-touch); } }
.site-nav a:hover { background: var(--color-state-hover); color: var(--color-text-primary); }
.site-nav a[aria-current="page"] { color: var(--color-text-primary); }

/* Home page */
.intro h1 { margin-top: var(--space-12); }

.app-card {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-primary);
  border: 1px solid var(--color-border-decorative);
  border-radius: var(--radius-large);
}
@media (min-width: 600px) { .app-card { padding: var(--space-6); } }
.app-card > p:last-child { margin-bottom: 0; }
.app-card__header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
/* At large text sizes the name and status wrap below the icon instead of squeezing into a narrow column. */
.app-card__header > div { flex: 1 1 10rem; }
.app-card__icon { border-radius: var(--radius-standard); flex: none; }
.app-card__links { font-size: var(--type-label-size); line-height: var(--type-label-line-height); font-weight: var(--type-label-weight); }

.status {
  display: inline-block;
  margin: var(--space-1) 0 0;
  padding-inline: var(--space-2);
  border: 1px solid var(--color-tone-neutral-border);
  border-radius: var(--radius-small);
  background: var(--color-tone-neutral-background);
  color: var(--color-tone-neutral-foreground);
  font-size: var(--type-caption-size);
  line-height: var(--type-label-line-height);
  font-weight: var(--type-label-weight);
}

.principles {
  display: grid;
  gap: var(--space-6);
  padding: 0;
  list-style: none;
}
@media (min-width: 600px) { .principles { grid-template-columns: 1fr 1fr; } }
.principles li + li { margin-top: 0; }
.principles p { margin: var(--space-1) 0 0; color: var(--color-text-secondary); }

/* Footer */
.site-footer {
  margin-top: var(--space-12);
  padding-block: var(--space-6) var(--space-8);
  border-top: 1px solid var(--color-divider);
  color: var(--color-text-secondary);
  font-size: var(--type-secondary-size);
  line-height: var(--type-secondary-line-height);
}
.site-footer a { color: inherit; }

/* Draft only: details the owner still has to supply stand out until they are filled in. */
[data-owner-fills-in] {
  padding-inline: var(--space-1);
  border-radius: var(--radius-small);
  background: var(--color-tone-warning-background);
  color: var(--color-tone-warning-foreground);
}

/* An app's own page. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.app-intro__icon { display: block; margin-top: var(--space-12); border-radius: var(--radius-large); border: 1px solid var(--color-border-decorative); }
.app-intro h1 { margin-top: var(--space-4); }
/* The screenshots scroll sideways on a phone instead of shrinking to unreadable sizes. */
.screens {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(10rem, 1fr);
  gap: var(--space-4);
  overflow-x: auto;
  margin: var(--space-6) 0 0;
  padding: 0 0 var(--space-2);
  list-style: none;
}
.screens li + li { margin-top: 0; }
.screens img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-large);
  border: 1px solid var(--color-border-decorative);
}
.faq h3 { margin-top: var(--space-6); }
.faq p { margin-top: var(--space-1); color: var(--color-text-secondary); }
.store-link { font-weight: var(--type-label-weight); }
