@layer reset, base, components, sections, motion;

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* How much of the signature is still to be drawn: 1 is none of it, 0 is all of it.
   It is inherited so that it reaches the strokes inside a <use>. */
@property --sig-draw {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

/* ── Tokens ─────────────────────────────────────────────────────────
   Light values are the default. `.scheme-light` repeats them for parts
   that stay light on a dark page (the printed proof), and `.scheme-dark`
   holds the night values for the bands that are dark on any page. */
:root,
.scheme-light {
  --page: #f4f6fb;
  --card: #ffffff;
  --surface: #e9edf6;
  --surface-2: #dfe5f1;
  --ink: #0a0f20;
  --ink-2: #39425e;
  --ink-3: #566080;
  --line: #d6dcea;
  --line-strong: #7d88a4;
  --graphite: #0a0f20;
  --grid: rgb(10 15 32 / 0.05);

  --accent: #06744c;
  --accent-hover: #055a3b;
  --on-accent: #ffffff;
  --accent-text: #06744c;
  --accent-soft: #d5f8e8;

  --good: #06744c;
  --good-soft: #d5f8e8;
  --info: #1f45c4;
  --info-soft: #dce6ff;
  --warn: #6b4700;
  --warn-soft: #ffefc9;
  --bad: #b9272e;
  --bad-soft: #fce9e8;

  --device: #0a0f20;
  --app-bg: #ffffff;
  --app-card: #f1f3f9;

  --map-land: #e4e9f3;
  --map-road: #ffffff;
  --map-bldg: #d3dae8;
  --map-park: #cdebdc;
  --map-water: #c9dcf6;
}

.scheme-dark {
  --page: #050916;
  --card: #0d1429;
  --surface: #0f1730;
  --surface-2: #18223f;
  --ink: #f5f7fc;
  --ink-2: #c4cce2;
  --ink-3: #93a0c2;
  --line: #222c4a;
  --line-strong: #66739a;
  --graphite: #c4cce2;
  --grid: rgb(196 204 226 / 0.045);

  --accent: #19e09a;
  --accent-hover: #6ff0c1;
  --on-accent: #032417;
  --accent-text: #19e09a;
  --accent-soft: #08272a;

  --good: #19e09a;
  --good-soft: #08272a;
  --info: #8fb0ff;
  --info-soft: #152350;
  --warn: #ffc85c;
  --warn-soft: #2e2208;
  --bad: #ff7a73;
  --bad-soft: #33151a;

  --device: #02040a;
  --app-bg: #070b18;
  --app-card: #121a33;

  --map-land: #0c1328;
  --map-road: #212c4f;
  --map-bldg: #151e3b;
  --map-park: #0d2a2a;
  --map-water: #0e2147;
}

:root {
  color-scheme: light dark;

  --night: #050916;
  --amber: #ffb020;
  --on-amber: #2b1c00;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --wrap: 74rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --header-h: 4.75rem;
  --target-size: 24px;

  /* The bright middle of the page follows the system: paper by day, ink by night. */
  @media (prefers-color-scheme: dark) {
    --page: #0a0f20;
    --card: #111935;
    --surface: #101830;
    --surface-2: #1a2444;
    --ink: #f5f7fc;
    --ink-2: #c4cce2;
    --ink-3: #93a0c2;
    --line: #232d4d;
    --line-strong: #66739a;
    --graphite: #c4cce2;
    --grid: rgb(196 204 226 / 0.045);

    --accent: #19e09a;
    --accent-hover: #6ff0c1;
    --on-accent: #032417;
    --accent-text: #19e09a;
    --accent-soft: #0b2c2c;

    --good: #19e09a;
    --good-soft: #0b2c2c;
    --info: #8fb0ff;
    --info-soft: #172656;
    --warn: #ffc85c;
    --warn-soft: #33260a;
    --bad: #ff7a73;
    --bad-soft: #33151a;

    --device: #02040a;
    --app-bg: #070b18;
    --app-card: #121a33;

    --map-land: #0c1328;
    --map-road: #212c4f;
    --map-bldg: #151e3b;
    --map-park: #0d2a2a;
    --map-water: #0e2147;
  }

  @media (pointer: coarse) {
    --target-size: 44px;
  }

  @media (prefers-contrast: more) {
    --line: var(--line-strong);
  }

  accent-color: var(--accent);
}

/* An island with its own scheme has its own background, and the inherited
   color properties are set again so they use that scheme's values. */
.scheme-light {
  color-scheme: only light;
  background: var(--card);
  color: var(--ink);
  accent-color: var(--accent);
}

.scheme-dark {
  color-scheme: only dark;
  background: var(--night);
  color: var(--ink);
  accent-color: var(--accent);
}

/* A see-through dark panel that sits over the scene. */
.glass {
  background: rgb(10 15 32 / 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);

  @media (prefers-reduced-transparency: reduce) {
    background: var(--card);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ── Reset ──────────────────────────────────────────────────────── */
@layer reset {
  :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset, legend) {
    margin: 0;
    padding: 0;
  }

  :where(ul, ol)[role="list"],
  :where(nav ul) {
    list-style: none;
  }

  :where(img, svg) {
    display: block;
    max-inline-size: 100%;
  }

  :where(img) {
    block-size: auto;
  }

  :where(fieldset) {
    border: 0;
    min-inline-size: 0;
  }

  :where(button, input, textarea, .button, .app-button, .phone, .paper) {
    box-sizing: border-box;
  }

  [hidden]:where(:not(.sheet, .banner)) {
    display: none !important;
  }
}

/* ── Base ───────────────────────────────────────────────────────── */
@layer base {
  html {
    font-family: var(--font);
    font-size-adjust: from-font;
    scroll-padding-block-start: calc(var(--header-h) + 1rem);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;

    @media (prefers-reduced-motion: no-preference) {
      scroll-behavior: smooth;
    }
  }

  /* The page opens and closes at night, so that is what shows past either end. */
  body {
    margin: 0;
    background: var(--night);
    color: var(--ink);
    font-size: 1.0625rem;
    line-height: 1.55;
    overflow-wrap: break-word;
  }

  h1,
  h2,
  h3,
  h4 {
    font-weight: 600;
    text-wrap: balance;
  }

  h1,
  h2 {
    line-height: 0.97;
    letter-spacing: -0.045em;
  }

  h1 {
    font-size: clamp(2.75rem, 1.2rem + 7vw, 7rem);
  }

  h2 {
    font-size: clamp(2.25rem, 1.3rem + 3.9vw, 4.75rem);
  }

  h3 {
    font-size: 1.1875rem;
    line-height: 1.3;
    letter-spacing: -0.005em;
  }

  h4 {
    font-size: 1.0625rem;
    line-height: 1.3;
  }

  /* One word in a heading is set in the italic serif. */
  :is(h1, h2, h3) em {
    color: var(--accent-text);
    font-family: var(--font-serif);
    font-size: 1.08em;
    font-size-adjust: none;
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.02em;
  }

  :where(p, li, dd) {
    text-wrap: pretty;
  }

  a {
    color: var(--accent-text);
    text-underline-offset: 0.18em;

    &:hover {
      text-decoration-thickness: 2px;
    }
  }

  strong,
  b {
    font-weight: 650;
  }

  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  :where(h1, h3)[tabindex="-1"]:focus-visible {
    outline: none;
  }

  .visually-hidden:where(:not(:focus-within, :active)) {
    position: absolute !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: nowrap !important;
  }

  .skip-link {
    position: fixed;
    inset-block-start: 0.75rem;
    inset-inline-start: 0.75rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    border: 2px solid var(--accent);
    border-radius: 0.75rem;
    background: var(--page);
    color: var(--ink);
    font-weight: 600;
  }

  .svg-defs {
    position: absolute;
  }

  .icon {
    inline-size: 1.25em;
    block-size: 1.25em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

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

  .wrap-narrow {
    max-inline-size: 50rem;
  }

  .wrap-wide {
    max-inline-size: 88rem;
  }

  .mono,
  .index,
  .eyebrow {
    font-family: var(--font-mono);
    font-size-adjust: none;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
  }

  .eyebrow {
    display: flex;
    align-items: center;
    gap: 0.65em;
    margin-block-end: 1rem;
    color: var(--accent-text);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;

    /* The allowed-distance ring, small. */
    &::before {
      content: "";
      box-sizing: border-box;
      inline-size: 0.8em;
      aspect-ratio: 1;
      border: 1.5px solid currentColor;
      border-radius: 50%;
    }
  }

  .index {
    color: var(--accent-text);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
  }

  .fine {
    color: var(--ink-3);
    font-size: 0.875rem;
  }

  html.js .no-js-only,
  html:not(.js) .js-only {
    display: none;
  }
}

/* ── Components ─────────────────────────────────────────────────── */
@layer components {
  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-block-size: max(2.75rem, var(--target-size));
    padding: 0.5rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 99em;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 150ms ease-out, border-color 150ms ease-out, scale 150ms ease-out;

    &:active {
      scale: 0.98;
    }
  }

  .button-primary {
    background: var(--accent);
    color: var(--on-accent);

    &:hover:not(:disabled) {
      background: var(--accent-hover);
    }

    &:disabled {
      opacity: 0.7;
      cursor: progress;
    }
  }

  .button-quiet {
    border-color: var(--line-strong);
    background: transparent;
    color: var(--ink);

    &:hover {
      background: var(--surface);
    }
  }

  .button-light {
    background: var(--ink);
    color: var(--night);

    &:hover {
      background: var(--ink-2);
    }
  }

  .button[aria-disabled="true"] {
    opacity: 0.75;
    cursor: default;
  }

  .button-large {
    min-block-size: 3.25rem;
    padding-inline: 1.6rem;
    font-size: 1.0625rem;
  }

  .button-block {
    inline-size: 100%;
  }

  /* Map drawing, shared by every map on the page */
  .map {
    inline-size: 100%;
    block-size: auto;
    border-radius: 0.9em;
  }

  .m-land {
    fill: var(--map-land);
  }

  .m-park {
    fill: var(--map-park);
  }

  .m-water {
    fill: var(--map-water);
  }

  .m-river {
    fill: none;
    stroke: var(--map-water);
    stroke-width: 40;
  }

  .m-bldg {
    fill: var(--map-bldg);
  }

  .m-road {
    fill: none;
    stroke: var(--map-road);
    stroke-width: 9;
  }

  .m-avenue {
    stroke-width: 15;
  }

  .m-radius {
    fill: color-mix(in oklab, var(--graphite) 14%, transparent);
    stroke: var(--graphite);
    stroke-width: 1.5;
  }

  .m-nudge {
    fill: none;
    stroke: var(--graphite);
    stroke-width: 1.2;
    stroke-dasharray: 3 4;
  }

  .m-in {
    fill: none;
    stroke: var(--good);
    stroke-width: 4.5;
  }

  .m-out {
    fill: var(--info);
    stroke: var(--map-road);
    stroke-width: 2;
  }

  .m-home {
    circle {
      fill: var(--graphite);
      stroke: var(--map-road);
      stroke-width: 1.5;
    }

    path {
      fill: none;
      stroke: var(--map-land);
      stroke-width: 1.7;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
  }

  .m-link {
    stroke: var(--walker, var(--good));
    stroke-width: 2;
    stroke-dasharray: 4 5;
    stroke-linecap: round;
  }

  /* The sample signature. Its strokes have pathLength="1", so one dash is the whole stroke. */
  .sig {
    inline-size: min(100%, 13rem);
    block-size: auto;
    color: var(--ink);
  }

  .sig-stroke {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    /* The name is written over the first four fifths, the line under it over the rest. */
    stroke-dashoffset: clamp(0, var(--sig-draw, 0) * 1.25 - 0.25, 1);
  }

  .sig-under {
    stroke-width: 1.2;
    stroke-dashoffset: clamp(0, var(--sig-draw, 0) * 5, 1);
    opacity: 0.55;
  }

  /* A signature drawn by the visitor */
  .ink {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* Phone and app screens */
  .phone {
    /* The app's own blue, so its buttons read as the app's and not as this page's. */
    --accent: #7dabfa;
    --accent-hover: #9cc0ff;
    --on-accent: #0b1220;
    --accent-text: #8ab4ff;
    --accent-soft: #15223a;
    container-type: inline-size;
    display: grid;
    inline-size: min(100%, 19.25rem);
    padding: 0.55rem;
    border: 1px solid var(--line-strong);
    border-radius: 3rem;
    background: var(--device);
  }

  .phone-screen {
    position: relative;
    display: grid;
    align-content: start;
    gap: 0.65em;
    overflow: clip;
    padding: 0 0.95em 1.3em;
    border-radius: 2.5rem;
    background: var(--app-bg);
    color: var(--ink);
    font-size: clamp(0.625rem, 3.8vw, 0.8125rem);
    line-height: 1.4;

    @supports (font-size: 1cqi) {
      font-size: clamp(0.625rem, 3.9cqi, 0.8125rem);
    }
  }

  .app-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1em 0.9em 0;
    font-size: 1.05em;
    font-weight: 650;
  }

  .app-island {
    inline-size: 6.4em;
    block-size: 1.9em;
    border-radius: 1em;
    background: #000;
  }

  .app-bars {
    display: flex;
    align-items: end;
    gap: 0.14em;
    block-size: 0.8em;

    i {
      inline-size: 0.2em;
      border-radius: 0.1em;
      background: currentColor;

      &:nth-child(1) { block-size: 40%; }
      &:nth-child(2) { block-size: 60%; }
      &:nth-child(3) { block-size: 80%; }
      &:nth-child(4) { block-size: 100%; }
    }
  }

  .app-nav {
    position: relative;
    display: grid;
    place-items: center;
    min-block-size: 2.8em;
  }

  .app-title {
    font-size: 1.1em;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.4;
  }

  .app-card {
    padding: 0.85em 1.05em;
    border: 1px solid var(--line);
    border-radius: 1.4em;
    background: var(--app-card);
  }

  .app-name {
    font-size: 1.15em;
    font-weight: 650;
  }

  .app-sub {
    color: var(--ink-3);
    font-size: 0.85em;
  }

  .app-rows {
    display: grid;
    gap: 0.45em;
    margin-block-start: 0.7em;
    padding-block-start: 0.65em;
    border-block-start: 1px solid var(--line);

    > div {
      display: flex;
      justify-content: space-between;
      gap: 1em;
    }

    span:first-child {
      color: var(--ink-3);
    }
  }

  .app-rows-flat {
    margin-block-start: 0;
    padding-block-start: 0;
    border: 0;
  }

  .app-text {
    margin-block-start: 0.6em;
    color: var(--ink-2);
  }

  .app-label {
    margin-block-end: 0.7em;
    color: var(--ink-2);
    font-size: 0.72em;
    font-weight: 650;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .app-active {
    display: grid;
    justify-items: center;
    gap: 0.25em;
    padding-block: 1.4em;
    text-align: center;
  }

  .app-badge {
    display: grid;
    place-items: center;
    inline-size: 3.6em;
    aspect-ratio: 1;
    margin-block-end: 0.4em;
    border: 1px solid color-mix(in oklab, var(--good) 35%, transparent);
    border-radius: 50%;
    background: var(--good-soft);
    color: var(--good);

    .icon {
      inline-size: 1.7em;
      block-size: 1.7em;
      stroke-width: 2.2;
    }
  }

  .app-big {
    font-size: 1.5em;
    font-weight: 650;
    letter-spacing: -0.015em;
  }

  .app-timer {
    margin-block: 0.25em 0.1em;
    font-size: 2.4em;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }

  .app-button {
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: 100%;
    min-block-size: max(3.5em, var(--target-size));
    padding: 0.6em 1em;
    border: 1px solid transparent;
    border-radius: 1.15em;
    background: var(--accent);
    color: var(--on-accent);
    font: inherit;
    font-size: 1.1em;
    font-weight: 650;
    text-align: center;
  }

  button.app-button {
    cursor: pointer;
    transition: background-color 150ms ease-out, scale 150ms ease-out;

    &:hover {
      background: var(--accent-hover);
    }

    &:active {
      scale: 0.98;
    }
  }

  button.app-button-quiet {
    border-color: var(--line);
    background: var(--app-card);
    color: var(--ink);

    &:hover {
      background: var(--surface-2);
    }
  }

  .app-link {
    min-block-size: max(2.4em, var(--target-size));
    padding: 0.2em 0.5em;
    border: 0;
    background: none;
    color: var(--accent-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
  }

  .app-hint {
    color: var(--ink-3);
    font-size: 0.9em;
    text-align: center;
  }

  .app-done {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    min-block-size: 3.5em;
    padding: 0.5em 0.9em;
    border: 1px solid color-mix(in oklab, var(--good) 30%, transparent);
    border-radius: 1.15em;
    background: var(--good-soft);
    color: var(--good);
    font-weight: 650;
  }

  .app-error {
    display: flex;
    align-items: start;
    gap: 0.5em;
    padding: 0.7em 0.9em;
    border: 1px solid color-mix(in oklab, var(--bad) 35%, transparent);
    border-radius: 1em;
    background: var(--bad-soft);
    color: var(--bad);
    font-weight: 500;

    .icon {
      margin-block-start: 0.1em;
    }
  }

  .note-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: start;
    gap: 0.75em;
    padding: 0.9em 1em;
    border: 1px solid var(--line);
    border-radius: 1.2em;
    background: var(--card);
    font-size: 0.875rem;
    line-height: 1.4;

    img {
      border-radius: 24%;
    }

    p:not(.note-title) {
      color: var(--ink-2);
    }
  }

  .phone-screen .note-card,
  .phone-screen .banner {
    font-size: 1em;
  }

  .note-title {
    font-weight: 650;
  }

  /* Range slider */
  input[type="range"] {
    --slider-track-size: 0.5rem;
    --slider-thumb-size: 1.75rem;
    --slider-track-color: var(--line-strong);
    --slider-fill-color: var(--accent);
    --slider-direction: to right;

    /* Read from the attributes where typed attr() works; app.js sets all three as well. */
    --attr-min: attr(min type(<number>), 0);
    --attr-max: attr(max type(<number>), 100);
    --control-value: attr(value type(<number>), 50);
    --slider-progress: calc(progress(var(--control-value), var(--attr-min), var(--attr-max)) * 100%);

    @supports not (opacity: progress(1, 0, 100)) {
      --slider-progress: calc((var(--control-value) - var(--attr-min)) / (var(--attr-max) - var(--attr-min)) * 100%);
    }

    appearance: none;
    inline-size: 100%;
    block-size: 2.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;

    &:dir(rtl) {
      --slider-direction: to left;
    }

    &:focus-visible {
      outline: 2px solid var(--slider-fill-color);
      outline-offset: 4px;
    }
  }

  input[type="range"]::-webkit-slider-runnable-track {
    block-size: var(--slider-track-size);
    border: 0;
    border-radius: 999px;
    background: linear-gradient(var(--slider-direction), var(--slider-fill-color) var(--slider-progress), var(--slider-track-color) var(--slider-progress));
  }

  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    inline-size: var(--slider-thumb-size);
    block-size: var(--slider-thumb-size);
    margin-block-start: calc((var(--slider-track-size) - var(--slider-thumb-size)) / 2);
    border: 3px solid var(--night);
    border-radius: 50%;
    background: var(--slider-fill-color);
  }

  input[type="range"]::-moz-range-track {
    block-size: var(--slider-track-size);
    border: 0;
    border-radius: 999px;
    background: var(--slider-track-color);
  }

  input[type="range"]::-moz-range-progress {
    block-size: var(--slider-track-size);
    border-radius: 999px;
    background: var(--slider-fill-color);
  }

  input[type="range"]::-moz-range-thumb {
    box-sizing: border-box;
    inline-size: var(--slider-thumb-size);
    block-size: var(--slider-thumb-size);
    border: 3px solid var(--night);
    border-radius: 50%;
    background: var(--slider-fill-color);
  }

  .chip-button {
    min-block-size: max(2.25rem, var(--target-size));
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: 99em;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 150ms ease-out, border-color 150ms ease-out;

    &:hover {
      border-color: var(--accent);
      background: var(--accent-soft);
    }

    &:active {
      scale: 0.97;
    }
  }

  .result-icon {
    display: grid;
    place-items: center;
    inline-size: 2.75rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--good-soft);
    color: var(--good);

    .icon {
      inline-size: 1.5rem;
      block-size: 1.5rem;
    }
  }

  /* The printed proof */
  .paper {
    --paper-pad: clamp(1.25rem, 4vw, 1.9rem);
    display: grid;
    gap: 1em;
    padding: var(--paper-pad);
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    font-size: clamp(0.75rem, 0.7rem + 0.25vw, 0.8438rem);
    line-height: 1.45;

    .map {
      border-radius: 0.25rem;
    }

    .sig {
      inline-size: min(60%, 12rem);
    }
  }

  .paper-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-block-end: 0.9em;
    border-block-end: 1px solid var(--line);
  }

  .paper-head-end {
    text-align: end;
  }

  .paper-brand {
    font-size: 1.6em;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
  }

  .paper-small {
    color: var(--ink-3);
    font-size: 0.86em;
  }

  .paper-strong {
    font-size: 1.1em;
    font-weight: 650;
  }

  .paper-label {
    margin-block-end: 0.25em;
    color: var(--ink-2);
    font-size: 0.72em;
    font-weight: 650;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .paper-pairs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9em 1.5em;
  }

  .paper-block,
  .paper-foot {
    position: relative;
  }

  /* Room at the sides so a change can be shown with a tint behind the block. */
  .paper-block {
    margin: -0.3em -0.5em;
    padding: 0.3em 0.5em;
    border-radius: 0.4em;
  }

  .paper-verdict {
    color: var(--info);
    font-size: 1.35em;
    font-weight: 700;
  }

  .paper[data-verdict="verified"] .paper-verdict {
    color: var(--good);
  }

  .paper[data-verdict="needsReview"] .paper-verdict {
    color: var(--warn);
  }

  .paper:not([data-marks~="in"]) #p-in,
  .paper:not([data-marks~="out"]) #p-out,
  .p-sig-sample,
  .p-sig-drawn,
  .p-sig-none {
    display: none;
  }

  .paper[data-sig="sample"] .p-sig-sample,
  .paper[data-sig="drawn"] .p-sig-drawn,
  .paper[data-sig="none"] .p-sig-none {
    display: block;
  }

  .paper-times {
    inline-size: 100%;
    border-collapse: collapse;
    font: inherit;

    caption {
      text-align: start;
    }

    th,
    td {
      inline-size: 33%;
      padding: 0.2em 0;
      font-variant-numeric: tabular-nums;
      font-weight: 400;
      text-align: start;
    }

    thead th {
      color: var(--ink-3);
      font-size: 0.82em;
    }

    tbody th,
    .is-pending {
      color: var(--ink-3);
    }
  }

  .paper-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25em 1em;
    padding-block-start: 0.9em;
    border-block-start: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 0.78em;
  }

  .mark,
  .callouts > li::before {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border: 1px solid transparent;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--font-mono);
    font-size-adjust: none;
    font-weight: 500;
    line-height: 1;
  }

  /* Numbered pins sit on the page's edge, half on the paper and half off it. */
  .mark {
    position: absolute;
    inset-block-start: 0.15em;
    inset-inline-start: calc(-1 * var(--paper-pad) - 0.875em + 0.61em);
    inline-size: 1.75em;
    font-size: 0.82em;
  }

  /* The footer's text is smaller, so its pin is scaled back up to match the others. */
  .paper-foot .mark {
    inset-block-start: 0.7em;
    inset-inline-start: calc(-1 * var(--paper-pad) - 0.875em);
    font-size: 1.05em;
  }
}

/* ── Sections ───────────────────────────────────────────────────── */
@layer sections {
  /* Header: a pill that floats over the page */
  .site-header {
    position: fixed;
    inset-block-start: 0.75rem;
    inset-inline: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    padding-inline: 0.75rem;
    pointer-events: none;

    &.is-measuring * {
      transition: none !important;
    }
  }

  .header-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem 1rem;
    box-sizing: border-box;
    min-inline-size: 0;
    max-inline-size: 100%;
    min-block-size: 3.25rem;
    padding: 0.375rem 0.375rem 0.375rem 1rem;
    border: 1px solid rgb(255 255 255 / 0.14);
    border-radius: 99em;
    pointer-events: auto;

    > * {
      flex-shrink: 0;
      white-space: nowrap;
    }
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-block-size: var(--target-size);
    color: var(--ink);
    font-size: 1.0625rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    text-decoration: none;

    img {
      border-radius: 24%;
    }
  }

  .site-nav {
    margin-inline-start: auto;
  }

  .header-cta {
    min-block-size: max(2.5rem, var(--target-size));
    padding-inline: 1.1rem;
    font-size: 0.9375rem;
  }

  .menu-button {
    anchor-name: --menu-button;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-block-size: max(2.5rem, var(--target-size));
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: 99em;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;

    &:hover {
      background: var(--surface-2);
    }
  }

  .site-menu {
    position: fixed;
    inset: auto;
    /* Browsers without anchor() keep this offset. */
    inset-block-start: 4.25rem;
    inset-block-start: anchor(--menu-button bottom);
    inset-inline-end: 1rem;
    inline-size: min(80dvw, 20rem);
    max-inline-size: calc(100dvw - 2rem);
    block-size: fit-content;
    max-block-size: calc(100dvh - 6rem);
    margin: 0;
    margin-block-start: 0.75rem;
    padding: 0.5rem;
    overflow: auto;
    border: 1px solid var(--line-strong);
    border-radius: 1.25rem;
    background: var(--card);
    color: var(--ink);

    a {
      display: flex;
      align-items: center;
      min-block-size: 2.75rem;
      padding-inline: 0.85rem;
      border-radius: 0.75rem;
      color: var(--ink);
      font-size: 1rem;
      font-weight: 500;
      text-decoration: none;

      &:hover {
        background: var(--surface-2);
      }
    }
  }

  /* Older browsers get popover from the polyfill, which marks an open one with a class. */
  @supports not selector(:popover-open) {
    [popover]:not(.\:popover-open) {
      display: none;
    }
  }

  /* Small phones: the button keeps its name, "Menu", but shows only the icon. */
  @media (max-width: 30rem) {
    .header-inner {
      gap: 0.5rem;
      padding-inline-start: 0.75rem;
    }

    .menu-button {
      padding-inline: 0.7rem;

      span {
        position: absolute;
        clip-path: inset(50%);
        overflow: hidden;
        width: 1px;
        height: 1px;
        white-space: nowrap;
      }
    }
  }

  @media (max-width: 20rem) {
    .site-header .brand span {
      position: absolute;
      clip-path: inset(50%);
      overflow: hidden;
      width: 1px;
      height: 1px;
      white-space: nowrap;
    }
  }

  .site-header.is-wide {
    .menu-button {
      display: none;
    }

    .site-menu {
      position: static;
      display: flex;
      align-items: center;
      gap: 0.125rem;
      inline-size: auto;
      max-inline-size: none;
      block-size: auto;
      max-block-size: none;
      margin: 0;
      padding: 0;
      overflow: visible;
      border: 0;
      background: transparent;

      a {
        min-block-size: max(2.5rem, var(--target-size));
        padding-inline: 0.7rem;
        color: var(--ink-2);
        font-size: 0.9375rem;

        &:hover {
          background: transparent;
          color: var(--ink);
        }
      }
    }

    .site-menu::backdrop {
      display: none;
    }
  }

  /* ── One visit, start to finish ──
     As written, the five scenes are blocks one after another, each with its panel in the
     finished state. story.js adds `is-film` (the stage stays put and the scroll position
     plays the visit) or `is-still` (one frame of the scene behind the first block). */
  .story {
    position: relative;
  }

  .stage {
    position: relative;
    background: radial-gradient(90rem 50rem at 70% 0, #142050, transparent 70%) no-repeat;
  }

  .world,
  .shade,
  .rail,
  .cue {
    display: none;
  }

  .scene {
    display: grid;
    align-content: center;
    /* When the words are taller than the window, they start at the top instead of spilling both ways. */
    align-content: safe center;
    align-items: center;
    gap: 2rem;
    box-sizing: border-box;
    max-inline-size: 84rem;
    margin-inline: auto;
    padding: clamp(3rem, 8vw, 5rem) var(--gutter);

    @media (min-width: 48rem) and (orientation: landscape) {
      grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
      gap: 2rem 4rem;
    }

    /* A phone on its side: the words get the wider share. */
    @media (min-width: 48rem) and (orientation: landscape) and (max-height: 32rem) {
      grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
      gap: 1.5rem;
    }
  }

  /* The first scene fills the window, so it sits in the same place in every mode. */
  .scene-lead,
  .is-film .scene {
    min-block-size: 100vh;
    min-block-size: 100svh;
    padding-block: calc(var(--header-h) + 0.75rem) 3.5rem;

    @media not ((min-width: 48rem) and (orientation: landscape)) {
      align-content: space-between;
      padding-block-end: 1.25rem;
    }

    @media (max-height: 32rem) {
      padding-block-end: 1rem;
    }
  }

  .scene-lead .cap {
    grid-column: 1 / -1;
  }

  .cap {
    display: grid;
    justify-items: start;
    gap: 1.25rem;
    max-inline-size: 37rem;

    .eyebrow {
      margin-block-end: 0;
    }

    h1 {
      font-size: clamp(2.75rem, min(1.2rem + 7vw, 15svh), 7rem);
    }

    h2 {
      font-size: clamp(2rem, min(1.2rem + 3.4vw, 9svh), 4.5rem);
    }

    .lede {
      max-inline-size: 32em;
      color: var(--ink-2);
      font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
    }

    @media (max-height: 32rem) {
      gap: 0.75rem;

      h1 {
        font-size: 2.25rem;
      }

      .lede {
        font-size: 0.9375rem;
      }

      .cap-fine {
        display: none;
      }
    }
  }

  .cap-fine {
    max-inline-size: 40em;
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-size-adjust: none;
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
  }

  /* The panels beside the captions */
  .hud {
    inline-size: min(100%, 26rem);

    @media (min-width: 48rem) and (orientation: landscape) {
      justify-self: end;
    }
  }

  .hud > .glass {
    display: grid;
    gap: 0.875rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid rgb(255 255 255 / 0.14);
    border-radius: 1.375rem;
  }

  .glass-label {
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-size-adjust: none;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .big {
    font-size: clamp(2.75rem, min(2rem + 4vw, 11svh), 5.25rem);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: -0.05em;
    line-height: 0.9;
  }

  .bar {
    position: relative;
    block-size: 6px;
    border-radius: 6px;
    background: rgb(255 255 255 / 0.14);
  }

  .bar-fill {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    inline-size: var(--fill, 1.8%);
    border-radius: 6px;
    background: var(--good);
  }

  /* 492 ft on a scale that ends at 1,640 ft */
  .bar-mark {
    position: absolute;
    inset-block: -5px;
    inset-inline-start: 30%;
    inline-size: 2px;
    background: var(--ink);
  }

  .bar-scale {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-block-start: 0.6rem;
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-size-adjust: none;
  }

  .state {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: 0.875rem;
    background: var(--good-soft);
    color: var(--ink-2);
    font-size: 0.9375rem;

    &::before {
      content: "";
      flex: none;
      inline-size: 0.7rem;
      aspect-ratio: 1;
      margin-block-start: 0.4rem;
      border-radius: 50%;
      background: var(--good);
      outline: 5px solid color-mix(in oklab, var(--good) 24%, transparent);
    }

    b {
      display: block;
      color: var(--ink);
    }
  }

  .hud.is-far {
    .bar-fill {
      background: var(--bad);
    }

    .state {
      background: var(--bad-soft);

      &::before {
        background: var(--bad);
        outline-color: color-mix(in oklab, var(--bad) 24%, transparent);
      }
    }
  }

  .clock {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    align-items: baseline;
    gap: 0.5rem 1.125rem;
    color: var(--ink-2);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-size-adjust: none;
    font-variant-numeric: tabular-nums;

    .th {
      color: var(--ink-3);
      font-size: 0.72rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .tl {
      color: var(--ink-3);
    }

    .tv {
      color: var(--ink);
      font-family: var(--font);
      font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
      font-weight: 600;
      letter-spacing: -0.03em;
    }
  }

  .sigbox {
    padding: 0.6rem 0.9rem 0.45rem;
    border-radius: 0.875rem;

    .sig {
      inline-size: 100%;
    }

    p {
      padding-block-start: 0.4rem;
      border-block-start: 1px solid var(--line);
      color: var(--ink-3);
      font-family: var(--font-mono);
      font-size: 0.6875rem;
      font-size-adjust: none;
      letter-spacing: 0.06em;
    }
  }

  .lock {
    color: var(--ink-2);
    font-size: 0.9375rem;

    b {
      color: var(--ink);
    }
  }

  .hud.is-signed .lock-shut,
  .hud:not(.is-signed) .lock-open {
    display: none;
  }

  /* The proof page, small. On a short window it is sized by the window's height. */
  .hud-doc {
    inline-size: min(100%, 26rem, 64svh);
  }

  .paper-mini {
    gap: 0.8em;
    padding: clamp(0.75rem, 3vw, 1.6rem);
    font-size: clamp(0.5rem, min(0.6rem + 0.3vw, 1.5svh), 0.8125rem);

    .sig {
      inline-size: min(50%, 9rem);
    }
  }

  .paper-stamped {
    position: relative;
  }

  .paper-lines {
    display: grid;
    gap: 0.1em;
  }

  .paper-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25em 0.75em;
    padding-block-start: 0.8em;
    border-block-start: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
  }

  .stamp {
    position: absolute;
    inset-block-end: 0.5rem;
    inset-inline-end: 0.75rem;
    padding: 0 0.45em;
    border: 0.11em solid var(--good);
    border-radius: 0.28em;
    background: rgb(255 255 255 / 0.88);
    color: var(--good);
    font-size: 2.2em;
    font-weight: 700;
    letter-spacing: -0.03em;
    rotate: -8deg;
  }

  .film-pause {
    display: none;
  }

  /* ── The film ── */
  .story.is-film {
    block-size: 640vh;
    block-size: 640svh;
  }

  .is-film .stage {
    position: sticky;
    inset-block-start: 0;
    /* As tall as the window gets, so the scene has no gap under it when a phone's toolbar hides. */
    block-size: 100vh;
    block-size: 100lvh;
    overflow: hidden;
    background: radial-gradient(120% 90% at 70% 10%, #142050 0%, var(--night) 60%);
  }

  .is-film .world {
    display: block;
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-out;
  }

  .has-world .world {
    opacity: 1;
  }

  /* Darker behind the words, clear over the scene */
  .is-film .shade,
  .is-still .shade {
    display: block;
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(180deg, rgb(5 9 22 / 0.92) 0%, rgb(5 9 22 / 0.78) 34%, rgb(5 9 22 / 0.15) 58%, rgb(5 9 22 / 0.8) 100%);

    @media (min-width: 48rem) and (orientation: landscape) {
      background:
        linear-gradient(90deg, rgb(5 9 22 / 0.9) 0%, rgb(5 9 22 / 0.62) 36%, rgb(5 9 22 / 0) 66%),
        linear-gradient(0deg, rgb(5 9 22 / 0.7) 0%, rgb(5 9 22 / 0) 30%);
    }
  }

  .is-film .scene {
    position: absolute;
    inset: 0 0 auto;
    block-size: 100vh;
    block-size: 100svh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease-out;

    .cap,
    .hud {
      transition: translate 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
    }

    .cap {
      translate: 0 1.5rem;
    }

    .hud {
      translate: 1.75rem 0;
    }

    .hud-doc {
      translate: none;
    }

    &.is-on {
      opacity: 1;
      transition-delay: 0.1s;

      .cap,
      .hud {
        pointer-events: auto;
        translate: none;
      }
    }
  }

  /* The proof page rises from below and lies flat as the scroll goes on. --k runs from 0 to 1. */
  .is-film .paper-mini {
    transform-origin: 50% 100%;
    transform: perspective(1300px) translateY(calc((1 - var(--k, 1)) * 105vh)) rotateX(calc((1 - var(--k, 1)) * 62deg)) rotate(-1.4deg);
  }

  .is-film .stamp {
    transition: scale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease-out;
    transition-timing-function: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1), ease-out;
  }

  .is-film .hud-doc:not(.is-stamped) .stamp {
    opacity: 0;
    scale: 2.2;
  }

  @media not ((min-width: 48rem) and (orientation: landscape)) {
    .is-film .cap {
      gap: 0.75rem;
    }

    .is-film .scene:not(.scene-lead) .cap-fine {
      display: none;
    }

    .is-film .hud {
      inline-size: 100%;
    }

    /* The page may hang off the bottom of a small screen. The whole page is in the lab below. */
    .is-film .hud-doc {
      inline-size: 100%;
      max-block-size: 44svh;
    }
  }

  .is-film .rail {
    position: absolute;
    inset-block-start: 50vh;
    inset-block-start: 50svh;
    inset-inline-end: 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    translate: 0 -50%;

    i {
      inline-size: 3px;
      block-size: 1.625rem;
      border-radius: 3px;
      background: rgb(255 255 255 / 0.22);
      transition: background-color 0.3s, block-size 0.3s;
    }

    .is-on {
      block-size: 2.75rem;
      background: var(--accent);
    }
  }

  .is-film .cue {
    position: absolute;
    inset-block-start: calc(100vh - 5.25rem);
    inset-block-start: calc(100svh - 5.25rem);
    /* Over the open part of the scene, clear of the words on the left. */
    inset-inline-start: 72%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-size-adjust: none;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    translate: -50% 0;
    transition: opacity 0.4s;

    &::after {
      content: "";
      inline-size: 1px;
      block-size: 2rem;
      background: linear-gradient(var(--ink-3), transparent);
    }

    &.is-off {
      opacity: 0;
    }
  }

  .is-film .film-pause:not([hidden]) {
    position: absolute;
    inset-block-start: calc(100vh - 3.5rem);
    inset-block-start: calc(100svh - 3.5rem);
    inset-inline-end: 2.75rem;
    display: inline-flex;
    align-items: center;
    min-block-size: max(2.25rem, var(--target-size));
    padding: 0.25rem 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: 99em;
    background: rgb(5 9 22 / 0.6);
    color: var(--ink-2);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;

    &:hover {
      color: var(--ink);
    }
  }

  @media not ((min-width: 48rem) and (orientation: landscape)) {
    .is-film .rail,
    .is-film .cue {
      display: none;
    }
  }

  @media (max-height: 32rem), (max-width: 63.99rem) {
    .is-film .cue {
      display: none;
    }
  }

  /* ── One frame, for people who have asked for less motion ── */
  .is-still .world {
    display: block;
    position: absolute;
    inset: 0 0 auto;
    inline-size: 100%;
    block-size: 100vh;
    block-size: 100svh;
  }

  .is-still .shade {
    inset: 0 0 auto;
    block-size: 100vh;
    block-size: 100svh;
    background:
      linear-gradient(0deg, var(--night) 0%, rgb(5 9 22 / 0) 26%),
      linear-gradient(90deg, rgb(5 9 22 / 0.9) 0%, rgb(5 9 22 / 0.62) 44%, rgb(5 9 22 / 0.2) 100%);
  }

  .is-still .scene {
    position: relative;
  }

  /* Section frame */
  .section {
    padding-block: clamp(4.5rem, 10vw, 7rem);
  }

  .day .section + .section {
    border-block-start: 1px solid var(--line);
  }

  .section-head {
    max-inline-size: 50rem;
    margin-block-end: clamp(2.5rem, 6vw, 3.5rem);
  }

  .section-lede {
    max-inline-size: 60ch;
    margin-block-start: 1.25rem;
    color: var(--ink-2);
    font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  }

  /* The heading on one side and a short introduction on the other */
  .section-head.is-split {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 1.25rem 4rem;
    max-inline-size: none;

    > div {
      flex: 1 1 32rem;
    }

    .section-lede {
      flex: 1 1 21rem;
      margin-block-start: 0;
      font-size: 1.0625rem;
    }
  }

  /* A dark band, on any page */
  .night {
    position: relative;
    isolation: isolate;
    border-block: 1px solid var(--line);

    &::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: -1;
      border-radius: inherit;
      background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
      background-size: 3rem 3rem;
      -webkit-mask-image: linear-gradient(#000, transparent 70%);
      mask-image: linear-gradient(#000, transparent 70%);
    }
  }

  /* A band whose rounded top slides over the band before it */
  .overlap,
  .day {
    position: relative;
    z-index: 2;
    margin-block-start: -2.125rem;
    border-radius: 2.125rem 2.125rem 0 0;
  }

  .day {
    background: var(--page);
    color: var(--ink);
  }

  /* The things to try in the lab. Each is ticked off when the rules catch it. */
  .tries {
    display: grid;
    gap: 0.75rem;
    margin-block-start: 1.75rem;
  }

  .tries-label {
    color: var(--ink-2);
    font-size: 0.9375rem;

    b {
      color: var(--ink);
      font-weight: 500;
    }
  }

  .tries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;

    li {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      padding: 0.4rem 0.9rem 0.4rem 0.6rem;
      border: 1px dashed var(--line-strong);
      border-radius: 99em;
      color: var(--ink-2);
      font-size: 0.9375rem;
      line-height: 1.3;
    }

    .icon {
      opacity: 0.35;
    }

    .is-caught {
      border-style: solid;
      border-color: color-mix(in oklab, var(--good) 50%, transparent);
      background: var(--good-soft);
      color: var(--good);

      .icon {
        opacity: 1;
      }
    }
  }

  /* The try-it lab */
  .lab {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 3rem 2.25rem;

    @media (min-width: 46rem) {
      grid-template-columns: minmax(0, 1fr) minmax(0, 19rem);
    }

    @media (min-width: 78rem) {
      grid-template-columns: minmax(0, 1fr) minmax(0, 19rem) minmax(0, 1fr);
      gap: 2.75rem;
    }
  }

  .lab-col {
    display: grid;
    align-content: start;
    gap: 1rem;
    min-inline-size: 0;
  }

  .lab-record {
    @media (min-width: 46rem) and (max-width: 77.99rem) {
      grid-column: 1 / -1;
      justify-self: center;
      inline-size: min(100%, 36rem);
    }
  }

  .lab-kicker {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    padding-block-end: 0.8rem;
    border-block-end: 1px solid var(--line);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
  }

  .lab-fine,
  .lab-note {
    color: var(--ink-3);
    font-size: 0.875rem;
  }

  .lab-fine {
    text-align: center;
  }

  .lab-note {
    max-inline-size: 70ch;
    margin-block-start: 2.5rem;
  }

  .street {
    position: relative;
    overflow: clip;
    aspect-ratio: 1;
    border: 1px solid var(--line-strong);
    border-radius: 1.25rem;
    background: var(--map-land);
    cursor: crosshair;
  }

  .street-map {
    block-size: 100%;
    border-radius: 0;
  }

  #lab-in,
  #lab-out {
    display: none;
  }

  .lab[data-marks~="in"] #lab-in,
  .lab[data-marks~="out"] #lab-out {
    display: inline;
  }

  /* The clinician: a button over the map, larger than the dot it shows */
  .lab {
    --walker: var(--good);

    &[data-zone="far"] {
      --walker: var(--bad);
    }

    &[data-zone="in"]:is([data-screen="active"], [data-screen="sign"]) {
      --walker: var(--warn);
    }
  }

  .walker {
    position: absolute;
    inset-block-start: calc(var(--y, 50.77) * 1%);
    inset-inline-start: calc(var(--x, 50.34) * 1%);
    display: grid;
    place-items: center;
    inline-size: 3rem;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    translate: -50% -50%;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;

    &[hidden] {
      display: none;
    }

    &.is-dragging {
      cursor: grabbing;
    }

    span {
      box-sizing: border-box;
      inline-size: 1.3rem;
      aspect-ratio: 1;
      border: 3px solid #fff;
      border-radius: 50%;
      background: var(--walker);
      outline: 0.55rem solid color-mix(in oklab, var(--walker) 30%, transparent);
      transition: background-color 200ms, outline-color 200ms;
    }

    &:focus-visible {
      outline: none;

      span {
        outline: 3px solid var(--ink);
        outline-offset: 3px;
      }
    }
  }

  .street-readout {
    position: absolute;
    inset-block-start: 0.75rem;
    inset-inline-start: 0.75rem;
    display: grid;
    padding: 0.5rem 0.85rem 0.55rem;
    border: 1px solid var(--line-strong);
    border-radius: 0.9rem;
    background: var(--card);
    pointer-events: none;

    b {
      color: var(--walker);
      font-size: 1.625rem;
      font-weight: 500;
      letter-spacing: -0.03em;
      line-height: 1.15;
      transition: color 200ms;
    }

    span {
      color: var(--ink-2);
      font-size: 0.8125rem;
    }
  }

  .street-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1.25rem;
    color: var(--ink-3);
    font-size: 0.8125rem;

    span {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
    }

    i {
      box-sizing: border-box;
      inline-size: 0.85rem;
      aspect-ratio: 1;
      border: 1.5px solid var(--graphite);
      border-radius: 50%;
    }

    .key-ring {
      background: color-mix(in oklab, var(--graphite) 18%, transparent);
    }

    .key-nudge {
      border-style: dashed;
    }
  }

  .street-help {
    color: var(--ink-3);
    font-size: 0.8125rem;
  }

  .street-controls {
    display: grid;
    gap: 0.25rem;
    margin-block-start: 0.5rem;

    label {
      font-size: 0.9375rem;
      font-weight: 600;
    }
  }

  .presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-block-start: 0.4rem;
  }

  /* The phone in the lab keeps one size from screen to screen. */
  .demo-phone {
    justify-self: center;
    inline-size: min(100%, 19rem);
    aspect-ratio: 9 / 19.5;

    .phone-screen {
      block-size: 100%;
      box-sizing: border-box;
      view-transition-name: demo-screen;
    }

    /* Dim the screen behind the sheet. */
    .phone-screen:has(.sheet:not([hidden], [data-closing]))::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 3;
      background: rgb(0 0 0 / 0.5);
    }
  }

  /* Each screen fills the phone, with its main button at the bottom, as in the app. */
  .demo-phone .phone-screen {
    display: flex;
    flex-direction: column;
  }

  .dscreen {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.75em;

    > .app-button {
      margin-block-start: auto;
    }

    > .app-hint + .app-button {
      margin-block-start: 0;
    }

    > .app-hint:has(+ .app-button) {
      margin-block-start: auto;
    }
  }

  .pad {
    position: relative;
    border: 1px dashed var(--line-strong);
    border-radius: 1.2em;
    background: var(--app-card);
    color: var(--ink);
    cursor: crosshair;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;

    svg {
      inline-size: 100%;
      block-size: auto;
    }

    &[data-sig] .pad-hint,
    &:not([data-sig="sample"]) #pad-sample {
      display: none;
    }
  }

  .pad-hint {
    position: absolute;
    inset: auto 0 0.7em;
    color: var(--ink-3);
    font-size: 0.85em;
    text-align: center;
    pointer-events: none;
  }

  .pad-actions {
    display: flex;
    justify-content: space-between;
    margin-block: -0.4em;
  }

  /* A notification that drops in under the status bar */
  .banner {
    position: absolute;
    inset-block-start: 3.5em;
    inset-inline: 0.7em;
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75em;
    padding: 0.85em 0.95em;
    border: 1px solid color-mix(in oklab, var(--warn) 55%, transparent);
    border-radius: 1.3em;
    background: var(--warn-soft);
    line-height: 1.35;

    img {
      border-radius: 24%;
    }

    p:not(.note-title) {
      color: var(--ink-2);
    }
  }

  /* The sheet the app shows when check-in is refused */
  .sheet {
    position: absolute;
    inset-block-end: 0;
    inset-inline: 0;
    z-index: 4;
    display: grid;
    justify-items: center;
    gap: 0.65em;
    padding: 1.5em 1.2em 1.4em;
    border-block-start: 1px solid var(--line-strong);
    border-radius: 1.8em 1.8em 0 0;
    background: var(--app-bg);
    text-align: center;

    > p:not(.sheet-hint) {
      color: var(--ink-2);
    }
  }

  .sheet-icon {
    display: grid;
    place-items: center;
    inline-size: 3.6em;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--warn-soft);
    color: var(--warn);

    .icon {
      inline-size: 1.8em;
      block-size: 1.8em;
    }
  }

  .sheet-title {
    font-size: 1.5em;
    font-weight: 650;
    letter-spacing: -0.015em;
  }

  .sheet-numbers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6em;
    inline-size: 100%;
    margin-block: 0.3em;

    > div {
      padding: 0.6em 0.5em;
      border: 1px solid color-mix(in oklab, var(--bad) 28%, transparent);
      border-radius: 1em;
      background: var(--bad-soft);

      &:last-child {
        border-color: color-mix(in oklab, var(--good) 28%, transparent);
        background: var(--good-soft);
      }
    }

    dt {
      color: var(--ink-2);
      font-size: 0.85em;
      font-weight: 600;
    }

    dd {
      color: var(--bad);
      font-size: 1.6em;
      line-height: 1.2;
    }

    > div:last-child dd {
      color: var(--good);
    }
  }

  .sheet-hint {
    display: flex;
    align-items: start;
    gap: 0.5em;
    color: var(--ink-3);
    font-size: 0.9em;
    text-align: start;

    .icon {
      margin-block-start: 0.1em;
    }
  }

  .office-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-block-size: 3rem;
    color: var(--ink-2);
    font-size: 0.9375rem;

    p {
      flex: 1 1 14rem;
    }
  }

  /* Leave room for the numbered pins that hang off the paper's edge. */
  .lab-record .paper {
    margin-inline-start: 0.9rem;
  }

  .callouts-head {
    display: grid;
    gap: 0.75rem;
    max-inline-size: 46rem;
    margin-block-start: clamp(3.5rem, 8vw, 5.5rem);
    padding-block-start: clamp(2rem, 5vw, 3rem);
    border-block-start: 1px solid var(--line);

    h3 {
      font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem);
      letter-spacing: -0.025em;
      line-height: 1.15;
    }

    p {
      color: var(--ink-2);
    }
  }

  .callouts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: 1.75rem 2.5rem;
    margin-block-start: 2.25rem;
    list-style: none;
    counter-reset: callout;

    > li {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      column-gap: 0.9rem;
      counter-increment: callout;

      &::before {
        content: counter(callout);
        grid-row: 1 / span 2;
        align-self: start;
        inline-size: 1.75rem;
        font-size: 0.8125rem;
      }
    }

    p {
      grid-column: 2;
      margin-block-start: 0.2rem;
      color: var(--ink-2);
      font-size: 1rem;
    }
  }

  /* Verdicts */
  .labels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: 0.875rem;
  }

  .label {
    display: flex;
    flex-direction: column;
    justify-content: end;
    gap: 0.6rem;
    box-sizing: border-box;
    min-block-size: 11.5rem;
    padding: 1.625rem;
    border: 1.5px solid transparent;
    border-radius: 1.25rem;
    background: var(--label-bg);
    color: var(--label-ink, var(--ink));

    dt {
      color: var(--label-head, inherit);
      font-size: 2.125rem;
      font-weight: 600;
      letter-spacing: -0.04em;
      line-height: 1;
    }

    dd {
      font-size: 0.96875rem;
    }
  }

  .label-verified {
    --label-bg: var(--good-soft);
    --label-head: var(--good);
  }

  .label-app {
    --label-bg: var(--info-soft);
    --label-head: var(--info);
  }

  .label-progress {
    --label-bg: var(--surface-2);
  }

  .label-review {
    --label-bg: var(--amber);
    --label-ink: var(--on-amber);
  }

  .label-reviewed {
    --label-bg: var(--warn-soft);
    --label-head: var(--warn);
  }

  .label-canceled {
    --label-bg: transparent;
    --label-ink: var(--ink-2);
    --label-head: var(--ink-3);
    border-style: dashed;
    border-color: var(--line-strong);
  }

  .why,
  .also {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 3.5rem;
    margin-block-start: 2.75rem;
    padding-block-start: 1.625rem;
    border-block-start: 1px solid var(--line-strong);

    h3 {
      flex: 1 1 17rem;
      font-size: 1.625rem;
      font-weight: 600;
      letter-spacing: -0.03em;
      line-height: 1.1;
    }

    > div {
      flex: 2 1 30rem;
      display: grid;
      gap: 0.75rem;
    }
  }

  .also {
    border-block-start-color: var(--line);

    > div {
      color: var(--ink-2);
    }
  }

  .why-note {
    color: var(--ink-2);
  }

  /* For the office */
  .office {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    gap: 2.5rem 3.5rem;
  }

  .dash {
    flex: 1 1 28rem;
    display: grid;
    gap: 1.125rem;
    box-sizing: border-box;
    min-inline-size: 0;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 1.625rem;
  }

  .tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;

    @media (max-width: 26rem) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  .tile {
    padding: 1rem 0.375rem;
    border-radius: 0.875rem;
    background: rgb(255 255 255 / 0.08);
    text-align: center;

    b {
      display: block;
      font-size: clamp(1.875rem, 1.2rem + 2.4vw, 2.5rem);
      font-variant-numeric: tabular-nums;
      font-weight: 600;
      letter-spacing: -0.04em;
      line-height: 1;
    }

    span {
      color: var(--ink-2);
      font-size: 0.75rem;
    }
  }

  .tile-done b {
    color: var(--good);
  }

  .tile-review {
    background: var(--amber);
    color: var(--on-amber);

    span {
      color: inherit;
    }
  }

  .dash-rows {
    list-style: none;

    li {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      padding-block: 0.75rem;
      border-block-start: 1px solid var(--line);
    }

    p span {
      display: block;
      color: var(--ink-3);
      font-size: 0.8125rem;
    }
  }

  .tag {
    padding: 0.25rem 0.625rem;
    border-radius: 99em;
    background: var(--warn-soft);
    color: var(--warn);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .feats {
    flex: 1 1 25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: 1.875rem 2rem;
    min-inline-size: 0;
    list-style: none;
  }

  .feats h3,
  .secu h3 {
    margin-block-end: 0.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
  }

  .feats p,
  .secu p {
    color: var(--ink-2);
    font-size: 1rem;
  }

  .leave {
    display: grid;
    gap: 1.375rem;
    margin-block-start: 3rem;
    padding: clamp(1.5rem, 4vw, 2.125rem);
    border-radius: 1.625rem;
    background: var(--amber);
    color: var(--on-amber);

    h3 {
      font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
      font-weight: 600;
      letter-spacing: -0.04em;
      line-height: 1;
    }

    > p {
      max-inline-size: 46em;
    }

    .note-card {
      border-color: transparent;
      color: var(--ink);
    }
  }

  .notes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 0.75rem;
    list-style: none;
  }

  .note {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0.5rem;
  }

  .note-who {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-size-adjust: none;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  /* Security */
  .secu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
    gap: 0 2.5rem;
    list-style: none;

    li {
      padding-block: 1.125rem 1.5rem;
      border-block-start: 1px solid var(--line-strong);
    }
  }

  .loc {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 3rem;
    margin-block-start: 1.75rem;
    padding: clamp(1.5rem, 4vw, 2.125rem);
    border: 1px solid var(--line);
    border-radius: 1.625rem;

    h3 {
      flex: 1 1 19rem;
      font-size: clamp(1.875rem, 1.3rem + 2.3vw, 3rem);
      font-weight: 600;
      letter-spacing: -0.04em;
      line-height: 1;
    }

    p {
      flex: 2 1 27rem;
      color: var(--ink-2);
    }
  }

  /* Questions */
  .accordion {
    border-block-start: 1px solid var(--line-strong);

    details {
      border-block-end: 1px solid var(--line);
    }

    summary {
      display: flex;
      align-items: center;
      gap: 0.8ch;
      min-block-size: var(--target-size);
      padding-block: 1.25rem;
      font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
      font-weight: 600;
      letter-spacing: -0.01em;
      list-style: none;
      cursor: pointer;

      &::-webkit-details-marker {
        display: none;
      }

      &::before {
        content: "";
        flex-shrink: 0;
        inline-size: 1em;
        block-size: 1em;
        background-color: var(--accent-text);
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E") no-repeat center / contain;
        rotate: -90deg;
      }

      &:dir(rtl)::before {
        rotate: 90deg;
      }

      details[open] > &::before {
        rotate: 0deg;
      }

      &:hover {
        color: var(--accent-text);
      }

      @media (prefers-reduced-motion: no-preference) {
        &::before {
          transition: rotate 0.2s;
        }
      }
    }

    .answer {
      max-inline-size: 65ch;
      padding-block-end: 1.4rem;
      padding-inline-start: calc(1em + 0.8ch);
      color: var(--ink-2);
    }

    details::details-content {
      interpolate-size: allow-keywords;
      overflow: clip;
      contain: layout;
    }

    details:not([open])::details-content {
      block-size: 0;
    }

    @media (prefers-reduced-motion: no-preference) {
      details::details-content {
        transition: block-size, content-visibility, display;
        transition-duration: 0.3s;
        transition-timing-function: ease-in-out;
        transition-behavior: allow-discrete;
      }
    }
  }

  /* Book a demo */
  .cta-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: clamp(2rem, 5vw, 4.5rem);

    @media (min-width: 58rem) {
      grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
    }
  }

  .cta-copy {
    @media (min-width: 58rem) {
      padding-block-start: 1.5rem;
    }
  }

  .next-steps {
    display: grid;
    gap: 0.9rem;
    margin-block-start: 2.25rem;
    list-style: none;
    color: var(--ink-2);

    li {
      display: grid;
      grid-template-columns: 2rem minmax(0, 1fr);
      align-items: baseline;
    }
  }

  .form-card {
    padding: clamp(1.25rem, 4vw, 2rem);
    border-radius: 1.625rem;
  }

  .form-note {
    margin-block-end: 1.25rem;
    color: var(--ink-3);
    font-size: 0.875rem;
  }

  .field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-block-end: 1.25rem;
  }

  .field > label,
  .field > legend {
    font-size: 0.9375rem;
    font-weight: 600;
  }

  .field > legend {
    margin-block-end: 0.4rem;
  }

  .optional {
    color: var(--ink-3);
    font-weight: 400;
  }

  .hint {
    color: var(--ink-3);
    font-size: 0.875rem;
  }

  .field :where(input[type="text"], input[type="email"], textarea) {
    inline-size: 100%;
    min-block-size: 3rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: 0.75rem;
    background: var(--page);
    color: var(--ink);
    font: inherit;
    font-size: max(1rem, 1em);

    @media (pointer: coarse) {
      min-block-size: 3.25rem;
    }

    &:user-invalid {
      border-color: var(--bad);
      background: var(--bad-soft);
    }
  }

  .field textarea {
    min-block-size: 6rem;
    resize: vertical;
  }

  .error-msg {
    display: none;
    align-items: start;
    gap: 0.4rem;
    color: var(--bad);
    font-size: 0.875rem;
    font-weight: 500;

    .icon {
      margin-block-start: 0.1em;
    }
  }

  :is(input, textarea):user-invalid + .error-msg {
    display: flex;
  }

  .choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
    gap: 0.5rem;

    label {
      display: flex;
      align-items: center;
      gap: 0.55rem;
      min-block-size: 2.75rem;
      padding-inline: 0.8rem;
      border: 1px solid var(--line-strong);
      border-radius: 0.75rem;
      cursor: pointer;

      &:hover {
        background: var(--surface-2);
      }

      &:has(:checked) {
        border-color: var(--accent);
        background: var(--accent-soft);
      }

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

    input {
      inline-size: 1.1rem;
      block-size: 1.1rem;
      margin: 0;
      accent-color: var(--accent);

      &:focus-visible {
        outline: none;
      }
    }
  }

  .hp {
    position: absolute;
    clip-path: inset(50%);
    overflow: hidden;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    white-space: nowrap;
  }

  .form-privacy {
    margin-block-start: 0.9rem;
    color: var(--ink-3);
    font-size: 0.875rem;
    text-align: center;
  }

  .form-status {
    margin-block-start: 0.9rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid color-mix(in oklab, var(--bad) 35%, transparent);
    border-radius: 0.75rem;
    background: var(--bad-soft);
    color: var(--bad);
    font-size: 0.9375rem;
    font-weight: 500;

    &:empty {
      display: none;
    }
  }

  .form-done {
    display: grid;
    justify-items: start;
    gap: 0.75rem;
    padding-block: 1rem;

    h3 {
      font-size: 1.5rem;
      letter-spacing: -0.015em;
    }

    p {
      color: var(--ink-2);
    }
  }

  /* Footer */
  .site-footer {
    padding-block: clamp(2.5rem, 6vw, 4rem);
    border-block-start: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 0.9375rem;
  }

  .footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;

    @media (min-width: 48rem) {
      grid-template-columns: minmax(13rem, 1fr) minmax(0, auto);
    }
  }

  .footer-brand p {
    margin-block-start: 0.75rem;
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;

    @media (min-width: 48rem) {
      justify-content: end;
    }

    a {
      display: inline-flex;
      align-items: center;
      min-block-size: var(--target-size);
      color: var(--ink-2);
      text-decoration: none;

      &:hover {
        color: var(--ink);
        text-decoration: underline;
      }
    }
  }

  .footer-fine {
    grid-column: 1 / -1;
    padding-block-start: 1.5rem;
    border-block-start: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 0.8125rem;
  }
}

/* ── Motion ───────────────────────────────────────────────────────
   Every part is drawn in its finished state by default. Movement is
   added only for people who have not asked for less of it. */
@layer motion {
  /* A block of the proof that just changed is tinted for a moment. */
  @keyframes fresh {
    from {
      background-color: var(--accent-soft);
    }
  }

  .is-fresh {
    animation: fresh 1.6s ease-out;
  }

  /* The sheet and the notification in the demo phone */
  .sheet,
  .banner {
    transition: display, opacity ease-out, translate ease-out;
    transition-duration: 0.3s;
    /* Separate from the shorthand so older browsers keep the rest. */
    transition-behavior: allow-discrete;

    @media (prefers-reduced-motion: reduce) {
      transition-duration: 0.1s;
    }
  }

  @starting-style {
    .sheet {
      opacity: 0;
      translate: 0 100%;
    }

    .banner {
      opacity: 0;
      translate: 0 -120%;
    }
  }

  .sheet:where([hidden], [data-closing]) {
    opacity: 0;
    translate: 0 100%;
  }

  .banner:where([hidden], [data-closing]) {
    opacity: 0;
    translate: 0 -120%;
  }

  :is(.sheet, .banner)[hidden] {
    display: none;
  }

  @media (prefers-reduced-motion: reduce) {
    @starting-style {
      .sheet,
      .banner {
        translate: none;
      }
    }

    :is(.sheet, .banner):where([hidden], [data-closing]) {
      translate: none;
    }

    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
      animation: none !important;
    }
  }

  /* The signature keeps its shape while it travels from the phone to the proof. */
  ::view-transition-old(signature),
  ::view-transition-new(signature) {
    block-size: 100%;
    object-fit: contain;
  }

  ::view-transition-group(signature) {
    animation-duration: 0.6s;
    animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
  }

  @media (prefers-reduced-motion: no-preference) {
    @keyframes pop {
      from { scale: 0.2; }
    }

    @keyframes rise {
      from { opacity: 0; translate: 0 0.75rem; }
    }

    @keyframes sig {
      from { --sig-draw: 1; }
      to { --sig-draw: 0; }
    }

    @keyframes drip {
      0% { scale: 1 0; transform-origin: top; }
      50% { scale: 1 1; transform-origin: top; }
      51% { transform-origin: bottom; }
      100% { scale: 1 0; transform-origin: bottom; }
    }

    .tries-list .is-caught {
      animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    /* "Sign for me" in the demo writes the sample signature. */
    .pad.is-writing #pad-sample {
      animation: sig 0.9s cubic-bezier(0.4, 0, 0.3, 1) both;
    }

    /* The line under "Scroll to follow one visit" runs while the scene is in motion,
       and stops with it when the visitor presses Pause motion. */
    .is-ambient .cue::after {
      animation: drip 1.8s infinite;
    }

    /* ── Cards rise as they scroll into view ── */
    @supports ((animation-timeline: view()) and (animation-range: entry)) {
      .reveal {
        animation: rise auto linear backwards;
        animation-timeline: view();
        animation-range: entry 0% entry 70%;
      }
    }
  }
}

/* Windows High Contrast and other forced color modes */
@media (forced-colors: active) {
  .accordion summary::before,
  .app-bars i {
    forced-color-adjust: none;
    background-color: CanvasText;
  }

  .mark,
  .callouts > li::before,
  .result-icon,
  .app-button,
  .walker span {
    border: 1px solid CanvasText;
  }

  .choices label:has(:checked) {
    outline: 2px solid Highlight;
  }
}
