@font-face {
  font-family: "Bricolage Grotesque";
  src: url("assets/fonts/BricolageGrotesque-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("assets/fonts/BricolageGrotesque-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

/* Colours from the app's asset catalog: LaunchScreenBackground, SoftBlack, CoralRed. */
:root {
  --sky: #87b1fd;
  --sky-deep: #5f93f2;
  --ink: #262626;
  --coral: #ec6242;

  --page: #ffffff;
  --surface: #efeff3;
  --line: #e7e7ec;
  --ink-soft: #77777e;
  --ink-body: #4a4a4f;

  /* Pastels behind cards and banners. */
  --tint-sky: #dde8ff;
  --tint-cream: #fcf3dc;
  --tint-coral: #fde1d9;
  --tint-mint: #d9f3ea;

  --heading: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #121214;
    --surface: #1f1f23;
    --line: #2e2e33;
    --ink: #f2f2f2;
    --ink-soft: #9a9aa1;
    --ink-body: #c8c8cd;
    --tint-sky: #1c2740;
    --tint-cream: #2b2619;
    --tint-coral: #34211c;
    --tint-mint: #172b25;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-top: calc(92px + max(12px, env(safe-area-inset-top)));
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: var(--heading);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 20px;
}

.wordmark {
  font-family: var(--heading);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

/* Placeholders to fill before publishing. `grep -r 'class="todo"'` finds them all. */
.todo {
  background: #fff3a8;
  color: #262626;
  padding: 0 0.25rem;
  border-radius: 4px;
}

/* Header */

.site-header {
  position: fixed;
  left: 0;
  right: 0;
  top: max(12px, env(safe-area-inset-top));
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: calc(100% - 32px);
  max-width: 1200px;
  min-height: 72px;
  margin: 0 auto;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--page);
  box-shadow: 0 4px 20px rgb(0 0 0 / 4%);
}

@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
  .site-header {
    background: color-mix(in srgb, var(--page) 85%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(110%);
    backdrop-filter: blur(16px) saturate(110%);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--page);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

html {
  scroll-padding-top: 112px;
}

.store-badge {
  display: block;
  line-height: 0;
}

.get-app {
  display: none;
  background: var(--ink);
  color: var(--page);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
}

@media (max-width: 640px) {
  .site-header {
    width: calc(100% - 24px);
    padding-inline: 12px;
    gap: 10px;
    border-radius: 22px;
  }

  .store-badge {
    display: none;
  }

  .get-app {
    display: inline-block;
  }
}

/* Home: hero */

.hero {
  margin: clamp(1.5rem, 6vh, 4rem) 0 0;
}

.hero h1 {
  text-align: center;
  font-size: clamp(2.3rem, 7vw, 4.5rem);
  text-wrap: balance;
}

/* Home: rating and reach */

.stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0 3rem;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
}

.stat svg {
  width: 28px;
  height: 56px;
  color: var(--ink-soft);
}

.stat svg:last-child {
  transform: scaleX(-1);
}

.stat p {
  margin: 0;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
}

.stat strong {
  display: block;
  font-family: var(--heading);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
}

/* Home: features */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: 1rem;
}

.feature {
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: 40px;
  background: var(--tint-sky);
}

.feature:nth-child(4n + 2) {
  background: var(--tint-mint);
}

.feature:nth-child(4n + 3) {
  background: var(--tint-cream);
}

.feature:nth-child(4n + 4) {
  background: var(--tint-coral);
}

.feature h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  text-wrap: balance;
}

.feature p {
  margin: 0.75rem 0 0;
  color: var(--ink-body);
  font-size: 1.15rem;
}

@media (max-width: 640px) {
  .feature {
    border-radius: 32px;
  }
}

/* Section headings shared by the home page and the Help Center */

.section-head {
  text-align: center;
  margin: 5rem 0 2rem;
}

.section-head h2,
.section-head h1 {
  font-size: clamp(2.1rem, 4vw, 3rem);
}

.section-head-top {
  margin-top: 1rem;
}

.section-head p {
  margin: 0.75rem auto 0;
  max-width: 40rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

/* Help topics: the cards on the home page and the Help Center */

.topics {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 1rem;
}

.topic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  min-height: 200px;
  padding: 2rem 1.5rem;
  border: 2px solid var(--line);
  border-radius: 40px;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
  transition: border-color 0.15s, transform 0.15s;
}

.topic:hover {
  border-color: var(--sky);
  transform: translateY(-2px);
}

.topic svg {
  width: 60px;
  height: 60px;
}

@media (max-width: 1000px) {
  .topics {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, 1fr);
  }

  .topic:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .topics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .topic {
    min-height: 160px;
  }
}

/* Help: topic banner */

.banner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 200px;
  padding: 2.5rem 3rem;
  border-radius: 48px;
  overflow: hidden;
}

.banner-title {
  position: relative;
  margin: 0;
  font-family: var(--heading);
  font-weight: 800;
  line-height: 1.05;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
}

.banner-billing {
  background: var(--tint-mint);
}

.banner-reminders {
  background: var(--tint-cream);
}

.banner-data {
  background: var(--tint-sky);
}

.banner-contact {
  background: var(--tint-coral);
}

@media (max-width: 640px) {
  .banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1.75rem;
    border-radius: 36px;
    min-height: 0;
  }
}

/* Help: questions */

.questions {
  display: grid;
  gap: 0.6rem;
  margin: 3rem 0 0;
}

.questions details {
  background: var(--surface);
  border-radius: 18px;
}

.questions summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--heading);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  line-height: 1.2;
}

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

.questions summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin: 0 0.4rem 0.3rem 0;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.questions details[open] summary::after {
  transform: translateY(0.35rem) rotate(-135deg);
}

.answer {
  position: relative;
  padding: 0 1.25rem 1.25rem;
}

.permalink {
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* The prose inside an answer or an article. */
.prose {
  max-width: 44rem;
  color: var(--ink-body);
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 0.75rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li + li {
  margin-top: 0.3rem;
}

.prose h2,
.prose h3,
.prose strong {
  color: var(--ink);
}

.prose a {
  color: var(--ink);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* Help: a single question */

.back {
  display: inline-flex;
  gap: 0.5rem;
  margin: 3.5rem 0 1rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-decoration: none;
}

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

.article {
  background: var(--surface);
  border-radius: 24px;
  padding: 1.75rem 1.5rem 1rem;
}

.article h1 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 1.25rem;
}

/* Help: other topics */

.other-topics h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 4rem 0 1.5rem;
}

/* Contact */

.contact {
  margin-top: 3rem;
  font-size: 1.15rem;
}

/* Legal documents */

main.doc {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 20px 1rem;
}

.doc h1 {
  font-size: clamp(2.4rem, 5vw, 3.25rem);
}

.doc h2 {
  font-size: 1.6rem;
  margin: 2.75rem 0 0.75rem;
}

.doc h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.75rem 0 0.4rem;
}

.doc .updated {
  color: var(--ink-soft);
  margin: 0.75rem 0 2rem;
}

.doc .prose {
  max-width: none;
}

.doc .contents {
  background: var(--surface);
  border-radius: 20px;
  padding: 1.25rem 1.5rem;
  margin: 0 0 2rem;
}

.doc .contents ol {
  margin: 0;
  columns: 2 16rem;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem;
  font-size: 0.95rem;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

.doc th {
  color: var(--ink);
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}

@media (max-width: 480px) {
  .doc table {
    font-size: 0.85rem;
  }

  .doc th,
  .doc td {
    padding: 0.5rem 0.3rem;
    overflow-wrap: anywhere;
    hyphens: auto;
  }
}

.callout {
  background: var(--tint-coral);
  border-radius: 20px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--ink);
}

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

/* 404 */

.not-found {
  text-align: center;
  padding: 4rem 0 2rem;
}

.not-found p {
  color: var(--ink-soft);
  font-size: 1.15rem;
}

/* Footer */

.site-footer {
  margin-top: 5rem;
  margin-bottom: 1.25rem;
}

.site-footer > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  border-radius: 48px;
  padding: 2rem 1.25rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.brand-icon,
.footer-logo {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 22.5%;
  -webkit-mask: url("assets/app-icon-mask.svg") center / contain no-repeat;
  mask: url("assets/app-icon-mask.svg") center / contain no-repeat;
}

.site-footer nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.site-footer nav a {
  text-decoration: none;
}

.site-footer nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.site-footer p {
  margin: 0.6rem 0 0;
}

.site-footer .disclaimer {
  margin-top: 1rem;
  font-size: 0.8rem;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-icon {
  flex-shrink: 0;
}

/* The download card sits under the hero, and floats at the bottom right only when the window has room beside the content. */
.download-section {
  width: 210px;
  max-width: 100%;
  margin: 2rem auto 0;
}

@media (min-width: 1760px) and (min-height: 760px) {
  .download-section {
    position: fixed;
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 90;
    margin: 0;
  }
}

.download-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: 40px;
  background: var(--page);
  box-shadow: 0 12px 36px rgb(0 0 0 / 7%);
  text-align: center;
  text-decoration: none;
}

.download-card:focus-visible {
  outline: 3px solid var(--sky-deep);
  outline-offset: 6px;
}

.download-eyebrow {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.download-qr {
  position: relative;
  display: block;
  width: 100%;
  margin: 16px 0;
  padding: 12px;
  background: white;
  border-radius: 16px;
}

.qr-code {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.qr-icon-well {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16%;
  aspect-ratio: 1;
  padding: 4px;
  border-radius: 12px;
  background: white;
}

.qr-icon-well img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 22.5%;
}

.download-caption {
  display: none;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}

/* The caption repeats the hero's title, so it shows only on the floating card. */
@media (min-width: 1760px) and (min-height: 760px) {
  .download-caption {
    display: block;
  }
}

.download-mobile-hint {
  display: none;
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.download-badge {
  display: none;
}

/* On a phone, where a QR code can't be scanned, the card is just the App Store badge. */
@media (max-width: 640px), (max-height: 500px) {
  .download-section {
    width: auto;
    margin-top: 1.5rem;
    text-align: center;
  }

  .download-card {
    display: inline-flex;
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: none;
    box-shadow: none;
  }

  .download-eyebrow,
  .download-qr,
  .download-caption,
  .download-mobile-hint {
    display: none;
  }

  .download-badge {
    display: block;
    width: 168px;
    height: 56px;
  }
}
