/*
 * «Агент» — the same tokens the product uses, written out by hand because this page has no
 * build step. They are not local choices: changing one here changes only this page, which is
 * how the two drift apart.
 *
 * Dark is the canonical theme and light is a designed equal, not an inversion — both sets of
 * values were contrast-checked against their own background. The OS decides: there is no
 * theme switcher here and no stored preference, so `prefers-color-scheme` is the whole
 * mechanism and nothing has to run before first paint to apply it.
 *
 * The page's own header sends `default-src 'self'` with no `unsafe-inline`, so the browser
 * drops a `style` attribute on sight. Every value a graphic needs therefore lives here or in
 * an SVG presentation attribute; a bar whose width was set inline would render as an empty
 * track with nothing in the console.
 *
 * One sheet for the whole site: the home page (a 1120px column with a sticky header, the
 * queue card, one drawn month of the product, three cards, the data band, the personal pair,
 * the queue band, a footer) and the pages that are one column of prose. The home page's rules
 * are the `home-` family below; the shell, the language switch and the legal pages come first.
 */


:root {
  --bg: #0b0e17;
  --surface: #141826;
  --surface-2: #1c2132;
  --border: #262c40;
  --text: #eef1f8;
  --muted: #98a1bc;
  --primary: #5b8cff;
  --primary-hover: #7ba3ff;
  --primary-ink: #08101f;
  --accent: #a78bfa;
  --cyan: #67e8f9;
  --personal: #7e88b8;

  /* Two graphic-only greys the token file does not carry, because only the illustrations
     need them: the outline of a drawn object, and the ghost bars standing in for text
     inside one. Light values are darkened well past a straight inversion — a placeholder
     line has to stay a visible object on white, not a suggestion of one. */
  --graphic-line: #2f3752;
  --graphic-ghost: #39425e;

  --grad-agent: linear-gradient(135deg, #5b8cff 0%, #a78bfa 60%, #67e8f9 100%);
  --grad-veil: radial-gradient(50% 40% at 50% 0%, rgb(91 140 255 / 0.2) 0%, rgb(11 14 23 / 0) 72%);
  --grad-rim: linear-gradient(90deg, rgb(167 139 250 / 0) 0%, rgb(167 139 250 / 0.45) 50%, rgb(167 139 250 / 0) 100%);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  --font-display: Geologica, 'Segoe UI', system-ui, sans-serif;
  --font-ui: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Martian Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 200ms;

  color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9ff;
    --surface: #ffffff;
    --surface-2: #f2f5fe;
    --border: #e1e7f7;
    --text: #0c1226;
    --muted: #5a6486;
    --primary: #3a63d8;
    --primary-hover: #2d51bd;
    --primary-ink: #ffffff;
    --accent: #6d4fd6;
    --cyan: #0e7c93;
    --personal: #5c6596;

    --graphic-line: #b4c0e0;
    --graphic-ghost: #9aa6ca;

    --grad-veil: radial-gradient(50% 40% at 50% 0%, rgb(58 99 216 / 0.12) 0%, rgb(247 249 255 / 0) 72%);
    --grad-rim: linear-gradient(90deg, rgb(109 79 214 / 0) 0%, rgb(109 79 214 / 0.5) 50%, rgb(109 79 214 / 0) 100%);
  }
}

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: opacity 250ms ease-out;
}

/* Hidden until i18n.js has put words on the page: a Russian hero flashing before an English
 * one is exactly the mismatch the copy discipline exists to prevent. i18n.js always removes
 * this, even when the catalog fetch fails; noscript.css covers JS being off entirely. */
html.boot body {
  opacity: 0;
}

/* The one veil on the page, behind everything, at the top where the eye lands. A second one
 * anywhere below turns the whole surface into a gradient and the light stops meaning
 * anything. */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 520px;
  background: var(--grad-veil);
  pointer-events: none;
  z-index: -1;
}

/* --- shell ------------------------------------------------------------------ */

.page {
  display: flex;
  min-height: 100dvh;
  max-width: 1120px;
  flex-direction: column;
  gap: 48px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* The pages that are one column of prose. The home page earns 1120px because it has a
 * schematic to put beside the words; a policy does not, and a masthead stretched to 1120
 * over a 62ch paragraph reads as a layout somebody forgot to finish. */
.page.narrow {
  max-width: 760px;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 860px) {
  .page.narrow {
    padding-left: 32px;
    padding-right: 32px;
  }
}

/* Wraps because at 320px the wordmark and the language pair together are 15px wider than the
 * page, and the toggle was the part hanging off the edge. Wrapping beat the alternatives:
 * shrinking the wordmark makes the one piece of branding here the smallest thing on screen,
 * and abbreviating the languages to RU/EN asks somebody to recognise their own language from
 * two letters in an alphabet they may not read. The auto margin holds the toggle right
 * whether it shares the line or gets one of its own. */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

/* Half the mark's height, per the brand rules — the gap is measured, not eyeballed. */
.brand svg {
  display: block;
  width: 36px;
  height: 36px;
  flex: none;
}

/* The mark's open orbit is the brand gradient; the trailing arc is the same hairline as
 * every card border, so it recedes in both themes instead of glowing in one. */
.mark-arc-lead {
  fill: none;
  stroke: url(#brandgrad);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.mark-arc-trail {
  fill: none;
  stroke: var(--border);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.mark-dot {
  fill: var(--primary);
}

a.brand {
  color: inherit;
  text-decoration: none;
}

/* --- language ---------------------------------------------------------------- */

.lang {
  display: flex;
  margin-left: auto;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
}

.lang button {
  position: relative;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.lang button[aria-pressed='true'] {
  background: var(--primary);
  color: var(--primary-ink);
}

/* >=44px hit area without a 44px-tall control. */
.lang button::after {
  content: '';
  position: absolute;
  inset: -6px;
}

main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 48px;
}

.hero {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 10vw, 3.75rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.lead {
  max-width: 42ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.125rem;
}

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

footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

footer a {
  color: inherit;
  text-underline-offset: 3px;
}

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

/* --- a11y --------------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
  body,
  .lang button {
    transition: none;
  }
}

@media (min-width: 640px) {
  .page {
    gap: 64px;
    padding: 40px 32px 32px;
  }
}

/* --- the missing page ---------------------------------------------------------------- */

.notfound {
  justify-content: center;
  gap: 20px;
  padding-bottom: 32px;
}

/* Big, quiet, and behind the sentence rather than in front of it: the number is what tells
 * you which kind of nothing this is, but the words are what tell you what to do. */
.notfound .code {
  margin: 0;
  color: var(--border);
  font-family: var(--font-mono);
  font-size: clamp(4rem, 20vw, 6.5rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.notfound .lead {
  max-width: 38ch;
}

.home {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--r-sm);
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease);
}

.home:hover {
  background: var(--primary-hover);
}

/* --- the legal pages ------------------------------------------------------------------ */

/* Long-form prose, which the rest of this sheet has never had to hold: the home page is a
 * handful of short blocks and the 404 is three. The measure is what does the work — a policy
 * nobody finishes is a policy nobody agreed to, and a 90-character line is the fastest way to
 * make somebody stop reading. */
.legal {
  padding-bottom: 32px;
  max-width: 680px;
  font-size: 0.9375rem;
  line-height: 1.75;
}

/* «конфиденциальность» is one word 18 characters long, and at 320px it was 73px wider than
 * the page — the title alone made the whole policy scroll sideways. Hyphenation is the fix
 * that keeps the word a word; the browser needs the document's `lang` for it, which i18n.js
 * sets before this ever matters. `break-word` is the backstop for a browser without the
 * patterns: an ugly break beats a page that slides. */
.legal h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}

/* Above the title, kicker-style: "when was this last touched" is the first thing a
 * suspicious reader looks for and the last thing most policies make easy to find. */
.legal-updated {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.legal-intro {
  margin: 16px 0 0;
  font-size: 1.0625rem;
}

/* A plain list of links, and only on the pages with more than six sections. No floating
 * side panel: these pages are read once and whole. */
.legal-toc {
  margin-top: 24px;
}

.legal-toc ol {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.legal-toc li::marker {
  color: var(--muted);
}

.legal section {
  margin-top: 48px;
}

.legal h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.legal p {
  margin: 0;
}

.legal section p + p,
.legal section ul + p,
.legal section p + ul {
  margin-top: 16px;
}

.legal ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.legal li {
  padding-left: 4px;
}

.legal li::marker {
  color: var(--muted);
}

/* The controller's name and the contact address are the two lines a reader actually came
 * for, so they get to stop looking like the paragraph around them. */
.legal-strong {
  font-weight: 600;
  font-size: 1.0625rem;
}

.legal-link {
  color: var(--primary);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.legal-link:hover {
  color: var(--primary-hover);
}

/* --- the home page ------------------------------------------------------------- */
/*
 * Leaning on everything above for what is the site's — tokens, type, the brand mark, the
 * language switch, focus rings, the veil — so this is only the layout the drawing asked for.
 * Every colour is a token; nothing here is a value of its own.
 *
 * The one thing undone from the shell: `.page` is a padded 1120px column, and this page has
 * bands that run edge to edge (the header's rule, the data band). So the outer frame is
 * full-bleed and each band centres its own `.home-wrap`.
 */

/* Five tokens the apex never needed and so never transcribed: the three category inks the
 * drawn month uses, the error ink for the row the agent could not place, and the border one
 * step up for a control under the cursor. Values as the token file has them, both themes. */
:root {
  --border-strong: #3a4460;
  --error: #f0736f;
  --cat-groceries: #3dd68c;
  --cat-cafe: #f2b44c;
  --cat-transport: #5b8cff;
}

@media (prefers-color-scheme: light) {
  :root {
    --border-strong: #c9d3ee;
    --error: #c6504c;
    --cat-groceries: #0b7a4e;
    --cat-cafe: #966109;
    --cat-transport: #3a63d8;
  }
}

.page.home-page {
  max-width: none;
  gap: 0;
  padding: 0;
}

.home-page main {
  gap: 0;
}

.home-wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.home-spacer {
  flex: 1;
}

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

.home-mono {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.home-muted {
  color: var(--muted);
}

.home-right {
  text-align: right;
}

.home-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-eyebrow svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-eyebrow-cyan {
  margin-bottom: 22px;
  font-size: 0.75rem;
  color: var(--cyan);
}

.home-eyebrow-personal {
  margin-bottom: 16px;
  color: var(--personal);
}

.home-h1 {
  margin: 0 0 22px;
  max-width: 840px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 1.2rem + 3.6vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.home-h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.home-h2-tight {
  margin-bottom: 16px;
  font-size: clamp(1.625rem, 1.25rem + 1.2vw, 2rem);
  line-height: 1.12;
}

.home-h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.home-lead {
  margin: 0 0 32px;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.1875rem;
  line-height: 1.55;
}

.home-section-lead {
  margin: 0 0 44px;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.home-body {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.home-body-md {
  margin-bottom: 22px;
  font-size: 0.9375rem;
}

.home-body-lg {
  font-size: 1rem;
}

.home-body-lg + .home-body-lg {
  margin-top: 14px;
}

/* --- buttons ------------------------------------------------------------------- */

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.home-btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 0.8125rem;
}

.home-btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
}

.home-btn-primary:hover {
  background: var(--primary-hover);
}

.home-btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
}

.home-btn-ghost:hover {
  border-color: var(--text);
}

/* --- header -------------------------------------------------------------------- */

.home-head {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.home-head-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.home-brand {
  font-size: 1.125rem;
}

.home-brand svg {
  width: 26px;
  height: 26px;
}

.home-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.875rem;
}

.home-nav a {
  color: var(--muted);
  text-decoration: none;
}

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

.home-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.home-head-actions .lang {
  margin-left: 0;
}

/* --- the drawn month ----------------------------------------------------------- */

.home-sample {
  padding-bottom: 72px;
}

.home-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.home-table-head {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.home-table-head span {
  white-space: nowrap;
}

.home-table-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8125rem;
}

.home-row {
  display: grid;
  grid-template-columns: 1fr 180px 120px 140px;
  gap: 0 16px;
  align-items: center;
  min-height: 52px;
  padding: 0 20px;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

.home-row-cols {
  min-height: 32px;
  border-top: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-cell-op {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.home-op-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-op-meta {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.625rem;
}

.home-cat {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8125rem;
}

.home-cat-unsure {
  color: var(--error);
}

.home-amount {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* The personal row is the reader's own, so it is drawn in the personal ink — the same
 * rule the product's table follows. Nothing is hidden from its only reader. */
.home-row-personal .home-op-title,
.home-row-personal .home-cat,
.home-row-personal .home-amount {
  color: var(--personal);
}

.home-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: var(--r-pill);
}

.home-dot-groceries {
  background: var(--cat-groceries);
}

.home-dot-cafe {
  background: var(--cat-cafe);
}

.home-dot-transport {
  background: var(--cat-transport);
}

.home-dot-personal {
  background: var(--personal);
}

.home-dot-unsure {
  border: 1px dashed var(--error);
}

/* The rim between the sample and the steps: the one gradient, used as a hairline of light. */
.home-rim {
  height: 1px;
  background: var(--grad-rim);
}

/* --- three steps --------------------------------------------------------------- */

.home-how {
  padding-top: 72px;
  padding-bottom: 72px;
}

.home-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.home-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.home-card-lg {
  padding: 28px;
}

.home-card-lit::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--grad-rim);
}

.home-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.home-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-icon-primary {
  stroke: var(--primary);
}

.home-icon-accent {
  stroke: var(--accent);
}

.home-icon-cyan {
  stroke: var(--cyan);
}

/* --- personal ------------------------------------------------------------------ */

.home-personal {
  padding-top: 72px;
  padding-bottom: 72px;
}

.home-personal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.home-peer {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.home-peer .home-eyebrow {
  font-size: 0.625rem;
}

.home-peer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.home-peer-row > span:first-of-type {
  flex: 1;
}

.home-peer-row .home-mono {
  font-size: 0.8125rem;
}

.home-peer-row:last-of-type {
  border-bottom: 0;
}

.home-peer-note {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.55;
}

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

.home-foot {
  display: block;
  margin-top: 32px;
  padding: 0;
  border-top: 1px solid var(--border);
}

.home-foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding-top: 32px;
  padding-bottom: 40px;
  font-size: 0.8125rem;
}

.home-foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-foot-brand svg {
  width: 22px;
  height: 22px;
  fill: var(--border-strong);
  stroke: var(--border-strong);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.home-foot-brand svg path {
  fill: none;
}

.home-foot a {
  color: var(--muted);
  text-decoration: none;
}

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

/* --- narrower than the drawing ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .home-btn {
    transition: none;
  }
}

@media (max-width: 1023px) {
  .home-nav {
    display: none;
  }
}

@media (max-width: 859px) {
  .home-steps,
  .home-personal-grid {
    grid-template-columns: 1fr;
  }

  .home-personal-grid {
    gap: 32px;
  }

  .home-personal {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .home-how {
    padding-top: 56px;
  }

  .home-sample {
    padding-bottom: 56px;
  }

  /* The table keeps its four columns down to a tablet; below that it becomes two: the
   * operation and its amount, category and who folded under the title. */
  .home-row {
    grid-template-columns: 1fr 120px 100px 110px;
  }
}

@media (max-width: 639px) {
  .home-head-row {
    gap: 12px;
  }

  .home-row {
    grid-template-columns: 1fr auto;
    row-gap: 2px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .home-row-cols span:nth-child(2),
  .home-row-cols span:nth-child(3),
  .home-row .home-muted:nth-child(3) {
    display: none;
  }

  .home-row .home-cat {
    grid-column: 1;
    font-size: 0.75rem;
  }

  .home-row .home-amount {
    grid-row: 1;
    grid-column: 2;
  }

  /* On a phone the table's header keeps the title and the total; the count goes. */
  .home-table-head .home-mono:first-of-type {
    display: none;
  }
}

/* --- what the pre-launch page adds --------------------------------------------- */

/* Six more tokens from the same file: the success and warning inks (the queue card's
 * "you are in", the third data card's edge), the ground surface behind a card that sits on
 * a surface, and the selection tint under a control. Both themes, values as the token file
 * has them. */
:root {
  --success: #3dd68c;
  --warning: #f2b44c;
  --sel: rgb(91 140 255 / 0.1);
}

@media (prefers-color-scheme: light) {
  :root {
    --success: #0b7a4e;
    --warning: #966109;
    --sel: rgb(58 99 216 / 0.08);
  }
}

.home-eyebrow-accent {
  color: var(--accent);
}

.home-eyebrow-success {
  color: var(--success);
}

.home-eyebrow-muted {
  color: var(--muted);
}

.home-eyebrow-xs {
  font-size: 0.625rem;
}

.home-h4 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}

.home-section-lead-md {
  margin-bottom: 36px;
  max-width: 660px;
  font-size: 1rem;
}

.home-status {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* --- hero: words beside the card ---------------------------------------------- */

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 452px;
  gap: 56px;
  align-items: start;
  padding-top: 80px;
  padding-bottom: 56px;
}

.home-hero .home-lead {
  margin-bottom: 24px;
  max-width: 600px;
}

.home-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  max-width: 600px;
  list-style: none;
}

.home-points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.home-points svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  fill: none;
  stroke: var(--success);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- the queue card ------------------------------------------------------------ */

.home-join {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  scroll-margin-top: 88px;
}

/* One card, two states; the attribute decides which of the two children exists. `display`
 * rather than opacity so the hidden one is out of the tab order and the reading order. */
.home-join[data-state='form'] .home-join-sent,
.home-join[data-state='sent'] .home-join-form {
  display: none;
}

.home-join .home-eyebrow {
  margin-bottom: 12px;
}

.home-join-title {
  margin: 0 0 10px;
  font-size: 1.5rem;
  line-height: 1.2;
}

.home-join-lead {
  margin-bottom: 20px;
}

.home-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.875rem;
}

.home-input {
  width: 100%;
  height: 48px;
  margin-bottom: 12px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease);
}

.home-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.home-input:hover {
  border-color: var(--border-strong);
}

.home-input:focus-visible {
  border-color: var(--primary);
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.home-join-form[data-error]:not([data-error='']) .home-input {
  border-color: var(--error);
}

/* The trap is off the page, not `display: none`: a script that fills every field it can see
 * has to be able to see this one. */
.home-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.home-join-submit {
  width: 100%;
}

/* The button's two labels — at rest and while the request is out. */
.home-join-submit span + span,
.home-join-form[data-busy='true'] .home-join-submit span:first-child {
  display: none;
}

.home-join-form[data-busy='true'] .home-join-submit span + span {
  display: inline;
}

.home-join-submit:disabled {
  opacity: 0.7;
  cursor: progress;
}

/* Every outcome is on the page; the form's `data-error` picks the one that shows. */
.home-join-error {
  margin: 12px 0 0;
  color: var(--error);
  font-size: 0.875rem;
  line-height: 1.5;
}

.home-join-error span {
  display: none;
}

.home-join-form[data-error='email_invalid'] [data-error='email_invalid'],
.home-join-form[data-error='email_disposable'] [data-error='email_disposable'],
.home-join-form[data-error='rate_limited'] [data-error='rate_limited'],
.home-join-form[data-error='network'] [data-error='network'] {
  display: inline;
}

.home-join-note {
  margin-top: 14px;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.home-join-sent .home-eyebrow {
  margin-bottom: 14px;
}

.home-join-sent .home-join-lead {
  margin-bottom: 16px;
}

.home-join-email {
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.home-join-already {
  display: none;
  margin: -6px 0 16px;
  font-size: 0.8125rem;
}

.home-join-is-already .home-join-already {
  display: block;
}

.home-join-mail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
}

.home-join-mail .home-eyebrow {
  margin: 0;
}

.home-join-mail .home-body {
  font-size: 0.8125rem;
  line-height: 1.55;
}

/* --- the sample's title line --------------------------------------------------- */

.home-sample-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 14px;
}

.home-sample-head .home-h3 {
  margin: 0;
}

/* --- data and AI ---------------------------------------------------------------- */

.home-ai {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.home-ai-wrap {
  padding-top: 64px;
  padding-bottom: 64px;
}

.home-ai .home-h2 {
  max-width: 760px;
}

.home-ai-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* A card on the surface band sits on the ground colour, so it still reads as a card. */
.home-card-ground {
  padding: 24px;
  background: var(--bg);
}

.home-card-warn {
  border-left: 2px solid var(--warning);
}

/* --- the queue band ------------------------------------------------------------- */

.home-queue {
  padding-bottom: 72px;
}

.home-queue-card {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 48px;
}

.home-queue-card > div {
  flex: 1;
}

.home-queue-card .home-h2 {
  margin-bottom: 12px;
}

.home-queue-card .home-body-lg {
  max-width: 560px;
}

.home-queue-card .home-btn {
  flex: none;
}

/* --- narrower than the drawing, continued --------------------------------------- */

@media (max-width: 1023px) {
  .home-status {
    display: none;
  }
}

@media (max-width: 859px) {
  .home-hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 56px;
    padding-bottom: 40px;
  }

  .home-ai-grid {
    grid-template-columns: 1fr;
  }

  .home-ai-wrap {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .home-queue-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 28px;
  }
}

@media (max-width: 639px) {
  .home-head-actions .home-btn {
    display: none;
  }

  .home-join {
    padding: 20px;
  }

  .home-queue-card .home-btn {
    width: 100%;
  }
}
