/*
 * The page, in the app's own colours (ADR-0015): base, surface, raised and line
 * for ground; ink and ink-dim for text; amber for the one thing being pointed at.
 *
 * No framework, no webfont, no JavaScript. The audience arrives on a phone on a
 * bad connection to find out whether this thing is worth installing, and every
 * request before the download link is a request that can fail. Barlow is the
 * app's face but it is a download; the system stack is already on the device.
 */

:root {
  --base: #0a0b0d;
  --surface: #141619;
  --raised: #1e2228;
  --line: #2a2f37;
  --ink: #f2f4f7;
  --ink-dim: #9ba3ae;
  --amber: #ffc24b;
  --amber-ink: #16180c;
  --red: #ff4a3d;

  --measure: 34rem;
  --gutter: 1.25rem;
}

* { box-sizing: border-box; }

html {
  background: var(--base);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--base);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

h1, h2, h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.5rem; margin-top: 0; }
h3 { font-size: 1.0625rem; }

p { max-width: var(--measure); }

.lede {
  font-size: 1.25rem;
  color: var(--ink);
}

.dim { color: var(--ink-dim); }

.small { font-size: 0.9375rem; }

/* Header -------------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

/* Hero ---------------------------------------------------------------- */

.hero {
  padding: 3rem 0 2.5rem;
}

.hero h1 { margin-bottom: 0.75rem; }

/* Sections ------------------------------------------------------------ */

section {
  padding: 2.25rem 0;
  border-top: 1px solid var(--line);
}

section:first-of-type { border-top: 0; }

/* The button ---------------------------------------------------------- */

.button {
  display: inline-block;
  background: var(--amber);
  color: var(--amber-ink);
  font-weight: 650;
  font-size: 1.0625rem;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 3px;
}

.button:hover, .button:focus {
  background: var(--ink);
  color: var(--base);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem;
  margin: 1.5rem 0 0.75rem;
}

/* Cards and panels ---------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.25rem;
  margin: 1.25rem 0;
}

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

.panel-warning {
  border-left: 3px solid var(--red);
}

.panel h3 { margin-top: 0; }

/* Lists --------------------------------------------------------------- */

.reasons {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 1.25rem;
}

.reasons h3 { margin-bottom: 0.25rem; }
.reasons p { margin: 0; color: var(--ink-dim); }

/* Tiers --------------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9375rem;
}

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

th { color: var(--ink-dim); font-weight: 600; }
thead th { white-space: nowrap; }

/* The two tier columns get equal room. Left to itself the browser gives the
   feature names everything and wraps "the whole line-up" over three lines. */
th:not(:first-child), td:not(:first-child) { width: 27%; }
td:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; }

.yes { color: var(--ink); }
.no { color: var(--ink-dim); }

.price {
  font-size: 1.25rem;
  font-weight: 650;
}

/* Downloads ----------------------------------------------------------- */

.download {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.1rem 1.25rem;
  margin: 0.85rem 0;
}

.download-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.download-abi {
  font-weight: 650;
}

.download-meta {
  color: var(--ink-dim);
  font-size: 0.9375rem;
}

.checksum {
  display: block;
  margin-top: 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--ink-dim);
  word-break: break-all;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  font-size: 0.9375em;
  color: var(--ink);
}

.shortcode {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.375rem;
  background: var(--base);
  border: 1px solid var(--amber);
  border-radius: 3px;
  padding: 0.5rem 1rem;
  margin: 0.75rem 0;
  color: var(--amber);
}

.release {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.release-notes {
  white-space: pre-wrap;
  color: var(--ink-dim);
  max-width: var(--measure);
}

/* Screenshots --------------------------------------------------------- */

.shot {
  margin: 1.5rem 0 2rem;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  /* The reserved box comes from width/height on the tag; this keeps the space
     the right shape while the image is still on its way, so nothing jumps. */
  aspect-ratio: 16 / 9;
  background: var(--surface);
}

.shot figcaption {
  margin-top: 0.6rem;
  color: var(--ink-dim);
  font-size: 0.9375rem;
  max-width: var(--measure);
}

/* A screenshot of a 1280 px television screen inside a 48 rem column of prose is
   a screenshot nobody can read. Where there is room, the figures break out of the
   column; the words stay at a readable measure. */
@media (min-width: 54rem) {
  .shot {
    width: min(calc(100vw - 3rem), 64rem);
    margin-left: 50%;
    transform: translateX(-50%);
  }

  .shot figcaption { max-width: var(--measure); }
}

/* A phone shot is portrait and tall. Drawn at the width it would be held at,
   rather than letting a 2400 px screenshot set the height of the page. */
.shot-phone img {
  aspect-ratio: 9 / 20;
  max-width: 17rem;
  margin: 0 auto;
}

/* The phone shot is already the size it should be drawn at; breaking it out of
   the column would only move it, not help it. */
@media (min-width: 54rem) {
  .shot-phone { width: auto; margin-left: 0; transform: none; }
  .shot-phone figcaption { margin: 0.6rem auto 0; }
}

.shot-phone figcaption { text-align: center; }

/* Flash --------------------------------------------------------------- */

.flash {
  max-width: none;
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 3px;
  background: var(--surface);
  border-left: 3px solid var(--amber);
}

.flash-alert { border-left-color: var(--red); }

/* Pairing -------------------------------------------------------------- */

.pairing-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: var(--amber);
}

.field {
  display: block;
  width: 100%;
  max-width: 22rem;
  background: var(--base);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  font-size: 1.0625rem;
  font-family: inherit;
  padding: 0.75rem 0.85rem;
  margin: 0.5rem 0 0.85rem;
}

.field:focus {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}

label { font-weight: 600; }

/* Footer -------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding: 1.75rem 0 3rem;
  color: var(--ink-dim);
  font-size: 0.9375rem;
}

/* Phone --------------------------------------------------------------- */

@media (max-width: 30rem) {
  h1 { font-size: 2rem; }
  .hero { padding: 2rem 0 1.75rem; }

  /* A thumb, not a mouse pointer: the button takes the width it is given. */
  .button-row { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .button { display: block; text-align: center; }

  table { font-size: 0.875rem; }
  th, td { padding: 0.6rem 0.35rem; }
}
