/* The site wears the app's own look: the dark tokens of apps/mobile/src/theme/tokens.json,
   and its three typefaces, served from this site (see apps/web/make-fonts.py).
   Like the app, it is dark whatever the visitor's device is set to.
   No inline styles and no scripts anywhere: the Content-Security-Policy in vercel.json refuses both. */

@font-face { font-family: 'Saira Condensed'; font-weight: 600; font-display: swap; src: url('/fonts/SairaCondensed-SemiBold.woff') format('woff'); }
@font-face { font-family: 'Saira Condensed'; font-weight: 700; font-display: swap; src: url('/fonts/SairaCondensed-Bold.woff') format('woff'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url('/fonts/IBMPlexSans-Regular.woff') format('woff'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url('/fonts/IBMPlexSans-SemiBold.woff') format('woff'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url('/fonts/IBMPlexMono-Regular.woff') format('woff'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url('/fonts/IBMPlexMono-Medium.woff') format('woff'); }

:root {
  color-scheme: dark;
  --asphalt: #0e1218;
  --panel: #161c25;
  --well: #090c11;
  --rule: #273040;
  --chalk: #e8ecf2;
  --haze: #96a1b2;
  --signal: #8098ff;
  --signal-ink: #0e1218;
  --ready: #3dcb86;
  --building: #f0b43c;
  --failed: #ff6b5e;
  --idle: #798494;

  --display: 'Saira Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace;

  --gutter: max(1.25rem, env(safe-area-inset-left, 0px));
  --page: 68rem;
}

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

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

body {
  margin: 0;
  background: var(--asphalt);
  color: var(--chalk);
  font: 400 1.0625rem/1.6 var(--body);
}

a { color: var(--signal); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

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

/* Small capitals in the data face: section labels, column heads, notes. */
.label {
  font: 500 0.6875rem/1rem var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--haze);
}

.haze { color: var(--haze); }
.mono { font-family: var(--mono); font-size: 0.92em; }

/* ---------- top of the page ---------- */

.top { border-bottom: 1px solid var(--rule); background: var(--well); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.875rem; }
.wordmark {
  font: 700 1.5rem/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--chalk);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
/* The logo's mark, beside the name. The name itself stays text. */
.wordmark .mark { display: block; width: 1.75rem; height: 1.75rem; }
.top nav { display: flex; gap: 1.25rem; }
.top nav a { font: 500 0.75rem/1rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- hero ---------- */

.hero { background: var(--well); border-bottom: 1px solid var(--rule); }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  padding-block: 3rem 3.5rem;
}
.hero h1 {
  font: 700 clamp(2.75rem, 9vw, 4.75rem)/0.94 var(--display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
  margin-top: 0.875rem;
}
.hero .lede { margin-top: 1.25rem; max-width: 34rem; font-size: 1.1875rem; line-height: 1.55; }
.hero .status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font: 500 0.75rem/1rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero .after { margin-top: 0.75rem; font-size: 0.9375rem; color: var(--haze); }

@media (min-width: 60rem) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr) 22.5rem; gap: 4rem; align-items: center; padding-block: 4.5rem 5rem; }
}

/* ---------- the Wall, drawn as the app draws it ---------- */

.phone {
  width: 100%;
  max-width: 22.5rem;
  margin-inline: auto;
  background: var(--asphalt);
  border: 1px solid var(--rule);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.45);
}
.phone figcaption { padding: 0.625rem 1rem 0.75rem; border-top: 1px solid var(--rule); text-align: center; }

.screen-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; padding: 1rem 1rem 0.75rem; }
.screen-head .title { font: 700 1.875rem/2.25rem var(--display); letter-spacing: 0.025em; text-transform: uppercase; }
.screen-head .as-of { font: 400 0.6875rem/1rem var(--mono); text-transform: uppercase; color: var(--haze); font-variant-numeric: tabular-nums; }

.row { display: flex; border-top: 1px solid var(--rule); }
.row .stripe { flex: none; width: 4px; border-radius: 0 2px 2px 0; background: var(--state); }
.row .pos { flex: none; width: 2rem; padding-top: 0.75rem; text-align: center; font: 500 0.6875rem/1rem var(--mono); color: var(--haze); font-variant-numeric: tabular-nums; }
.row .cell { flex: 1; min-width: 0; padding: 0.75rem 1rem 0.75rem 0; }
.row .head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.row .name { font: 600 0.9375rem/1.375rem var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .age { font: 400 0.6875rem/1rem var(--mono); color: var(--haze); }

.line { display: flex; align-items: center; margin-top: 2px; font: 400 0.6875rem/1rem var(--mono); }
.line .what { flex: none; width: 4rem; text-transform: uppercase; color: var(--haze); }
.line .state { flex: none; width: 7rem; }
.line .detail { flex: 1; min-width: 0; color: var(--haze); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* A state is a shape, then a word, then a colour. */
.state { display: inline-flex; align-items: center; gap: 0.375rem; font: 500 0.6875rem/1rem var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--state); white-space: nowrap; }
.state::before { content: ''; flex: none; width: 0.5rem; height: 0.5rem; margin: 0 1px; background: var(--state); }
.is-failed { --state: var(--failed); }
.is-building, .is-warning { --state: var(--building); }
.is-ready { --state: var(--ready); }
.is-idle { --state: var(--idle); }
.state.is-ready::before { border-radius: 50%; }
.state.is-building::before, .state.is-warning::before {
  width: 0; height: 0; margin: 0; background: none;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid var(--state);
}
.state.is-idle::before { height: 2px; }

.bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; padding: 0.75rem 1rem 1rem; border-top: 1px solid var(--rule); background: var(--panel); }
.bar span { padding: 0.5rem 0; border: 1px solid var(--rule); border-radius: 6px; text-align: center; font: 600 0.8125rem/1.25rem var(--body); }
.bar span:first-child { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }

/* ---------- sections ---------- */

.section { border-bottom: 1px solid var(--rule); }
.section .wrap { padding-block: 3.5rem; }
.section h2 {
  font: 600 clamp(1.875rem, 5vw, 2.5rem)/1.05 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
  margin-top: 0.625rem;
}
.section .intro { margin-top: 0.875rem; max-width: 40rem; color: var(--haze); }

.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 3rem; margin-top: 2rem; }
.grid > * { min-width: 0; padding-block: 1.25rem; border-top: 1px solid var(--rule); }
.grid h3 { font: 600 1.125rem/1.4 var(--body); margin-top: 0.375rem; }
.grid p { margin-top: 0.375rem; color: var(--haze); font-size: 1rem; }
@media (min-width: 48rem) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* How a row reads: the legend. */
.legend { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem 3rem; margin-top: 2rem; align-items: start; }
@media (min-width: 52rem) { .legend { grid-template-columns: 22.5rem minmax(0, 1fr); } }
.legend .sample { border: 1px solid var(--rule); border-top: 0; border-radius: 0 0 6px 6px; background: var(--asphalt); max-width: 22.5rem; }
.legend dl { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.625rem 1rem; align-items: baseline; }
.legend dd { color: var(--haze); font-size: 1rem; }
.legend .note { margin-top: 1.25rem; color: var(--haze); font-size: 1rem; max-width: 34rem; }

/* Free and Pro. */
.plans { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; margin-top: 2rem; }
@media (min-width: 48rem) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plan { min-width: 0; padding: 1.5rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); }
.plan .price { margin-top: 0.5rem; font: 700 2.25rem/1.1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.plan .terms { margin-top: 0.25rem; font: 400 0.8125rem/1.25rem var(--mono); color: var(--haze); }
.plan ul { margin-top: 1.125rem; }
.plan li { padding-block: 0.625rem; border-top: 1px solid var(--rule); font-size: 1rem; }
.plan li span { display: block; color: var(--haze); font-size: 0.9375rem; }
.plans-note { margin-top: 1.25rem; max-width: 40rem; color: var(--haze); font-size: 1rem; }

/* ---------- foot ---------- */

.foot .wrap { padding-block: 2rem 3rem; display: grid; gap: 0.75rem; }
.foot p { color: var(--haze); font-size: 0.875rem; max-width: 46rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font: 500 0.75rem/1rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- a page of text: the privacy policy, the page for a wrong address ---------- */

.text .wrap { max-width: 44rem; padding-block: 3rem 4rem; }
.text h1 { font: 700 clamp(2.25rem, 7vw, 3.25rem)/1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; margin-top: 0.625rem; }
.text .dated { margin-top: 0.75rem; }
.text h2 { font: 600 1.25rem/1.35 var(--body); margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.text h3 { font: 600 1.0625rem/1.4 var(--body); margin-top: 1.5rem; }
.text p { margin-top: 0.875rem; }
.text ul { margin-top: 0.875rem; padding-left: 1.25rem; list-style: square; }
.text li { margin-top: 0.375rem; padding-left: 0.25rem; }
.text li::marker { color: var(--idle); }
.text .short { margin-top: 1.75rem; padding: 1.25rem 1.5rem 1.5rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); }
.text .short ul { margin-top: 0.625rem; }
.text .scroll { overflow-x: auto; margin-top: 1rem; }
.text table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 0.9375rem; }
.text th { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--rule); font: 500 0.6875rem/1rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--haze); }
.text td { vertical-align: top; padding: 0.625rem 0.75rem 0.625rem 0; border-bottom: 1px solid var(--rule); }

/* The token hand-off page (/qr): the site's one field, and the code its one script draws. */
.handoff { margin-top: 1.75rem; padding: 1.25rem 1.5rem 1.5rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); }
.handoff label { display: block; }
.handoff input { display: block; width: 100%; margin-top: 0.5rem; padding: 0.75rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--well); color: var(--chalk); font: 400 0.9375rem/1.5 var(--mono); }
.handoff input::placeholder { color: var(--idle); }
.handoff .buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.875rem; }
.handoff button { padding: 0.625rem 1rem; border: 1px solid var(--rule); border-radius: 6px; background: transparent; color: var(--chalk); font: 600 0.9375rem/1.25rem var(--body); cursor: pointer; }
.handoff button.primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.handoff .status { min-height: 1.6em; color: var(--haze); font-size: 1rem; }
/* A code is dark on light whatever the page is, and its modules are drawn as squares, not smoothed. */
.handoff canvas { display: block; width: min(100%, 22rem); height: auto; margin-top: 1rem; border-radius: 6px; image-rendering: pixelated; }
.text .handoff-off { margin-top: 1.75rem; padding: 1rem 1.25rem; border-left: 3px solid var(--building); background: var(--panel); }

/* ---------- the beta (/beta), and the way to it from the front page ---------- */

/* A link that is the thing to do on its page, dressed as the app's primary button. Signal, as every interactive thing is. */
.button { display: inline-block; padding: 0.75rem 1.25rem; border-radius: 6px; background: var(--signal); color: var(--signal-ink); font: 600 1rem/1.25rem var(--body); text-decoration: none; }
.button:hover { background: var(--chalk); }

.hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.875rem 1rem; margin-top: 1.75rem; }
.hero .actions .status { margin-top: 0; }

/* A build of the beta: its download and its facts, in the data face. Written by apps/web/stamp-beta.js. */
.text .build { margin-top: 1.75rem; padding: 1.25rem 1.5rem 1.5rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); }
.text .build p:first-child { margin-top: 0; }
.build dl { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.375rem 1rem; margin-top: 1.25rem; font: 400 0.8125rem/1.375rem var(--mono); font-variant-numeric: tabular-nums; }
.build dt { font: 500 0.6875rem/1.375rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--haze); }
.build dd { overflow-wrap: anywhere; }

/* Numbered steps, with the number where a row of the Wall has its position. */
.text .steps { counter-reset: step; margin-top: 1rem; border-bottom: 1px solid var(--rule); }
.text .steps li { counter-increment: step; position: relative; margin-top: 0; padding: 0.75rem 0 0.75rem 2rem; border-top: 1px solid var(--rule); }
.text .steps li::before { content: counter(step); position: absolute; left: 0; top: 0.75rem; width: 1.25rem; text-align: center; font: 500 0.6875rem/1.7rem var(--mono); color: var(--haze); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
