/**
 * Atmovault - the public site.
 *
 * The console's design language, carried outside the app. Tokens are copied from
 * `frontend/src/styles.css` rather than re-picked, so the marketing page and the
 * product it advertises are lit by the same lamp. If a value here disagrees with the
 * one there, this file is the one that is wrong.
 *
 * THE ONE RULE, inherited unchanged:
 *
 *     There is a single light source, above and slightly in front. Every raised
 *     surface gets a bright top rim, a darker underside, and a shadow cast DOWN.
 *     Every recessed surface gets the exact inverse.
 *
 * COLOUR: white on near-black, no hue anywhere. The app reserves red for the moment a
 * deletion is confirmed; nothing on this site deletes anything, so red does not appear
 * here at all. White is rationed by area exactly as a saturated accent would be - one
 * lit key per page.
 *
 * TYPE splits three ways, and the split is an argument rather than a decoration:
 *   display - Archivo, semi-expanded. Titles and the brand.
 *   mono    - anything the server can see. On this site that means it is also the
 *             typeface of every claim about what is observable, and of the group
 *             labels down the left of the feature list.
 *   sans    - anything the server cannot, and ordinary prose.
 *
 * Dark only, for the same reason as the app: the depth system is light falling through
 * darkness and there is no honest light translation of it.
 */

@font-face {
  font-family: 'Archivo Display';
  src: url('./fonts/archivo-display.woff2') format('woff2-variations');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plex Mono';
  src: url('./fonts/plex-mono-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plex Mono';
  src: url('./fonts/plex-mono-semibold.woff2') format('woff2');
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --void: #0b0b0c;
  --panel: #141416;
  --raise: #1e1e21;
  --raise-2: #27272a;
  --well: #050506;
  --line: rgba(255, 255, 255, 0.075);
  --line-hi: rgba(255, 255, 255, 0.14);

  --text: #f2f2f0;
  --dim: #9d9d99;
  --faint: #91918c;

  --signal: #ffffff;
  --signal-dim: #d6d6d3;
  --signal-wall: #63636a;
  --signal-ink: #0b0b0c;

  --d1:
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.34);
  --d2:
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 6px 14px rgba(0, 0, 0, 0.38),
    0 14px 30px rgba(0, 0, 0, 0.26);
  --d3:
    0 4px 8px rgba(0, 0, 0, 0.5),
    0 12px 24px rgba(0, 0, 0, 0.4),
    0 26px 56px rgba(0, 0, 0, 0.32),
    0 48px 100px rgba(0, 0, 0, 0.24);

  --rim: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --underside: inset 0 -10px 18px -12px rgba(0, 0, 0, 0.85);

  /* A file, not a data: URL: the site's content policy allows images from itself only,
     and a data: image is not that, so the grain was silently dropped once served. */
  --grain: url("./img/grain.svg");

  --display: 'Archivo Display', system-ui, sans-serif;
  --sans:
    system-ui, -apple-system, 'Segoe UI Variable Text', 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --r: 14px;
  --r-sm: 10px;
  --r-lg: 20px;
  --readout: 11px;
  --control: 42px;

  /* The app's single spacing unit. Every gap on this site is a multiple of it. */
  --u: 14px;
  --measure: 68ch;
  --page: 1080px;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Room lighting and the engineered grid, exactly as the console does it: one soft pool
   of white where the header sits, so every shadow below has something to be cast away
   from, plus the 64px rule masked out toward the edges. On a pseudo-element, because
   atmosphere should not cost the document a node. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    radial-gradient(90% 50% at 50% -10%, rgba(255, 255, 255, 0.04) 0%, transparent 62%);
  background-size:
    64px 64px,
    64px 64px,
    100% 100%;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 78%);
}

/* The grain sits above the lighting and below the content. Same texture as the app, at
   the same strength, so a screenshot of one does not look cleaner than the other. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.032;
  mix-blend-mode: overlay;
}

/* Everything real sits above the atmosphere. */
.shell {
  position: relative;
  z-index: 1;
}

/* The index, whose headline and figure need the room. The legal pages keep the
   narrower page, because their job is a readable column. */
.shell--wide {
  --page: 1240px;
}

::selection {
  background: var(--signal);
  color: var(--signal-ink);
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 4px;
}

a {
  color: var(--text);
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--signal);
}

/* ---------------------------------------------------------------- type roles ---- */

h1,
h2,
h3 {
  font-family: var(--display);
  font-variation-settings: 'wdth' 112;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.06;
  margin: 0;
  text-wrap: balance;
}

/* Dialled back from the sizes a launch page would use. The display face is here to set
   the brand, not to shout; at 3.2rem the h1 still leads the page without turning a
   plain statement into a slogan. */
h1 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
}

h3 {
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

/* The readout: the app's column heads and metadata label. Used here for eyebrows and
   for anything that names a machine-visible quantity. */
.readout {
  font-family: var(--mono);
  font-size: var(--readout);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 calc(var(--u) * 1.2);
}

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

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

/* Read out by a screen reader, absent from the page. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------- keys ---- */

/**
 * The extruded key, lifted wholesale from the console.
 *
 * The side wall is a zero-blur box-shadow: a hard band of darker colour under the
 * face, which is literally the extruded edge. Pressing shrinks the wall and moves the
 * face down by the same distance, so the control travels rather than merely
 * recolouring.
 */
.key {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: var(--control);
  padding: 0 var(--u);
  border: 0;
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.12s var(--ease),
    box-shadow 0.12s var(--ease);
}

/* Graphite: the quiet half of every action pair. */
.key--ghost {
  color: #e2e2de;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, #3b3b41 0%, #232327 55%, #1c1c1f 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -8px 12px -8px rgba(0, 0, 0, 0.9),
    0 4px 0 #0b0b0d,
    var(--d1);
}

.key--ghost:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -8px 12px -8px rgba(0, 0, 0, 0.9),
    0 6px 0 #0b0b0d,
    var(--d2);
}

.key--ghost:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 3px 9px rgba(0, 0, 0, 0.8),
    0 0 0 #0b0b0d;
}

/* The lit key. One per page - it is the whole of the white budget outside the reveal. */
.key--primary {
  color: var(--signal-ink);
  text-shadow: none;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfa 62%, #e9e9e6 100%);
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -7px 9px -7px rgba(90, 90, 96, 0.35),
    0 4px 0 var(--signal-wall),
    var(--d1);
}

.key--primary:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -7px 9px -7px rgba(90, 90, 96, 0.3),
    0 6px 0 var(--signal-wall),
    var(--d2);
}

.key--primary:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 3px 8px rgba(60, 60, 66, 0.5),
    0 0 0 var(--signal-wall);
}

/* A call to action, sized to sit under a headline. */
.key--lg {
  height: 52px;
  padding: 0 calc(var(--u) * 1.6);
  border-radius: 12px;
  font-size: 16px;
}

.keys {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--u) * 1.2);
  align-items: center;
}

/* -------------------------------------------------------------------- frame ---- */

.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--u);
  padding: var(--u) calc(var(--u) * 1.6);
  background: rgba(11, 11, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  width: 26px;
  height: 26px;
  display: block;
}

.brand span {
  font-family: var(--display);
  font-variation-settings: 'wdth' 112;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.bar nav {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1.4);
}

.bar nav a {
  font-size: 13.5px;
  color: var(--dim);
  text-decoration: none;
}

.bar nav a:hover {
  color: var(--text);
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 calc(var(--u) * 1.6);
}

/* `section.wrap` rather than `section`, and padding-block rather than the shorthand.
   Nearly every section on this site carries `.wrap` too, and a class beats an element
   selector - so a bare `section` rule loses its vertical padding to `.wrap`'s
   `padding: 0 ...` and the sections run into each other. Matching both, and touching
   only the block axis, leaves the horizontal gutter where it was. */
section.wrap,
section {
  padding-block: calc(var(--u) * 5);
}

/* The eyebrow sits tight to the heading and the heading needs air beneath it, so the
   gap belongs here rather than on every following paragraph. Scoped to <section> so it
   cannot reach the legal pages, which set their own rhythm. */
section h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  margin-bottom: calc(var(--u) * 1.6);
}

/* The lifted panel: the console's content surface. Raised, so it takes the bright top
   rim, the darker underside, and a shadow cast down. */
.panel {
  background: var(--panel);
  border-radius: var(--r-lg);
  padding: calc(var(--u) * 2.4);
  box-shadow:
    var(--rim),
    var(--underside),
    var(--d2);
}

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

/**
 * One promise at headline scale, one sentence, one lit key, and the proof beside them.
 *
 * The figure is the app's signature moment run the other way. In the app a name arrives
 * as its own ciphertext and resolves; here a name is picked out on the raised panel and
 * its ciphertext is typed into the well beneath, which is the upload as the server
 * experiences it. Raised for the device and recessed for the server is the one rule
 * doing the explaining: what is yours is lit, what is stored is in the dark.
 *
 * It moves by CSS alone, so it costs the site no script and reads the same with
 * JavaScript off. Still, it shows both lists whole.
 */
section.hero {
  display: grid;
  gap: calc(var(--u) * 2.2);
  padding-block: calc(var(--u) * 2) calc(var(--u) * 3);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: calc(var(--u) * 1.2);
}

.hero__sub {
  font-size: clamp(1.02rem, 1.5vw, 1.25rem);
  color: var(--dim);
  max-width: 46ch;
  margin-bottom: calc(var(--u) * 1.6);
  text-wrap: balance;
}

/* An item of its own between the two keys, so the gap on each side of it is the same. */
.keys__or {
  color: var(--dim);
}

.vault {
  position: relative;
  min-width: 0;
  margin: 0;
}

.vault__device {
  position: relative;
  z-index: 1;
  background: var(--panel);
  border-radius: var(--r-lg);
  padding: calc(var(--u) * 1.2) calc(var(--u) * 1.5) var(--u);
  box-shadow:
    var(--rim),
    var(--underside),
    var(--d3);
}

/* The inverse of the panel above it: no rim, a shadow falling in from the top, and a
   lit lip along the bottom edge. Narrower, so it reads as sitting behind. */
.vault__server {
  margin: -18px var(--u) 0;
  padding: 18px calc(var(--u) * 1.5) calc(var(--u) * 0.6);
  background: var(--well);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow:
    inset 0 0 0 1px var(--line),
    inset 0 14px 18px -10px #000,
    0 1px 0 rgba(255, 255, 255, 0.08);
}

/* The clasp between the two, straddling the panel's bottom edge: the one place on the
   page where the encryption happens. */
.vault__seal {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  height: 26px;
  margin: -13px auto calc(var(--u) * 0.8);
  padding: 0 12px;
  border-radius: 13px;
  background: var(--raise-2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    var(--d1);
  font-family: var(--mono);
  font-size: var(--readout);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.vault__seal::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
}

.vault .readout {
  margin-bottom: calc(var(--u) * 0.5);
}

.vault__rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vault__rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--u);
  height: 46px;
  margin-inline: calc(var(--u) * -0.7);
  padding-inline: calc(var(--u) * 0.7);
  border-radius: var(--r-sm);
}

.vault__server .vault__rows li {
  height: 34px;
}

.vault__name {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

/* A sheet and a folder, drawn rather than fetched. */
.vault__name::before {
  content: '';
  flex: none;
  width: 12px;
  height: 15px;
  margin-inline: 2px;
  border-radius: 2px 5px 2px 2px;
  box-shadow: inset 0 0 0 1.5px var(--dim);
}

.vault__folder .vault__name::before {
  width: 16px;
  height: 12px;
  margin-inline: 0;
  border-radius: 2px 4px 3px 3px;
  background: var(--dim);
  box-shadow: none;
}

.vault__size {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

.vault__server .vault__size {
  color: var(--faint);
}

.vault__cipher {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: -0.01em;
  color: var(--dim);
}

@media (min-width: 980px) {
  section.hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    align-items: center;
    gap: calc(var(--u) * 4);
    padding-block: calc(var(--u) * 6);
  }
}

/* Every animation on the site is inside this query, so a reader who asked for stillness
   gets a page on which nothing was ever set moving. */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy > *,
  .vault {
    animation: rise 0.7s var(--ease) backwards;
  }

  .hero__copy > :nth-child(2) {
    animation-delay: 0.08s;
  }

  .hero__copy > :nth-child(3) {
    animation-delay: 0.16s;
  }

  .vault {
    animation-delay: 0.22s;
  }

  /* One row every 2.5s, and the same delay on a name and on its ciphertext is what
     pairs them. The first waits a second for the figure to arrive. */
  .vault__device li {
    animation: lit 10s linear 1s infinite;
  }

  .vault__cipher {
    animation: seal 10s linear 1s infinite;
  }

  .vault__seal::before {
    animation: pulse 2.5s linear 1s infinite;
  }

  .vault__rows li:nth-child(2),
  .vault__rows li:nth-child(2) .vault__cipher {
    animation-delay: 3.5s;
  }

  .vault__rows li:nth-child(3),
  .vault__rows li:nth-child(3) .vault__cipher {
    animation-delay: 6s;
  }

  .vault__rows li:nth-child(4),
  .vault__rows li:nth-child(4) .vault__cipher {
    animation-delay: 8.5s;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes lit {
  0%,
  22%,
  100% {
    background-color: transparent;
  }

  2%,
  15% {
    background-color: rgba(255, 255, 255, 0.09);
  }
}

/* Typed in a character at a step, which is why the wipe is stepped and not eased. */
@keyframes seal {
  0% {
    clip-path: inset(0 100% 0 0);
    animation-timing-function: step-end;
  }

  3% {
    clip-path: inset(0 100% 0 0);
    animation-timing-function: steps(28, end);
  }

  15%,
  100% {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes pulse {
  0%,
  70%,
  100% {
    opacity: 0.35;
  }

  12%,
  50% {
    opacity: 1;
  }
}

/* ------------------------------------------------------------------ promises ---- */

/* Three claims, and each is the whole of its card. The mark is the ledger's mark for
   something held shut, so the two sections say "sealed" the same way. */
.promises {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--u);
}

.promise {
  background: var(--panel);
  border-radius: var(--r-lg);
  padding: calc(var(--u) * 1.8);
  box-shadow:
    var(--rim),
    var(--underside),
    var(--d2);
}

.promise::before {
  content: '';
  display: block;
  width: 9px;
  height: 9px;
  margin-bottom: calc(var(--u) * 1.6);
  border-radius: 2px;
  background: var(--signal);
}

.promise h3 {
  font-size: 1.3rem;
  line-height: 1.15;
  margin-bottom: calc(var(--u) * 0.6);
}

.promise p {
  margin: 0;
  color: var(--dim);
}

/* ---------------------------------------------------------------- developers ---- */

/* The second audience, given a panel and a lit key of its own. The well holds the
   guide's quickstart as written there: a command is to be copied, so a long one scrolls
   sideways and is never wrapped into something that would not run. */
.dev {
  display: grid;
  gap: calc(var(--u) * 2);
}

.dev__code {
  min-width: 0;
  margin: 0;
  padding: calc(var(--u) * 1.3) calc(var(--u) * 1.4);
  overflow-x: auto;
  border-radius: var(--r);
  background: var(--well);
  box-shadow:
    inset 0 0 0 1px var(--line),
    inset 0 14px 18px -10px #000,
    0 1px 0 rgba(255, 255, 255, 0.08);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
}

.dev__code code {
  font: inherit;
}

@media (min-width: 980px) {
  .dev {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: center;
    gap: calc(var(--u) * 3);
    padding: calc(var(--u) * 3);
  }
}

.dev p:last-of-type,
.invite p:last-of-type {
  margin-bottom: calc(var(--u) * 1.8);
}

/* ------------------------------------------------------------------ caveats ---- */

/* The limits, given the same weight as the features and none of the decoration. A
   hollow mark rather than a filled one, matching the observed column of the ledger. */
.caveats {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 72ch;
}

.caveats li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
  color: var(--dim);
}

.caveats li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px var(--faint);
}

.spaced {
  margin: calc(var(--u) * 3) 0 var(--u);
}

/* ------------------------------------------------------------------- ledger ---- */

/**
 * The two columns of the claim.
 *
 * The claim is a precise one rather than a broad one, and the honest way to present it
 * is side by side: what the server cannot see, and what it still observes. The right
 * column is set in mono throughout, because mono on this site means exactly "the server
 * can read this". The typeface is the argument.
 */
.ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--u);
  margin-top: calc(var(--u) * 1.6);
}

.ledger__col h3 {
  margin-bottom: var(--u);
}

.ledger__col {
  background: var(--panel);
  border-radius: var(--r-lg);
  padding: calc(var(--u) * 1.8);
  box-shadow:
    var(--rim),
    var(--underside),
    var(--d1);
}

.ledger__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ledger__col li {
  padding-left: 20px;
  position: relative;
  color: var(--dim);
}

/* A sealed row and an observed row are marked differently: a filled square for what is
   held shut, a hollow one for what leaks. No colour does this work - only the mark. */
.ledger__col--sealed li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--signal-dim);
}

.ledger__col--seen li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px var(--faint);
}

.ledger__col--seen li {
  font-family: var(--mono);
  font-size: 13px;
}

/* --------------------------------------------------------------------- legal --- */

.legal {
  padding: calc(var(--u) * 3) 0 calc(var(--u) * 5);
}

.legal__head {
  margin-bottom: calc(var(--u) * 2.4);
}

.legal__meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  margin-top: calc(var(--u) * 0.8);
}

.legal .panel {
  max-width: none;
}

.legal h2 {
  font-size: 1.34rem;
  margin: calc(var(--u) * 2.4) 0 calc(var(--u) * 0.8);
}

.legal h2:first-of-type {
  margin-top: 0;
}

.legal h3 {
  margin: calc(var(--u) * 1.6) 0 calc(var(--u) * 0.5);
  color: var(--text);
}

.legal p,
.legal li {
  color: var(--dim);
}

.legal strong {
  color: var(--text);
  font-weight: 600;
}

.legal ul,
.legal ol {
  max-width: var(--measure);
  padding-left: 1.2em;
  margin: 0 0 1em;
}

.legal li {
  margin-bottom: 0.45em;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 13.5px;
}

.legal th,
.legal td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.legal th {
  font-family: var(--mono);
  font-size: var(--readout);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.legal td {
  color: var(--dim);
}

/* Anything a reader must fill in before publishing. Deliberately loud: an unfilled
   placeholder should be impossible to miss on a page that is otherwise this quiet. */
.fill {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--signal);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px var(--line-hi);
  border-radius: 4px;
  padding: 1px 6px;
}

/* The table of contents on a legal page: a rail, matching the app's nav. */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 calc(var(--u) * 2);
  padding: 0;
}

.toc a {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--raise);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    var(--d1);
}

.toc a:hover {
  color: var(--text);
}

/* -------------------------------------------------------------------- footer --- */

footer {
  border-top: 1px solid var(--line);
  padding: calc(var(--u) * 2.6) 0;
  margin-top: calc(var(--u) * 2);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: calc(var(--u) * 2);
}

.footer__grid h4 {
  font-family: var(--mono);
  font-size: var(--readout);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 calc(var(--u) * 0.9);
}

.footer__grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer__grid a {
  font-size: 13.5px;
  color: var(--dim);
  text-decoration: none;
}

.footer__grid a:hover {
  color: var(--text);
}

.footer__note {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  margin: calc(var(--u) * 2) 0 0;
  max-width: none;
}

/* ---------------------------------------------------------------- responsive --- */

@media (max-width: 860px) {
  .ledger,
  .promises,
  .footer__grid {
    grid-template-columns: 1fr;
  }

  .bar nav {
    gap: var(--u);
  }
}

@media (max-width: 560px) {
  section.wrap,
  section {
    padding-block: calc(var(--u) * 3.4);
  }

  .panel {
    padding: calc(var(--u) * 1.4);
    border-radius: var(--r);
  }

  /* Three rows are enough to make the point, and the fourth would push the figure off
     the first screen of a phone. */
  .vault__rows li:nth-child(4) {
    display: none;
  }

  .vault__rows li {
    height: 40px;
  }

  .vault__server .vault__rows li {
    height: 30px;
  }

  /* Slimmer, so the hero's two keys and the "or" between them still share a line. */
  .keys {
    gap: var(--u);
  }

  .key--lg {
    padding: 0 var(--u);
  }

  .dev .key,
  .invite .key {
    width: 100%;
  }

  .legal table,
  .legal thead,
  .legal tbody,
  .legal tr,
  .legal th,
  .legal td {
    display: block;
  }

  .legal thead {
    display: none;
  }

  .legal tr {
    padding: calc(var(--u) * 0.8) 0;
    border-bottom: 1px solid var(--line);
  }

  .legal td {
    border: 0;
    padding: 2px 0;
  }

  .legal tr > td:first-child {
    color: var(--text);
    font-weight: 600;
  }
}

/**
 * Reduced motion.
 *
 * The hero's animations are declared only where motion is welcome (see the hero), so
 * here there is nothing left to stop but a key lifting under the pointer and the smooth
 * scroll. The figure loses no meaning standing still: both lists are whole.
 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body::before,
  body::after {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .bar,
  .toc,
  footer {
    display: none;
  }

  .panel {
    box-shadow: none;
    background: none;
    padding: 0;
  }

  .legal p,
  .legal li,
  .legal td {
    color: #000;
  }
}

/* ----------------------------------------------------------------- the guide --- */
/* Code in the developer guide is a command to copy, so a long one scrolls sideways
   and is never wrapped into something that would not run. */
.legal pre {
  overflow-x: auto;
  margin: 0 0 1.2em;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 0 0 1px var(--line);
}
.legal code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--text);
}
.legal pre code {
  font-size: 13px;
}
