/*
 * The app's look (src/theme/theme.ts, design/README.md): its colors, Space
 * Grotesk for headings, its spacing and corners. Light only, even when the
 * phone or computer is set to dark (#193). No outside fonts or scripts.
 */

@font-face {
  font-family: 'Space Grotesk';
  font-weight: 700;
  font-display: swap;
  /* Latin subset of the app's heading font; license in fonts/OFL.txt. */
  src: url('/fonts/space-grotesk-700.woff2') format('woff2');
}

/* LIGHT_COLORS */
:root {
  --ground: #ece9e2;
  --surface: #fbfaf7;
  --line: #dad6cd;
  --card-border: #c4bfb4;
  --chalk: #15181c;
  --on-chalk: #fbfaf7;
  --muted: #5c636c;
  --red: #e0453a;
  --yellow: #e5b31f;
  --green: #2fa872;
  --blue: #2563eb;
  /* The phone frame around the screenshots, and its shadow. */
  --rim: #15181c;
  --shadow:
    0 24px 48px -20px rgba(21, 24, 28, 0.35),
    0 4px 12px -4px rgba(21, 24, 28, 0.12);

  /* SPACING and RADII */
  --small: 8px;
  --medium: 16px;
  --large: 24px;
  --side: 20px;
  /* Space between the landing page's sections, and before the footer.
     6rem from 720px wide (see the media query at the end). */
  --section: 3.5rem;
  --card-radius: 20px;
  --chip-radius: 12px;

  color-scheme: light;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--chalk);
  font:
    17px/1.55 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: var(--small) var(--side) 0;
}

.page.wide {
  max-width: 62rem;
}

a {
  color: inherit;
  text-underline-offset: 0.15em;
}

h1,
h2,
h3,
.brand,
.subtitle,
figcaption {
  font-family:
    'Space Grotesk',
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2.25rem;
  line-height: 1.1;
  text-wrap: balance;
  margin: 0 0 var(--small);
}

h2 {
  font-size: 1.3rem;
  text-wrap: balance;
  line-height: 1.25;
  margin: 2rem 0 var(--small);
}

.points h2 {
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 0 0 6px;
}

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

/* Top bar */
nav {
  display: flex;
  align-items: center;
  gap: var(--large);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--large);
}

nav a {
  /* At least 44pt tall, the app's minimum touch size. */
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 0;
  text-decoration: none;
  color: var(--muted);
}

nav a[aria-current='page'],
nav a:hover {
  color: var(--chalk);
}

nav .brand {
  gap: 10px;
  margin-right: auto;
  font-size: 1.2rem;
  color: var(--chalk);
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--card-border);
}

/* Cards: surface on ground, with the light-mode hairline border. */
.card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--medium);
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

main > .card {
  margin: var(--large) 0;
}

/* Landing page */
.hero {
  display: grid;
  gap: var(--large);
  padding: var(--medium) 0 0;
}

/* On a phone the header already shows the icon. */
.hero-icon {
  display: none;
  border: 1px solid var(--card-border);
}

.subtitle {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 var(--medium);
}

.lede {
  font-size: 1.15rem;
  margin: 0 0 var(--medium);
  max-width: 34rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 var(--large);
  border-radius: 999px;
  background: var(--chalk);
  color: var(--on-chalk);
  font-weight: 600;
  text-decoration: none;
}

.soon {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

/* A screenshot in a thin phone rim, its caption above. */
.phone {
  --phone-width: min(62vw, 260px);
  flex: 0 0 auto;
  width: var(--phone-width);
  margin: 0;
  scroll-snap-align: start;
}

.phone figcaption {
  font-size: 1.05rem;
  line-height: 1.3;
  text-align: center;
  margin-bottom: 12px;
}

.phone img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  border: 4px solid var(--rim);
  /* Roughly the iPhone's own screen corners at this width. */
  border-radius: calc(var(--phone-width) * 0.14);
  background: var(--rim);
  box-shadow: var(--shadow);
}

.hero .phone {
  justify-self: center;
}

.shots {
  display: flex;
  gap: var(--medium);
  margin: var(--section) calc(-1 * var(--side)) 0;
  /* Room for the shadow, which the scroll box would otherwise cut off. */
  padding: 0 var(--side) var(--large);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--side);
}

.points {
  display: grid;
  gap: var(--medium);
  /* Less the shots row's shadow room, so this gap matches the others. */
  margin: calc(var(--section) - var(--large)) 0 0;
  padding: 0;
  list-style: none;
}

.points p,
.tier p {
  margin: 0;
  color: var(--muted);
}

.points .dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-bottom: 12px;
}

.dot.red {
  background: var(--red);
}

.dot.blue {
  background: var(--blue);
}

.dot.yellow {
  background: var(--yellow);
}

.dot.green {
  background: var(--green);
}

/* Free and full version */
.pricing {
  margin-top: var(--section);
}

.pricing h2 {
  margin: 0 0 var(--medium);
}

.tiers {
  display: grid;
  gap: var(--medium);
}

.tier {
  border-top: 2px solid var(--chalk);
  padding-top: var(--medium);
}

.tier h3 {
  font-size: 1.1rem;
  margin: 0 0 var(--small);
}

.tier ul {
  margin: 0 0 var(--small);
  padding-left: 1.2em;
}

.tier li {
  margin-bottom: 2px;
}

/* Footer */
footer {
  margin-top: var(--section);
  padding: var(--large) 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

footer p {
  margin: 0 0 var(--small);
}

footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--large);
}

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

@media (min-width: 720px) {
  :root {
    --section: 6rem;
  }

  h1 {
    font-size: 3rem;
  }

  /* Two columns, the same as the cards and the screenshots below, so the
     phones sit on the same lines. */
  .hero,
  .shots,
  .points,
  .tiers {
    grid-template-columns: 1fr 1fr;
    column-gap: var(--large);
  }

  .hero {
    align-items: center;
    padding: 2rem 0 0;
  }

  .hero-icon {
    display: block;
    width: 96px;
    height: 96px;
    border-radius: 22px;
    margin-bottom: var(--large);
  }

  .phone {
    --phone-width: 260px;
  }

  .shots {
    display: grid;
    justify-items: center;
    overflow: visible;
    margin-inline: 0;
    padding: 0;
  }

  .points {
    margin-top: var(--section);
  }

  .points .card {
    padding: 20px var(--large);
  }
}
