/* compter landing page. Brand colours come from branding/brand.swift (the feature graphic). */

:root {
  /* Brand */
  --navy-deep: #0a1633;
  --navy-high: #1e3e78;
  --navy: #213f73;
  --navy-ink: #14224b;
  --sky: #30ceff;
  --sky-soft: #9fe3ff;

  /* The page below the hero: light-dark(light, dark), resolved by color-scheme */
  --canvas: light-dark(#f5f8fc, #08112a);
  --surface: light-dark(#ffffff, #0f1d3f);
  --surface-muted: light-dark(#eaf0f8, #13244b);
  --line: light-dark(#d9e2ee, #20345f);
  --ink: light-dark(#14224b, #eef3ff);
  --ink-muted: light-dark(#56648a, #9eaed0);
  --accent: light-dark(#06698f, #30ceff);
  --accent-soft: light-dark(#dcf5ff, #10345a);
  --positive: light-dark(#166a50, #6bd4ae);
  --positive-soft: light-dark(#e3f5ee, #133a3a);
  --caution: light-dark(#9a6410, #e9be72);
  --caution-soft: light-dark(#fff1d9, #3a2f1f);

  /* The hero and the closing call: light gray by day, the brand's navy by night */
  --hero-from: light-dark(#f3f5f8, var(--navy-deep));
  --hero-mid: light-dark(#eceff4, #10224a);
  --hero-to: light-dark(#dfe5ee, var(--navy-high));
  --hero-ink: light-dark(var(--navy-ink), #f2f6ff);
  --hero-muted: light-dark(#4b5878, #a9b8d6);
  --hero-tagline: light-dark(#0a6a93, var(--sky-soft));
  --hero-line: light-dark(rgb(20 34 75 / 0.06), rgb(159 227 255 / 0.1));
  --hero-glow: light-dark(rgb(48 206 255 / 0.16), rgb(48 206 255 / 0.1));
  --hero-soft: light-dark(rgb(20 34 75 / 0.06), rgb(255 255 255 / 0.08));
  --hero-soft-hover: light-dark(rgb(20 34 75 / 0.12), rgb(255 255 255 / 0.16));
  --hero-shadow: light-dark(rgb(20 34 75 / 0.18), rgb(0 0 0 / 0.42));
  --hero-field-line: light-dark(rgb(20 34 75 / 0.18), rgb(159 227 255 / 0.25));

  /* Always-navy surfaces: the open-source card and the phone menu */
  --dark-ink: #f2f6ff;
  --dark-muted: #a9b8d6;

  --font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Figtree", "Avenir Next", var(--font);

  --step-small: 0.875rem;
  --step-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-statement: clamp(1.375rem, 1.05rem + 1.3vw, 2.25rem);
  --step-head: clamp(2rem, 1.2rem + 3.2vw, 4rem);
  --step-display: clamp(4.5rem, 1.6rem + 10vw, 9.5rem);

  --m: clamp(16px, 3vw, 40px);
  --max: 1240px;
  --gap-section: clamp(96px, 11vw, 176px);
  --radius: 10px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-hover: 180ms;
  --t-reveal: 800ms;

  /* Follows the system until the visitor picks a theme */
  color-scheme: light dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* One scrollbar colour for both themes: it sits outside the theme switch's
     snapshot, so a themed one would flip the moment the switch is pressed. */
  scrollbar-color: rgb(127 140 170 / 0.55) transparent;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.55;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p,
figure,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
  transition: color var(--t-hover) ease;
}

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

::selection {
  background: var(--sky);
  color: var(--navy-deep);
}

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

.skip {
  position: absolute;
  left: var(--m);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--sky);
  color: var(--navy-deep);
  font-weight: 600;
  border-radius: 999px;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--m));
  margin-inline: auto;
  padding-inline: var(--m);
}

.head {
  font-family: var(--font-display);
  font-size: var(--step-head);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font: 600 1rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--t-hover) var(--ease-out),
    background-color var(--t-hover) ease,
    color var(--t-hover) ease;
}

.button:active {
  transform: scale(0.97);
}

.button-sky {
  background: var(--sky);
  color: var(--navy-deep);
}

.button-sky:hover {
  background: var(--sky-soft);
}

.button-ghost {
  background: var(--hero-soft);
  color: var(--hero-ink);
}

.button-ghost:hover {
  background: var(--hero-soft-hover);
}

/* ── Hero: the feature graphic ─────────────────────────────────────────── */

/* Fills the first screen: nav on top, facts on the bottom edge, the body centred between. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--hero-ink);
  background: linear-gradient(115deg, var(--hero-from) 0%, var(--hero-mid) 45%, var(--hero-to) 100%);
}

/* Faint grid, fading out towards the edges */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--hero-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--hero-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 70% at 40% 45%, #000 20%, transparent 75%);
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px 32px;
  min-height: 80px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.hero .brand img,
.close .brand img {
  padding: 3px;
  background: #fff;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  gap: 28px;
  margin-right: auto;
  font-size: 0.9375rem;
}

.nav-links a,
.nav-signin {
  color: var(--hero-muted);
  text-decoration: none;
}

.nav-links a:hover,
.nav-signin:hover {
  color: var(--hero-ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.9375rem;
}

.nav-actions .button {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.9375rem;
}

.nav-menu {
  display: none;
  position: relative;
  margin-left: auto;
}

.nav-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--hero-soft);
  font-weight: 600;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu ul {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 5;
  min-width: 220px;
  padding: 8px;
  color: var(--dark-ink);
  background: var(--navy-ink);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.4);
}

.nav-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  text-decoration: none;
}

.nav-menu a:hover {
  background: rgb(255 255 255 / 0.08);
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  flex: 1;
  padding-block: clamp(32px, 4vw, 64px);
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  /* Also bounded by the screen's height, so short laptops keep the facts on screen */
  width: min(100%, 520px, 56svh);
  justify-self: center;
}

.hero-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--hero-glow);
}

/* The dark arc that wraps the tile's right side in the graphic */
.hero-arc {
  position: absolute;
  inset: 21%;
  border-radius: 50%;
  border: 4px solid transparent;
  border-right-color: var(--navy-ink);
  border-top-color: var(--navy-ink);
  transform: rotate(18deg);
  z-index: -1;
}

.hero-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 58%;
  aspect-ratio: 1;
  padding: 7%;
  background: #fff;
  border-radius: 22%;
  box-shadow: 0 18px 48px var(--hero-shadow);
}

.hero-tile img {
  width: 100%;
}

.hero-text h1 {
  font-size: inherit;
}

.wordmark {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-display);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--hero-ink);
}

.tagline {
  display: block;
  margin-top: clamp(16px, 2vw, 28px);
  max-width: 25ch;
  font-size: var(--step-statement);
  font-weight: 500;
  line-height: 1.25;
  color: var(--hero-tagline);
}

.hero-lead {
  margin-top: 20px;
  max-width: 46ch;
  color: var(--hero-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 28px;
  padding-block: 28px 36px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--hero-muted);
  border-top: 1px solid var(--hero-line);
}

/* ── Panels shared by the interface fragments ─────────────────────────── */

.panel,
.app,
.answer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 0.9375rem;
  box-shadow: 0 24px 60px -24px rgb(20 34 75 / 0.25);
}

.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.chip-sky {
  background: var(--accent-soft);
  color: var(--accent);
}

.chip-ok {
  background: var(--positive-soft);
  color: var(--positive);
}

.chip-wait {
  background: var(--caution-soft);
  color: var(--caution);
}

/* ── From invoice to ledger ───────────────────────────────────────────── */

.flow {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  padding-block: var(--gap-section);
}

.checks {
  display: grid;
  gap: 22px;
  margin-top: 40px;
}

.checks li {
  position: relative;
  padding-left: 40px;
  color: var(--ink-muted);
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sky) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='%230a1633' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.checks strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
}

.panel-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.panel-bar span:first-child {
  margin-right: auto;
}

.panel-body {
  padding: 20px;
}

.panel-party {
  display: grid;
  gap: 2px;
  margin-bottom: 16px;
}

.panel-party span {
  color: var(--ink-muted);
  font-size: var(--step-small);
}

.lines,
.app-table,
.answer-table,
.journal {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.lines th,
.app-table th {
  padding: 8px 0;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line);
}

.lines td {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.lines th:not(:first-child),
.lines td:not(:first-child) {
  text-align: right;
  padding-left: 12px;
}

.sums {
  display: grid;
  gap: 6px;
  width: min(100%, 260px);
  margin: 16px 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.sums div,
.journal-mini div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.sums dt {
  color: var(--ink-muted);
}

.sums .total {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}

.sums .total dt {
  color: var(--ink);
}

.panel-foot {
  padding: 16px 20px 20px;
  background: var(--surface-muted);
  border-radius: 0 0 14px 14px;
}

.panel-foot-title {
  margin-bottom: 8px;
  font-weight: 600;
}

.journal-mini {
  display: grid;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}

.journal-mini dd {
  color: var(--ink);
}

/* ── The statement ─────────────────────────────────────────────────────── */

.say {
  display: grid;
  gap: 28px;
  max-width: calc(980px + 2 * var(--m));
  padding-bottom: var(--gap-section);
  font-family: var(--font-display);
  font-size: var(--step-statement);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.say-dim {
  color: var(--ink-muted);
}

/* ── Product overview ──────────────────────────────────────────────────── */

.product {
  padding-block: var(--gap-section);
  background: var(--surface-muted);
}

.app {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  margin-top: 48px;
  overflow: hidden;
}

.app-side {
  padding: 20px 14px;
  background: var(--navy-deep);
  color: var(--dark-muted);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 20px;
  font-family: var(--font-display);
  font-weight: 800;
  color: #fff;
}

.app-brand img {
  padding: 2px;
  background: #fff;
  border-radius: 5px;
  width: 22px;
}

.app-side li {
  padding: 8px 10px;
  border-radius: 8px;
}

.app-side li.is-on {
  background: rgb(48 206 255 / 0.14);
  color: var(--sky);
  font-weight: 600;
}

.app-main {
  padding: 24px 28px 28px;
  min-width: 0;
  overflow-x: auto;
}

.app-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.app-title {
  margin-right: auto;
  font-size: 1.25rem;
  font-weight: 700;
}

.app-search {
  padding: 8px 14px;
  min-width: 200px;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.app-new {
  padding: 8px 14px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
}

.app-table td {
  padding: 13px 16px 13px 0;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.app-table th {
  padding-right: 16px;
}

.app-table td:nth-child(4) {
  text-align: right;
}

.app-table th:nth-child(4) {
  text-align: right;
}

.cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
  margin-top: 56px;
}

.cols h3,
.card h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.cols h3 {
  padding-top: 16px;
  border-top: 3px solid var(--sky);
}

.cols p,
.card p {
  margin-top: 10px;
  color: var(--ink-muted);
}

/* ── Try it ────────────────────────────────────────────────────────────── */

.try {
  padding-block: var(--gap-section);
}

.try-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.try-text > p {
  margin-top: 20px;
  max-width: 44ch;
  color: var(--ink-muted);
}

.try-form input {
  width: 100%;
  margin-top: 32px;
  padding: 18px 20px;
  font: 600 clamp(1.125rem, 0.9rem + 1vw, 1.625rem) / 1.2 var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
  transition: border-color var(--t-hover) ease;
}

.try-form input:focus {
  outline: none;
  border-color: var(--sky);
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.examples button {
  padding: 8px 14px;
  font: 500 0.875rem/1.2 var(--font);
  color: var(--ink);
  background: var(--surface-muted);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color var(--t-hover) ease,
    transform var(--t-hover) var(--ease-out);
}

.examples button:hover {
  background: var(--accent-soft);
}

.examples button:active {
  transform: scale(0.96);
}

.answer {
  padding: 24px;
  transition: opacity 120ms ease;
}

.answer.is-updating {
  opacity: 0.55;
}

.answer-place {
  margin-bottom: 16px;
}

.answer-place.warn {
  color: var(--caution);
}

.answer-table th,
.answer-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.answer-table th {
  text-align: left;
  font-weight: 400;
  color: var(--ink-muted);
}

.answer-table td {
  text-align: right;
}

.answer-table .total th,
.answer-table .total td {
  font-weight: 700;
  color: var(--ink);
  border-bottom: 0;
}

.journal {
  margin-top: 20px;
  background: var(--surface-muted);
  border-radius: 10px;
}

.journal caption {
  padding: 0 0 8px;
  text-align: left;
  font-weight: 600;
}

.journal th,
.journal td {
  padding: 8px 12px;
  text-align: right;
}

.journal th {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.journal th:first-child,
.journal td:first-child {
  text-align: left;
}

.balanced {
  margin-top: 16px;
  font-weight: 600;
  color: var(--positive);
}

/* ── Trust grid ────────────────────────────────────────────────────────── */

.trust {
  padding-bottom: var(--gap-section);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.card {
  padding: clamp(24px, 3vw, 36px);
  background: var(--surface);
  border-radius: 16px;
}

.card-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  background: var(--navy-deep);
  color: var(--dark-ink);
}

.card-wide p {
  color: var(--dark-muted);
}

.text-link {
  display: inline-block;
  margin-top: 20px;
  font-weight: 600;
  color: var(--sky);
}

.code {
  margin: 0;
  padding: 20px 24px;
  overflow-x: auto;
  font: 0.875rem/1.65 ui-monospace, "SF Mono", Menlo, monospace;
  color: #dbe6ff;
  background: rgb(255 255 255 / 0.05);
  border-radius: 12px;
}

.code .k {
  color: var(--sky);
}

.code .c {
  color: #7f8fb3;
}

.code .n {
  color: #ffd08a;
}

/* ── Questions ─────────────────────────────────────────────────────────── */

.faq {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
  padding-bottom: var(--gap-section);
}

.faq-list {
  display: grid;
  gap: 8px;
}

.faq details {
  background: var(--surface);
  border-radius: 14px;
}

.faq summary {
  position: relative;
  padding: 20px 56px 20px 24px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* A plus that turns into a minus */
.faq summary::before,
.faq summary::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 50%;
  width: 14px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform var(--t-hover) var(--ease-out);
}

.faq summary::after {
  transform: rotate(90deg);
}

.faq details[open] summary::after {
  transform: rotate(0deg);
}

.faq details p {
  padding: 0 24px 22px;
  color: var(--ink-muted);
  max-width: 62ch;
}

/* ── Closing call ──────────────────────────────────────────────────────── */

.close {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--hero-ink);
  background: linear-gradient(115deg, var(--hero-from) 0%, var(--hero-to) 100%);
}

.close::before {
  content: "";
  position: absolute;
  right: -10%;
  top: 50%;
  z-index: -1;
  width: min(70vw, 720px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--hero-glow);
  transform: translateY(-50%);
}

.close-inner {
  padding-block: clamp(88px, 10vw, 160px);
}

.close-title {
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.4rem + 4.6vw, 5.5rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.close-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
  max-width: 560px;
}

.close-form input {
  flex: 1 1 240px;
  min-height: 52px;
  padding: 0 20px;
  font: 500 1rem var(--font);
  color: var(--hero-ink);
  background: var(--hero-soft);
  border: 1px solid var(--hero-field-line);
  border-radius: 999px;
}

.close-form input::placeholder {
  color: var(--hero-muted);
}

.close-form input:focus {
  outline: none;
  border-color: var(--sky);
}

.close-form .button {
  min-height: 52px;
}

.close-note {
  margin-top: 20px;
  color: var(--hero-muted);
}

.close-note a {
  color: var(--hero-tagline);
}

/* ── Footer ────────────────────────────────────────────────────────────── */

.foot {
  padding-top: clamp(56px, 7vw, 96px);
  overflow: hidden;
}

.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 40px;
}

.foot-brand .brand img {
  padding: 3px;
  background: #fff;
  border-radius: 8px;
}

.foot-brand p {
  margin-top: 16px;
  max-width: 32ch;
  color: var(--ink-muted);
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.foot-head {
  margin-bottom: 12px;
  font-weight: 600;
}

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

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

.foot-cols a:hover {
  color: var(--ink);
}

.foot-name {
  margin-top: clamp(48px, 6vw, 80px);
  font-family: var(--font-display);
  font-size: clamp(5rem, 1rem + 19vw, 18rem);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.05em;
  color: var(--surface-muted);
  white-space: nowrap;
}

.foot-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px 28px;
  font-size: var(--step-small);
  color: var(--ink-muted);
}

/* ── Theme switch ──────────────────────────────────────────────────────── */

.theme-toggle {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: rgb(127 140 170 / 0.16);
  cursor: pointer;
  transition:
    background-color var(--t-hover) ease,
    transform var(--t-hover) var(--ease-out);
}

/* Without the script there is no switch; the page follows the system. */
.js .theme-toggle {
  display: grid;
}

.theme-toggle:hover {
  background: rgb(127 140 170 / 0.28);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.hero .theme-toggle {
  color: var(--hero-tagline);
}

/* Show what the switch turns the page into */
.icon-sun,
:root[data-theme="dark"] .icon-moon {
  display: none;
}

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

/* The new theme is revealed by a circle growing from --wipe-x/--wipe-y to
   --wipe-r (set by main.js). It is a CSS animation, not a script one, so the
   new view is clipped from its very first frame instead of flashing in whole
   before a script could start clipping it. The radius grows with the square
   of time (ease-in-quad). */
:root.theme-switching::view-transition-old(root),
:root.theme-switching::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

:root.theme-switching::view-transition-new(root) {
  z-index: 1;
  animation: theme-wipe 900ms cubic-bezier(0.11, 0, 0.5, 0) both;
}

@keyframes theme-wipe {
  from {
    clip-path: circle(0 at var(--wipe-x) var(--wipe-y));
  }

  to {
    clip-path: circle(var(--wipe-r) at var(--wipe-x) var(--wipe-y));
  }
}

/* While the circle spreads, colours change at once rather than fading,
   so links and buttons inside it don't show the old theme. */
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}

/* ── Motion ────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] {
    animation: rise 900ms var(--ease-out) both;
    animation-delay: var(--d, 0ms);
  }

  .js .hero-glow {
    animation: glow 1400ms var(--ease-out) both;
  }

  .js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition:
      opacity var(--t-reveal) var(--ease-out),
      transform var(--t-reveal) var(--ease-out);
    transition-delay: var(--d, 0ms);
  }

  .js [data-reveal].is-in {
    opacity: 1;
    transform: none;
  }
}

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

@keyframes glow {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
}

/* ── Narrower screens ──────────────────────────────────────────────────── */

@media (max-width: 1000px) {
  .cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trust-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-wide {
    grid-template-columns: minmax(0, 1fr);
  }

  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-side {
    display: none;
  }
}

@media (max-width: 860px) {
  .nav-links,
  .nav-actions {
    display: none;
  }

  .nav-menu {
    display: block;
    margin-left: 0;
  }

  .nav .theme-toggle {
    margin-left: auto;
  }

  .hero-body,
  .flow,
  .try-grid,
  .faq,
  .foot-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-art {
    width: min(78%, 360px);
  }

  .facts {
    justify-content: flex-start;
  }

  .app-search {
    display: none;
  }
}

@media (max-width: 520px) {
  .cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-actions .button,
  .close-form .button {
    flex: 1 1 auto;
  }

  .panel-body,
  .answer {
    padding: 16px;
  }

  .lines th:nth-child(2),
  .lines td:nth-child(2) {
    display: none;
  }
}
