/* The website of Not a Math Person. It wears the app's own colours and typefaces, which travel
   with it: nothing here is fetched from anyone else. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo.woff2") format("woff2");
}

@font-face {
  font-family: "B612 Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/b612-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "B612 Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/b612-mono-700.woff2") format("woff2");
}

:root {
  --body: #e8eae3;
  --paper: #fdfdf8;
  --line: #c8ccbf;
  --ink: #161a14;
  --dim: #5a6054;
  --lcd: #c7d0b9;
  --accent: #f5be0b;
  --accent-ink: #1b1a0a;
  --frame: #161a14;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --body: #1a1d18;
    --paper: #262b23;
    --line: #363c31;
    --ink: #eceee5;
    --dim: #9aa18f;
    --lcd: #2b3126;
    --frame: #050604;
  }
}

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

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

body {
  margin: 0;
  background: var(--body);
  color: var(--ink);
  font: 400 17px/1.55 "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.wrap {
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: 20px;
}

.narrow {
  max-width: 680px;
}

/* ---------- The top of every page ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

/* The yellow = key, as on the app's icon. */
.key {
  display: grid;
  flex: none;
  align-content: center;
  justify-items: center;
  gap: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.key i {
  display: block;
  width: 13px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent-ink);
}

.top nav {
  display: flex;
  gap: 22px;
  font-weight: 600;
}

.top nav a {
  color: var(--dim);
  text-decoration: none;
}

.top nav a:hover,
.top nav a[aria-current="page"] {
  color: var(--ink);
}

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

h1 {
  margin: 0 0 18px;
  font-size: clamp(40px, 8vw, 76px);
  line-height: 1;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.narrow h1 {
  font-size: clamp(36px, 9vw, 52px);
}

/* Small engraved labels, like the legends printed around a calculator's keys. */
h2,
.label {
  margin: 0 0 8px;
  font: 400 13px/1.3 "B612 Mono", ui-monospace, Menlo, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

p {
  margin: 0 0 12px;
}

.lede {
  max-width: 34ch;
  margin: 0;
  font-size: clamp(19px, 2.6vw, 23px);
  line-height: 1.4;
  color: var(--dim);
}

.narrow .lede {
  max-width: none;
  font-size: 19px;
}

/* ---------- The front page ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 48px;
  padding-block: 28px 56px;
}

.hero .phone {
  justify-self: center;
  width: min(100%, 300px);
}

/* Where to get it, or that it is on its way. */
.get {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  margin-top: 28px;
  padding: 0 24px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-weight: 650;
  text-decoration: none;
}

a.get {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.about {
  max-width: 62ch;
  padding-block: 8px 44px;
  font-size: 19px;
  line-height: 1.5;
}

/* A picture of the app, in the outline of a phone. */
.phone {
  margin: 0;
  overflow: hidden;
  border: 7px solid var(--frame);
  border-radius: 38px;
  background: var(--frame);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.45);
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
}

/* The rest of the pictures, in a row that can be pushed along. */
.phones {
  display: flex;
  gap: 22px;
  margin-inline: -20px;
  padding: 8px 20px 34px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.phones figure {
  flex: none;
  width: min(64vw, 236px);
  margin: 0;
  scroll-snap-align: center;
}

.phones figcaption {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--dim);
}

.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px 40px;
  padding-block: 44px 20px;
  border-top: 1px solid var(--line);
}

.points p {
  margin: 0;
}

/* ---------- The pages of words ---------- */

.words {
  padding-block: 20px 8px;
}

.words section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

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

.words h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

/* The name of something on the app's own screen. */
.words b {
  font-weight: 650;
}

.missing {
  padding: 14px 16px;
  border: 1.5px dashed var(--ink);
  border-radius: 12px;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 56px;
  padding-block: 24px 48px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--dim);
}

.foot a {
  color: inherit;
}

/* The name has a line to itself, and the ways on sit under it. */
.foot span {
  flex-basis: 100%;
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding-block: 12px 40px;
  }

  .hero .phone {
    width: min(78%, 280px);
  }
}

/* On a narrow phone the name and the two links still share one line. */
@media (max-width: 430px) {
  .top nav {
    gap: 14px;
    font-size: 15px;
  }

  .brand {
    font-size: 16px;
    gap: 8px;
  }
}
