/*
 * the same tokens the app compiles from, restated here by hand.
 *
 * every value below is copied out of src/theme.ts. the site and the app are
 * two renderers of one design, and the only thing keeping them honest is that
 * these numbers are the same numbers — so if a token moves in the app, it
 * moves here too.
 */

:root {
  --paper: #efeeea;
  --ink: #2e2ad6;

  /* the palette a day can be written in */
  --blue: #2e2ad6;
  --green: #2f6b45;
  --red: #b5342b;
  --yellow: #9a7500;
  --pink: #c2497f;
  --purple: #6e35b5;
  --black: #211f1d;

  /* ink at fixed opacities — DOT_EMPTY, DOT_FUTURE and MUTED in the app */
  --muted: rgba(46, 42, 214, 0.45);
  --dot-empty: rgba(46, 42, 214, 0.2);
  --dot-future: rgba(46, 42, 214, 0.1);
  --rule: rgba(46, 42, 214, 0.16);

  --mono: 'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --hand: 'Caveat', 'Segoe Script', cursive;

  --pill-radius: 8px;
  --sheet-radius: 20px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  /* every string in the app is lowercase, and the site is not an exception */
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}

/*
 * the one place uppercase survives.
 *
 * a legal page has to be able to say "App Store" and mean the proper noun,
 * and lowercasing an address or a company name makes it wrong rather than
 * quiet. anything inside this class is left exactly as written.
 */
.as-written {
  text-transform: none;
}

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 24px;
}

.narrow {
  max-width: 620px;
}

/*
 * a comfortable line length, without moving the block it sits in.
 *
 * narrowing a section by shrinking its own .wrap pulls it out of line with
 * every other section — and with `margin: 0` on it, hard against the left of
 * the window. this constrains the text and leaves the container alone.
 */
.measure {
  max-width: 56ch;
}

/* ── type ─────────────────────────────────────────────────────────── */

h1,
h2,
h3 {
  font-weight: 400;
  line-height: 1.28;
  margin: 0;
}

h1 {
  font-size: clamp(30px, 6vw, 46px);
  letter-spacing: -0.5px;
}

h2 {
  font-size: clamp(20px, 3.4vw, 26px);
}

h3 {
  font-size: 15px;
}

p {
  margin: 0 0 16px;
}

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

.small {
  font-size: 13px;
}

.tiny {
  font-size: 11px;
}

.hand {
  font-family: var(--hand);
  text-transform: lowercase;
  font-size: 21px;
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--dot-empty);
  padding-bottom: 1px;
}

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

/* ── pill: filled ink, white mono 12, radius 8, padding 5x12 ──────── */

.pill {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  padding: 5px 12px;
  border-radius: var(--pill-radius);
  border: 0;
}

a.pill:hover {
  border: 0;
  opacity: 0.86;
}

/* ── layout ───────────────────────────────────────────────────────── */

header.top {
  padding: 26px 0 0;
}

header.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

nav {
  display: flex;
  gap: 20px;
  font-size: 13px;
}

nav a {
  border: 0;
  color: var(--muted);
}

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

section {
  padding: 74px 0;
}

.hero {
  padding: 56px 0 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  align-items: center;
}

.hero-copy p {
  max-width: 30ch;
}

/* ── the phone ────────────────────────────────────────────────────── */

/*
 * drawn rather than photographed.
 *
 * there is no simulator on this machine and there is no iphone attached to
 * it, so the screen below is not a screenshot — it is the app's own grid
 * geometry and the app's own doodle paths, rendered again in svg. it stays
 * sharp at any size, and it cannot go out of date the way a picture would.
 */
.phone {
  width: 300px;
  max-width: 100%;
  margin: 0 auto;
  display: block;
}

/* ── features ─────────────────────────────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 44px 36px;
}

.feature svg {
  display: block;
  margin-bottom: 14px;
}

.feature h3 {
  margin-bottom: 6px;
}

.feature p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* a drawn rule, the same hand-wobbled line the app uses under its fields */
.rule {
  display: block;
  width: 100%;
  height: 3px;
  overflow: visible;
}

/* ── prose pages ──────────────────────────────────────────────────── */

.prose {
  padding: 44px 0 90px;
}

.prose h2 {
  margin: 42px 0 14px;
}

.prose h2:first-of-type {
  margin-top: 28px;
}

.prose ul {
  margin: 0 0 18px;
  padding-left: 18px;
}

.prose li {
  margin-bottom: 8px;
}

.prose .lede {
  font-size: 17px;
  margin-bottom: 8px;
}

footer {
  padding: 40px 0 60px;
  color: var(--muted);
  font-size: 12px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
}

footer .spacer {
  flex: 1;
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 34px;
  }

  .hero-copy p {
    max-width: none;
  }

  section {
    padding: 54px 0;
  }
}
