/* raceproof site. Layout concept: a timing-diagram sheet. Left-aligned text on a faint measuring grid, two signal
   colours (the two racing paths) used only where they mean something: traces, the race window, pass/fail. */
:root {
  --bg: #f2f4f6;
  --surface: #ffffff;
  --ink: #121820;
  --muted: #586271;
  --rule: #d3d9e0;
  --grid: #e4e8ec;
  --sig-a: #0b7c76;      /* path A: the shopper's result, the brand colour */
  --sig-b: #a96500;      /* path B: the gateway's own timeout */
  --window: #f3e4c4;     /* the race window */
  --fail: #b3392b;
  --pass: #2b7640;
  --code-bg: #e9edf1;
  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --measure: 68ch;
  --wide: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1317; --surface: #151c22; --ink: #e5eaee; --muted: #97a2ad; --rule: #29333c; --grid: #1a2229;
    --sig-a: #3dbdb3; --sig-b: #e0a13d; --window: #3a2f19; --fail: #e3725f; --pass: #6cc07d; --code-bg: #1b242b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1317; --surface: #151c22; --ink: #e5eaee; --muted: #97a2ad; --rule: #29333c; --grid: #1a2229;
  --sig-a: #3dbdb3; --sig-b: #e0a13d; --window: #3a2f19; --fail: #e3725f; --pass: #6cc07d; --code-bg: #1b242b;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
}
img, video, svg { max-width: 100%; }
a { color: var(--sig-a); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--sig-a); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 760; font-stretch: 82%; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); font-weight: 720; font-stretch: 86%; }
h3 { font-size: 1.15rem; font-weight: 680; font-stretch: 92%; }
p { margin: 0; max-width: var(--measure); }
code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; }
pre {
  margin: 0; background: var(--code-bg); border: 1px solid var(--rule); border-radius: 4px;
  padding: 14px 16px; overflow-x: auto; line-height: 1.5; font-size: 0.86rem;
}
.num { font-variant-numeric: tabular-nums; }

/* page frame */
.wrap {
  max-width: var(--wide); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule);
}
.top .wrap { display: flex; align-items: center; gap: 24px; padding-block: 12px; flex-wrap: wrap; }
.mark {
  font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 1.45rem; letter-spacing: 0.01em;
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.mark svg { width: 26px; height: 18px; }
.top nav { display: flex; gap: 20px; flex-wrap: wrap; margin-left: auto; font-size: 0.95rem; }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--sig-a); }
.top nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

main { display: block; }
section { padding-block: 56px; border-top: 1px solid var(--rule); }
section:first-child { border-top: 0; }
.label {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px; display: block;
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.lead { font-size: 1.2rem; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* hero */
.hero { padding-block: 56px 48px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; }
.hero .stack { gap: 20px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 4px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none; border: 1px solid var(--sig-a);
}
.btn.primary { background: var(--sig-a); color: var(--surface); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { color: var(--sig-a); background: transparent; }
.diagram { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 14px; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.svg-text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.svg-strong { font-family: var(--mono); font-size: 11px; fill: var(--ink); font-weight: 600; }

/* lists of points */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 28px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 28px; }
.point h3 { margin-bottom: 8px; }
.point p { color: var(--muted); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 22px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 4px 12px; }
.steps li::before {
  content: counter(step); grid-row: span 2; font-family: var(--display); font-weight: 800; font-stretch: 75%;
  font-size: 1.7rem; color: var(--sig-a); line-height: 1;
}
.steps li p { color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin-top: 28px; align-items: start; }
.split > * { min-width: 0; }

/* tables */
.table-wrap { overflow-x: auto; margin-top: 24px; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
td.id { font-family: var(--mono); font-weight: 600; white-space: nowrap; color: var(--sig-a); }
.fail { color: var(--fail); font-weight: 600; }
.pass { color: var(--pass); font-weight: 600; }
.badge {
  display: inline-block; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em; padding: 2px 8px;
  border-radius: 999px; border: 1px solid currentColor; white-space: nowrap;
}
.badge.ok { color: var(--pass); }
.badge.ask { color: var(--muted); }
.tally { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.tally div { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 16px; }
.tally strong { display: block; font-family: var(--display); font-stretch: 80%; font-size: 2.2rem; line-height: 1; }

/* video */
.video { margin-top: 24px; background: #000; border-radius: 6px; overflow: hidden; border: 1px solid var(--rule); }
.video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.chapters { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.92rem; }
.chapters button {
  font: inherit; color: var(--sig-a); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline;
  text-underline-offset: 0.18em;
}
.chapters span { font-family: var(--mono); color: var(--muted); margin-right: 6px; }

/* call to action band */
.cta { background: var(--surface); }
.cta .wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.contact code { font-size: 1rem; padding: 8px 12px; user-select: all; }
.copy {
  font: 600 0.9rem var(--body); color: var(--sig-a); background: transparent; border: 1px solid var(--sig-a);
  border-radius: 4px; padding: 7px 12px; cursor: pointer;
}

footer { border-top: 1px solid var(--rule); padding-block: 32px 48px; font-size: 0.88rem; color: var(--muted); background: var(--bg); }
footer .wrap { display: grid; gap: 12px; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { color: var(--muted); }

/* catalog */
.group { margin-top: 40px; }
.group h2 { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.group .badge { font-size: 0.72rem; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 20px; border-top: 1px solid var(--rule); }
.card { padding: 18px 20px 18px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 4px 12px; }
.card:nth-child(odd) { border-right: 1px solid var(--rule); }
.card:nth-child(even) { padding-left: 20px; }
.card .id { font-family: var(--mono); font-weight: 600; color: var(--sig-a); grid-row: span 3; padding-top: 2px; }
.card h3 { font-size: 1.05rem; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .ok { color: var(--ink); }
.card .ok b { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pass); font-weight: 600; margin-right: 6px; }

@media (max-width: 860px) {
  .hero, .split, .cta .wrap { grid-template-columns: minmax(0, 1fr); }
  .grid3, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card:nth-child(odd) { border-right: 0; }
  .card:nth-child(even) { padding-left: 0; }
  section { padding-block: 44px; }
}
@media (max-width: 480px) {
  .tally { grid-template-columns: minmax(0, 1fr); }
  .top nav { margin-left: 0; gap: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .trace-a, .trace-b { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.4s ease-out forwards; }
  .trace-b { animation-delay: 0.25s; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* the product name in running text: the wordmark's face, never a plain word */
.rp { font-family: var(--display); font-weight: 760; font-stretch: 80%; letter-spacing: 0.01em; font-size: 1.04em; }

.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.three .card { padding: 18px 20px; border-right: 1px solid var(--rule); }
.cards.three .card:first-child { padding-left: 0; }
.cards.three .card:last-child { border-right: 0; }
@media (max-width: 860px) {
  .cards.three { grid-template-columns: minmax(0, 1fr); }
  .cards.three .card { padding: 18px 0; border-right: 0; }
}
