/* What every page shares: the reset, type, buttons, cards, header and footer. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchors stop below the sticky header. */
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

@media (min-width: 900px) {
  body {
    font-size: 1.0625rem;
    line-height: 1.65;
  }
}

h1,
h2,
h3,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--primary-text);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

/* Ink, not coral: a coral ring is under 3:1 on every light background here. */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.section--dark :focus-visible {
  outline-color: var(--surface);
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: currentColor;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -80px;
  z-index: 100;
  padding: var(--s-md) var(--s-lg);
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--surface);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--s-sm);
  color: var(--surface);
}

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: calc(var(--section-gap) / 2);
}

/* A band has a background of its own, so it keeps its full room above and below. */
.section--band {
  padding-block: var(--section-gap);
  margin-block: calc(var(--section-gap) / 2);
}

.section--subtle {
  background: var(--primary-subtle);
}

.section--dark {
  background: var(--camera-dock);
  color: var(--surface);
}

.section__head {
  max-width: 40rem;
  margin-bottom: var(--s-section);
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
}

/* ---------- Type ---------- */

.h1 {
  font-size: var(--text-h1);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.h2 {
  font-size: var(--text-h2);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.h3 {
  font-size: 1.125rem;
  line-height: 1.35;
  font-weight: 600;
}

/*
 * One coral word per heading, as in the app. On a light page the app's coral is 2.8:1, under the
 * 3:1 that large text needs, so the word takes the pressed coral (3.4:1). Display sizes only.
 */
.h1 em,
.h2 em {
  font-style: normal;
  color: var(--primary-pressed);
}

/* The grey Lora line under a heading. */
.tagline {
  margin-top: var(--s-sm);
  font-family: var(--font-tagline);
  font-style: italic;
  font-weight: 500;
  font-size: var(--text-tagline);
  line-height: 1.4;
  color: var(--ink-2-web);
  text-wrap: balance;
}

.section--dark .tagline {
  color: var(--on-dark-2);
}

.lead {
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink-2-web);
  text-wrap: pretty;
}

@media (min-width: 900px) {
  .lead {
    font-size: 1.25rem;
  }
}

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

.small {
  font-size: 0.875rem;
  line-height: 1.45;
}

/* ---------- The wordmark ---------- */

.wordmark {
  display: inline-block;
  font-style: italic;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark span {
  color: var(--primary);
}

.wordmark:hover {
  color: var(--ink);
}

.wordmark--large {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
}

/* ---------- Buttons: two kinds, as in the app ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  min-height: 48px;
  padding: var(--s-md) var(--s-xxl);
  border: 0;
  border-radius: var(--r-button);
  font: inherit;
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 150ms var(--ease),
    transform 150ms var(--ease);
}

.button:active {
  transform: scale(0.98);
}

/* Ink on coral is 6.2:1; the app's white on coral is 2.9:1, too little for the web. */
.button--primary {
  background: var(--primary);
  color: var(--ink);
}

.button--primary:hover {
  background: var(--primary-pressed);
  color: var(--ink);
}

.button--secondary {
  background: var(--surface-muted);
  color: var(--ink);
}

.button--secondary:hover {
  background: var(--border);
  color: var(--ink);
}

.button--small {
  min-height: 44px;
  padding: var(--s-sm) var(--s-lg);
  font-size: 0.9375rem;
  white-space: nowrap;
}

.button--block {
  width: 100%;
}

@media (min-width: 600px) {
  .button--block {
    width: auto;
  }
}

/* ---------- Cards, chips, icon wells ---------- */

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

/* On a tinted band a card lies flat. */
.card--flat {
  box-shadow: none;
}

/* Filled, never outlined. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px var(--s-md);
  border-radius: var(--r-full);
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 0.8125rem;
  line-height: 1.25;
  font-weight: 500;
}

.chip .icon {
  width: 16px;
  height: 16px;
}

.icon-well {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--r-full);
  background: var(--primary-soft);
  color: var(--primary);
}

.icon-well .icon {
  width: 22px;
  height: 22px;
}

/* A label on a picture, in the camera's glass. */
.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-full);
  background: var(--camera-overlay);
  color: var(--surface);
  font-size: 0.75rem;
  line-height: 1.3;
  font-weight: 500;
}

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

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(254, 250, 252, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease);
}

.header.is-scrolled {
  border-bottom-color: var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-lg);
  height: 100%;
}

/* The wordmark can't wrap, so on a narrow phone it and the button give way a little. */
@media (max-width: 399px) {
  .header__inner {
    gap: var(--s-sm);
  }

  .header .wordmark {
    font-size: 1rem;
  }

  .header .button--small {
    padding-inline: var(--s-md);
  }
}

@media (max-width: 359px) {
  .header .wordmark {
    font-size: 0.9375rem;
  }

  .header .button--small {
    font-size: 0.875rem;
  }
}

.nav {
  display: none;
}

@media (min-width: 900px) {
  .nav {
    display: flex;
    align-items: center;
    gap: var(--s-section);
    margin-left: auto;
  }

  .nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--ink);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
  }

  .nav a:hover {
    color: var(--primary-text);
  }

  .wordmark {
    font-size: 1.5rem;
  }
}

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

.footer {
  margin-top: calc(var(--section-gap) / 2);
  padding-block: var(--s-section) 40px;
  border-top: 1px solid var(--border);
  color: var(--ink-2-web);
  font-size: 0.875rem;
  line-height: 1.5;
}

.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-lg) var(--s-section);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs) var(--s-xxl);
}

.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--primary-text);
}

.footer__notes {
  display: grid;
  gap: var(--s-xs);
  max-width: 46rem;
  margin-top: var(--s-xl);
}

/* ---------- Pages of text: privacy, support, 404 ---------- */

.prose {
  max-width: 44rem;
  padding-block: 48px var(--section-gap);
}

.prose .h1 {
  font-size: clamp(2rem, 1.6rem + 1.8vw, 2.75rem);
}

.prose h2 {
  margin-top: 40px;
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.prose p,
.prose ul {
  margin-top: var(--s-md);
}

.prose ul {
  padding-left: 1.25rem;
  list-style: disc;
}

.prose li + li {
  margin-top: var(--s-xs);
}

.prose .updated {
  margin-top: var(--s-md);
  color: var(--ink-2-web);
  font-size: 0.875rem;
}

.notfound {
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding-block: 48px;
  text-align: center;
}

.notfound .h2 {
  margin-top: var(--s-section);
}

.notfound .lead {
  margin-block: var(--s-md) var(--s-xxl);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
