/*
 * Vigil design tokens. One accent colour (emerald) on neutral greys; red is
 * reserved for errors and invalid batches. Light is the default; dark follows
 * the system setting unless the reader picks a theme (data-theme on <html>).
 */
:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --hover: #f0f0f2;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --text: #18181b;
  --muted: #52525b;
  --dim: #6b6b74;
  --primary: #047857;
  --primary-hover: #065f46;
  --primary-text: #047857;
  --primary-soft: rgba(4, 120, 87, 0.09);
  --primary-ring: rgba(4, 120, 87, 0.35);
  --on-primary: #ffffff;
  --danger: #b91c1c;
  --danger-text: #b91c1c;
  --danger-soft: rgba(185, 28, 28, 0.08);
  --info: #2563eb;
  --info-text: #1d4ed8;
  --info-soft: rgba(37, 99, 235, 0.09);
  --warn: #d97706;
  --warn-text: #92400e;
  --warn-soft: rgba(217, 119, 6, 0.1);
  --violet: #7c3aed;
  --violet-text: #6d28d9;
  --violet-soft: rgba(124, 58, 237, 0.09);
  --pink: #db2777;
  --pink-text: #be185d;
  --pink-soft: rgba(219, 39, 119, 0.09);
  --wash-a: rgba(16, 185, 129, 0.16);
  --wash-b: rgba(37, 99, 235, 0.12);
  --header: rgba(247, 247, 248, 0.85);
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.05), 0 1px 3px rgba(24, 24, 27, 0.04);
  --shadow-lg: 0 12px 32px rgba(24, 24, 27, 0.12);
  --radius: 12px;
  --mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, Consolas, monospace;
  --sans:
    Inter, ui-sans-serif, "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #09090b;
    --surface: #111113;
    --surface-2: #18181b;
    --hover: #1f1f23;
    --line: #27272a;
    --line-strong: #3f3f46;
    --text: #fafafa;
    --muted: #a1a1aa;
    --dim: #8e8e98;
    --primary: #34d399;
    --primary-hover: #6ee7b7;
    --primary-text: #34d399;
    --primary-soft: rgba(52, 211, 153, 0.12);
    --primary-ring: rgba(52, 211, 153, 0.4);
    --on-primary: #052e1f;
    --danger: #f87171;
    --danger-text: #fca5a5;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --info: #60a5fa;
    --info-text: #93c5fd;
    --info-soft: rgba(96, 165, 250, 0.14);
    --warn: #fbbf24;
    --warn-text: #fcd34d;
    --warn-soft: rgba(251, 191, 36, 0.14);
    --violet: #a78bfa;
    --violet-text: #c4b5fd;
    --violet-soft: rgba(167, 139, 250, 0.14);
    --pink: #f472b6;
    --pink-text: #f9a8d4;
    --pink-soft: rgba(244, 114, 182, 0.14);
    --wash-a: rgba(52, 211, 153, 0.14);
    --wash-b: rgba(96, 165, 250, 0.1);
    --header: rgba(9, 9, 11, 0.8);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #18181b;
  --hover: #1f1f23;
  --line: #27272a;
  --line-strong: #3f3f46;
  --text: #fafafa;
  --muted: #a1a1aa;
  --dim: #8e8e98;
  --primary: #34d399;
  --primary-hover: #6ee7b7;
  --primary-text: #34d399;
  --primary-soft: rgba(52, 211, 153, 0.12);
  --primary-ring: rgba(52, 211, 153, 0.4);
  --on-primary: #052e1f;
  --danger: #f87171;
  --danger-text: #fca5a5;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --info: #60a5fa;
  --info-text: #93c5fd;
  --info-soft: rgba(96, 165, 250, 0.14);
  --warn: #fbbf24;
  --warn-text: #fcd34d;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --violet: #a78bfa;
  --violet-text: #c4b5fd;
  --violet-soft: rgba(167, 139, 250, 0.14);
  --pink: #f472b6;
  --pink-text: #f9a8d4;
  --pink-soft: rgba(244, 114, 182, 0.14);
  --wash-a: rgba(52, 211, 153, 0.14);
  --wash-b: rgba(96, 165, 250, 0.1);
  --header: rgba(9, 9, 11, 0.8);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: var(--primary-text);
  text-underline-offset: 3px;
}

/* The hidden attribute must win over any display rule below. */
[hidden] {
  display: none !important;
}

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

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

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

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 8px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 30;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* Header */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: saturate(180%) blur(12px);
}

.bar,
main,
footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.bar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand img {
  border-radius: 9px;
}

@media (max-width: 420px) {
  .brand {
    font-size: 16px;
  }
}

nav {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tabs a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}

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

.tabs a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 600;
}

.bar-end {
  display: flex;
  align-items: center;
  gap: 8px;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
}

.state.ok .dot {
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.state.warn .dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}

.state.bad .dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--hover);
  color: var(--text);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

/* Layout */

main {
  /* The hero's colour wash is wider than the page on purpose; never let it scroll sideways. */
  overflow-x: clip;
  padding-top: 40px;
  padding-bottom: 24px;
  min-height: 60vh;
}

main:focus {
  outline: none;
}

.stack {
  display: grid;
  gap: 32px;
}

.stack > *,
.grid > *,
.split > * {
  min-width: 0;
}

.page-head h1 {
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.8px;
}

.page-head .actions {
  margin-top: 12px;
}

.page-head p {
  max-width: 680px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

.hero h1 {
  font-size: clamp(32px, 5.2vw, 52px);
  font-weight: 750;
  line-height: 1.06;
  letter-spacing: -1.8px;
}

.hero {
  position: relative;
  isolation: isolate;
}

/* A soft wash of the brand colours behind the headline. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -120px;
  left: -10%;
  width: 120%;
  height: 460px;
  background:
    radial-gradient(40% 60% at 75% 30%, var(--wash-a), transparent 70%),
    radial-gradient(35% 55% at 95% 70%, var(--wash-b), transparent 70%);
  pointer-events: none;
}

.hero h1 em {
  background: linear-gradient(90deg, var(--primary-text), var(--info-text));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
}

.hero p {
  max-width: 640px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
}

.hero .actions {
  margin-top: 24px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.2px;
}

.section-head p,
.section-head a {
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.tiles {
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 45%), 1fr));
}

.grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 16px;
  align-items: start;
}

/* Read-only mirror banner (static export) */

.mirror-banner {
  box-sizing: border-box;
  width: min(1112px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 10px 16px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--text);
  font-size: 14px;
}

/* Surfaces */

.card,
.tile,
.table-wrap,
.feed > li,
.notice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card {
  padding: 22px;
}

.card > h2,
.card > h3 {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 650;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-head h2,
.card-head h3 {
  font-size: 16px;
  font-weight: 650;
  text-transform: capitalize;
}

.tile {
  padding: 16px 18px;
}

.tile .label {
  color: var(--muted);
  font-size: 13px;
}

.tile .value {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
}

.tile .hint {
  margin-top: 2px;
  color: var(--dim);
  font-size: 12px;
}

.notice {
  padding: 14px 16px;
  color: var(--muted);
}

.notice.info {
  border-color: var(--info);
  background: var(--info-soft);
  color: var(--text);
}

.notice.good {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--text);
}

.notice.warn {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--text);
}

.steps {
  counter-reset: step;
}

.steps .card {
  position: relative;
  padding-top: 54px;
}

.steps .card::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 20px;
  left: 22px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 13px;
  font-weight: 700;
}

.steps p {
  color: var(--muted);
}

/* Balance */

.balance {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.balance .amount {
  font-size: clamp(34px, 6vw, 48px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1.6px;
  font-variant-numeric: tabular-nums;
}

.balance .unit {
  margin-left: 8px;
  color: var(--muted);
  font-size: 18px;
  letter-spacing: 0;
}

dl.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  margin: 0;
}

dl.facts dt {
  color: var(--muted);
}

dl.facts dd {
  margin: 0;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

/* Buttons and forms */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.05s;
}

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

.button:active {
  transform: translateY(1px);
}

.button.ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

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

.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.button[aria-busy="true"]::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentcolor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.segmented button {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.segmented button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
}

form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
}

.field .help {
  color: var(--dim);
  font-size: 12px;
}

input,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--dim);
}

input:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.error {
  color: var(--danger-text);
  font-size: 13px;
}

/* Pills: emerald for good, neutral for anything pending, red for problems. */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill.good {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.pill.bad {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.pill.wait {
  background: var(--warn-soft);
  color: var(--warn-text);
}

.pill.info {
  background: var(--info-soft);
  color: var(--info-text);
}

.pill.violet {
  background: var(--violet-soft);
  color: var(--violet-text);
}

.pill.pink {
  background: var(--pink-soft);
  color: var(--pink-text);
}

.pill.plain {
  background: var(--surface-2);
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

tbody tr {
  border-top: 1px solid var(--line);
}

tbody tr.link:hover {
  background: var(--hover);
}

td a {
  font-weight: 600;
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.reasons {
  display: block;
  margin-top: 4px;
  color: var(--danger-text);
  font-size: 12px;
}

/* Lists */

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

.feed > li {
  padding: 12px 16px;
}

.feed > li.critical {
  border-left: 3px solid var(--danger);
}

.feed > li.warning {
  border-left: 3px solid var(--warn);
}

.feed > li.info {
  border-left: 3px solid var(--info);
}

.feed summary {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
}

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

/* Our own arrow, on the same line as the title. */
.feed summary::before {
  content: "";
  flex: none;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--dim);
  transition: transform 0.15s;
}

.feed details[open] summary::before {
  transform: rotate(90deg);
}

.feed summary .row {
  flex: 1;
  min-width: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}

.row .title {
  font-weight: 600;
}

.row time,
.row .meta {
  color: var(--dim);
  font-size: 12px;
}

.feed pre,
.memo-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.memo-text {
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 40px 0;
  color: var(--muted);
}

.loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.copy {
  min-height: 32px;
  margin-left: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.copy:hover {
  background: var(--hover);
}

.compare {
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
}

/* Toasts */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 40px));
}

.toast {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow-wrap: anywhere;
}

.toast.bad {
  border-left-color: var(--danger);
}

.toast strong {
  display: block;
}

.toast span {
  color: var(--muted);
  font-size: 13px;
}

footer {
  margin-top: 48px;
  padding-top: 20px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}

/* ---------- motion and data display ---------- */

.eyebrow {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.pulse {
  position: relative;
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  opacity: 0;
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.pill.live {
  gap: 7px;
}

.dot-off {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
}

.state.ok .dot {
  animation: breathe 2.4s ease-in-out infinite;
}

/* Settlement flow on the overview */
.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-step {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -12px;
  width: 12px;
  height: 2px;
  background: linear-gradient(90deg, var(--line-strong), var(--info));
}

.flow-index {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-bottom: 10px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 700;
}

.flow-step:nth-child(1) .flow-index {
  background: var(--info-soft);
  color: var(--info-text);
}

.flow-step:nth-child(2) .flow-index {
  background: var(--violet-soft);
  color: var(--violet-text);
}

.flow-step:nth-child(5) .flow-index {
  background: var(--pink-soft);
  color: var(--pink-text);
}

.flow-step .label {
  color: var(--muted);
  font-size: 13px;
}

.flow-step .value {
  margin-top: 2px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
}

.flow-step .hint {
  color: var(--dim);
  font-size: 12px;
}

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

  .flow-step::after {
    display: none;
  }
}

.split.wide-left {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

@media (max-width: 900px) {
  .split.wide-left {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Progress bars */
.progress {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.progress > span {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--primary);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress.window > span {
  background: linear-gradient(90deg, var(--warn), var(--primary));
}

.progress.neutral > span {
  background: var(--line-strong);
}

.enter .progress > span {
  animation: grow 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.status-cell {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.status-cell .meta,
.timing .meta,
.window-card .meta {
  color: var(--dim);
  font-size: 12px;
}

.window-card {
  display: grid;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.timing {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.timing .title {
  font-weight: 600;
}

.timing .meta.drift-high {
  color: var(--danger-text);
  font-weight: 600;
}

.bars {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
}

.bar-label {
  color: var(--muted);
}

.bar-value {
  font-variant-numeric: tabular-nums;
}

/* Settlement stepper on a batch page */
.stepper {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stepper li {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  padding-bottom: 20px;
}

.stepper li:last-child {
  padding-bottom: 0;
}

.stepper li:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 2px;
  left: 10px;
  width: 2px;
  background: var(--line);
}

.stepper li.done:not(:last-child)::before {
  background: var(--primary);
}

.step-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}

.stepper .done .step-dot {
  border-color: var(--primary);
  background: var(--primary);
}

.stepper .done .step-dot::after {
  content: "";
  width: 5px;
  height: 9px;
  margin-top: -2px;
  border: solid var(--on-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.stepper .current .step-dot {
  border-color: var(--warn);
  box-shadow: 0 0 0 4px var(--warn-soft);
}

.stepper .current .step-dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  animation: breathe 2s ease-in-out infinite;
}

.stepper .bad .step-dot {
  border-color: var(--danger);
  background: var(--danger);
}

.step-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.step-body .title {
  font-weight: 600;
}

.stepper .pending .title {
  color: var(--muted);
}

.step-body .meta {
  color: var(--dim);
  font-size: 13px;
}

.step-body .progress {
  margin-top: 4px;
}

/* Service list */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.service .title {
  font-weight: 600;
  text-transform: capitalize;
}

.service .meta {
  margin-left: auto;
  color: var(--dim);
  font-size: 12px;
}

.feed.compact > li {
  padding: 10px 14px;
}

/* Hover lift for interactive cards */
.lift {
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s,
    border-color 0.2s;
}

.lift:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}

/* Page entry: sections rise in, one after another. */
.enter > .stack > * {
  animation: rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.enter > .stack > *:nth-child(2) {
  animation-delay: 0.05s;
}

.enter > .stack > *:nth-child(3) {
  animation-delay: 0.1s;
}

.enter > .stack > *:nth-child(4) {
  animation-delay: 0.15s;
}

.enter > .stack > *:nth-child(n + 5) {
  animation-delay: 0.2s;
}

.enter .flow-step {
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.enter .flow-step:nth-child(2) {
  animation-delay: 0.06s;
}

.enter .flow-step:nth-child(3) {
  animation-delay: 0.12s;
}

.enter .flow-step:nth-child(4) {
  animation-delay: 0.18s;
}

.enter .flow-step:nth-child(5) {
  animation-delay: 0.24s;
}

.toast {
  animation: toast-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast.leaving {
  animation: toast-out 0.25s ease-in both;
}

/* Skeleton while a page loads */
.skeleton {
  display: grid;
  gap: 16px;
  padding-top: 8px;
}

.sk {
  display: block;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--hover) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.sk-title {
  width: 240px;
  height: 32px;
}

.sk-line {
  width: min(520px, 90%);
  height: 14px;
}

.sk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 12px;
}

.sk-card {
  height: 120px;
}

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

@keyframes grow {
  from {
    transform: scaleX(0);
  }
}

@keyframes ping {
  0% {
    opacity: 0.6;
    transform: scale(0.6);
  }

  80%,
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}

@keyframes breathe {
  50% {
    opacity: 0.55;
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}

/* ---------- Learn and Docs ---------- */

.with-side {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.side-nav {
  position: sticky;
  top: 88px;
}

.side-nav ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-nav a {
  display: block;
  padding: 8px 12px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.side-nav a:hover {
  border-left-color: var(--line-strong);
  color: var(--text);
}

.side-nav a[aria-current="page"] {
  border-left-color: var(--primary);
  color: var(--primary-text);
  font-weight: 600;
}

@media (max-width: 860px) {
  .with-side {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .side-nav {
    position: static;
  }

  .side-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .side-nav a {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
  }

  .side-nav a[aria-current="page"] {
    border-color: var(--primary);
    background: var(--primary-soft);
  }
}

.prose {
  display: grid;
  gap: 16px;
  max-width: 760px;
  font-size: 16px;
  line-height: 1.7;
}

.prose h2 {
  margin-top: 16px;
  font-size: 22px;
  letter-spacing: -0.4px;
}

.prose h3 {
  margin-top: 8px;
  font-size: 17px;
}

.prose h4 {
  font-size: 15px;
}

.prose p,
.prose li {
  color: var(--text);
}

.prose .lead {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

.prose code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.88em;
}

.prose pre.code {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  line-height: 1.55;
}

.prose pre.code code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
}

.prose blockquote {
  margin: 0;
  padding: 12px 16px;
  border-left: 3px solid var(--info);
  border-radius: 0 10px 10px 0;
  background: var(--info-soft);
}

.prose hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose .table-wrap {
  max-width: 100%;
}

.prose td.wrap,
td.wrap {
  white-space: normal;
  min-width: 180px;
}

.prose-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.prose-list li::marker {
  color: var(--primary);
}

.callout {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--info);
  border-radius: 10px;
  background: var(--info-soft);
}

.callout.warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.callout p {
  color: var(--text);
}

.steps-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.step-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 700;
}

.steps-list h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.steps-list p {
  color: var(--muted);
}

.glossary {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.glossary dt,
.glossary dd {
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.glossary dt:first-of-type,
.glossary dt:first-of-type + dd {
  border-top: 0;
}

.glossary dt {
  font-weight: 600;
}

.glossary dd {
  color: var(--muted);
}

@media (max-width: 600px) {
  .glossary {
    grid-template-columns: 1fr;
  }

  .glossary dd {
    padding-top: 0;
    border-top: 0;
  }
}

.faq {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.faq summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

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

.faq summary::before {
  content: "+";
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 700;
}

.faq[open] summary::before {
  content: "−";
}

.faq p {
  padding: 0 18px 16px 50px;
  color: var(--muted);
}

.algo {
  margin: 10px 0 6px;
  font-family: var(--mono);
  font-size: 20px;
}

/* The settlement diagram */
.diagram-wrap {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.diagram {
  width: 100%;
  min-width: 640px;
  height: auto;
  font-family: var(--sans);
}

.stage-box {
  fill: var(--surface-2);
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.stage-title {
  fill: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.stage-sub {
  fill: var(--muted);
  font-size: 12.5px;
}

.stage {
  animation: stage-glow 8.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 1.2s);
}

.tone-info {
  --tone: var(--info);
}

.tone-violet {
  --tone: var(--violet);
}

.tone-primary {
  --tone: var(--primary);
}

.tone-pink {
  --tone: var(--pink);
}

.stage .stage-box {
  stroke: var(--tone);
}

.link-base {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2;
}

.link-flow {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 10 300;
  animation: travel 2.4s linear infinite;
  animation-delay: calc(var(--i) * 0.35s);
}

.link-label {
  fill: var(--muted);
  font-size: 13px;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 4px;
}

@keyframes travel {
  from {
    stroke-dashoffset: 310;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes stage-glow {
  0%,
  14% {
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--tone) 55%, transparent));
  }

  22%,
  100% {
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .link-flow {
    stroke-dasharray: none;
    opacity: 0.6;
  }
}

/* Before and after */
.ba-race {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ba-timeline {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--tone);
  border-radius: var(--radius);
  background: var(--surface);
}

.ba-timeline.without {
  --tone: var(--danger);
}

.ba-timeline.with {
  --tone: var(--primary);
}

.ba-timeline h3 {
  margin: 0 0 12px;
  color: var(--tone-text, var(--text));
  font-size: 16px;
}

.ba-timeline ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ba-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 10px 0 10px 18px;
  border-left: 2px solid var(--line);
  font-size: 14px;
  animation: rise 0.5s both;
  animation-delay: calc(var(--i) * 0.45s + 0.2s);
}

.ba-timeline li::before {
  content: "";
  position: absolute;
  top: 16px;
  left: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tone);
}

.ba-timeline li:last-child {
  font-weight: 600;
}

.ba-time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
}

.ba-grid {
  display: grid;
  gap: 14px;
}

.ba-row {
  display: grid;
  gap: 8px;
}

.ba-topic {
  margin: 0;
  font-size: 15px;
}

.ba-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ba-side {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--tone);
  border-radius: 10px;
  background: var(--tone-soft);
}

.ba-side.without {
  --tone: var(--danger);
  --tone-soft: var(--danger-soft);
}

.ba-side.with {
  --tone: var(--primary);
  --tone-soft: var(--primary-soft);
}

.ba-side h4 {
  margin: 0;
  font-size: 15px;
}

.ba-side p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.ba-tag {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .ba-race,
  .ba-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .ba-timeline li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ---------- Home ---------- */

.home {
  gap: 88px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
  min-height: min(640px, calc(100vh - 140px));
}

.home-hero h1 {
  margin-top: 14px;
  font-size: clamp(36px, 5.6vw, 64px);
}

.home-lead {
  font-size: 18px !important;
  line-height: 1.6;
}

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

.pillars li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  animation: rise 0.5s both;
  animation-delay: calc(var(--i) * 0.12s + 0.15s);
}

.pillars strong {
  display: block;
  font-size: 15px;
}

.pillars span:not(.pillar-icon) {
  color: var(--muted);
  font-size: 14px;
}

.pillar-icon,
.feature-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--tone-soft, var(--primary-soft));
  color: var(--tone-text, var(--primary-text));
}

.pillar-icon svg,
.feature-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The live card next to the headline */
.live-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--text) 4%, transparent),
    0 24px 60px -24px color-mix(in srgb, var(--primary) 35%, transparent);
  backdrop-filter: blur(8px);
  animation: rise 0.6s both 0.25s;
}

.live-head,
.live-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-head {
  justify-content: space-between;
}

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

.live-list li {
  display: grid;
  grid-template-columns: 76px auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  animation: rise 0.45s both;
  animation-delay: calc(var(--i) * 0.1s + 0.4s);
}

.live-list a {
  font-weight: 600;
  text-decoration: none;
}

.live-status {
  justify-self: end;
  min-width: 0;
  text-align: right;
}

.live-status .status-cell {
  min-width: 120px;
}

.live-foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.live-foot div {
  display: grid;
  gap: 2px;
}

.live-foot .num {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.live-foot span:not(.num) {
  color: var(--muted);
  font-size: 12px;
}

.hero .live-note {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* Section heads */
.home-section {
  display: grid;
  gap: 24px;
}

.home-head {
  display: grid;
  gap: 8px;
  max-width: 720px;
}

.home-head h2 {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.8px;
}

.home-head p {
  color: var(--muted);
  font-size: 16px;
}

.kicker {
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.more {
  justify-self: start;
  font-weight: 600;
}

.more::after {
  content: " →";
}

/* Without and with */
.compare {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.compare-head,
.compare-row {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 0;
}

.compare-head > *,
.compare-row > * {
  padding: 14px 18px;
}

.compare-row {
  border-top: 1px solid var(--line);
}

.compare-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.compare-label.without {
  color: var(--danger-text);
}

.compare-label.with {
  color: var(--primary-text);
}

.compare-row p {
  font-size: 15px;
}

.compare-row p.without {
  background: var(--danger-soft);
  color: var(--muted);
}

.compare-row p.with {
  background: var(--primary-soft);
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}

.feature:hover {
  transform: translateY(-3px);
  border-color: var(--tone);
  box-shadow: 0 16px 40px -24px var(--tone);
}

.feature h3 {
  font-size: 17px;
}

.feature p {
  color: var(--muted);
  font-size: 14px;
}

.feature-link {
  color: var(--tone-text);
  font-size: 13px;
  font-weight: 600;
}

.feature-link::after {
  content: " →";
}

.tone-primary {
  --tone: var(--primary);
  --tone-text: var(--primary-text);
  --tone-soft: var(--primary-soft);
}

.tone-violet {
  --tone-text: var(--violet-text);
  --tone-soft: var(--violet-soft);
}

.tone-info {
  --tone-text: var(--info-text);
  --tone-soft: var(--info-soft);
}

.tone-pink {
  --tone-text: var(--pink-text);
  --tone-soft: var(--pink-soft);
}

.tone-warn {
  --tone: var(--warn);
  --tone-text: var(--warn-text);
  --tone-soft: var(--warn-soft);
}

/* Post-quantum band and closing call */
.pq-band,
.home-cta {
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: radial-gradient(60% 120% at 100% 0%, var(--wash-a), transparent 70%), var(--surface);
}

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

.algo-chip {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.algo-chip code {
  color: var(--primary-text);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
}

.algo-chip span {
  color: var(--muted);
  font-size: 13px;
}

.home-cta {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.home-cta h2 {
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.6px;
}

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

.home-cta pre.code {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 14px;
  max-width: 100%;
  overflow-x: auto;
}

@media (max-width: 980px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    min-height: 0;
  }

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

@media (max-width: 640px) {
  .home {
    gap: 56px;
  }

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

  .compare-head {
    display: none;
  }

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

  .compare-row p.without::before {
    content: "Without Vigil: ";
    color: var(--danger-text);
    font-weight: 600;
  }

  .compare-row p.with::before {
    content: "With Vigil: ";
    color: var(--primary-text);
    font-weight: 600;
  }

  .pq-band,
  .home-cta {
    padding: 22px;
  }

  /* Batch, verdict and status on one line when they fit; a long status wraps under them. */
  .live-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
  }

  .live-list li > a {
    min-width: 70px;
  }

  .live-status {
    margin-left: auto;
  }
}

/* ---------- Proof ---------- */
.proof-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.proof-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--tone, var(--primary));
  border-radius: var(--radius);
  background: var(--surface);
}

.proof-card:first-child {
  grid-column: 1 / -1;
  box-shadow: 0 20px 50px -30px var(--primary);
}

.proof-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.proof-live {
  color: var(--primary-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.proof-card h2 {
  font-size: 18px;
  letter-spacing: -0.3px;
}

.proof-story {
  color: var(--muted);
  font-size: 14.5px;
}

.proof-steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  list-style: none;
  font-size: 14px;
}

.proof-steps li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
}

.proof-outcome {
  font-size: 14.5px;
}

.proof-txs {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.proof-tx {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 13px;
}

.proof-tx-label {
  color: var(--muted);
}

.proof-tx a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  text-decoration: none;
}

.proof-tx code {
  font-family: var(--mono);
  font-size: 12.5px;
}

.proof-tx .ext {
  font-weight: 600;
}

.proof-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 18px;
  border: 1px solid var(--primary);
  border-radius: 12px;
  background: var(--primary-soft);
}

.proof-banner p {
  flex: 1 1 320px;
  font-size: 15px;
}

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

  .proof-steps li {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .bar {
    flex-wrap: wrap;
    gap: 6px 12px;
    padding-top: 10px;
    padding-bottom: 8px;
  }

  nav {
    order: 3;
    flex-basis: 100%;
  }

  .bar-end {
    margin-left: auto;
  }

  .bar,
  main,
  footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  th,
  td {
    padding: 11px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* "Verify on chain": the browser asks VigilReceipts directly. */
.onchain-box {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.onchain-box h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.onchain-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.onchain-actions label {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.onchain-root {
  display: block;
  margin-top: 0.5rem;
  overflow-wrap: anywhere;
}

.onchain-result {
  margin: 0.5rem 0 0;
  overflow-wrap: anywhere;
}

.proof-source {
  margin: 0.5rem 0 0;
}

/* Header menu: when the section links do not fit, they fold into a menu */

.top .bar {
  max-width: 1320px;
}

.tabs a {
  padding: 8px 10px;
}

.menu-toggle {
  display: none;
}

.top.compact .menu-toggle {
  display: inline-grid;
}

.menu-toggle path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.top.compact nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  overflow: visible;
}

.top.compact.open nav {
  display: block;
}

.top.compact .tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px 16px;
}

.top.compact .tabs a {
  padding: 12px 14px;
  font-size: 15px;
}

.top.compact .bar {
  flex-wrap: nowrap;
  justify-content: space-between;
}

@media (max-width: 760px) {
  .top.compact .tabs {
    padding: 10px 16px 14px;
  }
}

@media (max-width: 520px) {
  .state {
    padding: 8px;
  }

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

/* Demo video on the home page: YouTube loads only after a click */

.demo-video {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 20% 10%, var(--wash-a), transparent 60%),
    radial-gradient(100% 80% at 90% 90%, var(--wash-b), transparent 60%), var(--surface);
  box-shadow: var(--shadow-lg);
}

.demo-video iframe,
.demo-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.demo-play {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.demo-play .play-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 0 0 10px var(--primary-soft);
  transition: transform 0.2s ease;
}

.demo-play:hover .play-icon,
.demo-play:focus-visible .play-icon {
  transform: scale(1.08);
}

.demo-play .play-icon svg {
  width: 30px;
  height: 30px;
  margin-left: 4px;
  fill: currentColor;
}

.demo-play strong {
  font-size: 20px;
}

.demo-play span.muted {
  font-size: 14px;
}

.demo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  font-size: 14px;
}

/* A document's grid column never grows past the page: wide tables scroll inside their own box. */
.prose {
  grid-template-columns: minmax(0, 1fr);
}

/* The label is the checkbox's touch target, so it gets the height a small box lacks. */
.onchain-actions label {
  min-height: 32px;
  white-space: nowrap;
  cursor: pointer;
}

.onchain-actions input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

@media (max-width: 700px) {
  .diagram-wrap::before {
    content: "Swipe sideways to see the whole diagram.";
    color: var(--muted);
    font-size: 13px;
  }
}

/* Long hashes in running text break instead of running off the page. */
.prose :not(pre) > code {
  overflow-wrap: anywhere;
}
