@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fcfcfc;
  --ink: #1b1b1b;
  --quiet: #6b6b6b;
  --faint: #a3a3a3;
  --wash: #f2f2f2;
  --line: #ececec;
  --shot: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.07);
  --column: 644px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --ink: #ededed;
    --quiet: #9a9a9a;
    --faint: #616161;
    --wash: #1e1e1e;
    --line: #242424;
    --shot: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --bg: #111111;
  --ink: #ededed;
  --quiet: #9a9a9a;
  --faint: #616161;
  --wash: #1e1e1e;
  --line: #242424;
  --shot: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 8px 24px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/26px "Inter", system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: calc(var(--column) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 72px var(--gutter) 96px;
}

h1,
h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 26px;
}

p {
  margin: 0;
  color: var(--quiet);
}

p + p {
  margin-top: 16px;
}

section {
  margin-top: 40px;
}

section h2 + * {
  margin-top: 12px;
}

a {
  color: var(--ink);
  font-weight: 450;
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

code {
  color: var(--ink);
  font: 450 14px/1 ui-monospace, "SF Mono", Menlo, monospace;
}

.ink {
  color: var(--ink);
  font-weight: 450;
}

.num {
  font-variant-numeric: tabular-nums;
}

.who {
  display: flex;
  align-items: center;
  gap: 12px;
}

.who h1,
.who p {
  line-height: 22px;
}

.who a {
  display: block;
  line-height: 0;
}

.spark {
  display: block;
  width: 40px;
  height: 40px;
  color: var(--ink);
}

/* The one loud thing on the page, and it's still only a line of text. */
.demo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding: 14px 14px 14px 18px;
  background: var(--wash);
  border-radius: 12px;
}

.meter {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-width: 0;
}

#state {
  font-weight: 500;
}

#bytes {
  color: var(--ink);
  font-weight: 450;
}

.demo.paused #bytes {
  color: var(--quiet);
}

.unit {
  color: var(--quiet);
}

button {
  flex: none;
  min-width: 84px;
  height: 36px;
  padding: 0 14px;
  color: var(--bg);
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  font: 500 15px/1 "Inter", system-ui, sans-serif;
  font-feature-settings: "ss03";
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:active {
  opacity: 0.8;
}

.note {
  margin-top: 10px;
  padding: 0 2px;
  font-size: 14px;
  line-height: 22px;
}

/* The app's own window, at the size it opens, lying on the same wash as the demo. */
figure {
  margin: 12px 0 0;
}

figcaption {
  margin-top: 10px;
  padding: 0 2px;
  color: var(--quiet);
  font-size: 14px;
  line-height: 22px;
}

.stage {
  display: grid;
  place-items: center;
  padding: 42px;
  background: var(--wash);
  border-radius: 12px;
}

.stage img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shot);
}

.stage .dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stage .light {
    display: none;
  }

  :root:not([data-theme="light"]) .stage .dark {
    display: block;
  }
}

:root[data-theme="dark"] .stage .light {
  display: none;
}

:root[data-theme="dark"] .stage .dark {
  display: block;
}

.shots .note {
  margin-top: 4px;
  color: var(--faint);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin-top: 12px;
}

.tabs button {
  min-width: 0;
  height: 30px;
  padding: 0;
  color: var(--quiet);
  background: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 400;
}

.tabs button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 500;
}

.live .rack {
  display: grid;
}

/* Sharing a cell keeps the page still when the screen changes. */
.live figure {
  display: flex;
  flex-direction: column;
  grid-area: 1 / 1;
  min-width: 0;
  visibility: hidden;
}

.live figure.on {
  visibility: visible;
}

.live .stage {
  flex: 1;
}

.facts,
.prices {
  margin: 12px 0 0;
}

.facts div + div {
  margin-top: 16px;
}

dt {
  font-weight: 450;
}

dd {
  margin: 0;
  color: var(--quiet);
}

.prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.prices dd.num {
  color: var(--ink);
}

.plain {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--quiet);
}

.plain li + li {
  margin-top: 8px;
}

/* Label on the left, numbers on the right, ruled like a lab notebook and no louder. */
.measured {
  width: 100%;
  margin: 12px 0 0;
  border-collapse: collapse;
}

.measured th,
.measured td {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: baseline;
}

.measured tr:last-child th,
.measured tr:last-child td {
  border-bottom: 1px solid var(--line);
}

.measured th {
  padding-right: 16px;
  color: var(--quiet);
  font-weight: 400;
}

.measured thead th {
  border-top: 0;
  color: var(--faint);
  font-size: 14px;
}

.measured td {
  padding-left: 16px;
  color: var(--ink);
  font-weight: 450;
  text-align: right;
  white-space: nowrap;
}

.measured thead th:not(:first-child) {
  text-align: right;
}

.measured + .note {
  margin-top: 10px;
}

footer {
  margin-top: 72px;
  color: var(--quiet);
}

footer a + a {
  margin-left: 18px;
}

@media (max-width: 520px) {
  main {
    padding-top: 48px;
  }

  :root {
    --gutter: 16px;
  }

  .prices {
    grid-template-columns: 1fr;
  }

  .demo {
    padding: 12px 12px 12px 14px;
  }

  .unit {
    display: none;
  }

  .stage {
    padding: 12px;
  }

  /* On a phone the label takes the whole line, and the numbers sit under it. */
  .measured tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
  }

  .measured thead tr {
    padding-bottom: 0;
    border-top: 0;
  }

  .measured tr:last-child {
    border-bottom: 1px solid var(--line);
  }

  .measured th,
  .measured td,
  .measured tr:last-child th,
  .measured tr:last-child td {
    padding: 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }

  .measured tbody th {
    grid-column: 1 / -1;
    margin-bottom: 2px;
  }

  .measured thead th:first-child {
    display: none;
  }

  .measured thead th:not(:first-child) {
    text-align: left;
  }

  .measured td:empty {
    display: none;
  }
}

@media (pointer: coarse) {
  button {
    height: 44px;
  }

  .tabs button {
    height: 44px;
  }
}
