/* The home page's headline face, self-hosted with its licence (OFL.txt). */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-latin-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* Colours are the application's own, from constants/theme.ts. */
:root {
  --text: #101918;
  --muted: #5B6866;
  --background: #FAFBF7;
  --surface: #FFFFFF;
  --border: #D9E5E0;
  --primary: #007F86;
  /* The app's pressed teal: links on --tint, where --primary is 4.2:1 and
     falls just short of 4.5. This is 5.9:1. */
  --primary-strong: #06666B;
  --on-primary: #FFFFFF;
  --tint: #DDF5FA;
  --attention: #B45309;
  --attention-tint: #FFF4E5;
  --display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #EFF6F3;
    --muted: #B6C3C0;
    --background: #0F1514;
    --surface: #17211F;
    --border: #2E4642;
    --primary: #34D3D1;
    --primary-strong: #34D3D1;
    --on-primary: #0F1514;
    --tint: #10292A;
    --attention: #F6B73C;
    --attention-tint: #2B2112;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

main, header, footer {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

/*
 * Header, page and footer as three rows at least a screen tall, the page's
 * row taking the slack, so a short page's footer sits at the bottom of the
 * screen rather than part-way up it.
 */
body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
}

/*
 * The header the home page has: the logo, and Privacy and Support, across the
 * same 1200px frame as the home page and the footer, while the text below
 * keeps its narrower column for reading. Not sticky: on a phone it would
 * take room from the text for good.
 */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: none;
  margin: 0;
  padding: 22px max(20px, calc((100% - 1200px) / 2)) 0;
}

.brand { display: block; flex: none; }

/* Both dimensions from the artwork's own 1240 × 260. */
.logo { width: 190px; height: 40px; display: block; }

.site-nav { display: flex; gap: 4px 24px; }

.site-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

@media (max-width: 640px) {
  .logo { width: 150px; height: 31px; }
}

/* The narrowest phones: the logo as the home page has it there, and the
   links closer, so all three stay on one line. */
@media (max-width: 360px) {
  .site-header { column-gap: 12px; }
  .logo { width: 129px; height: 27px; }
  .site-nav { column-gap: 14px; }
}

/* Headings in the home page's face, so these pages read as the same site. */
h1, h2 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: 2.4rem; line-height: 1.05; margin: 36px 0 10px; }
h2 { font-size: 1.4rem; line-height: 1.15; margin: 40px 0 8px; scroll-margin-top: 20px; }

html { scroll-behavior: smooth; }

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

/* "On this page": a numbered list of jumps, two columns where there is room. */
.toc {
  margin: 28px 0 8px;
  padding: 18px 22px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.toc-title {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding-left: 1.4em;
  columns: 2 240px;
  column-gap: 28px;
}

.toc li { break-inside: avoid; padding: 3px 0; }

/* The short version, set apart before the detail. */
.highlight {
  margin: 32px 0;
  padding: 2px 22px 6px;
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  background: var(--tint);
}

.highlight a { color: var(--primary-strong); }

.highlight h2 {
  margin-top: 20px;
  /* The home page links here: land with the whole box in view. */
  scroll-margin-top: 44px;
}

.tagline { color: var(--primary); font-weight: 600; margin: 0 0 24px; }

a { color: var(--primary); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 20px;
  margin: 24px 0;
}

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

/*
 * The home page's footer, so every page ends the same way: a dark band right
 * across, on the same 1200px frame as the home page. Kept in step with the
 * Footer rules in home.css by hand; change both together.
 */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  max-width: none;
  margin: 56px 0 0;
  padding: 32px max(20px, calc((100% - 1200px) / 2)) 28px;
  background: #052F32;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.95rem;
}

.site-footer p { margin: 0; }

/* Both dimensions, from the artwork's 1240 x 260. */
.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.footer-brand img { display: block; width: 124px; height: 26px; }

.footer-legal {
  flex-basis: 100%;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }

.site-footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: inherit;
}

/* Support: the way to reach a person, first and plain. */
.contact-card {
  margin: 24px 0 28px;
  padding: 20px 22px;
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  background: var(--tint);
}

.contact-card p { margin: 0; }
.contact-card .button { margin: 14px 0 10px; }

/* A question that opens to its answer, so the list stays short as it grows.
   Plain HTML: it works with no script, and a screen reader announces it. */
.faq {
  border-top: 1px solid var(--border);
}

.faq details { border-bottom: 1px solid var(--border); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 12px 0;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1;
}

.faq details[open] summary::after { content: "\2212"; }

.faq details p { margin: 0 0 16px; }

/* A warning that costs somebody money if it is missed, in the app's amber
   for attention (its accent and saving-badge colours, constants/theme.ts). */
.warning {
  padding: 14px 18px;
  border-left: 4px solid var(--attention);
  border-radius: 12px;
  background: var(--attention-tint);
}

/* The guides' contents: each guide's title, and a line on what it covers. */
.guide-list {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.guide-list li {
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.guide-list a {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.guide-list a:hover { text-decoration: underline; }
.guide-list p { margin: 6px 0 0; color: var(--muted); }

/* On release: Apple's badge on the invitation page, as on the home page. */
.store-badge { display: inline-flex; }
.store-badge img { display: block; width: 160px; height: 53px; }

/* The one action on the invitation page. 48px tall, for a thumb. */
.button {
  display: inline-block;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
}

/* A class that sets display would otherwise overrule the hidden attribute. */
[hidden] { display: none !important; }
